Skip to main content

PyFirecREST

This is a simple python wrapper for the FirecREST API.

How to install

  • Through PyPI:

    python3 -m pip install pyfirecrest
    

How to use it as a python package

The full documentation of pyFirecREST is in this page but you can get an idea from the following example. This is how you can use the testbuild from the demo environment here. The configuration corresponds to the account firecrest-sample.

import firecrest as f7t

# Configuration parameters for the Authorization Object
client_id = "firecrest-sample"
client_secret = "b391e177-fa50-4987-beaf-e6d33ca93571"
token_uri = "http://localhost:8080/auth/realms/kcrealm/protocol/openid-connect/token"

# Create an authorization object with Client Credentials authorization grant
keycloak = f7t.ClientCredentialsAuth(
    client_id, client_secret, token_uri
)

# Setup the v2 client
client = f7t.v2.Firecrest(
    firecrest_url="http://localhost:8000", authorization=keycloak
)

try:
    systems = client.systems()
    print(f"Available systems: {systems}")
except f7t.FirecrestException as e:
    # When the error comes from the responses to a firecrest request you will get a
    # `FirecrestException` and from this you can examine the http responses yourself
    # through the `responses` property
    print(e)
    print(e.responses)
except Exception as e:
    # You might also get regular exceptions in some cases. For example when you are
    # trying to upload a file that doesn't exist in your local filesystem.
    pass

How to use it from the terminal

The CLI defaults to FirecREST v2. It supports two authentication modes.

Client credentials — set the following environment variables:

export FIRECREST_URL=http://localhost:8000
export FIRECREST_CLIENT_ID=firecrest-sample
export FIRECREST_CLIENT_SECRET=b391e177-fa50-4987-beaf-e6d33ca93571
export AUTH_TOKEN_URL=http://localhost:8080/auth/realms/kcrealm/protocol/openid-connect/token

Token command — set a shell command whose stdout is the bearer token (re-run on each request for automatic refresh):

export FIRECREST_URL=http://localhost:8000
export FIRECREST_TOKEN_COMMAND="my-org-cli auth token"

After that you can explore the capabilities of the CLI with the --help option:

firecrest --help
firecrest ls --help
firecrest submit --help
firecrest upload --help
firecrest download --help

Some basic examples:

# Get the available systems
firecrest systems

# Set the environment variable to specify the name of the system
export FIRECREST_SYSTEM="cluster"

# Get the user and group information for the current user on the selected system
firecrest id

# List files of directory
firecrest ls /home

# Submit a job
firecrest submit --working-dir /home/user script.sh

# Upload a file to the cluster filesystem
firecrest upload local_file.txt /path/to/cluster/fs remote_file.txt

Download files

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

Source Distribution

pyfirecrest-3.9.0.tar.gz (87.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyfirecrest-3.9.0-py3-none-any.whl (95.7 kB view details)

Uploaded Python 3

File details

Details for the file pyfirecrest-3.9.0.tar.gz.

File metadata

  • Download URL: pyfirecrest-3.9.0.tar.gz
  • Upload date:
  • Size: 87.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.34.2

File hashes

Hashes for pyfirecrest-3.9.0.tar.gz
Algorithm Hash digest
SHA256 62caf78801192423e0262a16f16420bfd7a017ce9adf7fe95392b08285927767
MD5 aa28b371cb755ef6f152038bb62bdc6c
BLAKE2b-256 ff37e206cfbbb8667ff5d0d1ab6ad16f774d7b9b25547063ad10f753b2ecee43

See more details on using hashes here.

File details

Details for the file pyfirecrest-3.9.0-py3-none-any.whl.

File metadata

  • Download URL: pyfirecrest-3.9.0-py3-none-any.whl
  • Upload date:
  • Size: 95.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.34.2

File hashes

Hashes for pyfirecrest-3.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5d815376d2fc1d29b8b50d65a6af9a0fca31c44d3fd83f91aee631fef64e6b73
MD5 5a526be5a71d4712cc4355a012c13094
BLAKE2b-256 ec97eb72344df167ee2093e157bc8d551d10177d9135d24d95c7bea5ea5a71a4

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

3.9.0 This release

2 files

3.8.1

2 files

3.8.0

2 files

3.7.1

2 files

3.7.0

2 files

3.6.0

2 files

3.5.1

2 files

3.5.0

2 files

3.4.0

2 files

3.3.1

2 files

3.3.0

2 files

3.2.2

2 files

3.2.1

2 files

3.2.0

2 files

3.1.0

2 files

3.0.1

2 files

3.0.0

2 files

2.7.0

2 files

2.6.0

2 files

2.5.0

2 files

2.4.0

2 files

2.3.0

2 files

2.2.1

2 files

2.2.0

2 files

2.1.0

2 files

2.0.0

2 files

1.5.1

2 files

1.5.0

2 files

1.4.0

2 files

1.3.0

2 files

1.2.0

2 files

1.1.0

2 files

1.0.0

2 files

0.0.12

2 files

0.0.11

2 files

0.0.10

2 files

0.0.9

2 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