Hand a provisioned worker its token in the environment, not argv
The generated batch script exported nothing and passed `--token`, which any user on a shared compute node reads from `ps`. It now exports FLUKSIO_WORKER_TOKEN after `prerun`, which the worker already reads.
This commit is contained in:
@@ -231,7 +231,6 @@ class SlurmProvisioner:
|
||||
worker = [
|
||||
"exec fluksio-worker",
|
||||
f"--url {self.engine_url}",
|
||||
f"--token {token}",
|
||||
f"--cpus {profile.cpus}",
|
||||
f"--gpus {profile.gpus}",
|
||||
f"--max-idle {self.max_idle_s:.0f}",
|
||||
@@ -248,6 +247,10 @@ class SlurmProvisioner:
|
||||
*[f"#SBATCH {option}" for option in profile.sbatch],
|
||||
"",
|
||||
*profile.prerun,
|
||||
# Not `--token`: argv is in `ps` for every user of a shared node,
|
||||
# the environment only for the job's owner. Exported after
|
||||
# `prerun`, so nothing it starts inherits the token.
|
||||
f"export FLUKSIO_WORKER_TOKEN={token}",
|
||||
" ".join(worker),
|
||||
"",
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user