Skip to content

Commit

Permalink
update to latest ibek features
Browse files Browse the repository at this point in the history
  • Loading branch information
gilesknap committed Sep 29, 2023
1 parent d15cc62 commit 0fb348c
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 251 deletions.
6 changes: 4 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
}
},
"remoteEnv": {
"DISPLAY": "${localEnv:DISPLAY}",
"PROJECT_NAME": "${localWorkspaceFolderBasename}"
"DISPLAY": "${localEnv:DISPLAY}"
},
"customizations": {
"vscode": {
Expand All @@ -31,10 +30,13 @@
},
// Make sure the files we are mapping into the container exist on the host
"initializeCommand": "bash .devcontainer/initializeCommand ${devcontainerId}",
"postCreateCommand": "bash .devcontainer/postCreateCommand ${devcontainerId}",
"runArgs": [
"--net=host",
"--security-opt=label=disable"
],
"workspaceMount": "source=${localWorkspaceFolder},target=/epics/ioc-adaravis,type=bind",
"workspaceFolder": "/epics/ioc-adaravis",
"mounts": [
// Mount some useful local files from the user's home directory
"source=${localEnv:HOME}/.bash_eternal_history,target=/root/.bash_eternal_history,type=bind",
Expand Down
10 changes: 10 additions & 0 deletions .devcontainer/postCreateCommand
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

# the IOC is made at build time but the devcontainer mounts over the top of it
# so we need to regenerate it for devcontainer use

cd /epics/ioc-config

ibek ioc make-source-template
ibek ioc generate-makefile
ibek ioc compile
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,10 @@
repos*
# build pulls the schema out of the container - ignore it
*.ibek.ioc.schema.json
# while working on ibek with this project somethimes include it as subfolder
ibek

# The ioc source tree is created here from a template inside the generic ioc
# repo.
# Remove from .gitignore if you want to customize the template.
/ioc/
27 changes: 9 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ ARG REGISTRY=ghcr.io/epics-containers

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

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

# During Development get latest ibek - TODO stable version will be in epics-base
RUN pip install --upgrade ibek
COPY ibek /ibek
RUN pip install /ibek

# copy the global ibek files
COPY ibek-support/_global/ _global
Expand All @@ -33,8 +34,8 @@ RUN ADCore/install.sh R3-12-1
COPY ibek-support/ADAravis/ ADAravis/
RUN ADAravis/install.sh R2-3

# add startup scripts
COPY ioc ${IOC}
# create IOC source tree
RUN ibek ioc make-source-template

# Make the IOC
RUN ibek ioc generate-makefile
Expand All @@ -48,28 +49,18 @@ RUN bash -c "ibek ioc generate-schema */*ibek.support.yaml --output ${IOC}/adara
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 --extras /usr/local/lib/x86_64-linux-gnu

##### 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 the Aravis library we built
COPY --from=developer /usr/local/lib/x86_64-linux-gnu/libaravis-0.8.so.0 /usr/local/lib/x86_64-linux-gnu/
# get the ibek-support folders for accessing the SUPPORT YAML files
COPY --from=developer /workspaces /workspaces
# 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 startup scripts
COPY ioc ${IOC}

ENV TARGET_ARCHITECTURE ${TARGET_ARCHITECTURE}

ENTRYPOINT ["/bin/bash", "-c", "${IOC}/start.sh"]
2 changes: 1 addition & 1 deletion ibek-support
18 changes: 0 additions & 18 deletions ioc/config/st.cmd

This file was deleted.

40 changes: 0 additions & 40 deletions ioc/iocApp/src/Makefile

This file was deleted.

40 changes: 0 additions & 40 deletions ioc/liveness.sh

This file was deleted.

113 changes: 0 additions & 113 deletions ioc/start.sh

This file was deleted.

19 changes: 0 additions & 19 deletions ioc/stop.sh

This file was deleted.

0 comments on commit 0fb348c

Please sign in to comment.