Skip to content

Commit

Permalink
Fix rl job list bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ProbablyFaiz committed Aug 28, 2024
1 parent 90db298 commit c4b43f3
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions rl/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,7 @@ def wrapper(*args, **kwargs):
@click.option(
"--partition",
"-p",
help="Partition. If 'owners' specified, will create a batch job then ssh into it",
default=CURRENT_GROUP,
show_default=True,
help=f"Partition. Default is {CURRENT_GROUP}. If 'owners' specified, will create a batch job then ssh into it",
type=str,
)
@click.option(
Expand Down Expand Up @@ -210,7 +208,7 @@ def wrapper(*args, **kwargs):
)
@_must_run_on_sherlock
def job(
partition: str,
partition: str | None,
name: str,
gpus: int,
gpu_constraint: str,
Expand All @@ -232,6 +230,12 @@ def job(
case _:
pass

# We don't set the click default because we don't want the default partition
# value when the user does rl job list, so we just set it after checking
# that the user isn't running list
if not partition:
partition = CURRENT_GROUP

LOG_DIR.mkdir(exist_ok=True, parents=True)

common_args = [
Expand Down Expand Up @@ -318,7 +322,7 @@ def create_batch_job(sbatch_args, name, job_time):
]
subprocess.run(sbatch_args, check=True)

curr_job: JobInfo
curr_job: JobInfo | None
with rich.progress.Progress(transient=True) as progress:
# noinspection PyTypeChecker
task = progress.add_task(
Expand Down

0 comments on commit c4b43f3

Please sign in to comment.