Skip to content
Merged
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
23 changes: 8 additions & 15 deletions hack/quickstart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ directly — no OLM bundle or `operator-sdk` required.
- A checkout of this repository (scripts reference each other via relative paths)
- `oc` CLI on PATH, logged into an OpenShift 4.22+ cluster
- cluster-admin privileges
- `python3` and `curl` on PATH (for automatic image resolution from Quay)
- `openssl` on PATH (for Postgres password generation, only with `--postgres`)
- `python3` and `openssl` on PATH

## Install

Expand Down Expand Up @@ -75,8 +74,8 @@ bash hack/quickstart/undeploy-otel.sh
| `--operator-image=IMAGE` | Agentic operator image (default: Konflux `:main`) |
| `--sandbox-image=IMAGE` | Sandbox image for the ConfigMap PodSpec (default: Konflux `:main`) |
| `--console-image=IMAGE` | Console plugin image (default: Konflux `:main`) |
| `--alerts-adapter-image=IMAGE` | Alerts adapter image (default: resolved from Quay) |
| `--otel-image=IMAGE` | OTEL collector image (default: resolved from Quay) |
| `--alerts-adapter-image=IMAGE` | Alerts adapter image (default: Konflux `:main`) |
| `--otel-image=IMAGE` | OTEL collector image (default: Konflux `:main`) |
| `--postgres` | Deploy Postgres backend for OTEL audit logs |

### Individual scripts
Expand All @@ -85,23 +84,17 @@ bash hack/quickstart/undeploy-otel.sh
|--------|------|---------|
| `deploy-operator.sh` | `--image=IMAGE` | Konflux `:main` |
| `deploy-console.sh` | `--image=IMAGE` | Konflux `:main` |
| `deploy-alerts-adapter.sh` | `--image=IMAGE` | Resolved from Quay (newest git SHA tag) |
| `deploy-otel.sh` | `--image=IMAGE` | Resolved from Quay (newest `on-pr-*` tag) |
| `deploy-alerts-adapter.sh` | `--image=IMAGE` | Konflux `:main` |
| `deploy-otel.sh` | `--image=IMAGE` | Konflux `:main` |
| `deploy-otel.sh` | `--postgres` | Deploy Postgres backend for audit logs |
| `deploy-configmap.sh` | `--sandbox-image=IMAGE` | Konflux `:main` |

Images with a Konflux `:main` tag use it directly. Images without a `:main`
tag (alerts adapter, OTEL collector) are resolved from Quay at runtime by
finding the most recent build tag.
All images use the Konflux floating `:main` tag by default.

## Image resolution

The **operator**, **sandbox**, and **console** images are built by this repo's
Konflux push pipeline and have a floating `:main` tag.

The **alerts adapter** and **OTEL collector** are built by the same Konflux
tenant (`crt-nshift-lightspeed-tenant`). They do not have `:main` tags, so the
deploy scripts query the Quay API to find the latest build automatically.
All quickstart images are built by the Konflux push pipeline under the same
tenant (`crt-nshift-lightspeed-tenant`) and have a floating `:main` tag.
Comment thread
coderabbitai[bot] marked this conversation as resolved.

To use a specific PR build of the agentic operator:

Expand Down
20 changes: 2 additions & 18 deletions hack/quickstart/deploy-alerts-adapter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,12 @@
# - Namespace openshift-lightspeed exists
#
# Flags:
# --image=IMAGE Alerts adapter image. If omitted, resolves the latest
# build from Quay automatically.
# --image=IMAGE Alerts adapter image (default: Konflux :main).

set -euo pipefail

NAMESPACE="${NAMESPACE:-openshift-lightspeed}"
ALERTS_ADAPTER_IMAGE=""
QUAY_REPO="redhat-user-workloads/crt-nshift-lightspeed-tenant/lightspeed-agentic-alerts-adapter"
ALERTS_ADAPTER_IMAGE="quay.io/redhat-user-workloads/crt-nshift-lightspeed-tenant/lightspeed-agentic-alerts-adapter:main"

