Skip to content

Commit b485305

Browse files
Hua Caoaws-tianquaw
authored andcommitted
change the patch logic to entrypoint of SMUS
1 parent 1f09252 commit b485305

File tree

6 files changed

+30
-1
lines changed

6 files changed

+30
-1
lines changed

template/v2/dirs/etc/patches/apply_patches.sh

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,35 @@
22

33
set -eux
44

5+
# Check if parameter is provided
6+
if [ $# -ne 1 ]; then
7+
echo "Usage: $0 [smus|studio-ai]"
8+
exit 1
9+
fi
10+
11+
# Validate parameter
12+
case "$1" in
13+
"smus")
14+
PATCH_DIR="/etc/patches/smus"
15+
;;
16+
"studio-ai")
17+
PATCH_DIR="/etc/patches/studio-ai"
18+
;;
19+
*)
20+
echo "Error: Parameter must be either 'smus' or 'studio-ai'"
21+
exit 1
22+
;;
23+
esac
24+
25+
# Check if patch directory exists
26+
if [ ! -d "$PATCH_DIR" ]; then
27+
echo "Error: Patch directory $PATCH_DIR does not exist"
28+
exit 1
29+
fi
30+
531
# Patch files can be generated via "diff -u /path/to/original_file /path/to/new_file > XXX_bad_package.patch"
632
# See https://www.thegeekstuff.com/2014/12/patch-command-examples/
7-
for PATCHFILE in /etc/patches/*.patch; do
33+
for PATCHFILE in "$PATCH_DIR"/*.patch; do
834
[ -f "$PATCHFILE" ] || continue
935
echo "Applying $PATCHFILE"
1036
(cd "/opt/conda" && patch --strip=3 < "$PATCHFILE")

template/v2/dirs/usr/local/bin/entrypoint-sagemaker-ui-jupyter-server

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ set -e
66
# micromamba commands (e.g. using `micromamba activate` to activate environments)
77
eval "$(micromamba shell hook --shell=bash)"
88

9+
# apply patches for SMUS
10+
/etc/patches/apply_patches.sh smus && sudo rm -rf /etc/patches
11+
912
# Activate conda environment 'base', where supervisord is installed
1013
micromamba activate base
1114

0 commit comments

Comments
 (0)