Skip to content

Commit 6f25499

Browse files
feat(image): pre-install Rust, Zig, and cargo-lambda
Bake toolchain needed by velmios-aws-lambdas release CI so self-hosted runners skip moonrepo/setup-rust and setup-zig on every job. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent a6e3471 commit 6f25499

5 files changed

Lines changed: 76 additions & 2 deletions

File tree

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Self-hosted GitHub Actions runner **container image** for Deerhide / Velmios CI:
88

99
- Image: `ghcr.io/deerhide/python-github-runner`
1010
- Base: `ghcr.io/actions/actions-runner` (`RUNNER_VERSION` in `manifest.yaml`)
11-
- Includes Python 3.12/3.13 (deadsnakes), Poetry, UV, DevOps CLIs (argo, kargo, kubectl, pack, skopeo, buildah, …), OpenAPI CLIs (redocly, spectral, portman, newman, oasdiff), Node/Bun, and a full OCI build/scan pipeline so the image can build itself.
11+
- Includes Python 3.12/3.13 (deadsnakes), Poetry, UV, DevOps CLIs (argo, kargo, kubectl, pack, skopeo, buildah, …), OpenAPI CLIs (redocly, spectral, portman, newman, oasdiff), Node/Bun, Rust + Zig + cargo-lambda (AWS Lambda Rust CI), and a full OCI build/scan pipeline so the image can build itself.
1212

1313
Tool inventory and version tables live in [README.md](README.md). Do not duplicate them here.
1414

