Skip to content

Commit

Permalink
update to ioc-template version 2024.2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
gilesknap committed Feb 19, 2024
1 parent f1deaf3 commit 187d3a8
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 47 deletions.
8 changes: 8 additions & 0 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
_commit: 2024.2.5
_src_path: gh:epics-containers/ioc-template
description: Generic IOC for Delta Tau power pmac and turbo pmac motion controllers
git_platform: github.com
github_org: epics-containers
name: ioc-pmac
repo_uri: [email protected]:epics-containers/ioc-pmac.git
12 changes: 1 addition & 11 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,6 @@
// we also mount the project folder into a know location in the container
// this is where the ibek-support and ioc folders reside in the container build
// in this way the devcontainer and runtime look very similar
"source=${localWorkspaceFolder},target=/epics/generic-source,type=bind",
// this provides eternal bash history in and out of the container
"source=${localEnv:HOME}/.bash_eternal_history,target=/root/.bash_eternal_history,type=bind",
// this bashrc hooks up the .bashrc_dev_container in the following mount
"source=${localWorkspaceFolder}/.devcontainer/.bashrc,target=/root/.bashrc,type=bind",
// provides a place for you to put your shell customizations for all your dev containers
"source=${localEnv:HOME}/.bashrc_dev_container,target=/root/.bashrc_dev_container,type=bind",
// provides a place to install any packages you want to have across all your dev containers
"source=${localEnv:HOME}/.bashprofile_dev_container,target=/root/.bashprofile_dev_container,type=bind",
// provides the same command line editing experience as your host
"source=${localEnv:HOME}/.inputrc,target=/root/.inputrc,type=bind"
"source=${localWorkspaceFolder},target=/epics/generic-source,type=bind"
]
}
13 changes: 2 additions & 11 deletions .devcontainer/initializeCommand
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
#!/bin/bash

# make sure all the files we mount into the container exist
for i in \
.bash_eternal_history \
.bashrc_dev_container \
.bashprofile_dev_container \
.inputrc
do
if [ ! -f $HOME/$i ] ; then
touch $HOME/$i;
fi
done
# custom initialization goes here - runs outside of the dev container
# just before the container is launched but after the container is created

echo "devcontainerID ${1}"
19 changes: 6 additions & 13 deletions .devcontainer/postCreateCommand
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash

# Custom initialization goes here if needed.
# Runs inside the dev container after the container is created

################################################################################
# When using docker we will not be root inside the container
# the following steps are then required
Expand All @@ -9,21 +12,11 @@ if [[ $USER != "root" ]] ; then
# make sure the non-root user can build iocs and (mounted in) support modules
sudo chown -R ${USER}:${USER} /epics/ibek-defs /epics/pvi-defs /epics/support/configure /venv
sudo chown -h ${USER}:${USER} /epics /epics/ioc /epics/support

# also give non-root user access to the same bash config we use in podman
sudo chmod a+rx /root
for f in .inputrc .bash_eternal_history .bashrc .bashrc_dev_container; do
sudo chmod a+rw /root/$f
ln -sf /root/$f $HOME/$f
done
fi

################################################################################
# Custom install script for each developer to add whatever they like to
# all epics-containers devcontainers
# Make sure ibek completion is available
################################################################################

# add user's custom profile container creation script
if [ -f ~/.bashprofile_dev_container ]; then
. ~/.bashprofile_dev_container
fi
echo 'source <(ibek --show-completion bash)' >> $HOME/.bashrc
echo 'source <(ibek --show-completion zsh)' >> $HOME/.zshrc
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ FROM ${REGISTRY}/epics-base-${TARGET_ARCHITECTURE}-developer:${BASE} AS develop
# The devcontainer mounts the project root to /epics/generic-source
# Using the same location here makes devcontainer/runtime differences transparent.
ENV SOURCE_FOLDER=/epics/generic-source
# connect ioc source folder its know location
# connect ioc source folder to its know location
RUN ln -s ${SOURCE_FOLDER}/ioc ${IOC}

# Get latest ibek while in development. Will come from epics-base when stable
Expand Down
19 changes: 15 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
An epics-containers generic IOC source file for Delta Tau pmac motion controllers.
# Generic IOC Template Repository ioc-pmac

Generates a Generic IOC for running in a container and
creating IOC instances to control pmac motion controllers.
## Description
Generic IOC for Delta Tau power pmac and turbo pmac motion controllers

See the https://epics-containers.github.io
## Template Info
This repository was generated by
[ioc-template](https://github.com/epics-containers/ioc-template)

To update to the latest version of the template:

```bash
# activate a python virtual environment

pip install copier
cd ioc-pmac
copier update -a --trust .
```
4 changes: 2 additions & 2 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ set -xe
cd $(dirname ${0})

# use docker if available else use podman
if ! docker version &>/dev/null; then alias docker=podman; fi
if ! docker version &>/dev/null; then docker=podman; else docker=docker; fi

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

# build and developer images
docker build -t ${TAG} --build-arg TARGET_ARCHITECTURE=$T_A --target $TARGET .
$docker build -t ${TAG} --build-arg TARGET_ARCHITECTURE=$T_A --target $TARGET .

18 changes: 14 additions & 4 deletions ioc/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,23 @@ description='
2. ioc.yaml *************************************************************
If the config folder contains a yaml file we invoke the ibek tool to
generate the startup script and database. Then launch with the generated
startup script. The file name should be the name of the ioc with a 'yaml'
extension e.g. bl38p-ea-panda-02.yaml. Using a unique name allows for:
startup script. The file name should always be 'ioc.yaml'. The ioc instance
can determine its own name with the following as the first line in 'ioc.yaml'
ioc_name: "{{ ioc_yaml_file_name }}"
ioc_name: ""{{ __utils__.get_env('IOC_NAME') }}""
at the top of the file and in turn "{{ ioc_name }}"" can be used in any
of the fields within the file.
of the fields within the file. For example: by default Kubernetes will be
looking at the iocStats PV IOC_NAME:Uptime to validate health of the IOC,
therefore most IOC instances should include:
entities:
- type: epics.EpicsEnvSet
name: EPICS_TZ
value: "GMT0BST"
- type: devIocStats.iocAdminSoft
IOC: "{{ ioc_name | upper }}"
3. st.cmd + ioc.subst *********************************************************
If the config folder contains a st.cmd script and a ioc.subst file then
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
ibek==1.6.3
# to install direct from github during development in a branch
# git+https://github.com/epics-containers/ibek.git@fix-extract-assets
# git+https://github.com/epics-containers/ibek.git@fix-extract-assets

0 comments on commit 187d3a8

Please sign in to comment.