Krishna1107 Claude Opus 4.7 commited on
Commit
571af06
·
1 Parent(s): cb93805

Use --env instead of --secrets KEY=VALUE for WANDB_API_KEY

Browse files

The --secrets KEY=VALUE form is not propagating into the container env
in the current hf CLI version (only the bare --secrets HF_TOKEN
auto-inject works). Switch WANDB_API_KEY to --env so it reliably
reaches the container. Tradeoff: value is plaintext in the job UI.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

Files changed (1) hide show
  1. scripts/submit_hf_job.sh +7 -5
scripts/submit_hf_job.sh CHANGED
@@ -1,12 +1,14 @@
1
  #!/usr/bin/env bash
2
  # Submit the MutantHunter GRPO training run as an HF Job.
3
  #
4
- # Required local env vars (the values are forwarded into the container as
5
- # secret env vars):
6
  # HF_TOKEN auto-injected by `hf jobs run` when --secrets HF_TOKEN
7
  # is bare. Make sure you ran `hf auth login` first.
8
- # WANDB_API_KEY forwarded explicitly via --secrets WANDB_API_KEY=$WANDB_API_KEY
9
- # (the auto-inject is HF_TOKEN-only).
 
 
 
10
 
11
  set -euo pipefail
12
 
@@ -16,6 +18,6 @@ hf jobs run \
16
  --flavor a100-large \
17
  --timeout 6h \
18
  --secrets HF_TOKEN \
19
- --secrets "WANDB_API_KEY=${WANDB_API_KEY}" \
20
  pytorch/pytorch:2.5.1-cuda12.4-cudnn9-devel \
21
  bash -c 'apt-get update && apt-get install -y --no-install-recommends git curl && curl -fsSL https://raw.githubusercontent.com/melohub-xbit/MetaOpenEnv_MutantHunter/main/scripts/run_hf_job.sh | bash'
 
1
  #!/usr/bin/env bash
2
  # Submit the MutantHunter GRPO training run as an HF Job.
3
  #
4
+ # Required local env vars:
 
5
  # HF_TOKEN auto-injected by `hf jobs run` when --secrets HF_TOKEN
6
  # is bare. Make sure you ran `hf auth login` first.
7
+ # WANDB_API_KEY forwarded as a plaintext --env (the --secrets KEY=VALUE
8
+ # form does not propagate reliably in the current CLI).
9
+ # The value will appear in the job's env/UI; rotate after
10
+ # if concerned. Or pre-store as a named HF secret and
11
+ # switch back to bare `--secrets WANDB_API_KEY`.
12
 
13
  set -euo pipefail
14
 
 
18
  --flavor a100-large \
19
  --timeout 6h \
20
  --secrets HF_TOKEN \
21
+ --env "WANDB_API_KEY=${WANDB_API_KEY}" \
22
  pytorch/pytorch:2.5.1-cuda12.4-cudnn9-devel \
23
  bash -c 'apt-get update && apt-get install -y --no-install-recommends git curl && curl -fsSL https://raw.githubusercontent.com/melohub-xbit/MetaOpenEnv_MutantHunter/main/scripts/run_hf_job.sh | bash'