-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathcdsw-build.sh
More file actions
47 lines (42 loc) · 2.12 KB
/
cdsw-build.sh
File metadata and controls
47 lines (42 loc) · 2.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# This cdsw-build.sh file will only be used when we are running in an
# environment with custom model root dirs disabled. Because composable
# amps and AI Studios are enabled under the same entitlement, in our current
# state we will never hit this if agent-studio/ directory exists, because the
# existence of that directory implies the ML_ENABLE_COMPOSABLE_AMPS entitlement
# as well as the model root dir feature, are both available.
# That being said, just in case this specific model root dir feature is ever moved
# way from the entitlement separately from the rest of the AI Studios features, we
# need to make sure that we explicitly still check for the existence of the folder.
if [ $AGENT_STUDIO_DEPLOY_MODE = "runtime" ]; then
echo "This is an Agent Studio runtime build. The dependencies are already installed in the runtime image."
else
echo "This is an Agent Studio AMP build. workflow engine will be in the project."
# Ensure uv is available
python -m pip install uv
# Get node
export NVM_DIR="$(pwd)/.nvm"
mkdir -p $NVM_DIR
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
nvm install 22
nvm use 22
if [ -d "/home/cdsw/agent-studio" ]; then
echo "agent-studio/ directory exists but model root dir feature is disabled."
cd /home/cdsw/agent-studio/studio/workflow_engine/
uv export --frozen --no-hashes > /tmp/requirements.txt
pip install -r /tmp/requirements.txt
rm /tmp/requirements.txt
# CRITICAL: Also install the workflow_engine package itself (not just dependencies)
pip install --no-deps .
cd -
else
echo "model root dir feature is disabled AND agent studio was installed as an AMP."
cd /home/cdsw/studio/workflow_engine/
uv export --frozen --no-hashes > /tmp/requirements.txt
pip install -r /tmp/requirements.txt
rm /tmp/requirements.txt
# CRITICAL: Also install the workflow_engine package itself (not just dependencies)
pip install --no-deps .
cd -
fi
fi