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:
- Python 3.10+ installed on your system
- A Science Platform account - For CANFAR, request an account with CADC
Installation¶
Install Skaha using pip
:
Virtual Environments
We recommend using a virtual environment to avoid conflicts with other packages:
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:
This command will:
- Discover available servers worldwide
- Guide you through server selection
- Handle the authentication process (X.509 or OIDC)
- Save your credentials for future use
Example Login Flow
Using Skaha Programmatically¶
Once authenticated via CLI, you can use Skaha in your Python code:
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:
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:
- Try our 5-Minute Quick Start for a hands-on introduction to creating and managing sessions.
- Learn about Authentication Contexts for managing multiple servers and advanced authentication scenarios.
- Explore Basic Examples and Advanced Examples for common use cases.
- Check out the Python API Reference for detailed documentation of all available methods.
- Refer to the FAQ for answers to common questions.
Getting Help
- ๐ Complete CLI Reference
- ๐ฌ Community Discussions
- ๐ Report Issues