Skip to content

Commit

Permalink
installation: untar libzmq in venv folder instead of /usr/local
Browse files Browse the repository at this point in the history
- on a linux-host docker build, the user can't write to /usr/local and installing pyzmq fails
- normal installation also changed because it's sensible to have all pyzmq dependencies in the venv
- this also makes the separate 'sudo rsync' command obsolete
- jukebox.Dockerfile: removing ZMQ_PREFIX=${PREFIX} since PREFIX variable doesn't exist in docker environment
- jukebox.Dockerfile: use ENV to set ZMQ_DRAFT_API
  • Loading branch information
notapirate committed Mar 23, 2024
1 parent cfd72b2 commit 54d3baa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions docker/jukebox.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ RUN pip install --no-cache-dir -r ${INSTALLATION_PATH}/requirements.txt

ENV ZMQ_TMP_DIR libzmq
ENV ZMQ_VERSION 4.3.5
ENV ZMQ_PREFIX /usr/local
ENV ZMQ_PREFIX ${VIRTUAL_ENV}
ENV ZMQ_DRAFT_API 1

RUN [ "$(uname -m)" = "aarch64" ] && ARCH="arm64" || ARCH="$(uname -m)"; \
wget https://github.com/pabera/libzmq/releases/download/v${ZMQ_VERSION}/libzmq5-${ARCH}-${ZMQ_VERSION}.tar.gz -O libzmq.tar.gz; \
tar -xzf libzmq.tar.gz -C ${ZMQ_PREFIX}; \
rm -f libzmq.tar.gz;

RUN export ZMQ_PREFIX=${PREFIX} && export ZMQ_DRAFT_API=1
RUN pip install -v --no-binary pyzmq pyzmq

EXPOSE 5555 5556
Expand Down
5 changes: 2 additions & 3 deletions installation/routines/setup_jukebox_core.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Constants
JUKEBOX_ZMQ_TMP_DIR="${HOME_PATH}/libzmq"
JUKEBOX_ZMQ_PREFIX="/usr/local"
JUKEBOX_ZMQ_PREFIX="${VIRTUAL_ENV}"
JUKEBOX_ZMQ_VERSION="4.3.5"

JUKEBOX_PULSE_CONFIG="${HOME_PATH}"/.config/pulse/default.pa
Expand Down Expand Up @@ -61,9 +61,8 @@ _jukebox_core_download_prebuilt_libzmq_with_drafts() {

cd "${JUKEBOX_ZMQ_TMP_DIR}" || exit_on_error
wget --quiet https://github.com/pabera/libzmq/releases/download/v${JUKEBOX_ZMQ_VERSION}/libzmq5-${ARCH}-${JUKEBOX_ZMQ_VERSION}.tar.gz -O ${zmq_tar_filename} || exit_on_error "Download failed"
tar -xzf ${zmq_tar_filename}
tar -xzf ${zmq_tar_filename} -C ${JUKEBOX_ZMQ_PREFIX}
rm -f ${zmq_tar_filename}
sudo rsync -a ./* ${JUKEBOX_ZMQ_PREFIX}/
}

_jukebox_core_build_and_install_pyzmq() {
Expand Down

0 comments on commit 54d3baa

Please sign in to comment.