Skip to main content

fabrictestbed-extensions

pypi-badge api-docs-badge

This is the implementation of a Python library, otherwise known as "FABlib", for interacting with FABRIC testbed.

Your first encounter with FABlib might be through FABRIC project's JupyterHub instance, where FABlib is pre-installed for you. You will be presented with many examples of interacting with FABRIC testbed and FABlib usage when you log in there. Those notebook sources can be found on GitHub as well.

If you want to interact with FABRIC from Jupyter or a Python project on your local development environment, that is possible too. See Install the FABRIC Python API and the notes below for details.

FABlib API docs can be found here. If you have questions about FABRIC or FABlib usage, please ask them in FABRIC forums.

Installing FABlib

You can install released versions of FABlib from PyPI:

$ pip install fabrictestbed-extensions

If you need the current development version of FABlib, install it from the git repository:

$ pip install git+https://github.com/fabric-testbed/fabrictestbed-extensions@main

Note that installing FABlib using either methods will also install a number of dependencies, so you might want to install FABlib in a virtual environment. Your favorite tool for managing virtual environments (venv, virtualenv, or virtualenvwrapper) should work. FABRIC team tends to favor virtualenvwrapper.

NOTE: This package has been tested and verified to work with Python versions 3.11 through 3.14.

Using FABlib

Once installed, you can use FABlib in your Python projects:

from fabrictestbed_extensions.fablib.fablib import FablibManager as fablib_manager

try:
    fablib = fablib_manager()
    fablib.show_config()
except Exception as e:
    print(f"Exception: {e}")

Please note that some configuration is required for this to work.

Command-Line Interface

FABlib includes a CLI tool (fabric-cli) that is automatically installed with the package. It provides commands for token management, slice operations, resource queries, user info, and environment setup — all from the terminal.

Quick start

# One-time setup: creates tokens, SSH keys, ssh_config, and fabric_rc
$ fabric-cli configure setup

# List your slices
$ fabric-cli slices list

# Check available testbed sites
$ fabric-cli resources sites

Configuration

The CLI resolves settings from (highest to lowest priority):

  1. Command-line options (--cmhost, --location, etc.)
  2. Environment variables (FABRIC_CREDMGR_HOST, FABRIC_TOKEN_LOCATION, etc.)
  3. Config file at ~/work/fabric_config/fabric_rc
  4. Built-in defaults

Commands

fabric-cli configure setup

Interactive first-time setup. Creates the config directory, obtains a token via browser-based CILogon authentication, generates bastion and sliver SSH keys, and writes ssh_config and fabric_rc files. Re-run to refresh expired tokens automatically; use --overwrite to regenerate everything.

When --config-dir is specified, all files are read from and written to that directory. An existing fabric_rc in the directory is used for configuration; default paths outside the directory are not consulted.

$ fabric-cli configure setup
$ fabric-cli configure setup --config-dir ~/my_fabric_config --overwrite

fabric-cli tokens

Manage FABRIC identity tokens.

$ fabric-cli tokens create                    # Create a new token (opens browser)
$ fabric-cli tokens create --no-browser       # Print URL instead of opening browser
$ fabric-cli tokens create --location ~/my_tokens/id_token.json  # Save to custom path
$ fabric-cli tokens refresh                   # Refresh an existing token
$ fabric-cli tokens revoke                    # Revoke a token

fabric-cli slices

List, inspect, renew, and delete slices.

$ fabric-cli slices list                      # List active slices
$ fabric-cli slices list --all                # Include Dead and Closing slices
$ fabric-cli slices show --name MySlice       # Show slice details
$ fabric-cli slices delete --name MySlice     # Delete a slice
$ fabric-cli slices renew --name MySlice --days 7  # Extend lease by 7 days
$ fabric-cli slices nodes --name MySlice      # List nodes in a slice
$ fabric-cli slices networks --name MySlice   # List networks in a slice
$ fabric-cli slices interfaces --name MySlice # List interfaces in a slice
$ fabric-cli slices slivers --name MySlice    # List slivers in a slice

fabric-cli resources

Query testbed resources.

