-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from epics-containers/dev
latest ioc-template changes
- Loading branch information
Showing
9 changed files
with
50 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
# Look for updates to python and docker dependencies. | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "docker" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
- package-ecosystem: "pip" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,80 +1,41 @@ | ||
#!/bin/bash | ||
|
||
# A script for building EPICS container images. | ||
# A generic build script for epics-containers ioc repositories | ||
# | ||
# Note that this is implemented in bash to make it portable between | ||
# CI frameworks. This approach uses the minimum of GitHub Actions. | ||
# Also works locally for testing outside of CI (with podman-docker installed) | ||
# Also works locally for testing outside of CI | ||
# | ||
# INPUTS: | ||
# PUSH: if true, push the container image to the registry | ||
# TAG: the tag to use for the container image | ||
# REGISTRY: the container registry to push to | ||
# REPOSITORY: the container repository to push to | ||
# CACHE: the directory to use for caching | ||
# PLATFORM: the platform to build for (linux/amd64 or linux/arm64) | ||
# CACHE: the directory to use for caching | ||
|
||
ARCH=${ARCH:-linux} | ||
PUSH=${PUSH:-false} | ||
if [[ ${PUSH} == 'true' ]] ; then PUSH='--push' ; else PUSH='' ; fi | ||
TAG=${TAG:-latest} | ||
REGISTRY=${REGISTRY:-ghcr.io} | ||
|
||
PLATFORM=${PLATFORM:-linux/amd64} | ||
CACHE=${CACHE:-/tmp/ec-cache} | ||
THIS=$(dirname ${0}) | ||
set -xe | ||
|
||
NEWCACHE=${CACHE}-new | ||
|
||
# setup a buildx driver for multi-arch / remote cached builds | ||
docker buildx create --driver docker-container --use | ||
|
||
# docker command line parameters | ||
cachefrom=--cache-from=type=local,src=${CACHE} | ||
cacheto=--cache-to=type=local,dest=${NEWCACHE},mode=max | ||
|
||
if ! ec --version 2> /dev/null ; then | ||
pip install --upgrade -r ${THIS}/../../requirements.txt | ||
fi | ||
|
||
do_build() { | ||
ARCHITECTURE=$1 | ||
TARGET=$2 | ||
shift 2 | ||
# add extra cross compilation platforms below if needed e.g. | ||
# ec dev build --buildx --arch rtems ... for RTEMS cross compile | ||
|
||
image_name=${REGISTRY}/${REPOSITORY}-${ARCHITECTURE}-${TARGET}:${TAG} | ||
args=" | ||
--build-arg TARGET_ARCHITECTURE=${ARCHITECTURE} | ||
--target ${TARGET} | ||
-t ${image_name} | ||
" | ||
if [[ ${ARCHITECTURE} == "linux" ]] ; then | ||
args="${args} --platform=${PLATFORM}" | ||
fi | ||
# build runtime and developer images | ||
ec --log-level debug dev build --buildx --tag ${TAG} --platform ${PLATFORM} \ | ||
--cache-to ${CACHE} --cache-from ${CACHE} ${PUSH} | ||
|
||
if [[ ${PUSH} == "true" ]] ; then | ||
args="--push "${args} | ||
else | ||
args="--load "${args} | ||
fi | ||
|
||
echo "CONTAINER BUILD FOR ${image_name} with ARCHITECTURE=${ARCHITECTURE} ..." | ||
|
||
( | ||
set -x | ||
docker buildx build ${args} ${*} . | ||
) | ||
} | ||
|
||
# EDIT BELOW FOR YOUR BUILD MATRIX REQUIREMENTS | ||
# | ||
# All builds should use cachefrom and the last should use cacheto | ||
# The last build should execute all stages for the cache to be fully useful. | ||
# | ||
# intermediate builds should use cachefrom but will also see the local cache | ||
# | ||
# If None of the builds use all stages in the Dockerfile then consider adding | ||
# cache-to to more than one build. But note there is a tradeoff in performance | ||
# as every layer will get uploaded to the cache even if it just came out of the | ||
# cache. | ||
# extract the ioc schema from the runtime image | ||
ec dev launch-local --tag ${TAG} --execute \ | ||
'ibek ioc generate-schema /epics/links/ibek/*.ibek.support.yaml' \ | ||
> ibek.ioc.schema.json | ||
|
||
do_build ${ARCH} developer ${cachefrom} | ||
do_build ${ARCH} runtime ${cachefrom} ${cacheto} | ||
# run acceptance tests | ||
shopt -s nullglob # expand to nothing if no tests are found | ||
for t in "${THIS}/../../tests/*.sh"; do bash ${t}; done | ||
|
||
docker run --entrypoint bash ${image_name} -c \ | ||
'ibek ioc generate-schema /epics/links/ibek/*ibek.support.yaml' > \ | ||
ibek.ioc.schema.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
TODO update with correct comment for included support module | ||
An epics-containers generic IOC source file for ADAravis. | ||
|
||
A container image template for creating new generic IOCs | ||
Generates a Generic IOC for running in a container and | ||
creating IOC instances to control Aravis cameras. | ||
|
||
See the https://epics-containers.github.io | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule ibek-support
updated
9 files
+0 −0 | .github/workflows/build.yml | |
+45 −11 | README.md | |
+112 −118 | iocStats/iocStats.ibek.support.yaml | |
+1 −1 | tests/Dockerfile.asyn | |
+6 −12 | tests/_test_support_build.sh | |
+27 −0 | tests/ioc_instance/ioc.db | |
+35 −0 | tests/ioc_instance/ioc.yaml | |
+20 −0 | tests/ioc_instance/st.cmd | |
+23 −0 | tests/test_ioc_instance.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
epics-containers-cli==2.2.0 | ||
# NOTE: to debug the CLI you can use intermediate builds by looking in Actions and copying the 'dist' URL i.e. | ||
# epics-containers-cli -e https://github.com/epics-containers/epics-containers-cli/suites/16919013647/artifacts/966547589 |