Skip to content

fix(image): restore login-shell PATH and SHELL for GARM runner jobs - #246

Merged
cbartz merged 3 commits into
mainfrom
fix/runner-login-env-parity
Oct 14, 2026
Merged

cbartz merged 3 commits into
mainfrom
fix/runner-login-env-parity

Conversation

@cbartz

@cbartz cbartz commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

Applicable spec: N/A

Overview

Jobs started by the GARM agent now get /home/ubuntu/.local/bin on PATH (through /etc/environment) and SHELL=/bin/bash (the runner account's login shell), matching the previous runner manager.

Rationale

#245 runs the agent in a PAM session, but a PAM session doesn't run a login shell, so ~/.profile never adds ~/.local/bin. Tools installed with pipx or pip install --user then fail with command not found in later steps. pam_env reads PATH from /etc/environment, which is also where GitHub-hosted runners put it. The runner alias account was created with useradd's default /bin/sh shell, while legacy and GitHub-hosted runners have /bin/bash.

An environment comparison of legacy, GARM and GitHub-hosted runners also found umask and XDG_DATA_DIRS differences. They're left unchanged on purpose: 0022 matches GitHub-hosted runners, and XDG_DATA_DIRS only matters to desktop apps.

Juju Events Changes

None.

Module Changes

cloud-init.sh.j2 configure_system_users: prepends ~/.local/bin to PATH in /etc/environment and gives the runner account /bin/bash. The new integration checks use systemd-run with User=runner and PAMName=su-l to reproduce the job environment.

Library Changes

None.

Checklist

AI-generated message.

Copilot AI left a comment

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.

🟢 Approval recommended

The implementation matches the stated goal and includes integration checks across the supported image matrix.

0 open findings

What changed in this PR

Restores the expected login environment for GARM runner jobs.

Changes:

  • Adds the user-local binary directory to the PAM-provided PATH.
  • Sets the runner account’s shell to Bash.
  • Adds integration coverage, changelog entry, and patch version bump.
File Description
docs/​changelog.md Documents the environment fix.
app/​tests/​unit/​test_openstack_builder.py Updates rendered cloud-init expectations.
app/​tests/​integration/​commands.py Verifies runner PATH and SHELL.
app/​src/​github_runner_image_builder/​templates/​cloud-init.sh.j2 Configures the environment and runner shell.
app/​pyproject.toml Bumps the application version to 0.14.4.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@cbartz
cbartz marked this pull request as ready for review October 9, 2026 12:46
@cbartz

cbartz commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator Author

force merging - application integration test pass . there is one charm integration test failing due to a garm runner picking it up (chicken-egg problem), but the pr does not really touch charm code so I don't anticipate issues there.

@cbartz
cbartz merged commit e16199f into main Oct 14, 2026
91 of 135 checks passed
@cbartz
cbartz deleted the fix/runner-login-env-parity branch October 14, 2026 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants