Skip to content

Commit

Permalink
dont set server port env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
gilesknap committed Dec 7, 2024
1 parent bd8d41e commit c7b074d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ FROM ghcr.io/epics-containers/epics-base-runtime:7.0.8ec2 as runtime
COPY --from=developer /venv /venv
COPY --from=developer /epics/ca-gateway /epics/ca-gateway
COPY --from=developer /epics/support/pcas /epics/support/pcas
COPY settings/config /config
COPY start.sh get_ioc_ips.py /
RUN apt update && \
apt install -y \
python3-distutils && \
rm -rf /var/lib/apt/lists/*

# ENTRYPOINT [ "bash" ]
9 changes: 5 additions & 4 deletions settings/config/pvagw.template
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* pvagw configuration template
*
* requires replacement of EPICS_PVA_ADDR_LIST and EPICS_PVA_SERVER_PORT
* requires replacement of IOC server address list for gw client side
* and SERVER PORT for gw server side
*
*/
{
Expand All @@ -10,9 +11,9 @@
{
"name":"theclient",
"provider":"pva",
"addrlist":"EPICS_PVA_ADDR_LIST",
"addrlist":"PVA_ADDR_LIST",
"autoaddrlist":false,
"serverport":5075,
"serverport":5075
"bcastport":5076
}
],
Expand All @@ -23,7 +24,7 @@
/* "interface":["127.0.0.1"], */
/* "addrlist":"127.255.255.255", */
"autoaddrlist":false,
"serverport":EPICS_PVA_SERVER_PORT,
"serverport":PVA_SERVER_PORT,
/* "bcastport":5076, */
"statusprefix":"sts:"
/* "access":"some.acf", */
Expand Down
10 changes: 5 additions & 5 deletions start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ export EPICS_PVA_ADDR_LIST=${IPS:-127.0.0.1}
export EPICS_CA_ADDR_LIST=${IPS:-127.0.0.1}

# PORTS for CA and PVA
export EPICS_CA_SERVER_PORT=${EPICS_CA_SERVER_PORT:-5064}
export EPICS_PVA_SERVER_PORT=${EPICS_PVA_SERVER_PORT:-5075}
export CA_SERVER_PORT=${CA_SERVER_PORT:-5064}
export PVA_SERVER_PORT=${PVA_SERVER_PORT:-5075}

# DEBUGGING
CA_DEBUG=${CA_DEBUG:-0}
PVA_DEBUG=${PVA_DEBUG:-0}

# background the CA Gateway
/epics/ca-gateway/bin/linux-x86_64/gateway -sport ${EPICS_CA_SERVER_PORT:-5064} -cip "${EPICS_CA_ADDR_LIST}" -pvlist /config/pvlist -access /config/access -log /dev/stdout -debug ${CA_DEBUG:-0} &>/tmp/cagw.log &
/epics/ca-gateway/bin/linux-x86_64/gateway -sport ${CA_SERVER_PORT} -cip "${EPICS_CA_ADDR_LIST}" -pvlist /config/pvlist -access /config/access -log /dev/stdout -debug ${CA_DEBUG:-0} &>/tmp/cagw.log &

# fix up the templated pva gateway config
cat /config/pvagw.template |
sed \
-e "s/EPICS_PVA_ADDR_LIST/${EPICS_PVA_ADDR_LIST}/" \
-e "s/EPICS_PVA_SERVER_PORT/${EPICS_PVA_SERVER_PORT}/" \
-e "s/PVA_ADDR_LIST/${EPICS_PVA_ADDR_LIST}/" \
-e "s/PVA_SERVER_PORT/${PVA_SERVER_PORT}/" \
> /config/pvagw.config

# background the PVA Gateway
Expand Down

0 comments on commit c7b074d

Please sign in to comment.