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 three 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"

API key — e.g. for a service account; sent in the X-API-Key header (override the header name with FIRECREST_API_KEY_HEADER):

export FIRECREST_URL=http://localhost:8000
export FIRECREST_API_KEY=my-api-key

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.10.0.tar.gz (89.0 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.10.0-py3-none-any.whl (97.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pyfirecrest-3.10.0.tar.gz
Algorithm Hash digest
SHA256 cad5271bcd868fa9651ea12af9c3d5dfa4e08e8853108adcbe5c4b1301e129a5
MD5 31b7e2fbeef91f86e6472b661aab3c8e
BLAKE2b-256 971aa9e1ba26bda4ce2fbc7ac7ada2683a7c749a4f34bb7abb004c8047a57b4d

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pyfirecrest-3.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f90e9b5083e3471a66f26ecf23d4bc0afdede9de214349747134d0ad1423cae9
MD5 ae6c46c5a8af3d862811937a12edcd26
BLAKE2b-256 3da082a6620cd0eed0202374f840444f3750077170598c30f45cbfaf8e008e7f

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

3.10.0 This release

2 files

3.9.0

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