From 58445c5d73a11a9416660a3b19fcb32e139bc2d0 Mon Sep 17 00:00:00 2001 From: Giles Knap Date: Tue, 10 Dec 2024 07:58:55 +0000 Subject: [PATCH] update to copier 4.1.0 --- .copier-answers.yml | 2 +- .devcontainer/.env | 3 -- .devcontainer/devcontainer.json | 15 --------- .gitlab-ci.yml | 47 ----------------------------- .gitlab/kanikobuild.sh | 29 ------------------ README.md | 4 +-- opi/phoebus-launch.sh | 15 +++++---- opi/settings.ini | 5 +-- tests/config/bl00i-ea-test-ioc.yaml | 3 +- tests/run-tests.sh | 1 - 10 files changed, 14 insertions(+), 110 deletions(-) delete mode 100644 .devcontainer/.env delete mode 100644 .gitlab-ci.yml delete mode 100644 .gitlab/kanikobuild.sh diff --git a/.copier-answers.yml b/.copier-answers.yml index b11b3af..df0d692 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,5 +1,5 @@ # Changes here will be overwritten by Copier; NEVER EDIT MANUALLY -_commit: 4.1.0b4 +_commit: 4.1.0 _src_path: gh:epics-containers/ioc-template description: Generic IOC for the Delta Tau turbo pmac and power pmac motion controllers git_platform: github.com diff --git a/.devcontainer/.env b/.devcontainer/.env deleted file mode 100644 index bbb52d3..0000000 --- a/.devcontainer/.env +++ /dev/null @@ -1,3 +0,0 @@ -EPICS_CA_SERVER_PORT=5064 -EPICS_CA_REPEATER_PORT=5065 -EPICS_PVA_SERVER_PORT=5075 diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index a858b4a..ad36638 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -46,21 +46,6 @@ // Make sure SELinux does not disable write access to host filesystems like tmp "--security-opt=label=disable" ], - "appPort": [ - // Expose Channel Access ports on the host's loopback interface - // Note: set all three environment variables below to unique values - // in order to a second devcontainer on the same host. - // - // Then use e.g. EPICS_CA_ADDR_LIST="127.0.0.1:5064 127.0.0.1:6064" - // for clients to connect to multiple devcontainers' PVs. - // - "127.0.0.1:${localEnv:EPICS_CA_SERVER_PORT:5064}:${localEnv:EPICS_CA_SERVER_PORT:5064}/udp", - "127.0.0.1:${localEnv:EPICS_CA_SERVER_PORT:5064}:${localEnv:EPICS_CA_SERVER_PORT:5064}", - "127.0.0.1:${localEnv:EPICS_CA_REPEATER_PORT:5065}:${localEnv:EPICS_CA_REPEATER_PORT:5065}", - // - // Expose the PVA name server port on all host interfaces - "${localEnv:EPICS_PVA_SERVER_PORT:5075}:${localEnv:EPICS_PVA_SERVER_PORT:5075}" - ], // Mount the parent of the project folder so we can access peer projects "workspaceMount": "source=${localWorkspaceFolder}/..,target=/workspaces,type=bind", // mount in other useful files from the host diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index c793e00..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,47 +0,0 @@ -stages: - - container - -.build: - tags: - - argus - - docker-image - stage: container - variables: - GIT_SUBMODULE_STRATEGY: recursive - image: - name: gcr.io/diamond-privreg/container-tools/kaniko-executor:v1.9.1-debug - entrypoint: [""] - script: - - echo 'Building image...' - - env | grep "CI_" - - /bin/sh .gitlab/kanikobuild.sh - - echo "Done!" - # uncomment to only publish on tags. At present untagged builds are published - # to gcr.io/diamond-privreg/controls/work/ioc - # only: - # refs: - # - tags - -build_linux_runtime: - extends: .build - variables: - ARCH: linux - TARGET: runtime - -build_linux_developer: - extends: .build - variables: - ARCH: linux - TARGET: developer - -# build_rtems_runtime: -# extends: .build -# variables: -# ARCH: rtems -# TARGET: runtime - -# build_rtems_developer: -# extends: .build -# variables: -# ARCH: rtems -# TARGET: developer diff --git a/.gitlab/kanikobuild.sh b/.gitlab/kanikobuild.sh deleted file mode 100644 index 75a3284..0000000 --- a/.gitlab/kanikobuild.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -# Script to be called by .gitlab-ci.yml to perform container build using gitlab kubernetes executor -# this script is designed for projects below the namespace /containers -# and deploys images to: -# $PROJECT_PATH in the work registry for untagged commits -# $PROJECT_PATH in the prod registry for tagged commits -# requires that CI_WORK_REGISTRY and CI_PROD_REGISTRY are set to a root path -# in your image registry for each of work and production images. -# See Settings->CI->Variables in the gitlab group /containers - -echo 'Building image...' -GROUP=${CI_PROJECT_NAMESPACE%%/containers*} -PROJECT_PATH=${CI_PROJECT_NAMESPACE##*containers/} - -if [ -z "${CI_COMMIT_TAG}" ]; then - DESTINATION=$CI_WORK_REGISTRY/$PROJECT_PATH/$CI_PROJECT_NAME - CI_COMMIT_TAG=$CI_COMMIT_REF_NAME -else - DESTINATION=$CI_PROD_REGISTRY/$PROJECT_PATH/$CI_PROJECT_NAME -fi - -CMDROOT="/kaniko/executor --context $CI_PROJECT_DIR --build-arg EPICS_TARGET_ARCH=${ARCH}" -CMD=$CMDROOT" --target ${TARGET}" -CMD=$CMD" --destination $DESTINATION-${ARCH}-${TARGET}:$CI_COMMIT_TAG" - -( - set -x - $CMD -) diff --git a/README.md b/README.md index 8fd9349..871bcd8 100644 --- a/README.md +++ b/README.md @@ -23,9 +23,9 @@ This repository includes a developer container configuration for Visual Studio C ## Channel Access -The developer container exposes channel access ports on the loopback interface. If you have channel access clients running on the host machine, you can connect to the IOC by setting the `EPICS_CA_ADDR_LIST` environment variable as follows: +The vscode developer container auto forwards the channel access ports on the loopback interface. If you have channel access clients running on the host machine, you can connect to the IOC by setting the `EPICS_CA_NAME_SERVERS` environment variable as follows: ```bash -export EPICS_CA_ADDR_LIST=127.0.0.1 +export EPICS_CA_NAME_SERVERS=127.0.0.1:5064 caget IOCNAME:PVNAME ``` diff --git a/opi/phoebus-launch.sh b/opi/phoebus-launch.sh index c1e4060..3341945 100755 --- a/opi/phoebus-launch.sh +++ b/opi/phoebus-launch.sh @@ -6,12 +6,11 @@ thisdir=$(realpath $(dirname $0)) workspace=$(realpath ${thisdir}/..) # update settings.ini with CA and PVA ports -source ${workspace}/.devcontainer/.env cat ${workspace}/opi/settings.ini | sed -r \ - -e "s|5064|${EPICS_CA_SERVER_PORT}|" \ - -e "s|5075|${EPICS_PVA_SERVER_PORT}|" \ - -e "s|5065|${EPICS_CA_REPEATER_PORT}|" > /tmp/settings.ini + -e "s|5064|${EPICS_CA_SERVER_PORT:-5064}|" \ + -e "s|5075|${EPICS_PVA_SERVER_PORT:-5075}|" \ + -e "s|5065|${EPICS_CA_REPEATER_PORT:-5065}|" > /tmp/settings.ini settings=" -resource ${workspace}/opi/auto-generated/index.bob @@ -31,10 +30,10 @@ elif module load phoebus 2>/dev/null; then else echo "No local phoebus install found, using a container" - # prefer docker but use podman if USE_PODMAN is set - if docker version &> /dev/null && [[ -z $USE_PODMAN ]] - then docker=docker; UIDGID=$(id -u):$(id -g) - else docker=podman; UIDGID=0:0 + # prefer podman but use docker if USE_DOCKER is set + if podman version &> /dev/null && [[ -z $USE_DOCKER ]] + then docker=podman; UIDGID=0:0 + else docker=docker; UIDGID=$(id -u):$(id -g) fi echo "Using $docker as container runtime" diff --git a/opi/settings.ini b/opi/settings.ini index abd3c00..b180c26 100644 --- a/opi/settings.ini +++ b/opi/settings.ini @@ -6,6 +6,7 @@ org.phoebus.pv.ca/addr_list=127.0.0.1 org.phoebus.pv.ca/server_port=5064 org.phoebus.pv.ca/repeater_port=5065 +org.phoebus.pv.ca/name_servers=127.0.0.1:5064 # point at local host for pvAccess name server -org.phoebus.pv.pva/epics_pva_name_servers=127.0.0.1 -org.phoebus.pv.pva/server_port=5075 +org.phoebus.pv.pva/epics_pva_name_servers=127.0.0.1:5075 +org.phoebus.pv.pva/server_port=5075 \ No newline at end of file diff --git a/tests/config/bl00i-ea-test-ioc.yaml b/tests/config/bl00i-ea-test-ioc.yaml index 6f79dd1..22e73e8 100644 --- a/tests/config/bl00i-ea-test-ioc.yaml +++ b/tests/config/bl00i-ea-test-ioc.yaml @@ -1,4 +1,4 @@ -# yaml-language-server: $schema=https://github.com/epics-containers/ioc-pmac/releases/download/2024.11.1/ibek.ioc.schema.json +# yaml-language-server: $schema=https://github.com/epics-containers/ioc-template-example/releases/download/4.1.0/ibek.ioc.schema.json ioc_name: "{{ ioc_yaml_file_name }}" @@ -26,4 +26,3 @@ entities: - type: epics.PostStartupCommand command: | dbgf EXAMPLE:IBEK:SUM - dbgf BL00I-EA-TEST-IOC:ST_SCRIPT1 diff --git a/tests/run-tests.sh b/tests/run-tests.sh index 7be4f65..1cdd1a6 100755 --- a/tests/run-tests.sh +++ b/tests/run-tests.sh @@ -39,4 +39,3 @@ elif [[ ! ${result} =~ "5.15" || ! ${result} =~ "/epics/runtime/st.cmd" ]]; then fi echo "Tests passed!" -