Add agentic deploy scripts, CRDs, and operator integration#1582
Conversation
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
| update_crds_and_rbac() { | ||
| step "Updating CRDs and RBAC" | ||
| cd "${OPERATOR_DIR}" | ||
| make manifests kustomize >/dev/null 2>&1 |
There was a problem hiding this comment.
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
}| # Step 3: AgenticConfig — Cluster Admin | ||
| # Approval policy, console/sandbox images, concurrency limits. | ||
| ########################################################################### | ||
| local AGENT_IMAGE="${INTERNAL_REG}/${NS_OPERATOR}/lightspeed-agentic-sandbox:${TAG}" |
There was a problem hiding this comment.
| local AGENT_IMAGE="${INTERNAL_REG}/${NS_OPERATOR}/lightspeed-agentic-sandbox:${TAG}" | |
| local AGENT_IMAGE="${INTERNAL_REG}/${NS_OPERATOR}/${BC_AGENT}:${TAG}" |
| local OPERATOR_IMG="${INTERNAL_REG}/${NS_OPERATOR}/lightspeed-operator:${TAG}" | ||
| local CONSOLE_IMG="${INTERNAL_REG}/${NS_OPERATOR}/lightspeed-console-plugin:${TAG}" |
There was a problem hiding this comment.
| 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}" |
There was a problem hiding this comment.
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…
| -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 \ |
There was a problem hiding this comment.
needs --wait as well, otherwise it returns 0 even on failure.
| # 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() { |
There was a problem hiding this comment.
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.
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>
|
Great feedback @iNecas , thanks, I will update the PR and test with those changes. |
Summary
hack/agentic/):deploy.shfor full deploy with on-cluster builds (--provider=vertex|bedrock),redeploy-{operator,agent,console,skills,all}.shfor fast iteration,undeploy.shfor teardown,lib.shwith shared build helpers (parallel builds, worktree-safe image tags)cmd/main.gowith--agentic-console-imageand--agentic-sandbox-imageflagsconfig/rbac-agentic/Test plan
make test— unit tests passKUBECONFIG=... bash hack/agentic/deploy.sh --provider=vertex— full deploy on fresh clusterKUBECONFIG=... bash hack/agentic/redeploy-operator.sh— fast iteration worksKUBECONFIG=... bash hack/agentic/undeploy.sh— clean teardown🤖 Generated with Claude Code