Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions NEW.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# OpenShift Dev Spaces for AI / ML

See [Old README](DEVSPACES.md)

This repo's content has been moved to [Demo - OpenShift GPUs](https://github.com/redhat-na-ssa/demo-ocp-gpu) and is no longer being maintained.
46 changes: 35 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,40 @@ This repo demos helps show the value of OpenShift and OpenShift Dev Spaces as a

### Prerequisites

- [x] Red Hat OpenShift Cluster 4.10+
- [x] Red Hat OpenShift Cluster 4.16+
- [x] Cluster admin permissions

The following cli tools are required:
[Red Hat Demo Platform](https://demo.redhat.com) Options (Tested)

- `bash`, `git`
- `oc` - Download [mac](https://formulae.brew.sh/formula/openshift-cli), [linux](https://mirror.openshift.com/pub/openshift-v4/clients/ocp), [windows](https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable/openshift-client-windows.zip)
- `kubectl` (optional) - Included in `oc` bundle
- `kustomize` (optional) - Download [mac](https://formulae.brew.sh/formula/kustomize), [linux](https://github.com/kubernetes-sigs/kustomize/releases)
NOTE: The node sizes below are the **recommended minimum** to select for provisioning

NOTE: `bash`, `git`, and `oc` are available in the [OpenShift Web Terminal](https://docs.openshift.com/container-platform/4.12/web_console/web_terminal/installing-web-terminal.html)
- <a href="https://demo.redhat.com/catalog?item=babylon-catalog-prod/sandboxes-gpte.sandbox-ocp.prod&utm_source=webapp&utm_medium=share-link" target="_blank">AWS with OpenShift Open Environment</a>
- 1 x Control Plane - `m6a.2xlarge`
- 0 x Workers - `m6a.2xlarge`
- <a href="https://demo.redhat.com/catalog?item=babylon-catalog-prod/sandboxes-gpte.ocp4-single-node.prod&utm_source=webapp&utm_medium=share-link" target="_blank">One Node OpenShift</a>
- 1 x Control Plane - `m6a.2xlarge`
- <a href="https://demo.redhat.com/catalog?item=babylon-catalog-prod/community-content.com-mlops-wksp.prod&utm_source=webapp&utm_medium=share-link" target="_blank">MLOps Demo: Data Science & Edge Practice</a>

## Getting Started

### Install the [OpenShift Web Terminal](https://docs.openshift.com/container-platform/4.12/web_console/web_terminal/installing-web-terminal.html)

The following icon should appear in the top right of the OpenShift web console after you have installed the operator. Clicking this icon launches the web terminal.

![Web Terminal](docs/images/web-terminal.png "Web Terminal")

### From a terminal

```
```sh
# start in a bash shell
# (this means you mac users; zsh)
bash

# oc login to your cluster
# oc login --token=<yours> --server=https://<yours>
oc whoami
```

```sh
# git clone demo
git clone https://github.com/redhat-na-ssa/demo-ai-devspaces.git
cd demo-ai-devspaces
Expand All @@ -45,14 +56,14 @@ cd demo-ai-devspaces

### Uninstall

```
```sh
# WARNING: Be certain you want your cluster returned to a vanilla state
. ./scripts/bootstrap.sh

delete_demo
```

## Quickstart
## Walkthrough

- Launch DevSpaces from the waffle menu on the OCP Web Console

Expand All @@ -74,6 +85,19 @@ delete_demo

## Additional Resources

### Tools

The following cli tools are required:

- `bash`, `git`
- `oc` - Download [mac](https://formulae.brew.sh/formula/openshift-cli), [linux](https://mirror.openshift.com/pub/openshift-v4/clients/ocp), [windows](https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable/openshift-client-windows.zip)
- `kubectl` (optional) - Included in `oc` bundle
- `kustomize` (optional) - Download [mac](https://formulae.brew.sh/formula/kustomize), [linux](https://github.com/kubernetes-sigs/kustomize/releases)

NOTE: `bash`, `git`, and `oc` are available in the [OpenShift Web Terminal](https://docs.openshift.com/container-platform/4.12/web_console/web_terminal/installing-web-terminal.html)

### Links

OpenShift Dev Spaces

- [OpenShift Dev Spaces - Overview](https://developers.redhat.com/products/openshift-dev-spaces/overview)
Expand Down
2 changes: 1 addition & 1 deletion devfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ projects:
components:
- container:
# image: image-registry.openshift-image-registry.svc:5000/registry/udi-cuda:latest
image: ghcr.io/redhat-na-ssa/udi-cuda:11.8.0-cudnn8-devel-ubi8-python39
image: ghcr.io/redhat-na-ssa/udi-cuda:12.6.3-cudnn-devel-ubi8-python311
sourceMapping: /projects
name: universal-developer-image
attributes:
Expand Down
Binary file added docs/images/web-terminal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 0 additions & 7 deletions gitops/00-operators/kustomization.yaml

This file was deleted.

6 changes: 6 additions & 0 deletions gitops/00-web-console/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component

resources:
- subscription.yaml
- web-terminal-tooling.yaml
11 changes: 11 additions & 0 deletions gitops/00-web-console/subscription.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: web-terminal
namespace: openshift-operators
spec:
channel: fast
installPlanApproval: Automatic
name: web-terminal
source: redhat-operators
sourceNamespace: openshift-marketplace
40 changes: 40 additions & 0 deletions gitops/00-web-console/web-terminal-tooling.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
apiVersion: workspace.devfile.io/v1alpha2
kind: DevWorkspaceTemplate
metadata:
annotations:
controller.devfile.io/allow-import-from: '*'
web-terminal.redhat.com/unmanaged-state: 'true'
name: web-terminal-tooling
namespace: openshift-operators
labels:
console.openshift.io/terminal: 'true'
spec:
components:
- container:
args:
- "/bin/bash"
- "-c"
- |
#!/bin/bash

echo "
GIT_REPO=https://github.com/redhat-na-ssa/demo-ai-devspaces.git
GIT_DIR=demo-ai-devspaces

[ -e ~/\${GIT_DIR} ] || git clone \${GIT_REPO}
[ -e ~/\${GIT_DIR} ] && cd ~/\${GIT_DIR}

" >> /home/user/.bashrc

. /home/user/.bashrc

sleep infinity # just in case

cpuLimit: 400m
cpuRequest: 100m
image: ghcr.io/redhat-na-ssa/web-terminal-tooling:latest
memoryLimit: 512Mi
memoryRequest: 128Mi
mountSources: false
sourceMapping: /projects
name: web-terminal-tooling
7 changes: 0 additions & 7 deletions gitops/01-operator-configs/kustomization.yaml

This file was deleted.

7 changes: 7 additions & 0 deletions gitops/01-operators/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- https://github.com/redhat-na-ssa/demo-ai-gitops-catalog/components/operators/devspaces/operator/overlays/stable?ref=v0.03
- https://github.com/redhat-na-ssa/demo-ai-gitops-catalog/components/operators/gpu-operator-certified/operator/overlays/stable?ref=v0.03
- https://github.com/redhat-na-ssa/demo-ai-gitops-catalog/components/operators/nfd/operator/overlays/stable?ref=v0.03
6 changes: 0 additions & 6 deletions gitops/02-components/kustomization.yaml

This file was deleted.

7 changes: 7 additions & 0 deletions gitops/02-operator-configs/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- https://github.com/redhat-na-ssa/demo-ai-gitops-catalog/components/operators/devspaces/instance/overlays/timeout-12m?ref=v0.03
- https://github.com/redhat-na-ssa/demo-ai-gitops-catalog/components/operators/gpu-operator-certified/instance/overlays/aws-time-sliced-2?ref=v0.03
- https://github.com/redhat-na-ssa/demo-ai-gitops-catalog/components/operators/nfd/instance/overlays/only-nvidia?ref=v0.03
6 changes: 6 additions & 0 deletions gitops/03-components/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- https://github.com/redhat-na-ssa/demo-ai-gitops-catalog/components/configs/kustomized/minio/overlays/with-namespace?ref=v0.03
- link-github.yaml
2 changes: 1 addition & 1 deletion gitops/cluster-default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- https://github.com/codekow/demo-ai-gitops-catalog/clusters/default?ref=v0.03
- https://github.com/redhat-na-ssa/demo-ai-gitops-catalog/clusters/default?ref=v0.03
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- https://github.com/codekow/demo-ai-gitops-catalog/demos/devspaces-nvidia-gpu-autoscale?ref=v0.03
- https://github.com/redhat-na-ssa/demo-ai-gitops-catalog/demos/overlays/devspaces-nvidia-gpu-autoscale?ref=v0.17
2 changes: 1 addition & 1 deletion gitops/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ kind: Kustomization
resources:
# - 00-operators
# - 01-operator-configs
- 02-components
- 03-components
- demo-devspaces-nvidia-gpu-autoscale

patches:
Expand Down
12 changes: 6 additions & 6 deletions scripts/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ is_sourced() {
return 1 # NOT sourced.
}

################# misc fucntions ################
################# misc functions ################

ocp_check_login(){
oc whoami || return 1
Expand Down Expand Up @@ -79,7 +79,7 @@ until_true(){
check_cluster_version(){
OCP_VERSION=$(oc version | sed -n '/Server Version: / s/Server Version: //p')
AVOID_VERSIONS=()
TESTED_VERSIONS=("4.12.12" "4.12.33" "4.13.13")
TESTED_VERSIONS=("4.12.12" "4.12.33" "4.13.13" "4.18.20")

echo "Current OCP version: ${OCP_VERSION}"
echo "Tested OCP version(s): ${TESTED_VERSIONS[*]}"
Expand Down Expand Up @@ -116,7 +116,7 @@ setup_demo(){
}

delete_demo(){
echo "WARNING: This will remove operators and other compoents!"
echo "WARNING: This will remove operators and other components!"
echo "WARNING: Manually clean up on a cluster that is not a default install"
echo "Hit <CTRL> + C to abort"
sleep "${SLEEP_SECONDS:-8}"
Expand All @@ -127,9 +127,9 @@ delete_demo(){
oc delete --wait -l operators.coreos.com/devspaces.openshift-operators csv -A

# standard demo uninstall
oc delete --wait -k gitops/02-components
oc delete --wait -k gitops/01-operator-configs
oc delete --wait -k gitops/00-operators
oc delete --wait -k gitops/03-components
oc delete --wait -k gitops/02-operator-configs
oc delete --wait -k gitops/01-operators
oc delete --wait -k gitops
}

Expand Down