Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy CI on aarch64 #572

Open
dboreham opened this issue Oct 11, 2023 · 5 comments
Open

Deploy CI on aarch64 #572

dboreham opened this issue Oct 11, 2023 · 5 comments

Comments

@dboreham
Copy link
Collaborator

We have had several cases where stacks don't build, or sometimes don't run, on ARM. e.g. #565

If we had CI running on an aarch64 machine, these failures would be more easily identified in advance.

@dboreham
Copy link
Collaborator Author

It turns out when I deployed our Gitea stack on an arm machine, jobs fail because...the setup-python GitHub action does not support arm (at all, on linux). See: actions/setup-python#705

@dboreham
Copy link
Collaborator Author

I was able to get our actions to run on arm eventually by using the deadsnakes action. That in turn required some changes to our runner image:

diff --git a/gitea/Dockerfile.task-executor b/gitea/Dockerfile.task-executor
index ad5cc64..9b27772 100644
--- a/gitea/Dockerfile.task-executor
+++ b/gitea/Dockerfile.task-executor
@@ -1,5 +1,8 @@
 FROM ubuntu:22.04

+# Set system time zone to prevent the tzdata package from hanging looking for user input pater
+RUN ln -snf /usr/share/zoneinfo/$CONTAINER_TIMEZONE /etc/localtime && echo $CONTAINER_TIMEZONE > /etc/timezone
+
 # Install basic tools
 RUN apt update && apt install -y gpg curl apt-transport-https ca-certificates lsb-release build-essential

@@ -24,3 +27,7 @@ RUN set -uex; \

 # Install Docker
 RUN apt update && apt install -y docker-ce && rm -rf /var/lib/apt/lists/*
+# Install sudo because some actions projects assume it is present, and it is present in GitHub runners
+RUN apt update && apt install -y sudo
+# Install software-properties-common so we have the add-apt-repository command, used by some actions to add a package repo
+RUN apt update && apt install -y software-properties-common

Then I made this change to an example job:

      - name: "Install Python"
        uses: deadsnakes/action@v3.0.1
        with:
          python-version: '3.8'

@dboreham
Copy link
Collaborator Author

Test job passed:

image

@dboreham
Copy link
Collaborator Author

RUNNER_ARCH=ARM64

@dboreham
Copy link
Collaborator Author

With this PR merged all our CI jobs will run on ARM, if a suitable runner is provisioned.

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

No branches or pull requests

1 participant