Containerfile

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ RUN apt-get update \
2020
skopeo buildah \
2121
jq \
2222
unzip \
23+
xz-utils \
2324
&& apt-get autoremove -y \
2425
&& apt-get clean \
2526
&& rm -rf /var/lib/apt/lists/*
@@ -162,6 +163,37 @@ RUN curl -sSL -o /tmp/oasdiff.tgz \
162163
&& chmod +x /usr/local/bin/oasdiff \
163164
&& rm -f /tmp/oasdiff.tgz
164165

166+
# Rust toolchain (velmios-aws-lambdas / cargo-lambda CI)
167+
ARG RUST_VERSION=1.97.1
168+
ENV RUSTUP_HOME=/usr/local/rustup \
169+
CARGO_HOME=/usr/local/cargo \
170+
PATH=/usr/local/cargo/bin:${PATH}
171+
# hadolint ignore=DL4006
172+
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
173+
| sh -s -- -y --default-toolchain "${RUST_VERSION}" --profile minimal \
174+
&& chmod -R a+rX /usr/local/rustup /usr/local/cargo \
175+
&& rustc --version && cargo --version
176+
177+
# Zig linker for cargo-lambda arm64 cross-builds.
178+
# 0.14.0 uses zig-linux-x86_64-*; 0.14.1+ renamed to zig-x86_64-linux-* — update URL on bump.
179+
ARG ZIG_VERSION=0.14.0
180+
RUN curl -sSL -o /tmp/zig.tar.xz \
181+
"https://ziglang.org/download/${ZIG_VERSION}/zig-linux-x86_64-${ZIG_VERSION}.tar.xz" \
182+
&& tar -xJf /tmp/zig.tar.xz -C /usr/local \
183+
&& mv "/usr/local/zig-linux-x86_64-${ZIG_VERSION}" /usr/local/zig \
184+
&& ln -sf /usr/local/zig/zig /usr/local/bin/zig \
185+
&& rm -f /tmp/zig.tar.xz \
186+
&& zig version
187+
188+
# cargo-lambda (AWS Lambda Rust packaging)
189+
ARG CARGO_LAMBDA_VERSION=1.9.1
190+
RUN curl -sSL -o /tmp/cargo-lambda.tgz \
191+
"https://github.com/cargo-lambda/cargo-lambda/releases/download/v${CARGO_LAMBDA_VERSION}/cargo-lambda-v${CARGO_LAMBDA_VERSION}.x86_64-unknown-linux-musl.tar.gz" \
192+
&& tar -xzf /tmp/cargo-lambda.tgz -C /usr/local/bin cargo-lambda \
193+
&& chmod +x /usr/local/bin/cargo-lambda \
194+
&& rm -f /tmp/cargo-lambda.tgz \
195+
&& cargo lambda --version
196+
165197
# Install pre-commit
166198
# hadolint ignore=DL3013
167199
RUN pip3 install --no-cache-dir pre-commit
@@ -198,4 +230,4 @@ RUN chmod +x /tmp/cache_actions.sh \
198230
&& rm -f /tmp/manifest.yaml /tmp/cache_actions.sh
199231

200232
# Add user tool paths to interactive shell PATH
201-
RUN echo "export PATH=\"/usr/local/bin:${APP_HOME}/.uv/bin:${APP_HOME}/.poetry/bin:${APP_HOME}/.local/bin:\$PATH\"" >> ~/.bashrc
233+
RUN echo "export PATH=\"/usr/local/bin:/usr/local/cargo/bin:${APP_HOME}/.uv/bin:${APP_HOME}/.poetry/bin:${APP_HOME}/.local/bin:\$PATH\"" >> ~/.bashrc

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,16 @@ Container image based on the [GitHub Actions Runner](https://github.com/actions/
2929
| [Node.js](https://nodejs.org/) / npm | JavaScript runtime and package manager (npm/npx bundled) |
3030
| [Bun](https://bun.sh/) | JavaScript runtime, package manager, bundler, and test runner |
3131

32+
### Rust / AWS Lambda
33+
34+
Pre-installed for [`velmios-aws-lambdas`](https://github.com/Laelidona/velmios-aws-lambdas) release builds (`cargo lambda build --arm64`).
35+
36+
| Tool | Version source | Notes |
37+
|------|----------------|-------|
38+
| [Rust](https://www.rust-lang.org/) (rustc, cargo) | `RUST_VERSION` | rustup `minimal` profile under `/usr/local/{rustup,cargo}` |
39+
| [Zig](https://ziglang.org/) | `ZIG_VERSION` | Linker for cargo-lambda cross-compile; `0.14.0` tarball name differs from `0.14.1+` |
40+
| [cargo-lambda](https://www.cargo-lambda.info/) | `CARGO_LAMBDA_VERSION` | Musl binary from GitHub releases |
41+
3242
### Build pipeline tools
3343

3444
These tools allow the image to run its own build pipeline as a self-hosted runner.

manifest.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ build:
2222
- PORTMAN_VERSION=1.35.0
2323
- NEWMAN_VERSION=6.2.2
2424
- OASDIFF_VERSION=1.23.0
25+
- RUST_VERSION=1.97.1
26+
- ZIG_VERSION=0.14.0
27+
- CARGO_LAMBDA_VERSION=1.9.1
2528
labels:
2629
- org.opencontainers.image.source=https://github.com/deerhide/python-github-runner
2730
- org.opencontainers.image.description="Python GitHub Runner"

renovate.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,35 @@
101101
"depNameTemplate": "oven-sh/bun",
102102
"datasourceTemplate": "github-releases",
103103
"extractVersionTemplate": "^bun-v?(?<version>.+)$"
104+
},
105+
{
106+
"customType": "regex",
107+
"description": "Update Rust toolchain version",
108+
"fileMatch": ["^Containerfile$", "^manifest\\.yaml$"],
109+
"matchStrings": ["RUST_VERSION=(?<currentValue>\\S+)"],
110+
"depNameTemplate": "rust",
111+
"datasourceTemplate": "github-releases",
112+
"packageNameTemplate": "rust-lang/rust",
113+
"extractVersionTemplate": "^v?(?<version>.+)$"
114+
},
115+
{
116+
"customType": "regex",
117+
"description": "Update Zig version",
118+
"fileMatch": ["^Containerfile$", "^manifest\\.yaml$"],
119+
"matchStrings": ["ZIG_VERSION=(?<currentValue>\\S+)"],
120+
"depNameTemplate": "zig",
121+
"datasourceTemplate": "github-releases",
122+
"packageNameTemplate": "ziglang/zig",
123+
"extractVersionTemplate": "^v?(?<version>.+)$"
124+
},
125+
{
126+
"customType": "regex",
127+
"description": "Update cargo-lambda version",
128+
"fileMatch": ["^Containerfile$", "^manifest\\.yaml$"],
129+
"matchStrings": ["CARGO_LAMBDA_VERSION=(?<currentValue>\\S+)"],
130+
"depNameTemplate": "cargo-lambda/cargo-lambda",
131+
"datasourceTemplate": "github-releases",
132+
"extractVersionTemplate": "^v?(?<version>.+)$"
104133
}
105134
]
106135
}

0 commit comments

Comments
 (0)