Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto mp api key #156

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ spec:
env:
- name: OMP_NUM_THREADS
value: "1"
- name: MP_API_KEY
value: "your_api_key"
- name: PYTHONPATH
value: "/home/jovyan/ocp:/home/jovyan/catlas"
- name: NVIDIA_VISIBLE_DEVICES
Expand Down Expand Up @@ -127,8 +125,6 @@ spec:
value: "/home/jovyan/ocp:/home/jovyan/catlas"
- name: MALLOC_TRIM_THRESHOLD_
value: "0"
- name: MP_API_KEY
value: "your_api_key"
resources:
limits:
cpu: "2"
Expand Down
14 changes: 10 additions & 4 deletions configs/dask_cluster/dask_operator/catlas-hybrid-cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ spec:
env:
- name: OMP_NUM_THREADS
value: "1"
- name: MP_API_KEY
value: "your_api_key"
# - name: MP_API_KEY
# value: 'your_api_key'
- name: PYTHONPATH
value: "/home/jovyan/ocp:/home/jovyan/catlas"
- name: NVIDIA_VISIBLE_DEVICES
Expand All @@ -41,6 +41,9 @@ spec:
- mountPath: /home/jovyan/dask-worker-space
name: shared-scratch
subPath: catlas/dask-worker-space
- mountPath: /home/jovyan/.pmgrc.yaml
name: workspace-inference
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont think this will work? The pmgrc.yaml is setup for use with MPRester from pymatgen?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the best route might be to have people store their api keys as github secrets: https://kubernetes.io/docs/concepts/configuration/secret/#using-secrets-as-environment-variables

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just to be clear, these would not be github secrets they would be in kubernetes. Regardless, that feels just as clunky as the current solution? We could have a settings.py file where people add there MP_API key and we can imported where needed. i.e. from catlas.settings import MP_API_KEY. At least that would keep in central so you wouldnt have to make the change to every single worker config yml

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and try to read from environment variables first so we can export it to the workers for github actions if needed?

subPath: .pmgrc.yaml
volumes:
- name: shared-scratch
persistentVolumeClaim:
Expand Down Expand Up @@ -130,8 +133,8 @@ spec:
value: "/home/jovyan/ocp:/home/jovyan/catlas"
- name: MALLOC_TRIM_THRESHOLD_
value: "0"
- name: MP_API_KEY
value: "your_api_key"
# - name: MP_API_KEY
# value: 'your_api_key'
resources:
limits:
cpu: "2"
Expand All @@ -153,6 +156,9 @@ spec:
- mountPath: /home/jovyan/dask-worker-space
name: shared-scratch
subPath: catlas/dask-worker-space
- mountPath: /home/jovyan/.pmgrc.yaml
name: workspace-inference
subPath: .pmgrc.yaml
volumes:
- name: shared-scratch
persistentVolumeClaim:
Expand Down