From a8ebfa6f105e7e5c1b115a07598aa2d79fc78124 Mon Sep 17 00:00:00 2001 From: azieseme <80332010+azieseme@users.noreply.github.com> Date: Thu, 22 Jan 2026 16:26:15 +0100 Subject: [PATCH 1/2] serverless-fleets - create subnetpool instead of adding CRNs to default secret, and use the pool in fleet create samples also minor fixes of cleanup, and vpc rules protocols ("all" deprecated) --- serverless-fleets/README.md | 5 +- serverless-fleets/init-fleet-sandbox | 53 ++++++++++++------- serverless-fleets/run | 3 +- serverless-fleets/run_gpu | 3 +- serverless-fleets/run_parallel_tasks | 21 ++++---- serverless-fleets/run_wordcount | 22 ++++---- serverless-fleets/tutorials/docling/README.md | 5 ++ serverless-fleets/tutorials/docling/run | 21 ++++---- serverless-fleets/tutorials/docling/run_gpu | 17 +++--- .../tutorials/inferencing/README.md | 3 +- serverless-fleets/tutorials/inferencing/run | 32 +++++------ .../tutorials/inferencing/run_h100 | 32 +++++------ .../tutorials/simulation/README.md | 2 + serverless-fleets/tutorials/simulation/run | 21 ++++---- 14 files changed, 143 insertions(+), 97 deletions(-) diff --git a/serverless-fleets/README.md b/serverless-fleets/README.md index f2e91e6c3..703e19521 100644 --- a/serverless-fleets/README.md +++ b/serverless-fleets/README.md @@ -142,6 +142,7 @@ Run a serverless fleet that runs 1 single task and instance with 2 CPUs and 4 GB ibmcloud code-engine fleet create --name fleet-b4bd2a33-1 --tasks-state-store fleet-task-store + --subnetpool-name fleet-subnetpool --image registry.access.redhat.com/ubi8/ubi-minimal:latest --command=sleep --arg 60 @@ -152,6 +153,7 @@ ibmcloud code-engine fleet create Successfully created fleet with name 'fleet-b4bd2a33-1' and ID 'e3caac88-cfc2-4602-8684-b527a6811716' Run 'ibmcloud ce fleet get --id e3caac88-cfc2-4602-8684-b527a6811716' to check the fleet status. Run 'ibmcloud ce fleet worker list --fleet-id e3caac88-cfc2-4602-8684-b527a6811716' to retrieve a list of provisioned workers. +Run 'ibmcloud ce fleet task list --fleet-id e3caac88-cfc2-4602-8684-b527a6811716' to retrieve a list of tasks. OK ``` @@ -283,8 +285,9 @@ Run a serverless fleet to process 100 tasks where each tasks gets 1 CPU and 2 GB ``` ➜ serverless-fleets ibmcloud code-engine fleet create --name fleet-847292b7-1 - --image registry.access.redhat.com/ubi8/ubi-minimal:latest --tasks-state-store fleet-task-store + --subnetpool-name fleet-subnetpool + --image registry.access.redhat.com/ubi8/ubi-minimal:latest --command=sleep --arg 2 --tasks 100 diff --git a/serverless-fleets/init-fleet-sandbox b/serverless-fleets/init-fleet-sandbox index e800abd7e..ee7d6c752 100755 --- a/serverless-fleets/init-fleet-sandbox +++ b/serverless-fleets/init-fleet-sandbox @@ -76,9 +76,19 @@ function clean() { ibmcloud is public-gateway-delete $vpc_name-gateway --force 2>/dev/null # END Remove old legacy components - ibmcloud is subnet-delete $vpc_name-subnet-1 --force 2>/dev/null - ibmcloud is subnet-delete $vpc_name-subnet-2 --force 2>/dev/null - ibmcloud is subnet-delete $vpc_name-subnet-3 --force 2>/dev/null + for i in {1..3} + do + if ibmcloud is subnet-public-gateway $vpc_name-subnet-$i >/dev/null 2>&1; then + ibmcloud is subnet-public-gateway-detach $vpc_name-subnet-$i --force 2>/dev/null + fi + if ibmcloud is subnet $vpc_name-subnet-$i $vpc_name >/dev/null 2>&1; then + ibmcloud is subnet-delete $vpc_name-subnet-$i --force 2>/dev/null + fi + if ibmcloud is public-gateway $vpc_name-gateway-$i >/dev/null 2>&1; then + ibmcloud is public-gateway-delete $vpc_name-gateway-$i --force 2>/dev/null + fi + done + ibmcloud is network-acl-delete $vpc_name-acl --force 2>/dev/null ibmcloud is security-group-delete $vpc_name-group --force 2>/dev/null ibmcloud is vpc-delete $vpc_name --force 2>/dev/null @@ -332,7 +342,7 @@ fi # Create the Network ACL if ! ibmcloud is network-acl $vpc_name-acl $vpc_name >/dev/null 2>&1; then print_msg "\nCreating the VPC Network ACL '$vpc_name-acl' ..." - ibmcloud is network-acl-create $vpc_name-acl $vpc_name --rules '[{ "name": "egress", "action": "allow", "destination": "0.0.0.0/0", "direction": "outbound", "source": "0.0.0.0/0", "protocol": "all" }, { "name": "ingress", "action": "allow", "destination": "0.0.0.0/0", "direction": "inbound", "source": "0.0.0.0/0", "protocol": "all" }]' + ibmcloud is network-acl-create $vpc_name-acl $vpc_name --rules '[{ "name": "egress", "action": "allow", "destination": "0.0.0.0/0", "direction": "outbound", "source": "0.0.0.0/0", "protocol": "icmp_tcp_udp" }, { "name": "ingress", "action": "allow", "destination": "0.0.0.0/0", "direction": "inbound", "source": "0.0.0.0/0", "protocol": "icmp_tcp_udp" }]' if [ $? -ne 0 ]; then print_error "VPC Network ACL creation failed!" abortScript @@ -409,11 +419,11 @@ if ! ibmcloud is security-group $vpc_name-group $vpc_name >/dev/null 2>&1; then fi print_msg "\nCreating required VPC Security group rules ..." - ibmcloud is security-group-rule-add $vpc_name-group outbound all --remote 0.0.0.0/0 --vpc $vpc_name >/dev/null - ibmcloud is security-group-rule-add $vpc_name-group outbound all --remote 161.26.0.0/16 --vpc $vpc_name >/dev/null - ibmcloud is security-group-rule-add $vpc_name-group outbound all --remote 166.8.0.0/14 --vpc $vpc_name >/dev/null - ibmcloud is security-group-rule-add $vpc_name-group outbound all --remote $vpc_name-group --vpc $vpc_name >/dev/null - ibmcloud is security-group-rule-add $vpc_name-group inbound all --remote $vpc_name-group --vpc $vpc_name >/dev/null + ibmcloud is security-group-rule-add $vpc_name-group outbound icmp_tcp_udp --remote 0.0.0.0/0 --vpc $vpc_name >/dev/null + ibmcloud is security-group-rule-add $vpc_name-group outbound icmp_tcp_udp --remote 161.26.0.0/16 --vpc $vpc_name >/dev/null + ibmcloud is security-group-rule-add $vpc_name-group outbound icmp_tcp_udp --remote 166.8.0.0/14 --vpc $vpc_name >/dev/null + ibmcloud is security-group-rule-add $vpc_name-group outbound icmp_tcp_udp --remote $vpc_name-group --vpc $vpc_name >/dev/null + ibmcloud is security-group-rule-add $vpc_name-group inbound icmp_tcp_udp --remote $vpc_name-group --vpc $vpc_name >/dev/null echo "Done" print_msg "\nPrinting the VPC Security group '$vpc_name-group' ..." @@ -624,23 +634,30 @@ if ! ibmcloud ce pds get --name fleet-input-store >/dev/null 2>&1; then --cos-access-secret fleet-cos-secret fi + +print_msg "\nCreating the Code Engine subnetpool 'fleet-subnetpool' ..." +create_or_update=update + +if ! ibmcloud ce connectivity subnetpool get --name fleet-subnetpool >/dev/null 2>&1; then + security_group_crn="$(ibmcloud is security-group ${vpc_name}-group --output json | jq -r '.crn')" + ibmcloud ce connectivity subnetpool create --name fleet-subnetpool \ + --subnet-crn key_1="$(ibmcloud is subnet ${vpc_name}-subnet-1 --output json | jq -r '.crn')" \ + --security-group-crn key_1="${security_group_crn}" \ + --subnet-crn key_2="$(ibmcloud is subnet ${vpc_name}-subnet-2 --output json | jq -r '.crn')" \ + --security-group-crn key_2="${security_group_crn}" \ + --subnet-crn key_3="$(ibmcloud is subnet ${vpc_name}-subnet-3 --output json | jq -r '.crn')" \ + --security-group-crn key_3="${security_group_crn}" +fi + print_msg "\nCreating the Code Engine default secret 'codeengine-fleet-defaults' with observability and VPC subnet configurations ..." create_or_update=update if ! ibmcloud ce secret get --name codeengine-fleet-defaults >/dev/null 2>&1; then create_or_update=create fi -security_group_crn="$(ibmcloud is security-group ${vpc_name}-group --output json | jq -r '.crn')" -ibmcloud ce secret $create_or_update -n codeengine-fleet-defaults \ - --from-literal pool_subnet_crn_1="$(ibmcloud is subnet ${vpc_name}-subnet-1 --output json | jq -r '.crn')" \ - --from-literal pool_security_group_crns_1="${security_group_crn}" \ - --from-literal pool_subnet_crn_2="$(ibmcloud is subnet ${vpc_name}-subnet-2 --output json | jq -r '.crn')" \ - --from-literal pool_security_group_crns_2="${security_group_crn}" \ - --from-literal pool_subnet_crn_3="$(ibmcloud is subnet ${vpc_name}-subnet-3 --output json | jq -r '.crn')" \ - --from-literal pool_security_group_crns_3="${security_group_crn}" if [[ "$SETUP_LOGGING" == "true" && "$icl_ingestion_apikey" != "" ]]; then print_msg "\nMake sure logs are sent to '${icl_ingestion_host}' ..." - ibmcloud ce secret update -n codeengine-fleet-defaults \ + ibmcloud ce secret $create_or_update -n codeengine-fleet-defaults \ --from-literal logging_ingress_endpoint="${icl_ingestion_host}" \ --from-literal logging_sender_api_key="${icl_ingestion_apikey}" \ --from-literal logging_level_agent=info \ diff --git a/serverless-fleets/run b/serverless-fleets/run index 5da47b7ba..6fa7c9739 100755 --- a/serverless-fleets/run +++ b/serverless-fleets/run @@ -7,6 +7,7 @@ uuid=$(uuidgen | tr '[:upper:]' '[:lower:]' | awk -F- '{print $1}') echo ibmcloud code-engine fleet create echo " " --name "fleet-${uuid}-1" echo " " --tasks-state-store fleet-task-store +echo " " --subnetpool-name fleet-subnetpool echo " " --image registry.access.redhat.com/ubi9/ubi-minimal:latest echo " " --command="sleep" echo " " --arg "60" @@ -15,4 +16,4 @@ echo " " --cpu 2 echo " " --memory 4G echo " " --max-scale 1 -ibmcloud code-engine fleet create --name "fleet-${uuid}-1" --tasks-state-store fleet-task-store --image registry.access.redhat.com/ubi9/ubi-minimal:latest --max-scale 1 --command="sleep" --arg "60" --tasks 1 --cpu 2 --memory 4G \ No newline at end of file +ibmcloud code-engine fleet create --name "fleet-${uuid}-1" --tasks-state-store fleet-task-store --subnetpool-name fleet-subnetpool --image registry.access.redhat.com/ubi9/ubi-minimal:latest --max-scale 1 --command="sleep" --arg "60" --tasks 1 --cpu 2 --memory 4G \ No newline at end of file diff --git a/serverless-fleets/run_gpu b/serverless-fleets/run_gpu index c2d873f82..b34adb64c 100755 --- a/serverless-fleets/run_gpu +++ b/serverless-fleets/run_gpu @@ -7,6 +7,7 @@ uuid=$(uuidgen | tr '[:upper:]' '[:lower:]' | awk -F- '{print $1}') echo ibmcloud code-engine fleet create echo " " --name "fleet-${uuid}-1" echo " " --tasks-state-store fleet-task-store +echo " " --subnetpool-name fleet-subnetpool echo " " --image registry.access.redhat.com/ubi8/ubi-minimal:latest echo " " --command="sleep" echo " " --arg "60" @@ -14,4 +15,4 @@ echo " " --tasks 1 echo " " --max-scale 1 echo " " --gpu l40s:1 -ibmcloud code-engine fleet create --name "fleet-${uuid}-1" --tasks-state-store fleet-task-store --image registry.access.redhat.com/ubi8/ubi-minimal:latest --max-scale 1 --command="sleep" --arg "60" --tasks 1 --gpu l40s:1 +ibmcloud code-engine fleet create --name "fleet-${uuid}-1" --tasks-state-store fleet-task-store --subnetpool-name fleet-subnetpool --image registry.access.redhat.com/ubi8/ubi-minimal:latest --max-scale 1 --command="sleep" --arg "60" --tasks 1 --gpu l40s:1 diff --git a/serverless-fleets/run_parallel_tasks b/serverless-fleets/run_parallel_tasks index b5e3673b7..32bd0e5bd 100755 --- a/serverless-fleets/run_parallel_tasks +++ b/serverless-fleets/run_parallel_tasks @@ -10,14 +10,15 @@ CPU=1 MEMORY=2G echo ibmcloud code-engine fleet create -echo " "--name "fleet-${uuid}-1" -echo " "--image registry.access.redhat.com/ubi8/ubi-minimal:latest -echo " "--tasks-state-store fleet-task-store -echo " "--command="sleep" -echo " "--arg "2" -echo " "--tasks $TASKS -echo " "--cpu $CPU -echo " "--memory $MEMORY -echo " "--max-scale $MAX_SCALE +echo " " --name "fleet-${uuid}-1" +echo " " --tasks-state-store fleet-task-store +echo " " --subnetpool-name fleet-subnetpool +echo " " --image registry.access.redhat.com/ubi8/ubi-minimal:latest +echo " " --command="sleep" +echo " " --arg "2" +echo " " --tasks $TASKS +echo " " --cpu $CPU +echo " " --memory $MEMORY +echo " " --max-scale $MAX_SCALE -ibmcloud code-engine fleet create --name "fleet-${uuid}-1" --tasks-state-store fleet-task-store --image registry.access.redhat.com/ubi9/ubi-minimal:latest --max-scale ${MAX_SCALE} --command="sleep" --arg "2" --tasks ${TASKS} --cpu ${CPU} --memory ${MEMORY} +ibmcloud code-engine fleet create --name "fleet-${uuid}-1" --tasks-state-store fleet-task-store --subnetpool-name fleet-subnetpool --image registry.access.redhat.com/ubi9/ubi-minimal:latest --max-scale ${MAX_SCALE} --command="sleep" --arg "2" --tasks ${TASKS} --cpu ${CPU} --memory ${MEMORY} diff --git a/serverless-fleets/run_wordcount b/serverless-fleets/run_wordcount index f80519066..d30b59250 100755 --- a/serverless-fleets/run_wordcount +++ b/serverless-fleets/run_wordcount @@ -22,15 +22,17 @@ CMDS=wordcount_commands.jsonl # ls data/tutorials/wordcount | awk '{ printf " { \"command\":\"/bin/bash\", \"args\": [\"-c\", \"cd /mnt/ce/data; wc tutorials/wordcount/"$1" > result/wordcount_"$1"\"]}\n" }' > wordcount_commands.jsonl echo ibmcloud code-engine fleet run -echo " "--name "fleet-${uuid}-1" -echo " "--image registry.access.redhat.com/ubi9/ubi-minimal:latest -echo " "--tasks-from-local-file $CMDS -echo " "--cpu $CPU -echo " "--memory $MEMORY -echo " "--max-scale $MAX_SCALE -echo " "--mount-data-store /input=fleet-input-store:/wordcount -echo " "--mount-data-store /output=fleet-output-store:/wordcount - -ibmcloud code-engine fleet create --name "fleet-${uuid}-1" --tasks-state-store fleet-task-store --image registry.access.redhat.com/ubi9/ubi-minimal:latest --max-scale $MAX_SCALE --tasks-from-local-file $CMDS --cpu $CPU --memory $MEMORY --mount-data-store /input=fleet-input-store:/wordcount --mount-data-store /output=fleet-output-store:/wordcount +echo " " --name "fleet-${uuid}-1" +echo " " --tasks-state-store fleet-task-store +echo " " --subnetpool-name fleet-subnetpool +echo " " --image registry.access.redhat.com/ubi9/ubi-minimal:latest +echo " " --tasks-from-local-file $CMDS +echo " " --cpu $CPU +echo " " --memory $MEMORY +echo " " --max-scale $MAX_SCALE +echo " " --mount-data-store /input=fleet-input-store:/wordcount +echo " " --mount-data-store /output=fleet-output-store:/wordcount + +ibmcloud code-engine fleet create --name "fleet-${uuid}-1" --tasks-state-store fleet-task-store --subnetpool-name fleet-subnetpool --image registry.access.redhat.com/ubi9/ubi-minimal:latest --max-scale $MAX_SCALE --tasks-from-local-file $CMDS --cpu $CPU --memory $MEMORY --mount-data-store /input=fleet-input-store:/wordcount --mount-data-store /output=fleet-output-store:/wordcount diff --git a/serverless-fleets/tutorials/docling/README.md b/serverless-fleets/tutorials/docling/README.md index e8b8aa2d5..f9fe4fa4a 100644 --- a/serverless-fleets/tutorials/docling/README.md +++ b/serverless-fleets/tutorials/docling/README.md @@ -76,6 +76,8 @@ Launch the fleet with the following command in the `tutorials/docling` directory ``` ➜ docling ./run ibmcloud code-engine fleet create --name fleet-3128b1c7-1 + --tasks-state-store fleet-task-store + --subnetpool-name fleet-subnetpool --image quay.io/docling-project/docling-serve-cpu --registry-secret fleet-registry-secret --worker-profile mx3d-24x240 @@ -88,6 +90,7 @@ ibmcloud code-engine fleet create --name fleet-3128b1c7-1 Successfully created fleet with name 'fleet-3128b1c7-1' and ID 'bd00d46e-4645-43b0-a892-d153455ac576' Run 'ibmcloud ce fleet get --id bd00d46e-4645-43b0-a892-d153455ac576' to check the fleet status. Run 'ibmcloud ce fleet worker list --fleet-id bd00d46e-4645-43b0-a892-d153455ac576' to retrieve a list of provisioned workers. +Run 'ibmcloud ce fleet task list --fleet-id bd00d46e-4645-43b0-a892-d153455ac576' to retrieve a list of tasks. OK ``` @@ -240,6 +243,8 @@ The GPUs are defined by setting the family and the number of GPUs per task, e.g. ``` ./run_gpu ibmcloud code-engine fleet create --name fleet-cc1f880d-1 + --tasks-state-store fleet-task-store + --subnetpool-name fleet-subnetpool --image quay.io/docling-project/docling-serve --registry-secret fleet-registry-secret --max-scale 1 diff --git a/serverless-fleets/tutorials/docling/run b/serverless-fleets/tutorials/docling/run index c4ab8e73e..c49533bba 100755 --- a/serverless-fleets/tutorials/docling/run +++ b/serverless-fleets/tutorials/docling/run @@ -7,22 +7,25 @@ uuid=$(uuidgen | tr '[:upper:]' '[:lower:]' | awk -F- '{print $1}') IMAGE="quay.io/docling-project/docling-serve-cpu" echo ibmcloud code-engine fleet create --name "fleet-${uuid}-1" -echo " "--image $IMAGE -echo " "--worker-profile mx3d-24x240 -echo " "--max-scale 8 -echo " "--tasks-from-local-file commands.jsonl -echo " "--cpu 12 -echo " "--memory 120G -echo " "--mount-data-store /input=fleet-input-store:/docling -echo " "--mount-data-store /output=fleet-output-store:/docling +echo " " --tasks-state-store fleet-task-store +echo " " --subnetpool-name fleet-subnetpool +echo " " --image $IMAGE +echo " " --worker-profile mx3d-24x240 +echo " " --max-scale 8 +echo " " --tasks-from-local-file commands.jsonl +echo " " --cpu 12 +echo " " --memory 120G +echo " " --mount-data-store /input=fleet-input-store:/docling +echo " " --mount-data-store /output=fleet-output-store:/docling ibmcloud code-engine fleet create --name "fleet-${uuid}-1" \ +--tasks-state-store fleet-task-store \ +--subnetpool-name fleet-subnetpool \ --image $IMAGE \ --worker-profile mx3d-24x240 \ --max-scale 8 \ --tasks-from-local-file commands.jsonl \ --cpu 12 \ --memory 120G \ ---tasks-state-store fleet-task-store \ --mount-data-store /input=fleet-input-store:/docling \ --mount-data-store /output=fleet-output-store:/docling diff --git a/serverless-fleets/tutorials/docling/run_gpu b/serverless-fleets/tutorials/docling/run_gpu index 64165a84c..ec92ec60d 100755 --- a/serverless-fleets/tutorials/docling/run_gpu +++ b/serverless-fleets/tutorials/docling/run_gpu @@ -8,18 +8,21 @@ uuid=$(uuidgen | tr '[:upper:]' '[:lower:]' | awk -F- '{print $1}') IMAGE="quay.io/docling-project/docling-serve" echo ibmcloud code-engine fleet create --name "fleet-${uuid}-1" -echo " "--image $IMAGE -echo " "--max-scale 1 -echo " "--tasks-from-local-file commands.jsonl -echo " "--gpu l40s -echo " "--mount-data-store /input=fleet-input-store:/docling -echo " "--mount-data-store /output=fleet-output-store:/docling +echo " " --tasks-state-store fleet-task-store +echo " " --subnetpool-name fleet-subnetpool +echo " " --image $IMAGE +echo " " --max-scale 1 +echo " " --tasks-from-local-file commands.jsonl +echo " " --gpu l40s +echo " " --mount-data-store /input=fleet-input-store:/docling +echo " " --mount-data-store /output=fleet-output-store:/docling ibmcloud code-engine fleet create --name "fleet-${uuid}-1" \ +--tasks-state-store fleet-task-store \ +--subnetpool-name fleet-subnetpool \ --image $IMAGE \ --max-scale 1 \ --tasks-from-local-file commands.jsonl \ --gpu l40s \ ---tasks-state-store fleet-task-store \ --mount-data-store /input=fleet-input-store:/docling \ --mount-data-store /output=fleet-output-store:/docling diff --git a/serverless-fleets/tutorials/inferencing/README.md b/serverless-fleets/tutorials/inferencing/README.md index a7533ca69..e938f6410 100644 --- a/serverless-fleets/tutorials/inferencing/README.md +++ b/serverless-fleets/tutorials/inferencing/README.md @@ -176,11 +176,12 @@ Use `./run_h100` to run all 8 batches from `commands_h100.jsonl` on machine with ``` ➜ inferencing ./run ibmcloud code-engine fleet create --name fleet-19f82e90-1 + --tasks-state-store fleet-task-store \ + --subnetpool-name fleet-subnetpool \ --image private.de.icr.io/ce--fleet-inferencing-e7469696/inferencing --registry-secret ce-auto-icr-private-eu-de --max-scale 1 --tasks-from-local-file commands.jsonl - --tasks-state-store fleet-task-store --gpu l40s:1 --cpu 24 --memory 120G diff --git a/serverless-fleets/tutorials/inferencing/run b/serverless-fleets/tutorials/inferencing/run index 4aeba6298..7262cd4ca 100755 --- a/serverless-fleets/tutorials/inferencing/run +++ b/serverless-fleets/tutorials/inferencing/run @@ -18,22 +18,25 @@ REGISTRY_SECRET_NAME="ce-auto-icr-private-$REGION" PRIVATE_IMAGE="private.$IMAGE" echo ibmcloud code-engine fleet create --name "fleet-${uuid}-1" -echo " "--image $PRIVATE_IMAGE -echo " "--registry-secret $REGISTRY_SECRET_NAME -echo " "--max-scale 1 -echo " "--tasks-from-local-file commands.jsonl -echo " "--tasks-state-store fleet-task-store -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 +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 \ @@ -41,7 +44,6 @@ ibmcloud code-engine fleet create --name "fleet-${uuid}-1" \ --gpu l40s:1 \ --cpu 24 \ --memory 120G \ ---tasks-state-store fleet-task-store \ --env HUGGINGFACEHUB_API_TOKEN="$HUGGINGFACEHUB_API_TOKEN" \ --env PYTORCH_CUDA_ALLOC_CONF="expandable_segments:True" \ --env MODEL_NAME="ibm-granite/granite-4.0-micro" \ diff --git a/serverless-fleets/tutorials/inferencing/run_h100 b/serverless-fleets/tutorials/inferencing/run_h100 index a8e97161c..a95089d28 100755 --- a/serverless-fleets/tutorials/inferencing/run_h100 +++ b/serverless-fleets/tutorials/inferencing/run_h100 @@ -18,22 +18,25 @@ REGISTRY_SECRET_NAME="ce-auto-icr-private-$REGION" PRIVATE_IMAGE="private.$IMAGE" echo ibmcloud code-engine fleet create --name "fleet-${uuid}-1" -echo " "--image $PRIVATE_IMAGE -echo " "--registry-secret $REGISTRY_SECRET_NAME -echo " "--max-scale 8 -echo " "--tasks-from-local-file commands_h100.jsonl -echo " "--tasks-state-store fleet-task-store -echo " "--gpu h100:1 -echo " "--cpu 20 -echo " "--memory 200G -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 +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 8 +echo " " --tasks-from-local-file commands_h100.jsonl +echo " " --gpu h100:1 +echo " " --cpu 20 +echo " " --memory 200G +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 8 \ @@ -41,7 +44,6 @@ ibmcloud code-engine fleet create --name "fleet-${uuid}-1" \ --gpu h100:1 \ --cpu 20 \ --memory 200G \ ---tasks-state-store fleet-task-store \ --env HUGGINGFACEHUB_API_TOKEN="$HUGGINGFACEHUB_API_TOKEN" \ --env PYTORCH_CUDA_ALLOC_CONF="expandable_segments:True" \ --env MODEL_NAME="ibm-granite/granite-4.0-micro" \ diff --git a/serverless-fleets/tutorials/simulation/README.md b/serverless-fleets/tutorials/simulation/README.md index fbaad7ddd..3c3911916 100644 --- a/serverless-fleets/tutorials/simulation/README.md +++ b/serverless-fleets/tutorials/simulation/README.md @@ -89,6 +89,8 @@ Now run the fleet to process the 24 stock tickers. In this tutorial we use the ` ``` ➜ simulation ./run ibmcloud code-engine fleet create --name fleet-c042e88d-1 + --tasks-state-store fleet-task-store \ + --subnetpool-name fleet-subnetpool \ --image private.br.icr.io/ce--fleet-simulation/simulation --registry-secret ce-auto-icr-private-br-sao --worker-profile mx2-4x32 diff --git a/serverless-fleets/tutorials/simulation/run b/serverless-fleets/tutorials/simulation/run index 5dbd6d16c..cf4f71077 100755 --- a/serverless-fleets/tutorials/simulation/run +++ b/serverless-fleets/tutorials/simulation/run @@ -23,16 +23,20 @@ REGISTRY_SECRET_NAME="ce-auto-icr-private-$REGION" PRIVATE_IMAGE="private.$IMAGE" echo ibmcloud code-engine fleet create --name "fleet-${uuid}-1" -echo " "--image $PRIVATE_IMAGE -echo " "--registry-secret $REGISTRY_SECRET_NAME -echo " "--worker-profile $PROFILE -echo " "--tasks-from-local-file commands.jsonl -echo " "--cpu $CPU -echo " "--memory $MEMORY -echo " "--max-scale $MAX_SCALE -echo " "--mount-data-store /output=fleet-output-store:/simulation +echo " " --tasks-state-store fleet-task-store \ +echo " " --subnetpool-name fleet-subnetpool \ +echo " " --image $PRIVATE_IMAGE +echo " " --registry-secret $REGISTRY_SECRET_NAME +echo " " --worker-profile $PROFILE +echo " " --tasks-from-local-file commands.jsonl +echo " " --cpu $CPU +echo " " --memory $MEMORY +echo " " --max-scale $MAX_SCALE +echo " " --mount-data-store /output=fleet-output-store:/simulation 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 $MAX_SCALE \ @@ -40,6 +44,5 @@ ibmcloud code-engine fleet create --name "fleet-${uuid}-1" \ --cpu $CPU \ --memory $MEMORY \ --worker-profile $PROFILE \ ---tasks-state-store fleet-task-store \ --mount-data-store /output=fleet-output-store:/simulation From 6181b49e80e035042e00348e013396da664852cd Mon Sep 17 00:00:00 2001 From: azieseme <80332010+azieseme@users.noreply.github.com> Date: Fri, 23 Jan 2026 12:19:23 +0100 Subject: [PATCH 2/2] serverless-fleets - create also zonal subnetpools --- serverless-fleets/init-fleet-sandbox | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/serverless-fleets/init-fleet-sandbox b/serverless-fleets/init-fleet-sandbox index ee7d6c752..4753da397 100755 --- a/serverless-fleets/init-fleet-sandbox +++ b/serverless-fleets/init-fleet-sandbox @@ -635,9 +635,7 @@ if ! ibmcloud ce pds get --name fleet-input-store >/dev/null 2>&1; then fi -print_msg "\nCreating the Code Engine subnetpool 'fleet-subnetpool' ..." -create_or_update=update - +print_msg "\nCreating the Code Engine subnetpools 'fleet-subnetpool' ..." if ! ibmcloud ce connectivity subnetpool get --name fleet-subnetpool >/dev/null 2>&1; then security_group_crn="$(ibmcloud is security-group ${vpc_name}-group --output json | jq -r '.crn')" ibmcloud ce connectivity subnetpool create --name fleet-subnetpool \ @@ -648,6 +646,15 @@ if ! ibmcloud ce connectivity subnetpool get --name fleet-subnetpool >/dev/null --subnet-crn key_3="$(ibmcloud is subnet ${vpc_name}-subnet-3 --output json | jq -r '.crn')" \ --security-group-crn key_3="${security_group_crn}" fi +for i in {1..3} +do + if ! ibmcloud ce connectivity subnetpool get --name fleet-subnetpool-zone-$i >/dev/null 2>&1; then + security_group_crn="$(ibmcloud is security-group ${vpc_name}-group --output json | jq -r '.crn')" + ibmcloud ce connectivity subnetpool create --name fleet-subnetpool-zone-$i \ + --subnet-crn key="$(ibmcloud is subnet ${vpc_name}-subnet-$i --output json | jq -r '.crn')" \ + --security-group-crn key="${security_group_crn}" + fi +done print_msg "\nCreating the Code Engine default secret 'codeengine-fleet-defaults' with observability and VPC subnet configurations ..." create_or_update=update