-
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.
- Loading branch information
Showing
16 changed files
with
220 additions
and
15 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
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
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# This docker compose definition stands up a ca-gateway and phoebus instance. | ||
# This enables interactive testing to the IOC developer container | ||
# | ||
# To lauch these services:- | ||
# source ./environment.sh | ||
# docker compose up -d | ||
# | ||
|
||
include: | ||
- services/gateway/compose.yml | ||
- services/phoebus/compose.yml |
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,54 @@ | ||
#! /bin/bash | ||
|
||
# Setup environment variables required to launch the services described in this | ||
# repo. A standard install of docker compose and permission to run docker | ||
# are the only other requirements (membership of the docker group). | ||
# | ||
# docker compose may be backed by podman or docker container engines, see | ||
# https://epics-containers.github.io/main/tutorials/setup_workstation.html. | ||
|
||
|
||
# This script must be sourced | ||
if [ "$0" = "$BASH_SOURCE" ]; then | ||
echo "ERROR: Please source this script (source ./environment.sh)" | ||
exit 1 | ||
fi | ||
|
||
# if there is a docker-compose module then load it | ||
if [[ $(module avail docker-compose 2>/dev/null) != "" ]] ; then | ||
module load docker-compose | ||
fi | ||
|
||
function check_docker { | ||
# return 0 if docker is detected, or 1 otherwise, | ||
# cope with the possibility that podman is aliased to docker | ||
if [[ $(docker version) =~ "Podman" ]]&> /dev/null; then | ||
return 1 | ||
fi | ||
} | ||
|
||
if check_docker; then | ||
USER_ID=$(id -u); USER_GID=$(id -g) | ||
else | ||
USER_ID=0; USER_GID=0 | ||
alias docker=podman | ||
fi | ||
|
||
# make sure we have a network to share beteen the devcontainer and gateway container | ||
if ! docker network inspect channel_access_devcontainer &>/dev/null ; then | ||
docker network create --subnet="170.21.0.0/16" channel_access_devcontainer | ||
fi | ||
|
||
# ensure local container users can access X11 server | ||
xhost +SI:localuser:$(id -un) | ||
|
||
# Set up the environment for compose ########################################### | ||
|
||
# set user id for the phoebus container for easy X11 forwarding. | ||
export UIDGID=$USER_ID:$USER_GID | ||
# choose test profile for docker compose | ||
export COMPOSE_PROFILES=test | ||
# for test profile our ca-gateway publishes PVS on the loopback interface | ||
export EPICS_CA_ADDR_LIST=127.0.0.1 | ||
# make a short alias for docker-compose for convenience | ||
alias ec='docker compose' |
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,54 @@ | ||
# ca gateway for exposing container network PVs to the host's loopback interface | ||
|
||
services: | ||
|
||
# ca-gateway for test / dev ################################################## | ||
|
||
ca-gateway: &ca-gateway | ||
|
||
container_name: ca-gateway | ||
|
||
image: ghcr.io/epics-containers/docker-ca-gateway:2.1.3ec1 | ||
|
||
expose: | ||
- 5064-5065/udp | ||
- 5064-5065 | ||
|
||
ports: | ||
# bind to localhost to isolate channel access to this host only | ||
- 127.0.0.1:5064:5064/udp | ||
- 127.0.0.1:5064-5065:5064-5065 | ||
|
||
restart: unless-stopped | ||
|
||
networks: | ||
channel_access_devcontainer: | ||
|
||
configs: | ||
- source: ca-gateway_config | ||
target: /config | ||
|
||
command: -cip 170.21.255.255 -pvlist /config/pvlist -access /config/access -log /dev/stdout -debug 1 | ||
|
||
profiles: | ||
- test | ||
- dev | ||
|
||
# debugging version of gateway container ##################################### | ||
ca-gateway-debug: | ||
|
||
<<: *ca-gateway | ||
|
||
# this image is not distroless and has network tools installed | ||
image: ghcr.io/epics-containers/docker-ca-gateway-debug:2.1.3ec1 | ||
|
||
profiles: | ||
- debug | ||
|
||
configs: | ||
ca-gateway_config: | ||
file: ./config | ||
|
||
networks: | ||
channel_access_devcontainer: | ||
external: true |
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,6 @@ | ||
# See /EPICS/extensions/src/gateway/GATEWAY.access for more detailed example | ||
|
||
ASG(DEFAULT) { | ||
RULE(1,READ) | ||
RULE(1,WRITE) | ||
} |
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,7 @@ | ||
# See /EPICS/extensions/src/gateway/GATEWAY.pvlist for more detailed example | ||
|
||
EVALUATION ORDER ALLOW, DENY | ||
|
||
[0-9].* ALLOW | ||
[a-z].* ALLOW | ||
[A-Z].* ALLOW |
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,34 @@ | ||
# for development and testing it is useful to bring up phoebus instanced to | ||
# interact with the local IOCs PVs. | ||
|
||
services: | ||
phoebus: | ||
container_name: phoebus | ||
image: ghcr.io/epics-containers/ec-phoebus:4.7.3ec2 | ||
environment: | ||
DISPLAY: $DISPLAY | ||
tty: true | ||
# pick a server port for phoebus so it does not reconnect to existing phoebus | ||
command: phoebus-product/phoebus.sh -settings /config/settings.ini -resource /opi/auto-generated/index.bob -server 7010 | ||
volumes: | ||
- /tmp/.X11-unix:/tmp/.X11-unix | ||
- ~/.Xauthority:/root/.Xauthority | ||
- ../../../opi:/opi | ||
- ../../../..:/workspaces | ||
|
||
# for X11 to work we need to run as the same UID as the host | ||
# IMPORTANT: set UIDGID to your host user:group e.g. 1000:1000 | ||
# BUT: always to 0:0 if you are using podman | ||
user: ${UIDGID} | ||
|
||
# network host with a gateway for CA is the most reliable way to | ||
# get X11 forwarding to work - even with ssh->container. | ||
network_mode: host | ||
|
||
configs: | ||
- source: phoebus_config | ||
target: /config | ||
|
||
configs: | ||
phoebus_config: | ||
file: ./config |
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,4 @@ | ||
# using localhost for channel access to isolate it to the host for development | ||
|
||
# TODO restore this once we have PVA gateway and IOCS running in the CNI | ||
org.phoebus.pv.ca/addr_list=127.0.0.1 |
Submodule ibek-support
updated
55 files
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