Reputation: 1334
According to the documentation, it is possible to pass environment variables to python module using a config file with the --config
argument of gcloud ai custom-jobs create
.
However I'd prefer not to use a config file and use only the CLI. Is it possible to use only the CLI to pass environment variables to the packaged python code?
I am adding a base command line that I would like to expand so that it takes also environment variables to pass to the job.
gcloud ai custom-jobs create \
--region=europe-west9 \
--display-name=try_vai \
--python-package-uris=gs://data-analyses/r_d/try_vertex_ai/dist/try_vertex_ai-0.1.tar.gz \
--worker-pool-spec=machine-type=e2-standard-4,replica-count=1,executor-image-uri=europe-docker.pkg.dev/vertex-ai/training/scikit-learn-cpu.0-23:latest,python-module=src.try_vertex_ai
Upvotes: 0
Views: 671
Reputation: 75910
I took the sample of the gcloud CLI documentation and I combine it with the container spec description
workerPoolSpecs:
machineSpec:
machineType: n1-highmem-2
replicaCount: 1
containerSpec:
imageUri: gcr.io/ucaip-test/ucaip-training-test
args:
- port=8500
env:
- name: envName1,
value: envValue1
- name: envName2,
value: envValue2
command:
- start
Upvotes: 1