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
57 changes: 47 additions & 10 deletions hack/quickstart/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Quickstart

Deploy Agentic OLS onto an OpenShift cluster using pre-built Konflux images.
No building, no cloning required.
Optionally installs Lightspeed Operator via OLM (`operator-sdk run bundle` from
git `related_images.json`). No building or cloning of this repo is required.

## Prerequisites

Expand All @@ -11,44 +12,80 @@ No building, no cloning required.

## Install

Download the script, then run it (required for interactive Lightspeed Operator prompts):

```bash
bash <(curl -sL https://raw.githubusercontent.com/openshift/lightspeed-agentic-operator/main/hack/quickstart/install.sh)
curl -fsSL -o install-agentic.sh \
https://raw.githubusercontent.com/openshift/lightspeed-agentic-operator/main/hack/quickstart/install.sh
bash install-agentic.sh
Comment on lines +18 to +20

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Make the download-and-execute step fail closed.

If curl fails, the shell still runs bash install-agentic.sh, potentially executing a stale file from a previous attempt. Chain execution on download success or download to a temporary file and execute only after a successful transfer.

Proposed fix
-curl -fsSL -o install-agentic.sh \
+curl -fsSL -o install-agentic.sh \
   https://raw.githubusercontent.com/openshift/lightspeed-agentic-operator/main/hack/quickstart/install.sh
-bash install-agentic.sh
+&& bash install-agentic.sh
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@hack/quickstart/README.md` around lines 18 - 20, Update the quickstart
download-and-execute commands so bash install-agentic.sh runs only when curl
successfully downloads install.sh, using command chaining or a temporary-file
workflow; preserve the existing installer URL and execution behavior after a
successful transfer.

```

The script installs CRDs, deploys the operator, and creates an ApprovalPolicy.
Do **not** use `curl … | bash` — stdin is the script, so `y`/`n` prompts cannot work.

The script:

1. Detects whether Lightspeed Operator is installed (`OLSConfig` CRD).
2. Optionally prompts to **install** or **update** it from
[`openshift/lightspeed-operator` `related_images.json`](https://github.com/openshift/lightspeed-operator/blob/main/related_images.json)
(git ref `OLS_GIT_REF`, default `main`) via `operator-sdk run bundle`.
3. After a successful OLS install/update: writes/exports an `OLSConfig` file
(`OLS_CONFIG_FILE`), lets you edit/apply in a loop, and waits until
`status.overallStatus=Ready` (dumps diagnostics on failure).
4. On decline of a fresh install only, creates an empty
`lightspeed-otel-collector-client` ConfigMap so agentic can start without OLS
(not recommended — agentic may function incorrectly).
5. Installs Agentic Operator CRDs, Deployment, ApprovalPolicy, and webhook.

After completion it prints instructions for configuring an LLM provider and
submitting a test run.

## Uninstall

Download the script, then run it (required for interactive Lightspeed Operator prompts):

```bash
bash <(curl -sL https://raw.githubusercontent.com/openshift/lightspeed-agentic-operator/main/hack/quickstart/uninstall.sh)
curl -fsSL -o uninstall-agentic.sh \
https://raw.githubusercontent.com/openshift/lightspeed-agentic-operator/main/hack/quickstart/uninstall.sh
bash uninstall-agentic.sh
```

Skip the confirmation prompt with `QUICKSTART_FORCE=1`.
Do **not** use `curl … | bash` — stdin is the script, so `y`/`n` prompts cannot work.

The script removes Agentic Operator resources and CRDs, and asks whether to also
uninstall Lightspeed Operator via `operator-sdk cleanup`. Declining leaves OLS
installed and keeps the namespace.

Skip the top-level confirmation with `QUICKSTART_FORCE=1`. For non-interactive
OLS decisions, set `REMOVE_OLS=1` (uninstall OLS) or `REMOVE_OLS=0` (keep OLS).

## Environment Variables

| Variable | Default | Description |
|---|---|---|
| `NAMESPACE` | `openshift-lightspeed` | Target namespace |
| `OPERATOR_IMAGE` | Konflux `:main` | Operator container image |
| `OPERATOR_IMAGE` | Konflux `:main` | Agentic operator container image |
| `SANDBOX_IMAGE` | Konflux `:main` | Agent sandbox container image |
| `SANDBOX_MODE` | `bare-pod` | Sandbox mode (`bare-pod` or `sandbox-claim`) |
| `IMAGE_PULL_POLICY` | *(empty — Kubernetes default)* | Image pull policy for operator and sandbox pods (`Always`, `IfNotPresent`, `Never`) |
| `OLS_GIT_REF` | `main` | Git ref for `openshift/lightspeed-operator` `related_images.json` |
| `OLS_RELATED_IMAGES_URL` | raw GitHub URL for that ref | Override the related_images.json URL |
| `BUNDLE_TIMEOUT` | `30m` | `operator-sdk run bundle` timeout |
| `OLS_CONFIG_FILE` | `$TMPDIR/olsconfig-quickstart.yaml` | Path for the editable OLSConfig manifest |
| `OLS_CONFIG_TIMEOUT_SEC` | `900` | Seconds to wait for `OLSConfig` `overallStatus=Ready` |
| `AGENTIC_ROLLOUT_TIMEOUT` | `300s` | `oc rollout status` timeout for the agentic Deployment |
| `REMOVE_OLS` | *(unset — prompt)* | Uninstall: `1` remove Lightspeed Operator, `0` keep it |
| `CLEANUP_TIMEOUT` | `5m` | Uninstall: `operator-sdk cleanup` timeout |

Example with overrides:

```bash
NAMESPACE=my-ns SANDBOX_MODE=sandbox-claim \
bash <(curl -sL https://raw.githubusercontent.com/openshift/lightspeed-agentic-operator/main/hack/quickstart/install.sh)
NAMESPACE=my-ns SANDBOX_MODE=sandbox-claim bash install-agentic.sh
```

For dev environments with floating tags like `:main`, force fresh pulls:

```bash
IMAGE_PULL_POLICY=Always \
bash <(curl -sL https://raw.githubusercontent.com/openshift/lightspeed-agentic-operator/main/hack/quickstart/install.sh)
IMAGE_PULL_POLICY=Always bash install-agentic.sh
```

## LLM Provider Examples
Expand Down
Loading