Skip to content

Commit b8999a7

Browse files
authored
allow --job-name arg to launch task (Metta-AI#250)
### TL;DR Added support for custom job names in AWS Batch task launcher. ### What changed? - Added a new `--job-name` command line argument to the AWS Batch task launcher - Modified the job name generation logic to use the provided job name if specified, otherwise falling back to the previous behavior of using the run ID with a random suffix
1 parent c925525 commit b8999a7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

devops/aws/batch/launch_task.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def submit_batch_job(args, task_args):
6767
batch = session.client("batch")
6868

6969
random_id = "".join(random.choices(string.ascii_lowercase + string.digits, k=5))
70-
job_name = args.run.replace(".", "_") + "_" + random_id
70+
job_name = args.job_name if args.job_name else args.run.replace(".", "_") + "_" + random_id
7171
job_queue = args.job_queue
7272

7373
request = {
@@ -243,6 +243,7 @@ def main():
243243
parser = argparse.ArgumentParser(description="Launch an AWS Batch task with a wandb key.")
244244
parser.add_argument("--cluster", default="metta", help="The name of the ECS cluster.")
245245
parser.add_argument("--run", required=True, help="The run id.")
246+
parser.add_argument("--job-name", help="The job name. If not specified, will use run id with random suffix.")
246247
parser.add_argument(
247248
"--cmd", required=True, choices=["train", "sweep", "evolve", "sandbox"], help="The command to run."
248249
)

0 commit comments

Comments
 (0)