Skip to content

Installation & Setup

This guide covers everything you need to install and configure Skaha for use with Science Platform servers worldwide.

New to Skaha?

If you want to jump right in with a hands-on tutorial, check out our 5-Minute Quick Start guide first!

Prerequisites

Before you can use Skaha, you need:

Installation

Install Skaha using pip:

Bash
pip install skaha --upgrade

Virtual Environments

We recommend using a virtual environment to avoid conflicts with other packages:

Bash
python -m venv skaha-env
source skaha-env/bin/activate  # On Windows: skaha-env\Scripts\activate
pip install skaha

Authentication Setup

Skaha uses an authentication context system to manage connections to multiple Science Platform servers. The easiest way to get started is with the CLI login command.

Quick Authentication

To authenticate with a Science Platform server:

Bash
skaha auth login

This command will:

  1. Discover available servers worldwide
  2. Guide you through server selection
  3. Handle the authentication process (X.509 or OIDC)
  4. Save your credentials for future use

Example Login Flow

Bash
$ skaha auth login
Starting Science Platform Login
Discovery completed in 2.1s (5/18 active)

Select a Skaha Server:
ยป ๐ŸŸข CANFAR  CADC
  ๐ŸŸข Canada  SRCnet
  ๐ŸŸข UK-CAM  SRCnet

X509 Certificate Authentication
Username: your-username
Password: ***********
โœ“ Login completed successfully!

Using Skaha Programmatically

Once authenticated via CLI, you can use Skaha in your Python code:

Python
from skaha.session import Session
from skaha.images import Images

# Uses your active authentication context
session = Session()
images = Images()

# List available images
container_images = images.fetch()
print(f"Found {len(container_images)} container images")

# Create a notebook session
session_info = session.create(
    kind="notebook",
    image="images.canfar.net/skaha/base-notebook:latest",
    name="my-analysis",
    cores=2,
    ram=4
)
print(f"Created session: {session_info.id}")

Private Container Images

To access private container images from registries like CANFAR Harbor, provide registry credentials:

Python
from skaha.models import ContainerRegistry
from skaha.session import Session

# Configure registry access
registry = ContainerRegistry(
    username="your-username",
    password="**************"
)

# Use with session
session = Session(registry=registry)

# Now you can use private images
session_info = session.create(
    kind="notebook",
    image="images.canfar.net/private/my-image:latest",
    cores=1,
    ram=2
)

Registry Credentials

The registry credentials are base64 encoded and passed to the server via the X-Skaha-Registry-Auth header.

Next Steps

Now that you have Skaha installed and configured:

Getting Help