Skip to content

Commit

Permalink
base: don't store build files in /opt/epics.
Browse files Browse the repository at this point in the history
These scripts and patches are only used during build time, so they can
be stored in a dedicated directory instead. This also makes the build
process more explicit, by not relying on being in the same directory as
other files.
  • Loading branch information
ericonr committed Dec 3, 2024
1 parent 3ce3724 commit fce6105
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 39 deletions.
34 changes: 19 additions & 15 deletions base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,30 +35,34 @@ RUN apt update -y && \
COPY lnls-get-n-unpack.sh /usr/local/bin/lnls-get-n-unpack
COPY lnls-run.sh /usr/local/bin/lnls-run

WORKDIR /opt/epics
COPY install-functions.sh .
ENV EPICS_IN_DOCKER /opt/epics-in-docker
RUN mkdir $EPICS_IN_DOCKER

COPY install-functions.sh $EPICS_IN_DOCKER

ENV EPICS_BASE_PATH /opt/epics/base
ENV EPICS_MODULES_PATH /opt/epics/modules
ENV EPICS_RELEASE_FILE /opt/epics/RELEASE

COPY backport-epics-base-musl.patch epics-base-static-linking.patch .
COPY epics_versions.sh install_epics.sh .
RUN ./install_epics.sh
WORKDIR /opt/epics

COPY backport-epics-base-musl.patch epics-base-static-linking.patch $EPICS_IN_DOCKER
COPY epics_versions.sh install_epics.sh $EPICS_IN_DOCKER
RUN $EPICS_IN_DOCKER/install_epics.sh

WORKDIR ${EPICS_MODULES_PATH}

COPY backport-ipmicomm.patch ipmicomm.patch caputlog-waveform-fix.patch .
COPY modules_versions.sh install_modules.sh .
RUN ./install_modules.sh
COPY backport-ipmicomm.patch ipmicomm.patch caputlog-waveform-fix.patch $EPICS_IN_DOCKER
COPY modules_versions.sh install_modules.sh $EPICS_IN_DOCKER
RUN $EPICS_IN_DOCKER/install_modules.sh

COPY backport-adsupport-nanohttp.patch .
COPY area_detector_versions.sh install_area_detector.sh .
RUN ./install_area_detector.sh
COPY backport-adsupport-nanohttp.patch $EPICS_IN_DOCKER
COPY area_detector_versions.sh install_area_detector.sh $EPICS_IN_DOCKER
RUN $EPICS_IN_DOCKER/install_area_detector.sh

COPY motor_versions.sh install_motor.sh .
RUN ./install_motor.sh
COPY motor_versions.sh install_motor.sh $EPICS_IN_DOCKER
RUN $EPICS_IN_DOCKER/install_motor.sh

ARG DEBIAN_VERSION
COPY opcua_versions.sh install_opcua.sh .
RUN ./install_opcua.sh
COPY opcua_versions.sh install_opcua.sh $EPICS_IN_DOCKER
RUN $EPICS_IN_DOCKER/install_opcua.sh
6 changes: 3 additions & 3 deletions base/install_area_detector.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

set -ex

. /opt/epics/install-functions.sh
. ./area_detector_versions.sh
. $EPICS_IN_DOCKER/install-functions.sh
. $EPICS_IN_DOCKER/area_detector_versions.sh

git clone --depth 1 --branch ${AREA_DETECTOR_VERSION} \
https://github.com/areaDetector/areaDetector
Expand Down Expand Up @@ -97,7 +97,7 @@ ARAVIS_INCLUDE=$(pkg-config --cflags-only-I aravis-0.8 | sed -e "s|-I||g")

cd -

patch -d ADSupport -Np1 < ${EPICS_MODULES_PATH}/backport-adsupport-nanohttp.patch
patch -d ADSupport -Np1 < ${EPICS_IN_DOCKER}/backport-adsupport-nanohttp.patch

make -j${JOBS}
make clean
Expand Down
8 changes: 4 additions & 4 deletions base/install_epics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

set -ex

. /opt/epics/install-functions.sh
. ./epics_versions.sh
. $EPICS_IN_DOCKER/install-functions.sh
. $EPICS_IN_DOCKER/epics_versions.sh

lnls-get-n-unpack -l https://epics-controls.org/download/base/base-${EPICS_BASE_VERSION}.tar.gz
mv base-${EPICS_BASE_VERSION} ${EPICS_BASE_PATH}

patch -d ${EPICS_BASE_PATH} -Np1 < backport-epics-base-musl.patch
patch -d ${EPICS_BASE_PATH} -Np1 < epics-base-static-linking.patch
patch -d ${EPICS_BASE_PATH} -Np1 < $EPICS_IN_DOCKER/backport-epics-base-musl.patch
patch -d ${EPICS_BASE_PATH} -Np1 < $EPICS_IN_DOCKER/epics-base-static-linking.patch

