Skip to content

Commit

Permalink
restore Port defaults in devcontainer.json
Browse files Browse the repository at this point in the history
  • Loading branch information
gilesknap committed Dec 2, 2024
1 parent ebe56ce commit 19b91c2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
3 changes: 0 additions & 3 deletions template/.devcontainer/.env

This file was deleted.

15 changes: 8 additions & 7 deletions template/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,18 @@
],
"appPort": [
// Expose Channel Access ports on the host's loopback interface
// Note: update the environment variables in .devcontainer/.env to
// change the ports when running multiple devcontainers simultaneously,
// then use e.g. EPICS_CA_ADDR_LIST="127.0.0.1:5064 127.0.0.1:6064"
// 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:${remoteEnv:EPICS_CA_SERVER_PORT}:${remoteEnv:EPICS_CA_SERVER_PORT}/udp",
"127.0.0.1:${remoteEnv:EPICS_CA_SERVER_PORT}:${remoteEnv:EPICS_CA_SERVER_PORT}",
"127.0.0.1:${remoteEnv:EPICS_CA_REPEATER_PORT}:${remoteEnv:EPICS_CA_REPEATER_PORT}",
"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
"${remoteEnv:EPICS_PVA_SERVER_PORT}:${remoteEnv:EPICS_PVA_SERVER_PORT}"
"${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",
Expand Down
7 changes: 3 additions & 4 deletions template/opi/phoebus-launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 19b91c2

Please sign in to comment.