Skip to content

Commit 53edfc0

Browse files
committed
Add stdio-expose and epics module loading
1 parent ff00751 commit 53edfc0

File tree

5 files changed

+41
-4
lines changed

5 files changed

+41
-4
lines changed

Charts/dev-c7/templates/statefulset.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ spec:
6868
{{- toYaml . | nindent 12 }}
6969
{{- end }}
7070
env:
71-
# make sure that the $HOME path is writeable
71+
# psuedo home sets up epics module etc.
7272
- name: HOME
73-
value: /tmp
73+
value: /epics_home
7474
imagePullPolicy: {{ .Values.image.pullPolicy }}
7575
{{- with .Values.livenessProbe }}
7676
livenessProbe:

Charts/dev-c7/values.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ image:
3535
# @schema description: container entry point command
3636
command:
3737
- bash
38-
- -c
39-
- ./bin/linux-x86_64/st*.sh
38+
- -lc
39+
- stdio-expose ./bin/linux-x86_64/st*.sh
4040

4141
# @schema description: enable host networking for the pod
4242
hostNetwork: false

Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,20 @@ RUN yum remove -y git git-core && \
7474
# change the nobody account and group IDs to match RedHat
7575
RUN sed -i 's/99:99/65534:65534/' /etc/passwd && \
7676
sed -i 's/:99:/:65534:/' /etc/group
77+
78+
# Install uv using the official image
79+
# See https://docs.astral.sh/uv/guides/integration/docker/#installing-uv
80+
COPY --from=ghcr.io/astral-sh/uv:0.8 /uv /uvx /bin/
81+
WORKDIR /opt
82+
83+
ENV UV_PYTHON_INSTALL_DIR=/python
84+
ENV PATH="${PATH}:/opt/.venv/bin"
85+
86+
# Add in stdio socket for sharing the epics console
87+
RUN uv venv --managed-python --python 3.12 && \
88+
uv pip install stdio-socket && \
89+
chmod -R a+rwX /opt/.venv
90+
91+
# Make a psuedo home directory for running in cluster
92+
COPY epics_home /epics_home
93+
RUN chmod a+rws /epics_home

epics_home/.bashrc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#! /bin/bash
2+
3+
# Source global definitions
4+
if [ -f /etc/bashrc ]; then
5+
. /etc/bashrc
6+
fi
7+
8+
# Source global definitions
9+
if [ -f ~/bashrc_local ]; then
10+
. ~/.bashrc_local
11+
fi
12+
13+
module load epics/3.14.12.7
14+
15+
alias console=/opt/.venv/bin/console

epics_home/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# epics_home
2+
3+
This is a psuedo home directory for launching EPICS IOCs in-cluster using dev-c7.
4+
5+
It allows us to have a writeable home directory and also to set up the module system with .bashrc. This in turn lets us load the epics module and gives access to caRepeater amoungst other things.

0 commit comments

Comments
 (0)