This repository has been archived by the owner on Jun 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 549
How to set environment variables or pass structure data when submitting job? #3956
Labels
Comments
if you want to use v2 api, pls refer to |
@abuccts Thanks for the help! It seems that But the trouble I met is that I wanna access the value inside the |
You can either add arguments for your code to accept those parameters (recommended), main.py --root-dir <% $parameters.root_dir %> --max-iter <% $parameters.max_iter %> or use a JSON string (e.g. parameters:
env: '{"jobEnvs": {"TASK_NAME": "the_task", "USER_NAME": "someone", "JOB_TYPE": ["train", "test"], "trainSets": ["xxx", "yyy"], "extra_config": {"ROOT_DIR": "/opt/outputs", "TRAIN": {"MAX_ITER": 1}}}}'
...
commands:
- export CONFIG=<% $parameters.env %> |
@abuccts , So much for the help, and it helps a lot. And could you please add a new feature when submitting new job(v2), which may directly set the environment. I love Thanks again! |
we may do it via a kube runtime plugin, which could export such |
54 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Organization Name: Private Test
Short summary about the issue/question:
How to set environment variables or pass structure data when submitting job?
I used to use
jobEnv
to set structure like:But I can not find any doc or code to submit with jobEnv in v0.14.0.
OpenPAI Environment:
Thanks!
The text was updated successfully, but these errors were encountered: