Fuzzball Documentation
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

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.

Please select either the GUI or CLI tab to see the appropriate instructions for your environment.

If you click “Workflow Editor” and “Create New”, you will see a blank page in the workflow editor.

Fuzzball create new workflow section

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.

Fuzzball editor newly opened

You can delete the current contents and copy and paste the workflow definition of from above.

Fuzzball editor copied and pasted printer workflow

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.

Fuzzball workflow editor with printer

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.

Fuzzball name workflow and submit screen

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.

Fuzzball workflow status page

To retrieve logs produced by this workflow, select the printer job within the workflow, and click the “Logs” option on the right.

Fuzzball workflow dashboard showing logs from the printer job

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
...