From df5f3777c2b45f3705b39b21fb3f0c291fe95807 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tibor=20=C5=A0imko?= Date: Sun, 29 Oct 2023 17:20:04 +0100 Subject: [PATCH] docker: fix build on arm64 architecture Closes reanahub/reana#753. --- CHANGES.rst | 5 +++++ Dockerfile | 17 ++++++++++++++++- requirements.txt | 1 - setup.py | 4 +++- 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index e7ff38a5..57f15502 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -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) -------------------------- diff --git a/Dockerfile b/Dockerfile index bfc2e4f3..7625d09c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 @@ -82,7 +85,19 @@ COPY . /code # Are we debugging? ARG DEBUG=0 -RUN if [ "${DEBUG}" -gt 0 ]; then pip install -e ".[debug]"; else pip install .; fi; +RUN if [ "${DEBUG}" -gt 0 ]; then \ + if echo "$COMPUTE_BACKENDS" | grep -q "htcondorcern"; then \ + pip install -e ".[debug,htcondor]"; \ + else \ + pip install -e ".[debug]"; \ + fi \ + else \ + if echo "$COMPUTE_BACKENDS" | grep -q "htcondorcern"; then \ + pip install ".[htcondor]"; \ + else \ + pip install .; \ + fi \ + fi # Are we building with locally-checked-out shared modules? # hadolint ignore=SC2102 diff --git a/requirements.txt b/requirements.txt index 8a66a763..ac7e64dd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 diff --git a/setup.py b/setup.py index 7501d303..751bd350 100644 --- a/setup.py +++ b/setup.py @@ -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"], } @@ -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", ]