Repository navigation
Skip job_queue on machines without a batch system - #309
Conversation
On a machine with no batch system (e.g. ubuntu-latest, the crocontainer default), CIME has no queues, and `./xmlchange JOB_QUEUE=...` fails with "Unknown Job Queue specified". Case(job_queue=...) then aborts after create_newcase and removes the case. The Getting Started tutorials all pass job_queue, so they fail this way on a laptop or in the container. Print a warning and skip JOB_QUEUE when BATCH_SYSTEM is none. JOB_WALLCLOCK_TIME is accepted on those machines, so it is unchanged.
|
📄 Preview your docs here: |
Codecov Report❌ Patch coverage is
🚀 New features to boost your workflow:
|
| f"{self.machine} has no batch system." | ||
| ) | ||
| else: | ||
| xmlchange("JOB_QUEUE", job_queue, is_non_local=self.cc._is_non_local()) |
There was a problem hiding this comment.
Not introduced by this PR, but related: when this xmlchange fails, all the user sees is Error running ./xmlchange JOB_QUEUE=mian. because visualCaseGen's xmlchange captures stderr and doesn't include it in the RuntimeError. So the CIME message is lost, and the case is deleted. Checking the queue name up front (see above) would avoid this for JOB_QUEUE. Including runout.stderr in that error message in visualCaseGen would help for the other variables too.
There was a problem hiding this comment.
Looks like ESMCI/visualCaseGen#51 allows errors passing to the user
| f"{self.machine} has no batch system." | ||
| ) | ||
| else: | ||
| xmlchange("JOB_QUEUE", job_queue, is_non_local=self.cc._is_non_local()) |
There was a problem hiding this comment.
Also not introduced here: job_queue goes unquoted into a shell=True command (cmd = f"./xmlchange {var}={val}" in visualCaseGen case_tools.py), and init_args_check only checks that it is a str. A value with a space, ;, or $ would break the command or run something else in caseroot. Same for job_wallclock_time. Probably best fixed in visualCaseGen with shlex.quote. (These can be a separate PR).
There was a problem hiding this comment.
Looks like ESMCI/visualCaseGen#51 solves this
On a machine with a batch system, xmlchange rejects any JOB_QUEUE the machine doesn't list, and visualCaseGen drops CIME's message. Check the queue first and raise an error that lists the valid ones. Use self.is_non_local for the xmlchange calls, and test both branches.
|
Thanks. This PR is ready to be merged once it's visualCaseGen is pinned to a new tag including ESMCI/visualCaseGen#51. |
Resolve conflicts with #325 (config.json versioning) and #309 (job_queue on machines without a batch system): - keep visualCaseGen's user_nl_blocks/xmlchange with caseroot= and USER_NL_TAG; take main's run_configurators() signature and job_queue checks - bump CONFIG_SCHEMA_VERSION to 1.1.0 with a 1.0 migration that drops the removed StreamYears entry, so the golden configs keep loading - give the job_queue test stub a caseroot Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On a machine with no batch system (for example
ubuntu-latest, the crocontainer default), CIME has no queues. There,./xmlchange JOB_QUEUE=...fails with "Unknown Job Queue specified", soCase(job_queue=...)aborts aftercreate_newcaseand deletes the case it just made.Every Getting Started tutorial passes
job_queue. Anyone running a tutorial on a laptop or in the container hits this, and so will CrocoGallery's nightly notebook run once the tutorials create their cases on the CI machine.Casenow prints a warning and skipsJOB_QUEUEwhenBATCH_SYSTEMisnone.JOB_WALLCLOCK_TIMEis accepted on those machines, so it is still applied. Machines with a batch system behave as before.🤖 Generated with Claude Code