Skip to content

Skip job_queue on machines without a batch system - #309

Merged
manishvenu merged 3 commits into
mainfrom
job-queue-no-batch-system
Nov 3, 2026
Merged

manishvenu merged 3 commits into
mainfrom
job-queue-no-batch-system

Conversation

@manishvenu

@manishvenu manishvenu commented Oct 11, 2026 •

Copy link
Copy Markdown
Member

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", so Case(job_queue=...) aborts after create_newcase and 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.

Case now prints a warning and skips JOB_QUEUE when BATCH_SYSTEM is none. JOB_WALLCLOCK_TIME is accepted on those machines, so it is still applied. Machines with a batch system behave as before.

🤖 Generated with Claude Code

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.
@github-actions

Copy link
Copy Markdown

📄 Preview your docs here:
👉 https://CROCODILE-CESM.github.io/CrocoDash/pr-309/index.html

@codecov

codecov Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.71429% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
CrocoDash/case.py 85.71% 1 Missing ⚠️
Files with missing lines Coverage Δ
CrocoDash/case.py 66.45% <85.71%> (+1.22%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@manishvenu
manishvenu marked this pull request as ready for review October 13, 2026 21:07
@manishvenu manishvenu closed this Oct 26, 2026
@manishvenu manishvenu reopened this Oct 26, 2026
Comment thread CrocoDash/case.py Resolved
Comment thread CrocoDash/case.py Outdated
f"{self.machine} has no batch system."
)
else:
xmlchange("JOB_QUEUE", job_queue, is_non_local=self.cc._is_non_local())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like ESMCI/visualCaseGen#51 allows errors passing to the user

Comment thread CrocoDash/case.py Outdated
f"{self.machine} has no batch system."
)
else:
xmlchange("JOB_QUEUE", job_queue, is_non_local=self.cc._is_non_local())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like ESMCI/visualCaseGen#51 solves this

Comment thread CrocoDash/case.py Resolved
Comment thread CrocoDash/case.py Resolved
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.

@manishvenu manishvenu left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment

@alperaltuntas

Copy link
Copy Markdown
Contributor

Thanks. This PR is ready to be merged once it's visualCaseGen is pinned to a new tag including ESMCI/visualCaseGen#51.

@manishvenu
manishvenu merged commit b8991c8 into main Nov 3, 2026
6 of 7 checks passed
@manishvenu
manishvenu deleted the job-queue-no-batch-system branch November 3, 2026 00:29
manishvenu added a commit that referenced this pull request Nov 3, 2026
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>
@manishvenu manishvenu added the bug Something isn't working label Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants