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

Read and authenticate with credentials from password file when starting Slurm worker manager #4125

Merged
merged 2 commits into from
Jun 5, 2022
Merged
Changes from 1 commit
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
9 changes: 9 additions & 0 deletions codalab/worker_manager/slurm_batch_worker_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import uuid
import subprocess
import getpass
import os
import re
import sys
import textwrap
Expand Down Expand Up @@ -108,6 +109,14 @@ def __init__(self, args):
# A set of newly submitted job id to keep tracking worker status, as worker might not be created right away.
self.submitted_jobs = self.load_worker_jobs()

if args.password_file:
logger.info(
f"--password-file specified. Reading credentials from {args.password_file}..."
)
with open(args.password_file) as f:
os.environ["CODALAB_USERNAME"] = f.readline().strip()
os.environ["CODALAB_PASSWORD"] = f.readline().strip()
teetone marked this conversation as resolved.
Show resolved Hide resolved

def load_worker_jobs(self):
"""
Load worker jobs that are created using SlurmWorkerManager and
Expand Down