Skip to content

Commit

Permalink
Merge pull request #10 from epics-containers/pvi-changes
Browse files Browse the repository at this point in the history
restore the latest ioc-template changes
  • Loading branch information
gilesknap authored Oct 11, 2023
2 parents e7d7e28 + a960529 commit 792c250
Show file tree
Hide file tree
Showing 13 changed files with 59 additions and 27 deletions.
2 changes: 2 additions & 0 deletions .devcontainer/.bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,5 @@ fi
if [ -f ~/.bashrc_dev_container ]; then
. ~/.bashrc_dev_container
fi

source /root/.bash_completions/ibek.sh
4 changes: 3 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,13 @@
"workspaceFolder": "/epics/${localWorkspaceFolderBasename}",
"mounts": [
// Mount some useful local files from the user's home directory
"source=${localWorkspaceFolder}/../,target=/repos,type=bind",
"source=${localEnv:HOME}/.bash_eternal_history,target=/root/.bash_eternal_history,type=bind",
"source=${localWorkspaceFolder}/.devcontainer/.bashrc,target=/root/.bashrc,type=bind",
"source=${localEnv:HOME}/.bashrc_dev_container,target=/root/.bashrc_dev_container,type=bind",
"source=${localEnv:HOME}/.bashprofile_dev_container,target=/root/.bashprofile_dev_container,type=bind",
"source=${localEnv:HOME}/.gitconfig,target=/root/.gitconfig,type=bind",
"source=${localEnv:HOME}/.inputrc,target=/root/.inputrc,type=bind",
"source=${localEnv:HOME}/.ssh,target=/root/.ssh,type=bind"
]
}
}
9 changes: 8 additions & 1 deletion .devcontainer/initializeCommand
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
#!/bin/bash

# make sure all the files we mount into the container exist
for i in .bash_eternal_history .bashrc_dev_container .inputrc .gitconfig; do
for i in \
.bash_eternal_history \
.bashrc_dev_container \
.bashprofile_dev_container \
.inputrc \
.gitconfig
do
if [ ! -f $HOME/$i ] ; then
touch $HOME/$i;
fi
echo verified existance of $i
done

echo "devcontainerID ${1}"
5 changes: 5 additions & 0 deletions .devcontainer/postCreateCommand
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,8 @@
# best to let the user do this manually once inside the container

# ibek ioc compile

# add user's custom profile
if [ -f ~/.bashprofile_dev_container ]; then
. ~/.bashprofile_dev_container
fi
5 changes: 5 additions & 0 deletions .github/workflows/buiild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Setup python
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Docker Build Script
env:
REGISTRY: ghcr.io
Expand Down
34 changes: 20 additions & 14 deletions .github/workflows/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,36 @@
# PLATFORM: the platform to build for (linux/amd64 or linux/arm64)
# CACHE: the directory to use for caching

if [[ ${PUSH} == 'true' ]] ; then PUSH='--push' ; else PUSH='' ; fi
TAG=${TAG:-latest}
PLATFORM=${PLATFORM:-linux/amd64}
CACHE=${CACHE:-/tmp/ec-cache}
export EC_TAG="--tag ${TAG:-latest}"
export EC_PLATFORM="--platform ${PLATFORM:-linux/amd64}"
export EC_CACHE="${CACHE:-/tmp/ec-cache}"
export EC_DEBUG=true
if [[ "${PUSH}" == 'true' ]] ; then EC_PUSH='--push' ; fi

THIS=$(dirname ${0})
set -xe
mkdir -p ${CACHE}

# get the current version of ec CLI
pip install -r ${THIS}/../../requirements.txt

if ! ec --version 2> /dev/null ; then
pip install --upgrade -r ${THIS}/../../requirements.txt
fi
# add cache arguments - local file cache passed by github seems to be most reliable
export EC_CARGS="
--cache-from type=local,src=${EC_CACHE}
--cache-to type=local,dest=${EC_CACHE}
"

# add extra cross compilation platforms below if needed e.g.
# ec dev build --buildx --arch rtems ... for RTEMS cross compile
# ec dev build --arch rtems ... for RTEMS cross compile

# build runtime and developer images
ec --log-level debug dev build --buildx --tag ${TAG} --platform ${PLATFORM} \
--cache-to ${CACHE} --cache-from ${CACHE} ${PUSH}
ec dev build --buildx ${EC_TAG} ${EC_PLATFORM} ${EC_PUSH} ${EC_CARGS}

# 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
echo ec dev launch-local ${EC_TAG} --execute \
'ibek ioc generate-schema /epics/links/ibek/*.ibek.support.yaml' > ibek.ioc.schema.json

# run acceptance tests
shopt -s nullglob # expand to nothing if no tests are found
for t in "${THIS}/../../tests/*.sh"; do bash ${t}; done
for t in "${THIS}/../../tests/*.sh"; do ${t}; done

5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@ 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/
/ioc/

# dont save workspaces as other users will have differing folders
*workspace
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
url = [email protected]:epics-containers/ibek-defs.git
[submodule "ibek-support"]
path = ibek-support
url = git@github.com:epics-containers/ibek-support.git
url = https://github.com/epics-containers/ibek-support.git
3 changes: 1 addition & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@
"activityBar.background": "#5F0A0C",
"titleBar.activeBackground": "#850E11",
"titleBar.activeForeground": "#FFFBFB"
},
"python.formatting.provider": "none"
}
}
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ ARG REGISTRY=ghcr.io/epics-containers

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

# Get latest ibek while in development. Will come from epics-base in futre.
RUN pip install ibek==1.3.5
# Get latest ibek while in development. Will come from epics-base
# TODO TODO getting ibek from the pvi-changes branch Gary and Giles made
RUN pip install git+https://github.com/epics-containers/ibek@pvi-changes

# the devcontainer mounts the project root to /epics/ioc-adaravis
WORKDIR /epics/ioc-adaravis/ibek-support
Expand All @@ -34,7 +35,7 @@ COPY ibek-support/ADAravis/ ADAravis/
RUN ADAravis/install.sh R2-3

# create IOC source tree, generate Makefile and compile IOC Instance
RUN ibek ioc compile
RUN ibek ioc build

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

Expand Down
3 changes: 3 additions & 0 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ set -xe

cd $(dirname ${0})

# make sure new repos get their submodule ibek-support
git submodule update --init

# build runtime and developer images
ec dev build --arch ${TARGET_ARCHITECTURE}

Expand Down
2 changes: 1 addition & 1 deletion ibek-support
5 changes: 2 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
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
# TODO using dev for the moment. Should be a pin to the current release
git+https://github.com/epics-containers/epics-containers-cli.git@dev

0 comments on commit 792c250

Please sign in to comment.