Skip to content

Latest commit

 

History

History
163 lines (121 loc) · 4.38 KB

stability-stable-studio.md

File metadata and controls

163 lines (121 loc) · 4.38 KB

StableStudio (Stability.ai) for RHODS

This document explains how to build and install StableStudio from Stability.ai on RHODS

Requirements:

  • Openshift >= v4.13
  • RHODS installed

Deployment Options

Currently, there are two different ways to install StableStudio on RHODS:

  1. External application: Can be accesses from RHODS, but is running de-coupled of RHODS, as a separate deployment.
  2. As a Built-in Notebook Image, in the Notebook Servers section.

Installing as external application

This method is not official or supported, but feel free to use it if it's more convenient in your case.

The code and manifests are available here on this GH Repo. Please, follow the next steps:

  1. Cloning repo of StableStudio
# Getting code
git clone https://github.com/r2dedios/StableStudio.git
cd StableStudio
git checkout rhods-integration

# Creating project
export NS="stable-studio"
oc new-project $NS
  1. Build a container image to be deployed on Openshift. There are two different ways to do this. Building it locally or using Openshift internal registry

    1. BuildConfig
    # Build Config for obtain and build the image, and push it into Openshift internal registry
    oc apply -f manifests/openshift/build-config.yaml
    
    oc start-build stable-studio-image
    # Wait for image building finish
    1. Local Building
    export IMAGE_ORG="<your-organization>"
    export IMAGE_SERVER="quay.io"
    export IMAGE_TAG="latest"
    
    
    podman build -t stable-studio:v0.1.0 -f ./manifests/Containerfile .
    podman tag localhost/stable-studio:v0.1.0 $IMAGE_SERVER/$IMAGE_ORG/stable-studio:latest
    podman push $IMAGE_SERVER/$IMAGE_ORG/stable-studio:latest
  2. Deploy the application

# Configure container image
vim manifests/openshift/stable-studio.yaml
#  -   21         - image: quay.io/avillega/stable-studio:latest
#  +   21         - image: quay.io/<YOUR_ORGANIZATION>/stable-studio:latest

# Deploys Deployment.apps,Service,Route and SA
oc apply -f manifests/openshift/stable-studio.yaml

# Assign 'anyuid' SCC to StableStudio ServiceAccount to allow running with an specific UID
oc adm policy add-scc-to-user anyuid -z stable-studio
  1. Once the application is running, create the route to expose the service by HTTPS
oc apply -f manifests/openshift/rhods-tile.yaml
  1. Create ConfigMap to enable the App
oc apply -f - << _EOF_
kind: ConfigMap
apiVersion: v1
metadata:
  name: stable-studio-enable
  namespace: redhat-ods-applications
data:
  validation_result: 'true'
_EOF_
  1. Get RHODS Route
oc get routes rhods-dashboard -n redhat-ods-applications -o jsonpath={.spec.host}
  1. Access to the console, and login.

  2. Check StableStudio is ready to be used SS_ENABLED

  3. Click on 'Launch Application' to open a new tab on StableStudio console

Install as a Builtin Notebook Image

This method will deploy StableStudio as a Notebook image.

  1. Cloning repo of workbench-images
# Getting code
git clone https://github.com/r2dedios/workbench-images.git
cd workbench-images
git checkout stability-studio-bundle
  1. Build a container image to be deployed as a Notebook Image
# Set image Name
image_name=stable-studio-rhel9-no_py-_2023c_20231117

# Building image
cd recipes/${image_name}
podman build -t workbench-images:${image_name} .
  1. Push images
# Set quay organization
IMAGE_ORG="<YOUR_ORGANIZATION>"

# Check is image is present
podman images --format "{{.Repository}}:{{.Tag}}" | grep $image_name > /dev/null 2>&1

# Push
podman push localhost/workbench-images:$image_name quay.io/${IMAGE_ORG}/workbench-images:$image_name
podman push localhost/workbench-images:$image_name quay.io/${IMAGE_ORG}/workbench-images:${image_name::-8}latest

# Go back to root folder
cd -
  1. Once the image is pushed, let's go to RHODS console to add the new Notebook image
oc get routes rhods-dashboard -n redhat-ods-applications -o jsonpath={.spec.host}
  1. Add Notebook image ADD_NOTEBOOK_IMAGE

  2. Create Notebook ADD_NOTEBOOK_IMAGE

  3. Start Notebook ADD_NOTEBOOK_IMAGE

  4. Notebook Started

STARTED_NOTEBOOK