diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fc3ee239..db627db5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -58,9 +58,9 @@ jobs: # To save arm64 runner resources, we run the tests only on main # and only for full-stack image (same for integration tests below). test-arm64: - if: >- - github.repository == 'aiidalab/aiidalab-docker-stack' - && (github.ref_type == 'tag' || github.ref_name == 'main') + #if: >- + # github.repository == 'aiidalab/aiidalab-docker-stack' + # && (github.ref_type == 'tag' || github.ref_name == 'main') needs: build uses: ./.github/workflows/test.yml with: @@ -80,9 +80,9 @@ jobs: runner: [ubuntu-22.04, buildjet-4vcpu-ubuntu-2204-arm] isPR: - ${{ github.event_name == 'pull_request' }} - exclude: - - isPR: true - runner: buildjet-4vcpu-ubuntu-2204-arm + #exclude: + # - isPR: true + # runner: buildjet-4vcpu-ubuntu-2204-arm uses: ./.github/workflows/test.yml with: diff --git a/build.json b/build.json index 06f2311c..a75a2d6b 100644 --- a/build.json +++ b/build.json @@ -7,7 +7,7 @@ "default": "15" }, "RMQ_VERSION": { - "default": "3.9.13" + "default": "3.13.5" }, "AIIDA_VERSION": { "default": "2.6.2" diff --git a/docker-bake.hcl b/docker-bake.hcl index 27d2c6c5..83bf3051 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -77,7 +77,6 @@ target "base-with-services" { } platforms = "${PLATFORMS}" args = { - "AIIDA_VERSION" = "${AIIDA_VERSION}" "PGSQL_VERSION" = "${PGSQL_VERSION}" "RMQ_VERSION" = "${RMQ_VERSION}" } diff --git a/stack/base-with-services/Dockerfile b/stack/base-with-services/Dockerfile index 2230bd43..01ba7813 100644 --- a/stack/base-with-services/Dockerfile +++ b/stack/base-with-services/Dockerfile @@ -6,10 +6,8 @@ LABEL maintainer="AiiDAlab Team " USER root WORKDIR /opt/ -ARG AIIDA_VERSION ARG PGSQL_VERSION ARG RMQ_VERSION -ARG TARGETARCH # Location of the Postgresql DB # This variable is automatically picked up by initdb and pg_ctl @@ -17,33 +15,11 @@ ARG TARGETARCH ENV PGDATA=/home/${NB_USER}/.postgresql # Install RabbitMQ and PostgreSQL in a dedicated conda environment. -# -# RabbitMQ is currently not available on conda-forge for arm64, see: -# https://github.com/conda-forge/rabbitmq-server-feedstock/issues/67If -# Instead we need install erlang via apt and RabbitMQ as a "Generic Unix Build", see: -# https://www.rabbitmq.com/install-generic-unix.html -# Note that this version must be compatible with system's erlang version. -# Currently installed Erlang version is 23.3, so the latest supported RMQ version is 3.9.21 -# https://www.rabbitmq.com/docs/which-erlang#old-timers -# Note that system erlang from arm64 is already installed in the base image, -# together with other APT dependencies to save build time. -RUN if [ "$TARGETARCH" = "amd64" ]; then \ - mamba create -p /opt/conda/envs/aiida-core-services --yes \ - postgresql=${PGSQL_VERSION} \ - rabbitmq-server=${RMQ_VERSION} && \ - mamba clean --all -f -y && \ - fix-permissions "${CONDA_DIR}"; \ - elif [ "$TARGETARCH" = "arm64" ]; then \ - mamba create -p /opt/conda/envs/aiida-core-services --yes \ - postgresql=${PGSQL_VERSION} && \ - mamba clean --all -f -y && \ - wget -c https://github.com/rabbitmq/rabbitmq-server/releases/download/v${RMQ_VERSION}/rabbitmq-server-generic-unix-${RMQ_VERSION}.tar.xz && \ - tar -xf rabbitmq-server-generic-unix-${RMQ_VERSION}.tar.xz && \ - rm rabbitmq-server-generic-unix-${RMQ_VERSION}.tar.xz && \ - mv rabbitmq_server-${RMQ_VERSION} /opt/conda/envs/aiida-core-services/rabbitmq_server && \ - ln -sf /opt/conda/envs/aiida-core-services/rabbitmq_server/sbin/* /opt/conda/envs/aiida-core-services/bin/ && \ - fix-permissions "${CONDA_DIR}"; \ - fi +RUN mamba create -p /opt/conda/envs/aiida-core-services --yes \ + postgresql=${PGSQL_VERSION} \ + rabbitmq-server=${RMQ_VERSION} && \ + mamba clean --all -f -y && \ + fix-permissions "${CONDA_DIR}" # Configure AiiDA profile. COPY config-quick-setup.yaml . diff --git a/stack/base-with-services/before-notebook.d/30_start-rabbitmq.sh b/stack/base-with-services/before-notebook.d/30_start-rabbitmq.sh index 391d1b53..e4ffa213 100644 --- a/stack/base-with-services/before-notebook.d/30_start-rabbitmq.sh +++ b/stack/base-with-services/before-notebook.d/30_start-rabbitmq.sh @@ -4,7 +4,4 @@ set -emx # Fix issue where the erlang cookie permissions are corrupted. chmod 400 "/home/${NB_USER}/.erlang.cookie" || echo "erlang cookie not created yet." -# NOTE: In arm64 build, rabbitmq is not installed via conda, -# but the following incantation still works since -# rabbitmq-server is available globally. mamba run -n aiida-core-services rabbitmq-server -detached diff --git a/stack/base-with-services/configure_rabbitmq.sh b/stack/base-with-services/configure_rabbitmq.sh index e9843d26..3eef3e62 100755 --- a/stack/base-with-services/configure_rabbitmq.sh +++ b/stack/base-with-services/configure_rabbitmq.sh @@ -1,14 +1,9 @@ #!/bin/bash set -emx -RMQ_ETC_DIR_ARM64="/opt/conda/envs/aiida-core-services/rabbitmq_server/etc/rabbitmq" -RMQ_ETC_DIR_AMD64="/opt/conda/envs/aiida-core-services/etc/rabbitmq" -if [[ -d $RMQ_ETC_DIR_ARM64 ]]; then - RMQ_ETC_DIR="$RMQ_ETC_DIR_ARM64" -elif [[ -d $RMQ_ETC_DIR_AMD64 ]]; then - RMQ_ETC_DIR="$RMQ_ETC_DIR_AMD64" -else - echo "ERROR: Could not find RabbitMQ etc directory" +RMQ_ETC_DIR="/opt/conda/envs/aiida-core-services/etc/rabbitmq" +if [[ ! -d $RMQ_ETC_DIR ]]; then + echo "ERROR: directory '$RMQ_ETC_DIR' does not exist!" exit 1 fi diff --git a/stack/base/Dockerfile b/stack/base/Dockerfile index b5e6a8a1..a08b657a 100644 --- a/stack/base/Dockerfile +++ b/stack/base/Dockerfile @@ -9,14 +9,11 @@ USER root # povray: rendering engine used in aiidalab-widgets-base ENV EXTRA_APT_PACKAGES "curl povray rsync" -# For ARM64 we need to install erlang as it is not available on conda-forge -# (this is needed later as rabbitmq dependency in base-with-services image, -# but we install it here so that we don't have to invoke apt multiple times. -# We also install build-essential, which includes GCC compilers that are needed when building -# pip packages from sources, which is more often needed on ARM64 +# For ARM64 we also install build-essential, which includes GCC compilers that are needed when building +# pip packages from sources, which is more often needed on ARM64. ARG TARGETARCH RUN if [ "$TARGETARCH" = "arm64" ]; then \ - EXTRA_APT_PACKAGES="erlang build-essential libhdf5-serial-dev pkg-config ${EXTRA_APT_PACKAGES}"; \ + EXTRA_APT_PACKAGES="build-essential libhdf5-serial-dev pkg-config ${EXTRA_APT_PACKAGES}"; \ fi;\ apt-get update --yes && \ apt-get install --yes --no-install-recommends ${EXTRA_APT_PACKAGES} && \ diff --git a/stack/lab/before-notebook.d/60_prepare-aiidalab.sh b/stack/lab/before-notebook.d/60_prepare-aiidalab.sh index 1e021938..c8d19618 100755 --- a/stack/lab/before-notebook.d/60_prepare-aiidalab.sh +++ b/stack/lab/before-notebook.d/60_prepare-aiidalab.sh @@ -6,11 +6,6 @@ set -x # Environment. export SHELL=/bin/bash -# Fix https://github.com/aiidalab/aiidalab-docker-stack/issues/225 -if [ -L /home/${NB_USER}/${NB_USER} ]; then - rm /home/${NB_USER}/${NB_USER} -fi - # Check whether this is likely the first time we run this script. [[ -z $(ls -A "/home/${NB_USER}/apps/") ]] && INITIAL_SETUP=1 || INITIAL_SETUP=0