Skip to content

Commit

Permalink
Miscellaneous kubernetes deployment fixes
Browse files Browse the repository at this point in the history
* Enable hostNetwork to helmchart in order to access instrumentation network
* Fix version extraction from folder path
* Change helmchart image name to mx-bluesky to match the release CI workflow
* Fix helmchart default log folder to not clash with non-containerised version
* Do final docker image pip install with no-deps to prevent editable dodal being clobbered
  • Loading branch information
rtuck99 committed Sep 18, 2024
1 parent 1dc26a5 commit 1180e5a
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Dockerfile.release
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ RUN git restore .

# Regenerate _version.py with the correct version - this should run quickly since we already have our dependencies
RUN rm src/mx_bluesky/_version.py
RUN pip install --no-cache-dir --no-compile -e .
RUN pip install --no-cache-dir --no-compile --no-deps -e .

ENTRYPOINT /app/hyperion/utility_scripts/docker/entrypoint.sh

Expand Down
42 changes: 41 additions & 1 deletion helmchart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,46 @@ spec:
path: "{{ .Values.hyperion.dataDir }}"
containers:
- name: hyperion
image: {{ .Values.hyperion.imageRepository}}/hyperion:{{ .Values.hyperion.appVersion }}
image: {{ .Values.hyperion.imageRepository}}/mx-bluesky:{{ .Values.hyperion.appVersion }}
securityContext:
capabilities:
# Required for hostNetwork
drop:
- AUDIT_WRITE
- CHOWN
- DAC_OVERRIDE
- FOWNER
- FSETID
- KILL
- MKNOD
- NET_BIND_SERVICE
- NET_RAW
- SETFCAP
- SETGID
- SETPCAP
- SETUID
- SYS_CHROOT
- AUDIT_CONTROL
- BLOCK_SUSPEND
- DAC_READ_SEARCH
- IPC_LOCK
- IPC_OWNER
- LEASE
- LINUX_IMMUTABLE
- MAC_ADMIN
- MAC_OVERRIDE
- SYS_ADMIN
- SYS_BOOT
- SYS_MODULE
- SYS_NICE
- SYS_PACCT
- SYS_MODULE
- SYS_PTRACE
- SYS_RESOURCE
- SYS_TIME
- SYS_TTY_CONFIG
- SYSLOG
- WAKE_ALARM
resources:
limits:
cpu: "1"
Expand Down Expand Up @@ -111,3 +150,4 @@ spec:
name: logs
- mountPath: "/dls/{{ .Values.hyperion.beamline }}/data"
name: data
hostNetwork: true
2 changes: 1 addition & 1 deletion helmchart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ hyperion:
supplementalGroups: []
beamline: i03
dev: false
logDir: "/dls_sw/i03/logs/bluesky"
logDir: "/dls_sw/i03/logs/bluesky/hyperion-k8s"
dataDir: "/dls/i03/data"
# These should be overridden at install time
projectDir: SET_ON_INSTALL
Expand Down
2 changes: 1 addition & 1 deletion utility_scripts/deploy/deploy_hyperion_to_k8s.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ else
cd $NEW_PROJECTDIR
PROJECTDIR=$NEW_PROJECTDIR
HYPERION_BASENAME=$(basename $HYPERION_BASE)
CHECKED_OUT_VERSION=${HYPERION_BASENAME#mx_bluesky_v}
CHECKED_OUT_VERSION=${HYPERION_BASENAME#mx_bluesky_}
fi


Expand Down

0 comments on commit 1180e5a

Please sign in to comment.