Skip to content

Commit

Permalink
docker: fix build on arm64 architecture
Browse files Browse the repository at this point in the history
  • Loading branch information
tiborsimko committed Oct 30, 2023
1 parent 1712018 commit a8f224c
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 11 deletions.
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Changes
=======

Version 0.9.2 (UNRELEASED)
--------------------------

- Fixes container image building on the arm64 architecture.

Version 0.9.1 (2023-09-27)
--------------------------

Expand Down
32 changes: 24 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
# Use Ubuntu LTS base image
FROM docker.io/library/ubuntu:20.04

# Recognise target architecture
ARG TARGETARCH

# Use default answers in installation commands
ENV DEBIAN_FRONTEND=noninteractive

Expand Down Expand Up @@ -44,8 +47,8 @@ RUN if echo "$COMPUTE_BACKENDS" | grep -q "htcondorcern"; then \
set -e; \
apt-get update -y; \
apt-get install --no-install-recommends -y wget alien gnupg2 rand; \
wget -O ngbauth-submit.rpm https://linuxsoft.cern.ch/internal/repos/batch8s-stable/x86_64/os/Packages/n/ngbauth-submit-0.26-2.el8s.noarch.rpm; \
wget -O myschedd.rpm https://linuxsoft.cern.ch/internal/repos/batch8s-stable/x86_64/os/Packages/m/myschedd-1.9-2.el8s.x86_64.rpm; \
wget -q -O ngbauth-submit.rpm https://linuxsoft.cern.ch/internal/repos/batch8s-stable/x86_64/os/Packages/n/ngbauth-submit-0.26-2.el8s.noarch.rpm; \
wget -q -O myschedd.rpm https://linuxsoft.cern.ch/internal/repos/batch8s-stable/x86_64/os/Packages/m/myschedd-1.9-2.el8s.x86_64.rpm; \
yes | alien -i myschedd.rpm; \
yes | alien -i ngbauth-submit.rpm; \
rm -rf myschedd.rpm ngbauth-submit.rpm; \
Expand All @@ -72,22 +75,35 @@ COPY etc/ngbauth-submit /etc/sysconfig/
COPY etc/ngauth_batch_crypt_pub.pem /etc/
COPY etc/cerngridca.crt /usr/local/share/ca-certificates/cerngridca.crt
COPY etc/cernroot.crt /usr/local/share/ca-certificates/cernroot.crt
COPY etc/job_wrapper.sh etc/job_wrapper.sh
RUN chmod +x /etc/job_wrapper.sh
RUN update-ca-certificates
COPY etc/job_wrapper.sh /etc/job_wrapper.sh
RUN chmod +x /etc/job_wrapper.sh && \
update-ca-certificates

# Copy cluster component source code
WORKDIR /code
COPY . /code

# Are we debugging?
ARG DEBUG=0
RUN if [ "${DEBUG}" -gt 0 ]; then pip install -e ".[debug]"; else pip install .; fi;
# hadolint ignore=DL3013,DL4006,SC1075
RUN if [ "${DEBUG}" -gt 0 ]; then \
if echo "$COMPUTE_BACKENDS" | grep -q "htcondorcern"; then \
pip install --no-cache-dir -e ".[debug,htcondor]"; \
else \
pip install --no-cache-dir -e ".[debug]"; \
fi \
else \
if echo "$COMPUTE_BACKENDS" | grep -q "htcondorcern"; then \
pip install --no-cache-dir ".[htcondor]"; \
else \
pip install --no-cache-dir .; \
fi \
fi

# Are we building with locally-checked-out shared modules?
# hadolint ignore=SC2102
RUN if test -e modules/reana-commons; then pip install -e modules/reana-commons[kubernetes] --upgrade; fi
RUN if test -e modules/reana-db; then pip install -e modules/reana-db --upgrade; fi
RUN if test -e modules/reana-commons; then pip install --no-cache-dir -e modules/reana-commons[kubernetes] --upgrade; fi
RUN if test -e modules/reana-db; then pip install --no-cache-dir -e modules/reana-db --upgrade; fi

# Check for any broken Python dependencies
RUN pip check
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ flask==2.1.3 # via reana-job-controller (setup.py)
fs==2.4.16 # via reana-commons, reana-job-controller (setup.py)
google-auth==2.23.0 # via kubernetes
gssapi==1.8.3 # via paramiko
htcondor==9.0.17 # via reana-job-controller (setup.py)
idna==3.4 # via jsonschema, requests
importlib-metadata==6.8.0 # via alembic, flask
importlib-resources==6.1.0 # via alembic
Expand Down
2 changes: 1 addition & 1 deletion run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ check_pytest () {
}

check_dockerfile () {
docker run -i --rm docker.io/hadolint/hadolint:v1.18.2 < Dockerfile
docker run -i --rm docker.io/hadolint/hadolint:v2.12.0 < Dockerfile
}

check_docker_build () {
Expand Down
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
"sphinxcontrib-openapi>=0.8.0",
"sphinxcontrib-redoc>=1.5.1",
],
"htcondor": [
"htcondor==9.0.17",
],
"tests": tests_require,
"ssh": ["paramiko[gssapi]>=3.0.0"],
}
Expand Down Expand Up @@ -63,7 +66,6 @@
"marshmallow>2.13.0,<=2.20.1",
"reana-commons[kubernetes]>=0.9.3,<0.10.0",
"reana-db>=0.9.2,<0.10.0",
"htcondor==9.0.17",
"retrying>=1.3.3",
]

Expand Down

0 comments on commit a8f224c

Please sign in to comment.