Skip to content

chore(scripts): add GitHub runner install script with unzip and awscurl#7

Open
andybrown668 wants to merge 1 commit intomainfrom
chore/runner-install-deps
Open

chore(scripts): add GitHub runner install script with unzip and awscurl#7
andybrown668 wants to merge 1 commit intomainfrom
chore/runner-install-deps

Conversation

@andybrown668
Copy link

Type of Change

  • New Feature
  • Bug Fix
  • Documentation
  • Performance Improvement
  • Test/CI
  • Refactor
  • Other:

Related Issues

N/A

Summary of Changes

Adds unzip (via apt) and awscurl (via pipx) to the GitHub Actions self-hosted runner install script. These tools are required by CI workflows that run on self-hosted runners.

  • apt-get install -y unzip pipx (pipx needed for awscurl)
  • pipx install awscurl
  • pipx ensurepath so ~/.local/bin is on PATH for job steps

Checklist

  • I have read and followed the CONTRIBUTING.md guidelines
  • Passed make pre-commit
  • Added/updated necessary tests
  • Documentation updated (if needed)
  • CI/CD passed (if applicable)

Impact

  • Breaking change (compatibility)
  • Requires doc/config/deployment update
  • Other impact:

Additional Notes

Verification: run ./scripts/install-github-runner.sh on a fresh Ubuntu VM; after the deps step, unzip --version and awscurl --help should succeed.


Thank you for your contribution! Please ensure your PR follows the community standards (CODE_OF_CONDUCT.md) and sign the CLA if this is your first contribution.

New script installs self-hosted runner plus apt:unzip and pipx:awscurl for CI workflows.

Made-with: Cursor
@andybrown668 andybrown668 force-pushed the chore/runner-install-deps branch from de307c5 to 1c63a67 Compare March 20, 2026 13:56
Copilot AI review requested due to automatic review settings March 20, 2026 13:56
@andybrown668 andybrown668 changed the title chore(scripts): add unzip and awscurl to runner install script chore(scripts): add GitHub runner install script with unzip and awscurl Mar 20, 2026
@andybrown668 andybrown668 enabled auto-merge March 20, 2026 13:57
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds additional tooling to the self-hosted GitHub Actions runner installation script so CI workflows can rely on unzip and awscurl being available on runner machines.

Changes:

  • Installs unzip and pipx via apt-get.
  • Installs awscurl via pipx and attempts to ensure ~/.local/bin is on PATH.
  • Adds checksum validation and runner download/config/service setup in the install script.

#!/usr/bin/env bash
# Install and configure a GitHub Actions self-hosted runner on Ubuntu.
# Repo: https://github.com/wasabi/rustfs
# Prompts for runner token and runner name; adds labels 'ubicloud-standard-2' and 'ubicloud-standard-4 '; uses default group.
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

The header comment has an extra trailing space in the label name ('ubicloud-standard-4 '). This looks like a typo and could confuse readers about the actual label being applied; update the comment to match RUNNER_LABELS exactly.

Suggested change
# Prompts for runner token and runner name; adds labels 'ubicloud-standard-2' and 'ubicloud-standard-4 '; uses default group.
# Prompts for runner token and runner name; adds labels 'ubicloud-standard-2' and 'ubicloud-standard-4'; uses default group.

Copilot uses AI. Check for mistakes.
Comment on lines +27 to +28
pipx ensurepath

Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

pipx ensurepath updates shell startup files, but GitHub Actions steps on self-hosted runners typically run in non-login, non-interactive shells and the runner itself is started via systemd. As a result, this usually won’t make awscurl discoverable in job steps. Prefer making awscurl available in a PATH location that the runner service and steps will actually see (e.g., install/symlink into /usr/local/bin, or set PATH explicitly in the runner systemd service environment).

Suggested change
pipx ensurepath
# Ensure awscurl is available on PATH for the GitHub runner service
PIPX_BIN_DIR="$(pipx environment --value PIPX_BIN_DIR 2>/dev/null || echo "$HOME/.local/bin")"
if [ -x "${PIPX_BIN_DIR}/awscurl" ]; then
echo "Linking awscurl into /usr/local/bin for runner PATH..."
sudo ln -sf "${PIPX_BIN_DIR}/awscurl" /usr/local/bin/awscurl
else
echo "Warning: awscurl binary not found in ${PIPX_BIN_DIR}; it may not be available in runner PATH."
fi

Copilot uses AI. Check for mistakes.

# Validate hash
echo "Validating checksum..."
echo "${RUNNER_SHA256} ${RUNNER_TAR}" | shasum -a 256 -c
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

Checksum verification uses shasum -a 256 -c, but shasum is not guaranteed to be present on a fresh Ubuntu install (whereas sha256sum from coreutils generally is). This can cause the installer to fail even when the download is correct; consider switching to sha256sum -c (or adding a small fallback that tries sha256sum then shasum).

Suggested change
echo "${RUNNER_SHA256} ${RUNNER_TAR}" | shasum -a 256 -c
if command -v sha256sum >/dev/null 2>&1; then
echo "${RUNNER_SHA256} ${RUNNER_TAR}" | sha256sum -c -
elif command -v shasum >/dev/null 2>&1; then
echo "${RUNNER_SHA256} ${RUNNER_TAR}" | shasum -a 256 -c -
else
echo "Error: neither 'sha256sum' nor 'shasum' is available to verify the runner checksum." >&2
exit 1
fi

Copilot uses AI. Check for mistakes.
sudo apt-get update -qq
sudo apt-get install -y unzip pipx
echo "Installing awscurl via pipx..."
pipx install awscurl
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

pipx install awscurl will exit non-zero if awscurl is already installed, and set -e will abort the whole script on re-runs. If re-running this installer is expected, make the awscurl installation idempotent (e.g., detect existing install and upgrade/skip, or use the appropriate pipx option to overwrite).

Suggested change
pipx install awscurl
pipx install --force awscurl

Copilot uses AI. Check for mistakes.
pipx ensurepath

# Prompt for token
read -r -p "Runner token: " RUNNER_TOKEN
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

The runner registration token is read with a normal read, which echoes the token as it’s typed and can leak it via terminal scrollback/recording. Use a silent prompt for secrets (and print a newline afterwards) to reduce accidental exposure.

Suggested change
read -r -p "Runner token: " RUNNER_TOKEN
read -r -s -p "Runner token: " RUNNER_TOKEN
echo

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants