Skip to content

Commit e64163c

Browse files
Merge branch 'master' into update-trash-calls
2 parents 5a3cb87 + 324c053 commit e64163c

File tree

7 files changed

+101
-18
lines changed

7 files changed

+101
-18
lines changed

.github/workflows/ci-arm-build.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: CI ARM64 Build and Push
2+
3+
on:
4+
# push:
5+
# branches:
6+
# - "master"
7+
# tags-ignore:
8+
# - "*"
9+
# pull_request:
10+
# branches-ignore:
11+
# - "*"
12+
workflow_dispatch:
13+
14+
jobs:
15+
build-and-push-arm64:
16+
if: github.event_name == 'workflow_dispatch'
17+
runs-on: ubuntu-latest
18+
strategy:
19+
matrix:
20+
os: [ubuntu-22.04]
21+
python: ["3.11"]
22+
env:
23+
# secrets can be set in settings/secrets on github
24+
DOCKER_REGISTRY: ${{ secrets.DOCKER_REGISTRY }}
25+
steps:
26+
- uses: actions/checkout@v4
27+
- name: setup QEMU
28+
uses: docker/setup-qemu-action@v3
29+
- name: setup docker buildx
30+
id: buildx
31+
uses: docker/setup-buildx-action@v3
32+
with:
33+
driver: docker-container
34+
- name: expose github runtime for buildx
35+
uses: crazy-max/ghaction-github-runtime@v3
36+
- name: show system environs
37+
run: ./ci/helpers/show_system_versions.bash
38+
- name: login to Dockerhub
39+
uses: docker/login-action@v2
40+
with:
41+
username: ${{ secrets.DOCKER_USERNAME }}
42+
password: ${{ secrets.DOCKER_PASSWORD }}
43+
- name: Set deployment variables
44+
run: |
45+
if [ "${GITHUB_REF}" == "refs/heads/master" ]; then
46+
echo "TAG_PREFIX=master-github" >> $GITHUB_ENV
47+
elif [[ "${GITHUB_REF}" == refs/heads/hotfix_v* ]]; then
48+
echo "TAG_PREFIX=hotfix-github" >> $GITHUB_ENV
49+
elif [[ "${GITHUB_REF}" == refs/heads/hotfix_staging_* ]]; then
50+
echo "TAG_PREFIX=hotfix-staging-github" >> $GITHUB_ENV
51+
fi
52+
- name: build & push images for latest tag
53+
run: |
54+
export DOCKER_IMAGE_TAG="$TAG_PREFIX-latest-arm64"
55+
export DOCKER_TARGET_PLATFORMS=linux/arm64
56+
make build push=true
57+
- name: build & push images for specific tag
58+
run: |
59+
export DOCKER_IMAGE_TAG=$(exec ci/helpers/build_docker_image_tag.bash)-arm64
60+
export DOCKER_TARGET_PLATFORMS=linux/arm64
61+
make build push=true
62+
- name: fuse images in the registry for latest tag
63+
run: |
64+
export DOCKER_IMAGE_TAG="$TAG_PREFIX-latest"
65+
make docker-image-fuse SUFFIX=arm64
66+
- name: set git tag
67+
run: echo "GIT_TAG=${GITHUB_REF##*/}" >> $GITHUB_ENV

