Skip to main content

A simple async workflow engine for interfacing with FirecREST.

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fireflow-0.0.1.tar.gz (30.6 kB view details)

Uploaded Source

Built Distribution

fireflow-0.0.1-py3-none-any.whl (30.5 kB view details)

Uploaded Python 3

File details

Details for the file fireflow-0.0.1.tar.gz.

File metadata

  • Download URL: fireflow-0.0.1.tar.gz
  • Upload date:
  • Size: 30.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.28.1

File hashes

Hashes for fireflow-0.0.1.tar.gz
Algorithm Hash digest
SHA256 c03b2335dbb5909c554a2b736a37fbd757bc405844f7b698b2345a2d7542190d
MD5 72f44b6e0d50618bd57833ff1ee91967
BLAKE2b-256 7049aa93cc5e5444f69e64b88c44651b2140dbca4e6d0b8d396de0a8bc2496c0

See more details on using hashes here.

File details

Details for the file fireflow-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: fireflow-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 30.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.28.1

File hashes

Hashes for fireflow-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a7bae75fc0eb150981409c25efaf47651c122f966394fbfde7ef8ff67b547e73
MD5 38f8a31ee5a6bdb95b983fa2330dba04
BLAKE2b-256 51f9351cc626ab49c4426385baaccba0fa87bfac1f24db19f65a71ec54684776

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page