Skip to content

Commit

Permalink
fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
gilesknap committed Oct 2, 2023
1 parent 1fd61ea commit 5c0140b
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 46 deletions.
19 changes: 7 additions & 12 deletions tests/Dockerfile.adsimdetector
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
##### build stage ##############################################################

ARG TARGET_ARCHITECTURE
ARG BASE=7.0.7+ec1
ARG BASE
ARG REGISTRY=ghcr.io/epics-containers

FROM ${REGISTRY}/epics-base-${TARGET_ARCHITECTURE}-developer:${BASE} AS developer

RUN pip install --upgrade ibek

# In a devcontainer this folder is mounted on the host's clone of ioc-adsimdetector
WORKDIR /workspaces/ioc-adsimdetector/ibek-support
WORKDIR /epics/ioc-adsimdetector/ibek-support

# copy the global ibek files
COPY ibek-support/_global/ _global
Expand All @@ -31,32 +33,25 @@ COPY ibek-support/ADSimDetector/ ADSimDetector/
RUN ADSimDetector/install.sh R2-10

# Make the IOC
RUN ibek ioc generate-makefile
RUN ibek ioc compile

##### runtime preparation stage ################################################

FROM developer AS runtime_prep

# get the products from the build stage and reduce to runtime assets only
WORKDIR /min_files
RUN bash /epics/scripts/minimize.sh ${IOC} $(ls -d ${SUPPORT}/*/)
RUN ibek ioc extract-runtime-assets /assets

##### runtime stage ############################################################

FROM ${REGISTRY}/epics-base-${TARGET_ARCHITECTURE}-runtime:${BASE} AS runtime

# get the virtual environment from the developer stage
COPY --from=developer /venv /venv
# add products from build stage
COPY --from=runtime_prep /min_files /
# get runtime assets from the preparation stage
COPY --from=runtime_prep /assets /

# install runtime system dependencies, collected from install.sh scripts
RUN ibek support apt-install --runtime

# add ioc sample startup scripts
COPY ioc ${IOC}

ENV TARGET_ARCHITECTURE ${TARGET_ARCHITECTURE}

ENTRYPOINT ["/bin/bash", "-c", "${IOC}/start.sh"]
17 changes: 6 additions & 11 deletions tests/Dockerfile.asyn
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ ARG TARGET_ARCHITECTURE

FROM ${REGISTRY}/epics-base-${TARGET_ARCHITECTURE}-developer:${BASE} AS developer

RUN pip install --upgrade ibek

# In a devcontainer this folder is mounted on the host's clone of ioc-adsimdetector
WORKDIR /workspaces/ioc-adsimdetector/ibek-support
WORKDIR /epics/ioc-adsimdetector/ibek-support

# copy the global ibek files
COPY ibek-support/_global/ _global
Expand All @@ -16,32 +18,25 @@ COPY ibek-support/asyn/ asyn/
RUN asyn/install.sh R4-42

# Make the IOC
RUN ibek ioc generate-makefile
RUN ibek ioc compile

##### runtime preparation stage ################################################

FROM developer AS runtime_prep

# get the products from the build stage and reduce to runtime assets only
WORKDIR /min_files
RUN bash /epics/scripts/minimize.sh ${IOC} $(ls -d ${SUPPORT}/*/)
RUN ibek ioc extract-runtime-assets

##### runtime stage ############################################################

FROM ${REGISTRY}/epics-base-${TARGET_ARCHITECTURE}-runtime:${BASE} AS runtime

# get the virtual environment from the developer stage
COPY --from=developer /venv /venv
# add products from build stage
COPY --from=runtime_prep /min_files /
# get runtime assets from the preparation stage
COPY --from=runtime_prep /assets /

# install runtime system dependencies, collected from install.sh scripts
RUN ibek support apt-install --runtime

# add ioc sample startup scripts
COPY ioc ${IOC}

ENV TARGET_ARCHITECTURE ${TARGET_ARCHITECTURE}

ENTRYPOINT ["/bin/bash", "-c", "${IOC}/start.sh"]
17 changes: 6 additions & 11 deletions tests/Dockerfile.busy
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ ARG TARGET_ARCHITECTURE

FROM ${REGISTRY}/epics-base-${TARGET_ARCHITECTURE}-developer:${BASE} AS developer

RUN pip install --upgrade ibek

# In a devcontainer this folder is mounted on the host's clone of ioc-adsimdetector
WORKDIR /workspaces/ioc-adsimdetector/ibek-support
WORKDIR /epics/ioc-adsimdetector/ibek-support

# copy the global ibek files
COPY ibek-support/_global/ _global
Expand All @@ -22,32 +24,25 @@ COPY ibek-support/busy/ busy/
RUN busy/install.sh R1-7-3

# Make the IOC
RUN ibek ioc generate-makefile
RUN ibek ioc compile

##### runtime preparation stage ################################################

FROM developer AS runtime_prep

# get the products from the build stage and reduce to runtime assets only
WORKDIR /min_files
RUN bash /epics/scripts/minimize.sh ${IOC} $(ls -d ${SUPPORT}/*/)
RUN ibek ioc extract-runtime-assets /assets

##### runtime stage ############################################################

FROM ${REGISTRY}/epics-base-${TARGET_ARCHITECTURE}-runtime:${BASE} AS runtime

# get the virtual environment from the developer stage
COPY --from=developer /venv /venv
# add products from build stage
COPY --from=runtime_prep /min_files /
# get runtime assets from the preparation stage
COPY --from=runtime_prep /assets /

# install runtime system dependencies, collected from install.sh scripts
RUN ibek support apt-install --runtime

# add ioc sample startup scripts
COPY ioc ${IOC}

ENV TARGET_ARCHITECTURE ${TARGET_ARCHITECTURE}

ENTRYPOINT ["/bin/bash", "-c", "${IOC}/start.sh"]
15 changes: 4 additions & 11 deletions tests/_test_support_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,21 +89,14 @@ for dockerfile in ${DOCKERFILES}; do
do_build ${ARCH} runtime ${dockerfile}

# launch the runtime IOC container
$docker run --name test_me --rm -dit test_image_only
$docker run --name test_me --rm -it test_image_only | \
grep "Generic IOC start script"

# verify that the IOC is running - but give it time to start
for retry in {1..10}; do
sleep 1
if $docker exec test_me ps aux | grep /epics/ioc/bin/linux-x86_64/ioc ; then
echo "IOC is running"
break
fi
done

$docker stop -t0 test_me
$docker rmi test_image_only

# The above check is sufficient to show that the generic IOC will load and
# run and that all the necessary runtime libraries are in place.

done


2 changes: 1 addition & 1 deletion tests/ioc.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# yaml-language-server: $schema=https://github.com/epics-containers/ioc-adaravis/releases/download/23.9.1/adaravis.ibek.ioc.schema.json
# yaml-language-server: $schema=https://github.com/epics-containers/ioc-adaravis/releases/download/23.9.4/ibek.ioc.schema.json

ioc_name: bl45p-ea-ioc-01
description: Sample and overview cameras IOC for BL45P
Expand Down

0 comments on commit 5c0140b

Please sign in to comment.