Makefile

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,16 @@ docker buildx bake --allow=fs.read=.. \
172172
,--load\
173173
)\
174174
)\
175+
$(if $(push),\
176+
$(foreach service, $(SERVICES_NAMES_TO_BUILD),\
177+
--set $(service).tags=$(DOCKER_REGISTRY)/$(service):$(DOCKER_IMAGE_TAG) \
178+
) \
179+
$(foreach service, $(SERVICES_NAMES_TO_BUILD),\
180+
--set $(service).output="type=registry$(comma)push=true" \
181+
)\
182+
,) \
175183
$(if $(push),--push,) \
176-
$(if $(push),--file docker-bake.hcl,) --file docker-compose-build.yml $(if $(target),$(target),$(INCLUDED_SERVICES)) \
184+
--file docker-compose-build.yml $(if $(target),$(target),$(INCLUDED_SERVICES)) \
177185
$(if $(findstring -nc,$@),--no-cache,\
178186
$(foreach service, $(SERVICES_NAMES_TO_BUILD),\
179187
--set $(service).cache-to=type=gha$(comma)mode=max$(comma)scope=$(service) \
@@ -859,3 +867,8 @@ release-staging release-prod: .check-on-master-branch ## Helper to create a sta
859867
.PHONY: release-hotfix release-staging-hotfix
860868
release-hotfix release-staging-hotfix: ## Helper to create a hotfix release in Github (usage: make release-hotfix version=1.2.4 git_sha=optional or make release-staging-hotfix name=Sprint version=2)
861869
$(create_github_release_url)
870+
871+
.PHONY: docker-image-fuse
872+
docker-image-fuse:
873+
$(foreach service, $(SERVICES_NAMES_TO_BUILD),\
874+
docker buildx imagetools create --tag $(DOCKER_REGISTRY)/$(service):$(DOCKER_IMAGE_TAG) $(DOCKER_REGISTRY)/$(service):$(DOCKER_IMAGE_TAG)-$(SUFFIX) $(DOCKER_REGISTRY)/$(service):$(DOCKER_IMAGE_TAG);)

scripts/install_rclone.bash

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ set -o pipefail # don't hide errors within pipes
1010
IFS=$'\n\t'
1111

1212
R_CLONE_VERSION="1.63.1"
13-
curl --silent --location --remote-name "https://downloads.rclone.org/v${R_CLONE_VERSION}/rclone-v${R_CLONE_VERSION}-linux-amd64.deb"
14-
dpkg --install "rclone-v${R_CLONE_VERSION}-linux-amd64.deb"
15-
rm "rclone-v${R_CLONE_VERSION}-linux-amd64.deb"
13+
TARGETARCH="${TARGETARCH:-amd64}"
14+
15+
echo "platform ${TARGETARCH}"
16+
17+
curl --silent --location --remote-name "https://downloads.rclone.org/v${R_CLONE_VERSION}/rclone-v${R_CLONE_VERSION}-linux-${TARGETARCH}.deb"
18+
dpkg --install "rclone-v${R_CLONE_VERSION}-linux-${TARGETARCH}.deb"
19+
rm "rclone-v${R_CLONE_VERSION}-linux-${TARGETARCH}.deb"
1620
rclone --version

scripts/shellcheck.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
# - VS extension: https://github.com/timonwong/vscode-shellcheck
66
#
77

8-
exec docker run --rm --interactive --volume "$PWD:/mnt:ro" koalaman/shellcheck:v0.9.0 "$@"
8+
exec docker run --rm --interactive --volume "$PWD:/mnt:ro" koalaman/shellcheck:v0.10.0 "$@"

services/agent/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
# Define arguments in the global scope
44
ARG PYTHON_VERSION="3.11.9"
55
ARG UV_VERSION="0.4"
6+
67
FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS uv_build
78
# we docker image is built based on debian
89
FROM python:${PYTHON_VERSION}-slim-bookworm AS base
910

11+
1012
#
1113
# USAGE:
1214
# cd sercices/agent
@@ -57,6 +59,8 @@ ENV PYTHONDONTWRITEBYTECODE=1 \
5759
ENV PATH="${VIRTUAL_ENV}/bin:$PATH"
5860

5961
# rclone installation
62+
ARG TARGETARCH
63+
ENV TARGETARCH=${TARGETARCH}
6064
RUN \
6165
--mount=type=bind,source=scripts/install_rclone.bash,target=/tmp/install_rclone.bash \
6266
./tmp/install_rclone.bash

services/docker-bake.hcl

Lines changed: 0 additions & 12 deletions
This file was deleted.

services/dynamic-sidecar/Dockerfile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ RUN \
5353
&& gosu nobody true
5454

5555
# install RClone, we do it in a separate layer such that the cache is not locked forever, as this seems to take a long time
56+
ARG TARGETARCH
57+
ENV TARGETARCH=${TARGETARCH}
5658
RUN \
5759
--mount=type=bind,source=scripts/install_rclone.bash,target=install_rclone.bash \
5860
./install_rclone.bash
@@ -64,7 +66,12 @@ RUN \
6466
./install_7zip.bash
6567

6668
RUN AWS_CLI_VERSION="2.11.11" \
67-
&& curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64-${AWS_CLI_VERSION}.zip" -o "awscliv2.zip" \
69+
&& case "${TARGETARCH}" in \
70+
"amd64") ARCH="x86_64" ;; \
71+
"arm64") ARCH="aarch64" ;; \
72+
*) echo "Unsupported architecture: ${TARGETARCH}" && exit 1 ;; \
73+
esac \
74+
&& curl "https://awscli.amazonaws.com/awscli-exe-linux-${ARCH}-${AWS_CLI_VERSION}.zip" -o "awscliv2.zip" \
6875
&& apt-get update && apt-get install -y unzip \
6976
&& unzip awscliv2.zip \
7077
&& ./aws/install \

0 commit comments

Comments
 (0)