Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
echo "aws_cli=$(grep aws_cli versions | cut -d= -f2)" | tee -a $GITHUB_OUTPUT
echo "azure_cli=$(grep azure_cli versions | cut -d= -f2)" | tee -a $GITHUB_OUTPUT
echo "scalr_cli=$(grep scalr_cli versions | cut -d= -f2)" | tee -a $GITHUB_OUTPUT
echo "python=$(grep python versions | cut -d= -f2)" | tee -a $GITHUB_OUTPUT

- name: Build Docker image
uses: docker/build-push-action@v6
Expand All @@ -47,6 +48,7 @@ jobs:
AWS_CLI_VERSION=${{ steps.versions.outputs.aws_cli }}
AZURE_CLI_VERSION=${{ steps.versions.outputs.azure_cli }}
SCALR_CLI_VERSION=${{ steps.versions.outputs.scalr_cli }}
PYTHON_VERSION=${{ steps.versions.outputs.python }}
cache-from: type=registry,ref=scalr/runner:buildcache
cache-to: type=registry,ref=scalr/runner:buildcache
load: true
Expand All @@ -59,4 +61,7 @@ jobs:
docker run --rm scalr/runner:sha-${{ github.sha }} -xc 'aws --version'
docker run --rm scalr/runner:sha-${{ github.sha }} -xc 'az --version'
docker run --rm scalr/runner:sha-${{ github.sha }} -xc 'kubectl version --client'
docker run --rm scalr/runner:sha-${{ github.sha }} -xc 'scalr -version'
docker run --rm scalr/runner:sha-${{ github.sha }} -xc 'scalr -version'
docker run --rm scalr/runner:sha-${{ github.sha }} -xc 'python --version'
docker run --rm scalr/runner:sha-${{ github.sha }} -xc 'pip --version'
docker run --rm scalr/runner:sha-${{ github.sha }} -xc 'pip install requests'
2 changes: 2 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
echo "aws_cli=$(grep aws_cli versions | cut -d= -f2)" | tee -a $GITHUB_OUTPUT
echo "azure_cli=$(grep azure_cli versions | cut -d= -f2)" | tee -a $GITHUB_OUTPUT
echo "scalr_cli=$(grep scalr_cli versions | cut -d= -f2)" | tee -a $GITHUB_OUTPUT
echo "python=$(grep python versions | cut -d= -f2)" | tee -a $GITHUB_OUTPUT

- name: Format Image Tag
id: image_tag
Expand All @@ -49,6 +50,7 @@ jobs:
AWS_CLI_VERSION=${{ steps.versions.outputs.aws_cli }}
AZURE_CLI_VERSION=${{ steps.versions.outputs.azure_cli }}
SCALR_CLI_VERSION=${{ steps.versions.outputs.scalr_cli }}
PYTHON_VERSION=${{ steps.versions.outputs.python }}
platforms: linux/amd64,linux/arm64
cache-from: type=registry,ref=scalr/runner:buildcache
cache-to: type=registry,ref=scalr/runner:buildcache
Expand Down
2 changes: 0 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,4 @@