$ fabric-cli resources sites                  # List all sites with usage bars
$ fabric-cli resources sites --site TACC      # Show details for a specific site
$ fabric-cli resources hosts                  # List all hosts
$ fabric-cli resources hosts --site TACC      # Filter hosts by site
$ fabric-cli resources links                  # List inter-site network links
$ fabric-cli resources facility-ports         # List facility ports

fabric-cli user

Query user and project information.

$ fabric-cli user info                        # Show current user info
$ fabric-cli user projects                    # List your projects

Common options

Most commands accept the following options:

Option Description
--cmhost Credential Manager host
--ochost Orchestrator host
--location Path to token JSON file
--projectid Project UUID
--scope Token scope (cf, mf, or all)
--json Output raw JSON instead of formatted text

Help

Use --help on any command or subcommand for full usage details:

$ fabric-cli --help
$ fabric-cli slices --help
$ fabric-cli tokens create --help

Contributing to FABlib

We welcome contributions in the form of bug reports, feature requests, code patches, documentation updates, etc. If you have ideas that can help FABlib, please review the guidelines first.

Download files

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

Source Distribution

fabrictestbed_extensions-2.0.9.tar.gz (498.3 kB view details)

Uploaded Source

Built Distribution

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

fabrictestbed_extensions-2.0.9-py3-none-any.whl (521.5 kB view details)

Uploaded Python 3

File details

Details for the file fabrictestbed_extensions-2.0.9.tar.gz.

File metadata

  • Download URL: fabrictestbed_extensions-2.0.9.tar.gz
  • Upload date:
  • Size: 498.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for fabrictestbed_extensions-2.0.9.tar.gz
Algorithm Hash digest
SHA256 05920f3bbc111c5896a98fe2dc4d62567a1e5dd0b3bdb0f44024fda4fe954032
MD5 4db16c9641dbbd4592a426c23b965fb1
BLAKE2b-256 532ad1c6ac46feb33fe3c06b9005eaa09f553d6dddefc3565897c8eaa511688b

See more details on using hashes here.

Provenance

The following attestation bundles were made for fabrictestbed_extensions-2.0.9.tar.gz:

Publisher: publish.yml on fabric-testbed/fabrictestbed-extensions

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fabrictestbed_extensions-2.0.9-py3-none-any.whl.

File metadata

File hashes

Hashes for fabrictestbed_extensions-2.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 43a841bf82903d28ee2bf7e47c2aff2acfd8635c1d7793085fcb64fd599a4cc9
MD5 eaf54e3e4a1c9946ac6e37323d64caf9
BLAKE2b-256 829fd9f735a8827863aa671eaefb1d2b07336b22da57defcb60fcb069a8e639e

See more details on using hashes here.

Provenance

The following attestation bundles were made for fabrictestbed_extensions-2.0.9-py3-none-any.whl:

Publisher: publish.yml on fabric-testbed/fabrictestbed-extensions

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

2.0.9 This release

2 files

2.0.8

2 files

2.0.7

2 files

2.0.6

2 files

2.0.5

2 files

2.0.4

2 files

2.0.3

2 files

2.0.2

2 files

2.0.1

2 files

2.0.0

2 files

1.9.6

2 files

1.9.5

2 files

1.9.4

2 files

1.9.3

2 files

1.9.2

2 files

1.9.1

2 files

1.9.0

2 files

1.8.1

2 files

1.8.0

2 files

1.7.4

2 files

1.7.3

2 files

1.7.2

2 files

1.7.1

2 files

1.7.0

2 files

1.6.4

2 files

1.6.3

2 files

1.6.2

2 files

1.6.1

2 files

1.6.0

2 files

1.5.6

2 files

1.5.5

2 files

1.5.4

2 files

1.5.3

2 files

1.5.2

2 files

1.5.1

2 files

1.5.0

2 files

1.4.6

2 files

1.4.5

2 files

1.4.4

2 files

1.4.3

2 files

1.4.2

2 files

1.4.1

2 files

1.4.0

2 files

1.3.4

2 files

1.3.3

2 files

1.3.2

2 files

1.3.1

2 files

1.3.0

2 files

1.2.4

2 files

1.2.3

2 files

1.2.2

2 files

1.2.1

2 files

1.2

2 files

1.1.3

2 files

1.1.2

2 files

1.1.1

2 files

1.1

2 files

0.3

2 files

0.2

2 files

0.1

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