Skip to content

Commit

Permalink
switch to bind mounts for opis
Browse files Browse the repository at this point in the history
  • Loading branch information
gilesknap committed Jul 23, 2024
1 parent 9f6cc5a commit 08872bd
Show file tree
Hide file tree
Showing 15 changed files with 49 additions and 4,481 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@
venv*
.venv*
*workspace

# this is the root directory for generated opi files
# and is created at runtime
services/opi
2 changes: 1 addition & 1 deletion compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ include:
# all profiles
- services/bl01t-ea-test-01/compose.yml
- services/bl01t-di-cam-01/compose.yml
- services/gateway/compose.yml

# develop profile only
- services/phoebus/compose.yml

# deploy profile only
- services/gateway/compose.yml
- services/epics-opis/compose.yml
8 changes: 0 additions & 8 deletions include/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,3 @@

# copy in any opi files from the repo
cp -r /repo/opi/* /opi;

# make sure there is a subfolder of opi volumes for each service
cd /repo/services
for i in *; do
echo adding folder $i to opi volume
mkdir -p /opi/$i;
mkdir -p /opi_auto/$i;
done
12 changes: 4 additions & 8 deletions include/init.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
# A basic init service that sets up volumes for the IOCs described in
# this repo.
#
# At present this is just making sure the opi volume has a subfolder for
# each service and copies in any hand coded opis to those folders.

services:

init_iocs:

image: docker.io/busybox

command: |
sh /repo/include/init.sh
volumes:
- opi:/opi/
- opi_auto:/opi_auto/
- ..:/repo
# mount the runtime opi folder
- ../services/opi:/opi/
# mount the repo to copy hand coded opis into runtime opi
- ..:/repo
20 changes: 18 additions & 2 deletions include/volumes.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
volumes:
# hand coded opi files from this repo
opi:
# auto generated opi files created by pvi in each IOC
opi_auto:

# Note - for the moment we don't use this volume but instead bind mount
# services/opis host folder into the ioc containers.
#
# This is because of a podman limitation that ignores the subpath field
# of a volume mount.
#
# Keeping this file as a reminder of how we would prefer to use docker
# volumes for this purpose once the issue is resolved:
# https://github.com/containers/podman/issues/20661

# in kubernetes we also create volumes for
# - autosave
# - runtime (mounted to /epics/runtime)
# - data - for each IOC that wants to persist data
# - binaries - for proxy that control hard IOCs and supply their binaries
#
# in future this compose framework could include these volumes too
23 changes: 18 additions & 5 deletions opi/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
OPI Folders for IOCs
====================
OPI Files
=========

If required, hand coded bob files can be added here for each IOC in a subfolder with the same name as the IOC. These folders are copied in to the 'opi' volume by the init_epics container.
In this repository there are two opi folders:

PVI autogenerated bob files will then be added to these folders in the opi volume as each IOC launches.
- services/opi - This folder is used as the runtime opi location mounted by
all iocs. Its contents are not committed in to git.

NOTE: because podman does not currently support sub_path volume mounts - we place all of the generated files for this project in here and refer to those from phoebus. See this issue for details: https://github.com/containers/podman/issues/20661
Each ioc mounts a subfolder in this directory and places its generated
opi files in there.

In future this will be a docker/podman volume.
But at present there is an bug with podman that does not allow it to
mount a subfolder of a volume. See
[podman issue 20661](https://github.com/containers/podman/issues/20661)

- opi - This folder is a place for hand coded bob files that are copied into
the opi volume by the init container [init.yaml](../include/init.yaml).

The contents of this folder are committed in to git. For this reason it is
found in .gitignore.
Loading

0 comments on commit 08872bd

Please sign in to comment.