Deploy CI on aarch64 #572

Open
opened 2023-10-11 01:01:30 +00:00 by dboreham · 5 comments
Owner

We have had several cases where stacks don't build, or sometimes don't run, on ARM. e.g. https://github.com/cerc-io/stack-orchestrator/issues/565

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

We have had several cases where stacks don't build, or sometimes don't run, on ARM. e.g. https://github.com/cerc-io/stack-orchestrator/issues/565 If we had CI running on an aarch64 machine, these failures would be more easily identified in advance.
Author
Owner

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: https://github.com/actions/setup-python/issues/705

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: https://github.com/actions/setup-python/issues/705
Author
Owner

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'
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' ```
Author
Owner

Test job passed:

image

Test job passed: ![image](https://github.com/cerc-io/stack-orchestrator/assets/1649760/5fbb93f3-451d-4037-a114-95270925cdd9)
Author
Owner

RUNNER_ARCH=ARM64

`RUNNER_ARCH=ARM64`
Author
Owner

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

With [this PR](https://github.com/cerc-io/stack-orchestrator/pull/578) merged all our CI jobs will run on ARM, if a suitable runner is provisioned.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cerc-io/stack-orchestrator#572
No description provided.