Skip to main content

fireflow

A simple async workflow engine for interfacing with FirecREST.

The workflow engine uses pyfirecrest to interface with the REST API.

See also the https://github.com/eth-cscs/firecrest demo server.

Usage

After installing the package, the fireflow command is available.

You can then create a workflow database from a YAML file, such as example_setup.yml:

clients:
  - label: test-client
    client_url: "http://localhost:8000/"
    client_id: "firecrest-sample"
    client_secret: "b391e177-fa50-4987-beaf-e6d33ca93571"
    token_uri: "http://localhost:8080/auth/realms/kcrealm/protocol/openid-connect/token"
    machine_name: "cluster"
    work_dir: "/home/service-account-firecrest-sample"
    small_file_size_mb: 5
codes:
  - label: test-code1
    client_label: test-client
    script: |
      #!/bin/bash
      #SBATCH --job-name={{ calc.uuid }}
      mkdir -p output
      echo '{{ calc.parameters.echo_string }}' > output.txt
calcjobs:
  - label: test-calcjob1
    code_label: test-code1
    parameters:
      echo_string: "Hello world!"
    download_globs:
    - output.txt
  - label: test-calcjob2
    code_label: test-code1
    parameters:
      echo_string: "Hello world 2!"
    download_globs:
    - output.txt

Then run fireflow init -a example_setup.yaml, which will create a database in a .fireflow_project folder.

You can list all the calcjobs with:

$ fireflow calcjob tree
Calcjobs 1-2 of 2
└── 1 - test-client
    └── 1 - test-code1
        ├── 1 - test-calcjob1 ▶
        └── 2 - test-calcjob2 ▶

You can then run all the calcjobs with:

$ fireflow run
2023-02-07 20:10:58:fireflow.process:REPORT: PK-1: Uploading files to remote
2023-02-07 20:11:00:fireflow.process:REPORT: PK-2: Uploading files to remote
2023-02-07 20:11:01:fireflow.process:REPORT: PK-1: submitting on remote
2023-02-07 20:11:03:fireflow.process:REPORT: PK-2: submitting on remote
2023-02-07 20:11:05:fireflow.process:REPORT: PK-1: polling job until finished
2023-02-07 20:11:06:fireflow.process:REPORT: PK-2: polling job until finished
2023-02-07 20:11:08:fireflow.process:REPORT: PK-1: copying from remote folder
2023-02-07 20:11:09:fireflow.process:REPORT: PK-2: copying from remote folder
2023-02-07 20:11:13:fireflow.process:REPORT: PK-1: parsing output files
2023-02-07 20:11:13:fireflow.process:REPORT: PK-1: paths: ['job.sh', 'output.txt', 'slurm-147.out']
2023-02-07 20:11:13:fireflow.process:REPORT: PK-2: parsing output files
2023-02-07 20:11:13:fireflow.process:REPORT: PK-2: paths: ['slurm-148.out', 'job.sh', 'output.txt']

The calcjobs run asynchronously, with the steps:

  • prepare for submission: create the job script
  • copying to remote folder: copy the job script and input files to the remote folder
  • submitting on remote: submit the job script to the scheduler
  • polling job until finished: poll the job status until it is finished
  • copying from remote folder: copy the output files from the remote folder
  • parsing output files: parse the output files and store the results in the database

Aims

  • Minimise the number of requests to the server

Upstream o AiiDA

https://chat.openai.com/chat/e453e10b-19fd-46a8-9cfb-0c8d31d1a60d

Release files for fireflow 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fireflow 0.0.1
File Size Uploaded
fireflow-0.0.1.tar.gz 30.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fireflow 0.0.1
File Interpreter ABI Platform
fireflow-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 61.2 kB

Release files / fireflow-0.0.1.tar.gz

Download URL fireflow-0.0.1.tar.gz
Size 30.6 kB
Tags Source
SHA-256 checksum
How to use checksums
c03b2335dbb5909c554a2b736a37fbd757bc405844f7b698b2345a2d7542190d
BLAKE2b-256 checksum
How to use checksums
7049aa93cc5e5444f69e64b88c44651b2140dbca4e6d0b8d396de0a8bc2496c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.28.1

Release files / fireflow-0.0.1-py3-none-any.whl

Download URL fireflow-0.0.1-py3-none-any.whl
Size 30.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a7bae75fc0eb150981409c25efaf47651c122f966394fbfde7ef8ff67b547e73
BLAKE2b-256 checksum
How to use checksums
51f9351cc626ab49c4426385baaccba0fa87bfac1f24db19f65a71ec54684776
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.28.1

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page