The Fovus Python CLI
Project description
Getting Started With The Fovus CLI
The official CLI tool for interacting with the Fovus Serverless HPC Platform. Installation, setup, and usage documentation is provided here. Further detail is available via the CLI --help command or at our CLI documentation website.
Features include job creation (with validation), job status checking, and job file downloading. In addition, reusable job and user configurations with optional command-line overriding are supported. Additional features are detailed in this README and in our help documentation (linked above).
Installation
Prerequisites
- Python and pip installation: https://www.python.org/downloads/
- Click the "Download Python" button.
- Select ALL of the following according to your operating system:
- Windows
- Install pip (should be selected by default).
- Add Python to PATH.
- Add Python to environment variables (this is generally found under "Customize Installation" and should be automatically enabled if you selected "Add Python to PATH").
- Unix-based OS
- Install or upgrade pip (under Customize)
- Shell profile updater (under Customize)
- Windows
- Close and reopen your Command Prompt/PowerShell (Windows) or terminal (Unix-based systems).
- Install fovus using pip with the following command:
pip install fovus
Note:
-
The pip package is usually bundled with Python. If you have Python and you don't have pip, you can install pip at the following link: https://pip.pypa.io/en/stable/installation/.
-
Windows: If you encounter a command not found error and have already installed Python, try re-running the Python installer, selecting "Modify". In the following menus (you may have to click "Next"), select the following options:
- Install pip (should be selected by default).
- Add Python to environment variables.
-
Unix-based OS: If you encounter any Python-related issues, try reinstalling Python according to the instructions above.
Initial Setup
Before use, set up the following:
- Make sure you have an account with https://app.fovus.co
- Authenticate your account through the Fovus CLI
Authentication
To login with your Fovus credentials, run the command:
fovus auth login
To logout from the Fovus CLI, run the command:
fovus auth logout
To view the current user and workspace information or verify whether a user is authenticated, run the command:
fovus auth user
Windows - Python Can't Find Script
-
In "Run" (Windows + R), enter
sysdm.cpl -
System Properties will open up. Go to Advanced -> Environment Variables
-
Under "User variables for xxx", click the variable labeled "Path"
-
Click the "Edit" button under the "User variables for xxx" section
-
Click the "New" button in the "Edit environment variables" pane that opens
-
In the terminal you used to install the Fovus CLI, run the following command:
pip show fovus(this will show a message similar to the sample output provided after these instructions) -
Copy the "Location" value from the output of the above command (e.g.,
C:\Users\TestFovusUser\AppData\Local\Programs\Python\Python311\Lib\site-packages) and paste it as a new environment variable. Once it is pasted, replace the\Lib\site-packageswith\Scripts(e.g.,C:\Users\TestFovusUser\AppData\Local\Programs\Python\Python311\Scripts) -
Click "OK" on all open environment variable windows.
Sample output for pip show fovus (reference from step 6 above):
PS C:\Users\TestFovusUser> pip show fovus
Name: fovus
Version: 1.0.6
Summary: The Fovus Python CLI
Home-page:
Author: Fovus Corporation
Author-email:
License:
Location: C:\Users\TestFovusUser\AppData\Local\Programs\Python\Python311\Lib\site-packages
Requires: boto3, dateparser, jsonschema, pycognito, requests, tqdm
Required-by:
Note: If the above fails, try reinstalling/modifying your Python and pip installation following the instructions under the "Prerequisites" section above.
Basic Usage
See the "Advanced Usage" section for additional options regarding file inclusion/exclusion for create job and download job files.
Viewing Your Config Files
fovus config open
Note:
- Contains empty job and user config files for reference and copying.
Creating Jobs
This command will upload files from the specified directory to Fovus and create a job.
Upon job creation:
- The following will be validated: your job configuration structure (if provided as JSON), your job configuration values against your chosen benchmarking profile, and your software configurations (if job is monolithic).
- A
.fovusfolder will be created in your local file root directory, which will contain ajob_data.jsonfile (i.e.,/path/to/job/file/root/directory/.fovus/job_data.json. This json is used to facilitate checking job status and downloading job files by tracking the job'sjobID.
fovus job create "/path/to/job/config/file.json" "/path/to/job/file/root/directory"
Note:
- To create your own job template, you have two options:
- Create a job config through the Fovus web app:
- Login to the Fovus web app.
- Click "Create job" in the top right corner.
- Fill in all sections of the form. Uploading files is not necessary.
- Click the "Export" button in the top right corner. This will download a JSON file that you can use as a template.
- Create a job config from an existing JSON template:
- Open the fovus config folder with
fovus config open. - Make a copy of either
~/.fovus/job_configs/FOVUS_job_template_containerized.jsonor~/.fovus/job_configs FOVUS_job_template_monolithic.json. - IMPORTANT: rename your copy, or it will be overwritten.
- Fill in the fields.
- Open the fovus config folder with
- Create a job config through the Fovus web app:
- Each subdirectory in your job file root directory will be treated as its own task.
- Folder and file names must only contain the following characters: a–z, A–Z, 0–9, hyphen (-), underscore (_), period (.), exclamation mark (!), and parentheses (()).
- You can add the optional argument
--job-name "your_job_name_here"to set a custom job name.
Getting Job Status
If you created the job using the Fovus CLI on the same local machine (i.e., the .fovus folder was created in your job root directory -- see "Creating job" section for details):
fovus job status --job-directory "/path/to/job/file/root/directory
If you did not create the job using the Fovus CLI:
fovus job status --job-id "your_job_id"
Note:
- Job ID is viewable in the Web UI.
Downloading Completed Job Files
If you created the job using the Fovus CLI on the same local machine (i.e., the .fovus folder was created in your job root directory -- see "Creating job" section for details):
fovus job download "/path/to/job/file/root/directory"
If you did not create the job using the Fovus CLI:
fovus job download "/path/to/job/file/root/directory" --job-id "your_job_id"
Note:
- Only new or updated files will be downloaded (checked using file hash).
Uploading Files to Fovus Storage
To upload files or directories to Fovus storage for archival, sharing, use in jobs, or access from workstations, utilize the following command:
fovus storage upload "/path/to/file/directory/or/file"
To upload a file to a specific path within the My Files section of Fovus storage, you can append the path within My Files to the command:
fovus storage upload "/path/to/file/directory/or/file" "your/destination/path"
Mounting Fovus Storage as a Network Drive
Supported operating systems: Windows, Ubuntu, CentOS, and Redhat.
To mount Fovus Storage as a network drive on your local machine, use the following command:
fovus storage mount
Supported file operations: sequential & random read, sequential write, overwrite, delete
Job files are read-only.
The Fovus Storage network file system does not support modifying existing files directly. To modify a file, overwrite it instead. We recommend using Fovus Storage as a cloud archive instead of a working directory due to suboptimal performance and usability.
Fovus Storage will be mounted as a network file system at /fovus-storage/ on Linux or <WindowsDrive>:\fovus-storage\ on Windows.
Advanced Usage
Include/Exclude File Patterns
When creating a job, the arguments --include-paths and --exclude-paths are available to you. These arguments are used to include/exclude filepaths for upload/download. Valid values for these arguments are alphanumeric along with the wildcards: * (matches any number of characters), ? (matches any single character).
For example:
--include-paths "Car*/*" "config?/*"includes:- All files under any directory that begins with
Car. - All files in folders titled
configX, whereXis any character.
- All files under any directory that begins with
--exclude-paths "Car*/*.log" "local?/*"uploads all files except:- All
.logfiletypes within every directory that begins withCar. - All files in any directory titled
localXwhereXis any character.
- All
Usage With fovus job create
--include-pathswill only upload filepaths (relative to the job root directory) that match the expressions provided.--exclude-pathswill upload all filepaths except those that match the expression provided.
Usage With fovus job download
--include-pathswill only download filepaths (relative to the job root directory) that match the expressions provided.--exclude-pathswill download all filepaths except those that match the expression provided.
Overriding
Any value in a job config or a user config can be overriden by providing the respective json key as an argument. Examples are given below, and more details are available in --help.
Single-value Arguments
All single-value arguments (i.e., not lists) can be overriden using a single argument and a value. For example, the benchmarkingProfileName in your job config, you can do so by providing the argument --benchmarking-profile-name "your_benchmarking_profile_name_here".
Lists of Values
All lists of values can be overridden using a single argument and a list of values. For example, if you want to override the supportedCpuArchitectures in your job config, you can do so by providing the argument --supported-cpu-architectures "x86_64" "arm64".
Lists of Objects
Currently, the only list of objects that exists is the monolithicList, which is only used for monolithic jobs. The only value that can be overridden in a monolithicList is licenseCountPerTask. To do this, use the command --monolithic-override "vendor_name" "software_name" "license_feature" "your_new_license_count_here".
Note:
- The monolithicList object must already exist in the job config JSON.
- The vendor name, software name, and license feature are used to reference the specific object within the list and do not override existing values.
- If an object that does not match the given vendor name, software name, and license feature does not exist, an error will be thrown.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fovus-2.0.44-py3-none-any.whl.
File metadata
- Download URL: fovus-2.0.44-py3-none-any.whl
- Upload date:
- Size: 133.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a99b99df11c5fb3bb5348117e9bc5cf77338487f35a0f764bc04f04a14a96e57
|
|
| MD5 |
3698a66700db12c6145bc32d8fd6ba2b
|
|
| BLAKE2b-256 |
c99c4b5028f3c43acb6d4f4141a0948b7e7253fd2cfdb23d2faf488b50c2d1f1
|
Provenance
The following attestation bundles were made for fovus-2.0.44-py3-none-any.whl:
Publisher:
python-release.yml on Fovus/fovus-cli-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fovus-2.0.44-py3-none-any.whl -
Subject digest:
a99b99df11c5fb3bb5348117e9bc5cf77338487f35a0f764bc04f04a14a96e57 - Sigstore transparency entry: 855039949
- Sigstore integration time:
-
Permalink:
Fovus/fovus-cli-python@c85a43191062ce061f4547f607c464b5cf499247 -
Branch / Tag:
refs/tags/2.0.44 - Owner: https://github.com/Fovus
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-release.yml@c85a43191062ce061f4547f607c464b5cf499247 -
Trigger Event:
release
-
Statement type: