Skip to content

Commit 90fa979

Browse files
committed
Install RabbitMQ from conda on arm64
1 parent e6fab3c commit 90fa979

File tree

6 files changed

+10
-50
lines changed

6 files changed

+10
-50
lines changed

build.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"default": "15"
88
},
99
"RMQ_VERSION": {
10-
"default": "3.9.13"
10+
"default": "3.13.2"
1111
},
1212
"AIIDA_VERSION": {
1313
"default": "2.5.1"

stack/base-with-services/Dockerfile

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,44 +6,20 @@ LABEL maintainer="AiiDAlab Team <[email protected]>"
66
USER root
77
WORKDIR /opt/
88

9-
ARG AIIDA_VERSION
109
ARG PGSQL_VERSION
1110
ARG RMQ_VERSION
12-
ARG TARGETARCH
1311

1412
# Location of the Postgresql DB
1513
# This variable is automatically picked up by initdb and pg_ctl
1614
# WARNING: If you change this, you have to change it in full-stack as well!
1715
ENV PGDATA=/home/${NB_USER}/.postgresql
1816

1917
# Install RabbitMQ and PostgreSQL in a dedicated conda environment.
20-
#
21-
# RabbitMQ is currently not available on conda-forge for arm64, see:
22-
# https://github.com/conda-forge/rabbitmq-server-feedstock/issues/67If
23-
# Instead we need install erlang via apt and RabbitMQ as a "Generic Unix Build", see:
24-
# https://www.rabbitmq.com/install-generic-unix.html
25-
# Note that this version must be compatible with system's erlang version.
26-
# Currently installed Erlang version is 23.3, so the latest supported RMQ version is 3.9.21
27-
# https://www.rabbitmq.com/docs/which-erlang#old-timers
28-
# Note that system erlang from arm64 is already installed in the base image,
29-
# together with other APT dependencies to save build time.
30-
RUN if [ "$TARGETARCH" = "amd64" ]; then \
31-
mamba create -p /opt/conda/envs/aiida-core-services --yes \
32-
postgresql=${PGSQL_VERSION} \
33-
rabbitmq-server=${RMQ_VERSION} && \
34-
mamba clean --all -f -y && \
35-
fix-permissions "${CONDA_DIR}"; \
36-
elif [ "$TARGETARCH" = "arm64" ]; then \
37-
mamba create -p /opt/conda/envs/aiida-core-services --yes \
38-
postgresql=${PGSQL_VERSION} && \
39-
mamba clean --all -f -y && \
40-
wget -c https://github.com/rabbitmq/rabbitmq-server/releases/download/v${RMQ_VERSION}/rabbitmq-server-generic-unix-${RMQ_VERSION}.tar.xz && \
41-
tar -xf rabbitmq-server-generic-unix-${RMQ_VERSION}.tar.xz && \
42-
rm rabbitmq-server-generic-unix-${RMQ_VERSION}.tar.xz && \
43-
mv rabbitmq_server-${RMQ_VERSION} /opt/conda/envs/aiida-core-services/rabbitmq_server && \
44-
ln -sf /opt/conda/envs/aiida-core-services/rabbitmq_server/sbin/* /opt/conda/envs/aiida-core-services/bin/ && \
45-
fix-permissions "${CONDA_DIR}"; \
46-
fi
18+
RUN mamba create -p /opt/conda/envs/aiida-core-services --yes \
19+
postgresql=${PGSQL_VERSION} \
20+
rabbitmq-server=${RMQ_VERSION} && \
21+
mamba clean --all -f -y && \
22+
fix-permissions "${CONDA_DIR}"
4723

4824
# Configure AiiDA profile.
4925
COPY config-quick-setup.yaml .

stack/base-with-services/before-notebook.d/30_start-rabbitmq.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,4 @@ set -emx
44
# Fix issue where the erlang cookie permissions are corrupted.
55
chmod 400 "/home/${NB_USER}/.erlang.cookie" || echo "erlang cookie not created yet."
66

7-
# NOTE: In arm64 build, rabbitmq is not installed via conda,
8-
# but the following incantation still works since
9-
# rabbitmq-server is available globally.
107
mamba run -n aiida-core-services rabbitmq-server -detached

stack/base-with-services/configure_rabbitmq.sh

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
#!/bin/bash
22
set -emx
33

4-
RMQ_ETC_DIR_ARM64="/opt/conda/envs/aiida-core-services/rabbitmq_server/etc/rabbitmq"
5-
RMQ_ETC_DIR_AMD64="/opt/conda/envs/aiida-core-services/etc/rabbitmq"
6-
if [[ -d $RMQ_ETC_DIR_ARM64 ]]; then
7-
RMQ_ETC_DIR="$RMQ_ETC_DIR_ARM64"
8-
elif [[ -d $RMQ_ETC_DIR_AMD64 ]]; then
9-
RMQ_ETC_DIR="$RMQ_ETC_DIR_AMD64"
10-
else
11-
echo "ERROR: Could not find RabbitMQ etc directory"
4+
RMQ_ETC_DIR="/opt/conda/envs/aiida-core-services/etc/rabbitmq"
5+
if [[ ! -d $RMQ_ETC_DIR ]]; then
6+
echo "ERROR: directory '$RMQ_ETC_DIR' does not exist!"
127
exit 1
138
fi
149

stack/base/Dockerfile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,9 @@ USER root
1212
# povray: rendering engine used in aiidalab-widgets-base
1313
ENV EXTRA_APT_PACKAGES "curl povray rsync build-essential"
1414

15-
# For ARM64 we need to install erlang as it is not available on conda-forge
16-
# (this is needed later as rabbitmq dependency in base-with-services image,
17-
# but we install it here so that we don't have to invoke apt multiple times.
1815
ARG TARGETARCH
1916
RUN if [ "$TARGETARCH" = "arm64" ]; then \
20-
EXTRA_APT_PACKAGES="erlang libhdf5-serial-dev pkg-config ${EXTRA_APT_PACKAGES}"; \
17+
EXTRA_APT_PACKAGES="libhdf5-serial-dev pkg-config ${EXTRA_APT_PACKAGES}"; \
2118
fi;\
2219
apt-get update --yes && \
2320
apt-get install --yes --no-install-recommends ${EXTRA_APT_PACKAGES} && \

stack/lab/before-notebook.d/60_prepare-aiidalab.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@ set -x
66
# Environment.
77
export SHELL=/bin/bash
88

9-
# Fix https://github.com/aiidalab/aiidalab-docker-stack/issues/225
10-
if [ -L /home/${NB_USER}/${NB_USER} ]; then
11-
rm /home/${NB_USER}/${NB_USER}
12-
fi
13-
149
# Check whether this is likely the first time we run this script.
1510
[[ -z $(ls -A "/home/${NB_USER}/apps/") ]] && INITIAL_SETUP=1 || INITIAL_SETUP=0
1611

0 commit comments

Comments
 (0)