Skip to content

Add agentic deploy scripts, CRDs, and operator integration#1582

Draft
harche wants to merge 1 commit into
openshift:mainfrom
harche:wt/e2e-testing
Draft

Add agentic deploy scripts, CRDs, and operator integration#1582
harche wants to merge 1 commit into
openshift:mainfrom
harche:wt/e2e-testing

Conversation

@harche
Copy link
Copy Markdown

@harche harche commented Apr 30, 2026

Summary

  • Adds agentic stack deployment infrastructure to lightspeed-operator
  • Deploy scripts (hack/agentic/): deploy.sh for full deploy with on-cluster builds (--provider=vertex|bedrock), redeploy-{operator,agent,console,skills,all}.sh for fast iteration, undeploy.sh for teardown, lib.sh with shared build helpers (parallel builds, worktree-safe image tags)
  • Operator integration: Wires agentic controller in cmd/main.go with --agentic-console-image and --agentic-sandbox-image flags
  • Agentic CRDs: ApprovalPolicy, Agent, LLMProvider, Proposal, result CRDs (analysis, execution, verification, escalation)
  • RBAC: Agentic controller roles in config/rbac-agentic/
  • Dockerfile.dev: Local module builds for agentic-operator dependency
  • Build/CI: Tekton pipelines, integration test scenarios, OLM bundle manifests, catalog updates, related images

Test plan

  • make test — unit tests pass
  • KUBECONFIG=... bash hack/agentic/deploy.sh --provider=vertex — full deploy on fresh cluster
  • KUBECONFIG=... bash hack/agentic/redeploy-operator.sh — fast iteration works
  • Verify proposals work end-to-end on deployed cluster
  • KUBECONFIG=... bash hack/agentic/undeploy.sh — clean teardown

🤖 Generated with Claude Code

@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 30, 2026
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Apr 30, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci openshift-ci Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 30, 2026
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Apr 30, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign raptorsun for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Comment thread hack/agentic/lib.sh
update_crds_and_rbac() {
step "Updating CRDs and RBAC"
cd "${OPERATOR_DIR}"
make manifests kustomize >/dev/null 2>&1
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Developer experience hint, many commands throw the output away, so the script fails without giving reasons why.

My agent suggests something like and I tent to agree

_run() {
    local _out
    _out=$(mktemp)
    if "$@" >"${_out}" 2>&1; then
        rm -f "${_out}"
    else
        local _rc=$?
        echo -e "    ${RED}${NC} Command failed: $*" >&2
        cat "${_out}" >&2
        rm -f "${_out}"
        return ${_rc}
    fi
}

Comment thread hack/agentic/lib.sh Outdated
# Step 3: AgenticConfig — Cluster Admin
# Approval policy, console/sandbox images, concurrency limits.
###########################################################################
local AGENT_IMAGE="${INTERNAL_REG}/${NS_OPERATOR}/lightspeed-agentic-sandbox:${TAG}"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
local AGENT_IMAGE="${INTERNAL_REG}/${NS_OPERATOR}/lightspeed-agentic-sandbox:${TAG}"
local AGENT_IMAGE="${INTERNAL_REG}/${NS_OPERATOR}/${BC_AGENT}:${TAG}"

Comment thread hack/agentic/lib.sh
Comment on lines +373 to +374
local OPERATOR_IMG="${INTERNAL_REG}/${NS_OPERATOR}/lightspeed-operator:${TAG}"
local CONSOLE_IMG="${INTERNAL_REG}/${NS_OPERATOR}/lightspeed-console-plugin:${TAG}"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
local OPERATOR_IMG="${INTERNAL_REG}/${NS_OPERATOR}/lightspeed-operator:${TAG}"
local CONSOLE_IMG="${INTERNAL_REG}/${NS_OPERATOR}/lightspeed-console-plugin:${TAG}"
local OPERATOR_IMG="${INTERNAL_REG}/${NS_OPERATOR}/${BC_OPERATOR}:${TAG}"
local CONSOLE_IMG="${INTERNAL_REG}/${NS_OPERATOR}/${BC_CONSOLE}:${TAG}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Given all the other envs are also set in one place, might make sense to do this for _IMG vars as well. I see the SKILLS_IMAGE in redeploy.sh as well… the consistency could help a bit.

I know it's just a dev script, but still…

Comment thread hack/agentic/lib.sh
-p "{\"spec\":{\"output\":{\"to\":{\"name\":\"${bc_name}:${TAG}\"}}}}" >/dev/null 2>&1
echo " Building ${label} on cluster (uploading source)..."
oc start-build "${bc_name}" -n "${NS_OPERATOR}" \
--from-dir="${from_dir}" --follow \
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

needs --wait as well, otherwise it returns 0 even on failure.

Comment thread hack/agentic/lib.sh
# Uploads the source directory to a builder pod, which runs the Dockerfile
# natively on amd64 and pushes to the internal registry — no local container
# engine, cross-compilation, registry route, or auth tokens needed.
build_on_cluster() {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

given build_on_cluster and start_build_async are very similar, how about having just _build sync and _build async and handle the differences in particular places.

@openshift-ci openshift-ci Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 12, 2026
@harche harche changed the title WIP: Agentic deploy scripts, Dockerfile.dev, and CRD fixes Add agentic deploy scripts, CRDs, and operator integration May 12, 2026
Adds the agentic stack deployment infrastructure to lightspeed-operator:

Deploy scripts (hack/agentic/):
- deploy.sh: Full deploy with on-cluster builds (--provider=vertex|bedrock)
- redeploy-{operator,agent,console,skills,all}.sh: Fast iteration scripts
- undeploy.sh: Teardown with optional GCP SA cleanup
- lib.sh: Shared build helpers (parallel builds, worktree-safe image tags)

Operator integration:
- cmd/main.go: Wire agentic controller with --agentic-console-image and
  --agentic-sandbox-image flags
- Agentic CRDs: ApprovalPolicy, Agent, LLMProvider, Proposal, results
- config/rbac-agentic/: RBAC for agentic controller
- Dockerfile.dev: Local module builds for agentic-operator dependency

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@harche
Copy link
Copy Markdown
Author

harche commented May 12, 2026

Great feedback @iNecas , thanks, I will update the PR and test with those changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants