feat(astera): put SBGrid on $PATH when /programs is mounted - #362
feat(astera): put SBGrid on $PATH when /programs is mounted#362manzuoni-astera wants to merge 1 commit into
Conversation
Astera installs the SBGrid collection once on a shared `sbgrid-programs` PVC, which the actl catalog auto-mounts read-only at /programs for every diffuse profile. The mount arrives regardless of image, but scientists on this image still had to run three manual steps before phenix worked. Two of those steps were the image's fault. `tcsh` is a hard requirement, not a convenience: /programs/sbgrid.shrc aborts with "requires the C shell" when /bin/csh is missing and sets up nothing at all, so the entire collection stays invisible. `bsdextrautils` provides column(1), which SBGrid's sbgrid-obsolete helper shells out to on every title lookup. Both are added to the verification loop. The third was the missing shell init, added here following the existing ext-shell pattern. It is guarded so it cannot break shells that have no collection: /programs is created empty in the image, so a non-diffuse workspace or a --no-mount run simply no-ops. The `|| true` is load-bearing. sbgrid.shrc runs commands that return non-zero benignly, so sourcing it under `set -e` kills the shell — verified on a live pod, and the reason my first attempt at this failed. Verified against the real collection on the current image with the PVC mounted read-only: an interactive shell resolves phenix.molprobity with no setup and scores 1CRN correctly, `bash -lc` works for non-interactive callers, pixi is unaffected, an absent mount is a clean no-op under both plain and `set -e` shells, and SBGRID_NO_AUTOINIT=1 opts out. Note this brings phenix and the rest of SBGrid; tortoize is not an SBGrid title and still comes from `pixi run -e analysis`.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe Astera image now installs additional shell utilities, validates their commands, creates ChangesAstera SBGrid shell integration
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant AsteraImage
participant ShellHookInstaller
participant ShellStartup
participant SBGridProfile
participant SBGridCollection
AsteraImage->>ShellHookInstaller: install startup hooks
ShellHookInstaller->>ShellStartup: append guarded source command
ShellStartup->>SBGridProfile: source profile
SBGridProfile->>SBGridCollection: source /programs/sbgrid.shrc when mounted
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds automatic, guarded SBGrid shell initialization in the Astera image when the shared /programs PVC is mounted, while keeping behavior a no-op when it isn’t.
Changes:
- Add a guarded
/etc/profile.dhook to source/programs/sbgrid.shrconly when present. - Add an installer script to wire the hook into bash/zsh startup files idempotently.
- Update
Dockerfile.asterato install required packages (bsdextrautils,tcsh) and install the new shell hooks.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| docker/astera/sbgrid-shell.sh | Adds guarded SBGrid initialization sourced at shell startup when /programs/sbgrid.shrc exists. |
| docker/astera/install-sbgrid-shell-hooks.sh | Appends an idempotent source line into common bash/zsh rc/profile files. |
| Dockerfile.astera | Installs dependencies, ensures /programs exists, and installs/runs the SBGrid hook wiring. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| profile_comment="# Sampleworks: put SBGrid on \$PATH when /programs is mounted." | ||
| profile_line="[ -r ${profile_script} ] && . ${profile_script}" | ||
|
|
||
| touch /root/.bashrc /home/dev/.bashrc |
|
|
||
| profile_script="/etc/profile.d/sbgrid-shell.sh" | ||
| profile_comment="# Sampleworks: put SBGrid on \$PATH when /programs is mounted." | ||
| profile_line="[ -r ${profile_script} ] && . ${profile_script}" |
| # under `set -e` and would take the whole shell with it. It is also chatty | ||
| # on first run and writes into $HOME. Neither should be able to break shell | ||
| # startup, hence the redirect and the `|| true`. | ||
| . /programs/sbgrid.shrc >/dev/null 2>&1 || true |
| # under `set -e` and would take the whole shell with it. It is also chatty | ||
| # on first run and writes into $HOME. Neither should be able to break shell | ||
| # startup, hence the redirect and the `|| true`. | ||
| . /programs/sbgrid.shrc >/dev/null 2>&1 || true |
marcuscollins
left a comment
There was a problem hiding this comment.
LGTM. I'm not sure what's going on with the tests and scans. I triggered them to run again, maybe it was transient. Please don't merge if they are still failing, but other wise go ahead.
Astera now installs the SBGrid collection once on a shared
sbgrid-programsPVC, which the actl catalog auto-mounts read-only at /programs for every diffuse profile. The mount arrives regardless of image — but on this image a scientist still had to run three manual steps before phenix worked:The symlink goes away on the actl side. This PR removes the other two, so
--image sampleworkslands you in a shell where phenix just works.Why tcsh is not optional
/programs/sbgrid.shrcaborts with "requires the C shell" when/bin/cshis missing and sets up nothing at all — the entire collection stays invisible.bsdextrautilsprovidescolumn(1), which SBGrid'ssbgrid-obsoletehelper shells out to on every title lookup. Both added to the existing verification loop.The shell init
Follows the existing ext-shell pattern (
/etc/profile.d/+install-*-shell-hooks.sh). Guarded so it cannot break shells with no collection:/programsis created empty in the image, so a non-diffuse workspace or a--no-mountrun is a clean no-op.The
|| trueis load-bearing — sbgrid.shrc runs commands that return non-zero benignly, so sourcing it underset -ekills the shell. Verified on a live pod; it's why my first attempt at this failed.Verified
Against the real collection, on the current image, with the PVC mounted read-only exactly as the catalog will:
phenix.molprobitywith no setup, and scores 1CRN correctly (MolProbity 0.56, 0.00% Ramachandran outliers)bash -lc 'phenix.version'works for non-interactive callerspixiunaffected (0.71.2) — the analysis env and SBGrid coexistset -eshellsSBGRID_NO_AUTOINIT=1opts outNote
This brings phenix and the ~3,200 other SBGrid commands. tortoize is not an SBGrid title and still comes from
pixi run -e analysis.Depends on Astera-org/asteractl#138 + #139 for the /programs mount; harmless to merge before them (no mount → no-op).
Summary by CodeRabbit
New Features
/programsdirectory when available.Bug Fixes