Adding Integrations

Kaspian supports integrations with several external services, including AWS/GCP, Github, and Slack.

Amazon Web Services (AWS)

Kaspian relies on an existing AWS account where it will host the compute and some elements of data storage. An IAM role for Kaspian services to assume should be created to facilitate this. The IAM Role ARN and AWS region are required for Kaspian to function.

This role requires a limited set of access policies to ensure the services work and have access to Kaspian-specific resources. Please contact Kaspian support for instructions on setting this up.

Google Cloud Platform (GCP)

For those who use GCP, Kaspian runs in its own project. Access to this project is provided via a service account using a Workload Identity Pool, eliminating the need to provide Kaspian with private key JSON files.

Microsoft Azure

Support for Microsoft Azure is coming soon.

Git

GitHub

Code storage for Kaspian pipelines can be hosted on GitHub. In order to access the Github repo, Kaspian needs a GitHub personal access token (PAT) with read permissions for the account. This is a required piece of information.

Instructions to create a personal access token can be found here. Only repo permissions need to be provided.

GitLab

Code can also be hosted on GitLab. GitLab supports personal access tokens as well as project access tokens (for Premium users and above). When generating a token, you must select the read_api and read_repository scopes.

Bitbucket

Support for Bitbucket is coming soon.

Specifying Repository Entrypoints

GitHub/GitLab integrations can be scoped to individual repositories (or paths within those repositories) using entrypoints.
Start by clicking the highlighted + within the integration form.

In the form that appears, enter the information as described below:

  1. Owner: Github/Gitlab organization or individual who owns the repository, e.g. Kaspian-Inc
  2. Repository: Repository name, as it appears on GitHub or GitLab
  3. Ref (Optional): Specific branch name or commit hash
  4. Path: PYTHONPATH relative to the directory’s root, e.g. / if at the root, or /path/to/python/code/
  5. Regular Expression: Regex specifying which directories to include within the repo, e.g. .* for all repo content

Slack

To send notifications in the event of a pipeline error, Kaspian supports an optional Slack integration. Setting up this integration requires a Slack app OAuth token for the desired workspace (detailed instructions below).

To obtain an app access token, first create a custom Slack app. The most direct way to create an app is via an “app manifest,” which is a YAML-formatted specification for an app’s information and permissions, such as:

_metadata:
  major_version: 1
  minor_version: 1
display_information:
  name: kaspian-bot
features:
  bot_user:
    display_name: kasper
    always_online: false
oauth_config:
  scopes:
    bot:
      - channels:join
      - channels:read
      - chat:write
settings:
  org_deploy_enabled: false
  socket_mode_enabled: false
  token_rotation_enabled: false

To create a custom Slack app, follow the below steps:

  1. Visit the Slack API site, and sign in.
  2. Click Create New App > From an app manifest
  3. Select the workspace to install the app in, and hit Next
  4. Paste the above app manifest YAML and hit Next
  5. Click Create, which will redirect to an app management page
  6. On the left sidebar, go to OAuth & Permissions
  7. Click Install to Workspace under the section titled OAuth Tokens for Your Workspace
  8. Copy the token that appears under the field titled Bot User OAuth Token (it should begin with xoxb)

Once the app is created and linked to a Slack workspace, provide the access token in the Slack integration form.

Microsoft Teams

Kaspian’s Microsoft Teams integration supports the Incoming Webhooks feature. To set up this integration, first create a new incoming webhook in the desired channel. Instructions for this can be found here. In the Kaspian form, simply enter the channel and the configured webhook URL.