Skip to content

Commit

Permalink
changes for rtems runtime target
Browse files Browse the repository at this point in the history
  • Loading branch information
gilesknap committed Mar 16, 2024
1 parent e9200da commit 310b324
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 15 deletions.
9 changes: 8 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@
"name": "epics-containers IOC devcontainer",
"build": {
"dockerfile": "../Dockerfile",
"target": "developer"
"target": "developer",
"args": {
// Native target development settings ==============================
"TARGET_ARCHITECTURE": "linux-x86_64"
// Local cross compilation settings ================================
// "TARGET_ARCHITECTURE": "RTEMS-beatnik",
// "RUNTIME": "ghcr.io/epics-containers/rtems-proxy"
}
},
"remoteEnv": {
// allows X11 apps to run inside the container
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
epics-host: linux-x86_64
extension: -rtems-beatnik
platform: linux/amd64
runtime: "RUNTIME=python:3.12.2-alpine3.19"
runtime: "RUNTIME=ghcr.io/epics-containers/rtems-proxy:0.1.4"

- epics-target: linux-x86_64
epics-host: linux-x86_64
Expand Down
2 changes: 0 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,5 @@ COPY --from=runtime_prep /assets /
# install runtime system dependencies, collected from install.sh scripts
RUN ibek support apt-install --runtime

RUN chmod +x ${IOC}/start.sh

ENTRYPOINT ["bash", "-c", "${IOC}/start.sh"]

12 changes: 8 additions & 4 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,21 @@
# generic local build script for epics-containers repositories #
################################################################################

# log commands and stop on errors
set -xe
set -e

# set TARGET_ARCHITECTURE to rtems for RTEMS based targets
T_A=${TARGET_ARCHITECTURE:-linux_x86_64}
# set TARGET to runtime for runtime images
TARGET=${TARGET:-developer}
# set TAG to override the default tag
TAG=${TAG:-ec_test}

if [[ ${T_A} != "linux_x86_64" ]]; then
# container image extension is the lcase of TARGET_ARCHITECTURE
IMAGE_EXT=-"${T_A,,}"
if [ "$T_A" = "RTEMS-beatnik" ]; then
runtime="--build-arg RUNTIME=ghcr.io/epics-containers/rtems-proxy"
fi
fi

cd $(dirname ${0})
Expand All @@ -28,7 +31,8 @@ if $docker buildx version &>/dev/null; then builx=buildx; load=--load; fi
if [ ! -d ibek-support ] ; then git submodule update --init ; fi

# build and developer images
$docker build $buildx -t ${TAG} "${@}" $load \
set -x
$docker build $buildx -t ${TAG} "${@}" $load \
--build-arg TARGET_ARCHITECTURE=$T_A \
--build-arg IMAGE_EXT=$IMAGE_EXT \
--target $TARGET .
$runtime --target $TARGET .
10 changes: 4 additions & 6 deletions ioc/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ description='
4. empty config folder *******************************************************
If the config folder is empty this message will be displayed.
RTEMS IOCS - RTEMS IOC startup files can be generated using any of the above.
For RTEMS we do not execute the ioc inside of the pod. Instead we:
Expand Down Expand Up @@ -156,12 +155,11 @@ fi

# Launch the IOC ***************************************************************

if [[ ${TARGET_ARCHITECTURE} == "rtems" ]] ; then
echo "RTEMS IOC startup - copying IOC to RTEMS mount point ..."
cp -r ${IOC} ${K8S_IOC_ROOT}
sleep 100
else
if [[ ${TARGET_ARCHITECTURE} == "linux-x86_64" ]] ; then
# Execute the IOC binary and pass the startup script as an argument
exec ${IOC}/bin/linux-x86_64/ioc ${final_ioc_startup}
fi

# Non-linux architectures will now return to the calling script


2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
ibek==1.7.2b3
ibek==1.7.2b6
# to install direct from github during development in a branch
# git+https://github.com/epics-containers/ibek.git@fix-extract-assets

0 comments on commit 310b324

Please sign in to comment.