Skip to content

Commit

Permalink
Merge pull request #256 from VERITAS-Observatory/v490.6-dev2-docker-u…
Browse files Browse the repository at this point in the history
…pdates

v490.6 dev2 docker updates
  • Loading branch information
GernotMaier authored Jan 31, 2024
2 parents bc5be83 + 29daa95 commit 32f178f
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 36 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-buildmatrix-cpp11.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

steps:
# Checks-out your repository under $GITHUB_WORKSPACE
- uses: actions/checkout@v4
- uses: actions/checkout@v3

- name: vbf
run: |
Expand Down
23 changes: 14 additions & 9 deletions .github/workflows/vts-eventdisplay-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@
name: VTS Eventdisplay Docker Image

on:
workflow_dispatch:
push:
branches: ["main"]
branches:
- main
tags:
- 'v*'
pull_request:
branches: ["main"]
release:
Expand All @@ -26,6 +30,14 @@ jobs:
with:
path: 'EventDisplay_v4'

- name: Set build arguments
run: |
if [[ "${{ github.event_name }}" == 'pull_request' ]]; then
echo "BUILD_BRANCH=${GITHUB_HEAD_REF}" >> "$GITHUB_ENV"
else
echo "BUILD_BRANCH=${GITHUB_REF#refs/heads/}" >> "$GITHUB_ENV"
fi
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
Expand All @@ -39,18 +51,11 @@ jobs:
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: vbf
run: |
curl https://syncandshare.desy.de/index.php/s/${{ secrets.VBFcpp17 }}/download > VBF.tar.gz
- name: sofa
run: |
curl https://syncandshare.desy.de/index.php/s/${{ secrets.SOFA }}/download > sofa.tar.gz
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
build-args: BUILD_BRANCH=${{ env.BUILD_BRANCH }}
push: ${{ github.event_name != 'pull_request' }}
file: ./EventDisplay_v4/dockerfiles/Dockerfile
tags: ${{ steps.meta.outputs.tags }}
Expand Down
61 changes: 35 additions & 26 deletions dockerfiles/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,42 +1,51 @@
ARG ROOT_VERSION=latest
FROM rootproject/root:${ROOT_VERSION} AS vbf_build
ARG ROOT_VERSION=6.30.02-alma9
FROM rootproject/root:${ROOT_VERSION} AS build
ARG VBF_VERSION=0.3.4
ARG BUILD_BRANCH=main

LABEL maintainer.name="Eventdisplay Team"
LABEL maintainer.email="gernot.maier@desy.de"

COPY VBF.tar.gz VBF.tar.gz
RUN mkdir VBF &&tar -xzf VBF.tar.gz -C VBF --strip-components=1 \
&& cd VBF \
&& ./configure --prefix=/opt/VBF \
&& make && make install \
&& make clean

FROM rootproject/root:${ROOT_VERSION} as eventdisplay_build
WORKDIR /opt/
COPY --from=vbf_build /opt/VBF /opt/VBF
# VBF
ADD https://syncandshare.desy.de/index.php/s/NrnZNKfT8WxFpcn/download /workdir/VBF-$VBF_VERSION.tar.gz
WORKDIR /workdir/
RUN mkdir VBF && tar -xzf VBF-$VBF_VERSION.tar.gz -C VBF --strip-components=1 && \
cd VBF && \
./configure --prefix=/opt/VBF && \
make && make install && make clean
ENV VBFSYS /opt/VBF
ENV LD_LIBRARY_PATH "${VBFSYS}/lib/:${LD_LIBRARY_PATH}"
ENV EVNDISPSYS /opt/EventDisplay_v4
ENV SOFASYS "${EVNDISPSYS}/sofa"
ENV PATH ${VBFSYS}/bin:${PATH}

COPY EventDisplay_v4 /opt/Eventdisplay
COPY sofa.tar.gz sofa.tar.gz
ENV EVNDISPSYS /opt/Eventdisplay
ENV LD_LIBRARY_PATH "${EVNDISPSYS}/obj:${EVNDISPSYS}/lib:${ROOTSYS}/lib:${VBFSYS}/lib:${LD_LIBRARY_PATH}"
ENV SOFASYS "${EVNDISPSYS}/sofa"

RUN cd ${EVNDISPSYS} \
&& mv -f /opt/sofa.tar.gz ./sofa/ \
&& ./install_sofa.sh \
&& make VTS
WORKDIR /opt/
RUN BUILD_BRANCH=$(echo ${BUILD_BRANCH} | sed 's#refs/tags/##') && \
git clone -b ${BUILD_BRANCH} https://github.com/VERITAS-Observatory/EventDisplay_v4.git --depth 1
ADD https://syncandshare.desy.de/index.php/s/jr9NrbWFR5MLaDf/download ${SOFASYS}/sofa.tar.gz

RUN cd ${EVNDISPSYS} \
&& ./install_sofa.sh && make VTS

FROM rootproject/root:${ROOT_VERSION}
WORKDIR /opt/
COPY --from=vbf_build /opt/VBF /opt/VBF
COPY --from=eventdisplay_build /opt/Eventdisplay /opt/Eventdisplay

ENV EVNDISPSYS /opt/Eventdisplay
COPY --from=build /opt/VBF /opt/VBF
COPY --from=build /opt/EventDisplay_v4 /opt/EventDisplay_v4
ENV EVNDISPSYS /opt/EventDisplay_v4
ENV VBFSYS /opt/VBF
ENV LD_LIBRARY_PATH "${VBFSYS}/lib/:${LD_LIBRARY_PATH}"
ENV PATH ${VBFSYS}/bin:${PATH}
ENV LD_LIBRARY_PATH "${EVNDISPSYS}/obj:${EVNDISPSYS}/lib:${ROOTSYS}/lib:${VBFSYS}/lib:${LD_LIBRARY_PATH}"
ENV SOFASYS "${EVNDISPSYS}/sofa"

# add main branch of VERITAS Analysis files
WORKDIR /opt/
RUN git clone https://github.com/VERITAS-Observatory/Eventdisplay_AnalysisFiles_VTS.git --dept 1
ENV VERITAS_EVNDISP_AUX_DIR /opt/Eventdisplay_AnalysisFiles_VTS

# data and user data and log directory (to be mounted)
ENV VERITAS_DATA_DIR /opt/data
ENV VERITAS_LOG_DIR /opt/data
ENV VERITAS_USER_DATA_DIR /opt/user_data
ENV VERITAS_USER_USER_DIR /opt/user_data

0 comments on commit 32f178f

Please sign in to comment.