Skip to content

Commit 55f5dcc

Browse files
remove unnecessary command options and align README.md
1 parent 0ddb497 commit 55f5dcc

File tree

5 files changed

+87
-17
lines changed

5 files changed

+87
-17
lines changed

beta/serverless-fleets/README.md

Lines changed: 83 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,8 @@ ibmcloud code-engine beta fleet create
221221
--name fleet-b4bd2a33-1
222222
--tasks-state-store fleet-task-store
223223
--image registry.access.redhat.com/ubi8/ubi-minimal:latest
224-
--registry-secret fleet-registry-secret
225224
--command=sleep
226225
--arg 60
227-
--worker-profile cx2-2x4
228226
--tasks 1
229227
--cpu 2
230228
--memory 4G
@@ -364,7 +362,6 @@ Run a serverless fleet to process 100 tasks where each tasks gets 1 CPU and 2 GB
364362
➜ serverless-fleets ibmcloud code-engine beta fleet create
365363
--name fleet-847292b7-1
366364
--image registry.access.redhat.com/ubi8/ubi-minimal:latest
367-
--registry-secret fleet-registry-secret
368365
--tasks-state-store fleet-task-store
369366
--command=sleep
370367
--arg 2
@@ -501,15 +498,93 @@ The example mounts the [Persistant Data Stores](https://cloud.ibm.com/docs/codee
501498

502499
It mounts the `fleet-input-store:/wordcount` to `/input` and `fleet-output-store:/wordcount` to `/output`.
503500

501+
> Note, this example assumes that the automated One-Time-Setup has been performed. Otherwise, the upload and download would need to be done manually.
502+
503+
504504
Four steps are required to run the example:
505-
1. `./upload` - will upload the .txt files from the local data directory to Cloud Object Storage
506-
2. `./run_wordcount` - launch the fleet to perform `wc` on each of the novels.
507-
3. `./watch_result wordcount` - will watch the COS bucket for the results, press ctrl-c if all 6 results are present
508-
4. `./download` - will download the results from the COS bucket
505+
506+
#### Step 1 - Upload files
507+
508+
Upload the .txt files from the local data directory to Cloud Object Storage
509+
```
510+
./upload
511+
```
512+
513+
#### Step 2 - Run the fleet
514+
515+
Launch the fleet to perform `wc` on each of the novels which defines the tasks from [wordcount_commands.jsonl](./wordcount_commands.jsonl) and mounts the input and output data stores.
516+
```
517+
./run_wordcount
518+
```
519+
520+
Confirm that you uploaded the files with `#? 1`
521+
522+
<a name="output"></a>
523+
<details>
524+
<summary>Output</summary>
525+
```
526+
➜ serverless-fleets ./run_wordcount
527+
Did you upload the .txt files to COS?
528+
1) Yes
529+
2) No
530+
#? 1
531+
ibmcloud code-engine beta fleet run
532+
--name fleet-7e818989-1
533+
--image registry.access.redhat.com/ubi9/ubi-minimal:latest
534+
--tasks-from-local-file wordcount_commands.jsonl
535+
--cpu 1
536+
--memory 2G
537+
--max-scale 4
538+
--mount-data-store /input=fleet-input-store:/wordcount
539+
--mount-data-store /output=fleet-output-store:/wordcount
540+
Successfully created fleet with name 'fleet-7e818989-1' and ID '3f7a1c2a-6d85-4b27-bc4f-7e519645e23b'
541+
Run 'ibmcloud ce beta fleet get --id 3f7a1c2a-6d85-4b27-bc4f-7e519645e23b' to check the fleet status.
542+
Run 'ibmcloud ce beta fleet worker list --fleet-id 3f7a1c2a-6d85-4b27-bc4f-7e519645e23b' to retrieve a list of provisioned workers.
543+
Run 'ibmcloud ce beta fleet task list --fleet-id 3f7a1c2a-6d85-4b27-bc4f-7e519645e23b' to retrieve a list of tasks.
544+
OK
545+
```
546+
</details>
547+
<br>
548+
549+
#### Step 3 - Watch results
550+
551+
You can run the following command to watch the COS bucket for the results, press ctrl-c if all 6 results are present
552+
```
553+
./watch_result wordcount
554+
```
555+
556+
<a name="output"></a>
557+
<details>
558+
<summary>Output</summary>
559+
```
560+
Every 2.0s: ibmcloud cos list-objects-v2 --bucket fleetlab-dev-output-91b55a45 --prefix wordcount Jeremiass-MacBook-Pro.local: 13:48:47
561+
562+
OK
563+
Name Last Modified (UTC) Object Size
564+
wordcount/.keep Aug 29, 2025 at 12:05:04 0 B
565+
wordcount/wordcount_alice_in_wonderland.txt Sep 01, 2025 at 11:51:16 52 B
566+
wordcount/wordcount_der_struwwelpeter.txt Sep 01, 2025 at 11:51:14 47 B
567+
wordcount/wordcount_dracula.txt Sep 01, 2025 at 11:51:16 40 B
568+
wordcount/wordcount_gullivers_travels.txt Sep 01, 2025 at 11:51:14 50 B
569+
wordcount/wordcount_romeo_and_juliet.txt Sep 01, 2025 at 11:51:30 49 B
570+
wordcount/wordcount_the_call_of_the_wild.txt Sep 01, 2025 at 11:51:31 53 B
571+
572+
Found 7 objects in bucket 'fleetlab-dev-output-91b55a45'
573+
```
574+
</details>
575+
<br>
576+
577+
#### Step 4 - Download the results
578+
579+
Download the results from the output COS bucket to `./data/output`
580+
581+
```
582+
./download
583+
````
584+
509585
510586
🚀 The example was successful, if you can tell the number of words of the "Alice in Wonderland" novel 🚀
511587
512-
> Note, this example assumes that the automated One-Time-Setup has been performed. Otherwise, the upload and download would need to be done manually.
513588
514589
## Tutorials
515590

beta/serverless-fleets/run

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,11 @@ echo ibmcloud code-engine beta fleet create
88
echo " " --name "fleet-${uuid}-1"
99
echo " " --tasks-state-store fleet-task-store
1010
echo " " --image registry.access.redhat.com/ubi9/ubi-minimal:latest
11-
echo " " --registry-secret fleet-registry-secret
1211
echo " " --command="sleep"
1312
echo " " --arg "60"
14-
echo " " --worker-profile cx2-2x4
1513
echo " " --tasks 1
1614
echo " " --cpu 2
1715
echo " " --memory 4G
1816
echo " " --max-scale 1
1917

20-
ibmcloud code-engine beta fleet create --name "fleet-${uuid}-1" --tasks-state-store fleet-task-store --image registry.access.redhat.com/ubi9/ubi-minimal:latest --registry-secret fleet-registry-secret --worker-profile cx2-2x4 --max-scale 1 --command="sleep" --arg "60" --tasks 1 --cpu 2 --memory 4G
18+
ibmcloud code-engine beta 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

beta/serverless-fleets/run_gpu

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@ echo ibmcloud code-engine beta fleet create
88
echo " " --name "fleet-${uuid}-1"
99
echo " " --tasks-state-store fleet-task-store
1010
echo " " --image registry.access.redhat.com/ubi8/ubi-minimal:latest
11-
echo " " --registry-secret fleet-registry-secret
1211
echo " " --command="sleep"
1312
echo " " --arg "60"
1413
echo " " --tasks 1
1514
echo " " --max-scale 1
1615
echo " " --gpu l40s:1
1716

18-
ibmcloud code-engine beta fleet create --name "fleet-${uuid}-1" --tasks-state-store fleet-task-store --image registry.access.redhat.com/ubi8/ubi-minimal:latest --registry-secret fleet-registry-secret --worker-profile cx2-2x4 --max-scale 1 --command="sleep" --arg "60" --tasks 1 --gpu l40s:1
17+
ibmcloud code-engine beta 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

beta/serverless-fleets/run_parallel_tasks

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ MEMORY=2G
1212
echo ibmcloud code-engine beta fleet create
1313
echo " "--name "fleet-${uuid}-1"
1414
echo " "--image registry.access.redhat.com/ubi8/ubi-minimal:latest
15-
echo " "--registry-secret fleet-registry-secret
1615
echo " "--tasks-state-store fleet-task-store
1716
echo " "--command="sleep"
1817
echo " "--arg "2"
@@ -21,4 +20,4 @@ echo " "--cpu $CPU
2120
echo " "--memory $MEMORY
2221
echo " "--max-scale $MAX_SCALE
2322

24-
ibmcloud code-engine beta fleet create --name "fleet-${uuid}-1" --tasks-state-store fleet-task-store --image registry.access.redhat.com/ubi9/ubi-minimal:latest --registry-secret fleet-registry-secret --max-scale ${MAX_SCALE} --command="sleep" --arg "2" --tasks ${TASKS} --cpu ${CPU} --memory ${MEMORY}
23+
ibmcloud code-engine beta 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}

beta/serverless-fleets/run_wordcount

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,13 @@ CMDS=wordcount_commands.jsonl
2424
echo ibmcloud code-engine beta fleet run
2525
echo " "--name "fleet-${uuid}-1"
2626
echo " "--image registry.access.redhat.com/ubi9/ubi-minimal:latest
27-
echo " "--registry-secret fleet-registry-secret
2827
echo " "--tasks-from-local-file $CMDS
2928
echo " "--cpu $CPU
3029
echo " "--memory $MEMORY
3130
echo " "--max-scale $MAX_SCALE
3231
echo " "--mount-data-store /input=fleet-input-store:/wordcount
3332
echo " "--mount-data-store /output=fleet-output-store:/wordcount
3433

35-
ibmcloud code-engine beta fleet create --name "fleet-${uuid}-1" --tasks-state-store fleet-task-store --image registry.access.redhat.com/ubi9/ubi-minimal:latest --registry-secret fleet-registry-secret --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
34+
ibmcloud code-engine beta 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
3635

3736

0 commit comments

Comments
 (0)