- SCALRCORE-34486 \> Basic Repository Setup [\#1](https://github.com/Scalr/runner/pull/1) ([artemvang](https://github.com/artemvang))



\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
37 changes: 33 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ RUN <<EOT
git-core git-lfs openssh-client \
jq \
gnupg \
python3 python3-pip python3-setuptools python3-wheel \
zip unzip \
lsb-release
[ "${TARGETARCH}" = "amd64" ] && SESSION_MANAGER_ARCH="64bit" || SESSION_MANAGER_ARCH="arm64"
Expand All @@ -32,9 +31,39 @@ RUN <<EOT
find /usr -name __pycache__ -type d -exec rm -rf {} +
EOT

# This effectively makes `pip install --break-system-packages ...` the default, allowing
# to install packages system-wide without needing to initialize a virtual environment.
ENV PIP_BREAK_SYSTEM_PACKAGES=1
# Install python standalone build.
ARG PYTHON_VERSION
LABEL python.version=${PYTHON_VERSION}
ENV PIP_ROOT_USER_ACTION=ignore
RUN <<EOT
# See: https://gregoryszorc.com/docs/python-build-standalone/main/running.html#extracting-distributions
export VERSION="${PYTHON_VERSION}"
export RELEASE="20250517"
apt-get update -y
apt-get install -y --no-install-recommends zstd binutils
[ "${TARGETARCH}" = "amd64" ] && export OPTIONS="x86_64-unknown-linux-gnu-pgo+lto-full"
[ "${TARGETARCH}" = "arm64" ] && export OPTIONS="aarch64-unknown-linux-gnu-lto-full"
curl -L -o python.tar.zst "https://github.com/astral-sh/python-build-standalone/releases/download/${RELEASE}/cpython-${VERSION}+${RELEASE}-${OPTIONS}.tar.zst"
tar --zstd -xf python.tar.zst
cp -rp python/install/* /usr
rm python.tar.zst
rm -rf python
# Strip debug symbols from shared libraries.
strip -d /usr/lib/libpython3.13.so
# Remove unneeded packages.
rm -rf /usr/lib/Tix* /usr/lib/tcl* /usr/lib/tk* /usr/lib/itcl* /usr/lib/thread*
rm -rf /usr/lib/libpython3.13.a
rm -rf "/usr/lib/python3.13/config-3.13-$(uname -m)-linux-gnu"
rm -rf /usr/lib/python3.13/ensurepip
rm -rf /usr/lib/python3.13/tkinker
rm -rf /usr/lib/python3.13/test
# Cleanup.
apt-get remove -y zstd binutils
apt-get clean
apt-get autoremove -y
rm -rf /var/lib/apt/lists/*
find /usr -name __pycache__ -type d -exec rm -rf {} +
EOT

# Kubectl
ARG KUBECTL_VERSION
Expand Down
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

This is the Git repo of the official runner image.

The image is based on the [`debian:trixie-slim`](https://hub.docker.com/_/debian),
and contains the following software:
The image is based on the [`debian:trixie-slim`](https://hub.docker.com/_/debian).

## Included Tools

Expand Down Expand Up @@ -33,17 +32,22 @@ This environment comes pre-equipped with a comprehensive suite of tools essentia
* Kubectl ([0.33.1](https://github.com/kubernetes/kubectl/releases/tag/v0.33.1)) - Kubernetes CLI.
* Scalr CLI ([0.17.1](https://github.com/Scalr/scalr-cli/releases/tag/v0.17.1)) - The command-line to communicate with the Scalr API.

The versions for Cloud Clients, Kubectl, and Scalr CLI are specifically pinned and detailed in the [versions](./versions) file. All other software included in this environment is sourced directly from the Debian Trixie upstream repositories.
The versions for Python, Cloud Clients, Kubectl, and Scalr CLI are specifically pinned and detailed in the [versions](./versions) file. All other software included in this environment is sourced directly from the Debian Trixie upstream repositories.

## Python Distribution

The environment uses the [standalone Python build](https://github.com/astral-sh/python-build-standalone) provided by the [astral.sh](https://astral.sh/) team.

## Runner Image Building

```bash
docker buildx build \
--build-arg PYTHON_VERSION=3.13.3 \
--build-arg KUBECTL_VERSION=v1.33.1 \
--build-arg GCLOUD_VERSION=525.0.0 \
--build-arg AWS_CLI_VERSION=2.27.1 \
--build-arg AZURE_CLI_VERSION=2.71.0 \
--build-arg SCALR_CLI_VERSION=0.17.1 \
--platform linux/amd64 \
-t runner:latest --load .
-t scalr/runner:latest --load .
```
1 change: 1 addition & 0 deletions versions
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ gcloud=525.0.0
aws_cli=2.27.32
azure_cli=2.74.0
scalr_cli=0.17.1
python=3.13.3