-
Notifications
You must be signed in to change notification settings - Fork 151
Expand file tree
/
Copy pathrun
More file actions
executable file
·54 lines (44 loc) · 1.91 KB
/
run
File metadata and controls
executable file
·54 lines (44 loc) · 1.91 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
48
49
50
51
52
#!/bin/bash
set -e
uuid=$(uuidgen | tr '[:upper:]' '[:lower:]' | awk -F- '{print $1}')
IMAGE=$(ibmcloud cr images | grep "ce--fleet-inferencing" | awk '{print $1}')
if [ -z "${IMAGE}" ]; then
echo "no image found. pls build a inferencing image with ./build"
exit -1
fi
# getting the automatically created registry secret, e.g. ce-auto-icr-private-<region>
REGION=$(ibmcloud target -o json | jq -r '.region.name')
REGISTRY_SECRET_NAME="ce-auto-icr-private-$REGION"
PRIVATE_IMAGE="private.$IMAGE"
echo ibmcloud code-engine fleet create --name "fleet-${uuid}-1"
echo " " --tasks-state-store fleet-task-store
echo " " --subnetpool-name fleet-subnetpool
echo " " --image $PRIVATE_IMAGE
echo " " --registry-secret $REGISTRY_SECRET_NAME
echo " " --max-scale 1
echo " " --tasks-from-local-file commands.jsonl
echo " " --gpu l40s:1
echo " " --cpu 24
echo " " --memory 120G
echo " " --env HUGGINGFACEHUB_API_TOKEN="REDACTED"
echo " " --env PYTORCH_CUDA_ALLOC_CONF="expandable_segments:True"
echo " " --env MODEL_NAME="ibm-granite/granite-4.0-micro"
echo " " --mount-data-store /root/.cache/huggingface=fleet-input-store:/huggingface
echo " " --mount-data-store /input=fleet-input-store:/inferencing
echo " " --mount-data-store /output=fleet-output-store:/inferencing
ibmcloud code-engine fleet create --name "fleet-${uuid}-1" \
--tasks-state-store fleet-task-store \
--subnetpool-name fleet-subnetpool \
--image $PRIVATE_IMAGE \
--registry-secret $REGISTRY_SECRET_NAME \
--max-scale 1 \
--tasks-from-local-file commands.jsonl \
--gpu l40s:1 \
--cpu 24 \
--memory 120G \
--env HUGGINGFACEHUB_API_TOKEN="$HUGGINGFACEHUB_API_TOKEN" \
--env PYTORCH_CUDA_ALLOC_CONF="expandable_segments:True" \
--env MODEL_NAME="ibm-granite/granite-4.0-micro" \
--mount-data-store /root/.cache/huggingface=fleet-input-store:/huggingface \
--mount-data-store /input=fleet-input-store:/inferencing \
--mount-data-store /output=fleet-output-store:/inferencing