Printer
The Fuzzfile below specifies a simple printer workflow that uses a public Alpine container from Dockerhub to print 1 integer every second for 5 minutes. This simple workflow will help familiarize you with the Fuzzball’s real-time logging feature, and can also be used to experiment with Fuzzball’s in-job terminal.
version: v1
jobs:
printer:
image:
uri: docker://alpine:latest
policy:
timeout:
execute: 10m0s
env:
- PRINTER_START_INT=1
- PRINTER_END_INT=300
- PRINTER_SLEEP_INTERVAL=1
command:
- /bin/sh
- '-c'
- for i in $(seq $PRINTER_START_INT $PRINTER_END_INT); do echo $i; sleep $PRINTER_SLEEP_INTERVAL; done
resource:
cpu:
cores: 1
affinity: NUMA
memory:
size: 1GB
You can run this workflow either through the GUI or the CLI.
If you click “Workflow Editor” and “Create New”, you will see a blank page in the workflow editor.
Now you can either click the ellipses (...
) menu in the lower right and select “Edit YAML” or
simply press e
on your keyboard. An editor with a Fuzzfile stub will appear.
You can delete the current contents and copy and paste the workflow definition of from above.
Now pressing “save” will return you to the interactive workflow editor. You will now see the
printer
job instead of a blank editor page. The Fuzzball GUI will automatically validate the
yaml file for syntax errors.
Submitting your workflow to Fuzzball with the GUI is easy. Simply press the triangular “Start Workflow” button in the lower right corner of the workflow editor. You will be prompted to provide an optional descriptive name for your workflow.
Now you can click on “Start Workflow” in the lower right corner of the dialog box and your workflow will be submitted. If you click “Go to Status” you can view the workflow status page. The screenshot below shows the status page for a printer workflow submission.
To retrieve logs produced by this workflow, select the printer
job within the workflow, and
click the “Logs” option on the right.
To run this workflow through the CLI you will need access to the Fuzzball CLI. You can install it using the Fuzzball CLI installation instructions.
First, you can create a Fuzzfile printer.fz
with the contents above using the text editor of your
choice.
You can start start this workflow using the CLI by running the following command:
$ fuzzball workflow start printer.fz
Workflow "065e8665-f025-4247-8783-d4abdb7723be" started.
You can monitor the workflow’s status by running the following command:
$ fuzzball workflow describe <workflow UUID>
Name: printer.yaml
Email: bphan@ciq.co
UserId: e554e134-bd2d-455b-896e-bc24d8d9f81e
Status: STAGE_STATUS_STARTED
Created: 2024-06-27 01:56:58PM
Started: 2024-06-27 01:56:58PM
Finished: N/A
Error:
Stages:
KIND | STATUS | NAME | STARTED | FINISHED
Workflow | Started | 42bc8d9b-6b20-4b8a-824a-b83cdc610a1c | 2024-06-27 01:56:58PM | N/A
Image | Finished | docker://alpine:latest | 2024-06-27 01:56:59PM | 2024-06-27 01:57:14PM
Job | Started | printer | 2024-06-27 01:57:28PM | N/A
You can view outputs logged by the workflow, by executing the following command:
$ fuzzball workflow log <workflow UUID> printer
1
2
3
4
...