if [ -n "$COMMANDLINE_LIBRARY" ]; then
echo "COMMANDLINE_LIBRARY = $COMMANDLINE_LIBRARY" > ${EPICS_BASE_PATH}/configure/CONFIG_SITE.local
Expand Down
10 changes: 5 additions & 5 deletions base/install_modules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

set -ex

. /opt/epics/install-functions.sh
. ./modules_versions.sh
. $EPICS_IN_DOCKER/install-functions.sh
. $EPICS_IN_DOCKER/modules_versions.sh

install_from_github mdavidsaver pvxs PVXS $PVXS_VERSION "
EPICS_BASE
Expand Down Expand Up @@ -58,7 +58,7 @@ EPICS_BASE
"

download_from_github epics-modules caPutLog $CAPUTLOG_VERSION
patch -d caPutLog -Np1 < caputlog-waveform-fix.patch
patch -d caPutLog -Np1 < $EPICS_IN_DOCKER/caputlog-waveform-fix.patch
install_module caPutLog CAPUTLOG "
EPICS_BASE
"
Expand All @@ -76,8 +76,8 @@ EPICS_BASE
"

download_from_github slac-epics-modules ipmiComm $IPMICOMM_VERSION
patch -d ipmiComm -Np1 < backport-ipmicomm.patch
patch -d ipmiComm -Np1 < ipmicomm.patch
patch -d ipmiComm -Np1 < $EPICS_IN_DOCKER/backport-ipmicomm.patch
patch -d ipmiComm -Np1 < $EPICS_IN_DOCKER/ipmicomm.patch
JOBS=1 install_module ipmiComm IPMICOMM "
EPICS_BASE
ASYN
Expand Down
4 changes: 2 additions & 2 deletions base/install_motor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

set -ex

. /opt/epics/install-functions.sh
. ./motor_versions.sh
. $EPICS_IN_DOCKER/install-functions.sh
. $EPICS_IN_DOCKER/motor_versions.sh

git clone --depth 1 --branch ${MOTOR_VERSION} \
https://github.com/epics-modules/motor
Expand Down
6 changes: 3 additions & 3 deletions base/install_opcua.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

set -ex

. /opt/epics/install-functions.sh
. /opt/epics/epics_versions.sh
. ./opcua_versions.sh
. $EPICS_IN_DOCKER/install-functions.sh
. $EPICS_IN_DOCKER/epics_versions.sh
. $EPICS_IN_DOCKER/opcua_versions.sh

opcua_release_url=https://github.com/epics-modules/opcua/releases/download/v${OPCUA_VERSION}
opcua_release_file=IOC_opcua-${OPCUA_VERSION}_Base-${EPICS_BASE_VERSION}_debian${DEBIAN_VERSION%.*}.tar.gz
Expand Down
18 changes: 11 additions & 7 deletions base/musl/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,25 @@ RUN apk add --no-cache \
COPY lnls-get-n-unpack.sh /usr/local/bin/lnls-get-n-unpack
COPY lnls-run.sh /usr/local/bin/lnls-run

ENV EPICS_IN_DOCKER /opt/epics-in-docker
RUN mkdir $EPICS_IN_DOCKER

COPY install-functions.sh $EPICS_IN_DOCKER

ENV EPICS_BASE_PATH /opt/epics/base
ENV EPICS_MODULES_PATH /opt/epics/modules
ENV EPICS_RELEASE_FILE /opt/epics/RELEASE

WORKDIR /opt/epics
COPY install-functions.sh .

COPY backport-epics-base-musl.patch epics-base-static-linking.patch .
COPY epics_versions.sh install_epics.sh .
RUN COMMANDLINE_LIBRARY=READLINE_NCURSES ./install_epics.sh
COPY backport-epics-base-musl.patch epics-base-static-linking.patch $EPICS_IN_DOCKER
COPY epics_versions.sh install_epics.sh $EPICS_IN_DOCKER
RUN COMMANDLINE_LIBRARY=READLINE_NCURSES $EPICS_IN_DOCKER/install_epics.sh

WORKDIR ${EPICS_MODULES_PATH}

COPY backport-ipmicomm.patch ipmicomm.patch caputlog-waveform-fix.patch .
COPY modules_versions.sh install_modules.sh .
RUN NEEDS_TIRPC=YES ./install_modules.sh
COPY backport-ipmicomm.patch ipmicomm.patch caputlog-waveform-fix.patch $EPICS_IN_DOCKER
COPY modules_versions.sh install_modules.sh $EPICS_IN_DOCKER
RUN NEEDS_TIRPC=YES $EPICS_IN_DOCKER/install_modules.sh

COPY lnls-build-static-ioc.sh /usr/local/bin/lnls-build-static-ioc

0 comments on commit fce6105

Please sign in to comment.