while [ $# -gt 0 ]; do
case "$1" in
Expand All @@ -32,20 +30,6 @@ while [ $# -gt 0 ]; do
esac
done

if [ -z "${ALERTS_ADAPTER_IMAGE}" ]; then
echo " Resolving latest alerts adapter image from Quay..."
TAG="$(curl -fsSL "https://quay.io/api/v1/repository/${QUAY_REPO}/tag/?limit=100&onlyActiveTags=true" \
| python3 -c "
import json,sys,re
tags = json.load(sys.stdin)['tags']
pat = re.compile(r'^(on-pr-)?[0-9a-f]{40}$')
tag = next((t['name'] for t in sorted(tags, key=lambda t: t['start_ts'], reverse=True) if pat.match(t['name'])), None)
if not tag: sys.exit('No matching tag found in Quay repo')
print(tag)
")" || { echo "Failed to resolve image from Quay. Use --image=IMAGE." >&2; exit 1; }
ALERTS_ADAPTER_IMAGE="quay.io/${QUAY_REPO}:${TAG}"
echo " Resolved: ${ALERTS_ADAPTER_IMAGE}"
fi

ADAPTER_NAME="lightspeed-agentic-alerts-adapter"
ALERTMANAGER_URL="https://alertmanager-main.openshift-monitoring.svc:9094"
Expand Down
22 changes: 3 additions & 19 deletions hack/quickstart/deploy-otel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,14 @@
# - Namespace openshift-lightspeed exists
#
# Flags:
# --image=IMAGE OTEL collector image. If omitted, resolves the latest
# build from Quay automatically.
# --image=IMAGE OTEL collector image (default: Konflux :main).
# --postgres Deploy Postgres and wire the collector to export logs to it.

set -euo pipefail

NAMESPACE="${NAMESPACE:-openshift-lightspeed}"
OTEL_IMAGE=""
OTEL_IMAGE="quay.io/redhat-user-workloads/crt-nshift-lightspeed-tenant/lightspeed-otel-collector:main"
WITH_POSTGRES=0
QUAY_REPO="redhat-user-workloads/crt-nshift-lightspeed-tenant/lightspeed-otel-collector"

COLLECTOR_NAME="lightspeed-otel-collector"
CERT_SECRET="${COLLECTOR_NAME}-cert"
Expand All @@ -44,20 +42,6 @@ while [ $# -gt 0 ]; do
esac
done

if [ -z "${OTEL_IMAGE}" ]; then
echo " Resolving latest OTEL collector image from Quay..."
TAG="$(curl -fsSL "https://quay.io/api/v1/repository/${QUAY_REPO}/tag/?limit=100&onlyActiveTags=true" \
| python3 -c "
import json,sys,re
tags = json.load(sys.stdin)['tags']
pat = re.compile(r'^(on-pr-)?[0-9a-f]{40}$')
tag = next((t['name'] for t in sorted(tags, key=lambda t: t['start_ts'], reverse=True) if pat.match(t['name'])), None)
if not tag: sys.exit('No matching tag found in Quay repo')
print(tag)
")" || { echo "Failed to resolve image from Quay. Use --image=IMAGE." >&2; exit 1; }
OTEL_IMAGE="quay.io/${QUAY_REPO}:${TAG}"
echo " Resolved: ${OTEL_IMAGE}"
fi

info() { echo " ✓ $*"; }
step() { echo "[otel] $*"; }
Expand Down Expand Up @@ -135,7 +119,7 @@ COLLECTOR_CONFIG='
routing/logs:
default_pipelines: [logs/unmatched]
table:
- condition: "attributes[\"service.name\"] == \"lightspeed-agentic\""
- condition: "resource.attributes[\"service.name\"] == \"lightspeed-agentic-sandbox\""
pipelines: [logs/postgres]
extensions:
health_check:
Expand Down
11 changes: 4 additions & 7 deletions hack/quickstart/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ Options:
--operator-image=IMAGE Agentic operator image (default: Konflux :main)
--sandbox-image=IMAGE Sandbox image (default: Konflux :main)
--console-image=IMAGE Console plugin image (default: Konflux :main)
--alerts-adapter-image=IMAGE Alerts adapter image (default: resolved from Quay)
--otel-image=IMAGE OTEL collector image (default: resolved from Quay)
--alerts-adapter-image=IMAGE Alerts adapter image (default: Konflux :main)
--otel-image=IMAGE OTEL collector image (default: Konflux :main)
--postgres Deploy Postgres backend for OTEL audit logs
-h, --help Show this help and exit
EOF
Expand Down Expand Up @@ -76,11 +76,8 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
step "1/7 Checking prerequisites"

command -v oc >/dev/null 2>&1 || fail "oc CLI not found. Install it first."
command -v curl >/dev/null 2>&1 || fail "curl not found. Required for image resolution from Quay."
command -v python3 >/dev/null 2>&1 || fail "python3 not found. Required for image resolution from Quay."
if [ "${WITH_POSTGRES}" = "1" ]; then
command -v openssl >/dev/null 2>&1 || fail "openssl not found. Required for Postgres password generation."
fi
command -v python3 >/dev/null 2>&1 || fail "python3 not found. Required by deploy scripts."
command -v openssl >/dev/null 2>&1 || fail "openssl not found. Required by deploy scripts."
Comment on lines +79 to +80

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

rg -n -P '(^|[^[:alnum:]_])(curl|openssl)([^[:alnum:]_]|$)|--postgres' \
  hack/quickstart --glob '*.sh'

Repository: openshift/lightspeed-agentic-operator

Length of output: 1295


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

printf '--- install.sh outline ---\n'
ast-grep outline hack/quickstart/install.sh --view expanded || true

printf '\n--- install.sh relevant lines ---\n'
sed -n '1,140p' hack/quickstart/install.sh

printf '\n--- deploy scripts ---\n'
for f in hack/quickstart/deploy-otel.sh hack/quickstart/deploy-postgres.sh; do
  printf '\n### %s\n' "$f"
  sed -n '1,120p' "$f"
done

printf '\n--- curl/openssl occurrences under hack/quickstart ---\n'
rg -n --word-regexp 'curl|openssl' hack/quickstart --glob '*.sh' || true

Repository: openshift/lightspeed-agentic-operator

Length of output: 266


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

printf '%s\n' '--- install.sh outline ---'
ast-grep outline hack/quickstart/install.sh --view expanded || true

printf '%s\n' ''
printf '%s\n' '--- install.sh relevant lines ---'
sed -n '1,140p' hack/quickstart/install.sh

printf '%s\n' ''
printf '%s\n' '--- deploy scripts ---'
for f in hack/quickstart/deploy-otel.sh hack/quickstart/deploy-postgres.sh; do
  printf '%s\n' ""
  printf '%s\n' "### $f"
  sed -n '1,120p' "$f"
done

printf '%s\n' ''
printf '%s\n' '--- curl/openssl occurrences under hack/quickstart ---'
rg -n --word-regexp 'curl|openssl' hack/quickstart --glob '*.sh' || true

Repository: openshift/lightspeed-agentic-operator

Length of output: 13197


Make the Top-level openssl prerequisite conditional.

openssl is required only when --postgres is passed: hack/quickstart/deploy-otel.sh:54 checks it before Postgres deployment, and hack/quickstart/deploy-postgres.sh:32 uses openssl rand -base64 16. Keep this check conditional in hack/quickstart/install.sh:80, or document openssl as a global quickstart prerequisite.

🤖 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/install.sh` around lines 79 - 80, Make the openssl
prerequisite check in the install script conditional on the --postgres option,
while keeping the python3 check unconditional. Reuse the script’s existing
argument-parsing state or option variable to guard the command -v openssl
validation, ensuring non-Postgres quickstarts do not require openssl.

info "Required CLI tools found"

for script in deploy-otel.sh deploy-alerts-adapter.sh deploy-configmap.sh deploy-operator.sh deploy-console.sh; do
Expand Down