Skip to content

Commit 8420727

Browse files
mprpicclaude
andauthored
RHOAIENG-48052: Scheduled sessions (#864)
Introduce scheduled sessions that let users create cron-based schedules for automatically launching agentic sessions. The feature spans all layers of the platform: Backend: CRUD handlers for scheduled sessions backed by Kubernetes CronJobs, with suspend/resume, manual trigger, and run-history endpoints. Auth checks delegate to the user's token while CronJob operations use the backend service account. Operator: session-trigger subcommand that runs inside CronJob-spawned pods, reads a session template from env vars, and creates an AgenticSession CR. ProjectSettings reconciler ensures per-namespace RBAC (ServiceAccount, Role, RoleBinding) for the trigger SA. Frontend: Schedules tab in the project workspace, create dialog with cron presets and expression preview, detail page with run history, Next.js API route proxies, React Query hooks, and TypeScript types. Manifests: Backend ClusterRole gains CronJob and Job/create permissions, operator ClusterRole gains AgenticSession/create, backend deployment reads OPERATOR_IMAGE and IMAGE_PULL_POLICY from operator-config ConfigMap, Vertex AI config keys made optional to avoid clobbering. Includes unit tests for backend helpers (sanitizeLabelValue, cronJobToScheduledSession), operator trigger (sanitizeName), operator RBAC (ensureSessionTriggerRBAC), frontend query hooks, and cron utils. --------- Signed-off-by: Martin Prpič <mprpic@redhat.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 3f8f78b commit 8420727

48 files changed

Lines changed: 3448 additions & 755 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -780,6 +780,14 @@ kind-rebuild: check-kind check-kubectl check-local-context build-all ## Rebuild,
780780
@kubectl rollout restart deployment -n $(NAMESPACE) $(QUIET_REDIRECT)
781781
@kubectl rollout status deployment -n $(NAMESPACE) --timeout=120s $(QUIET_REDIRECT)
782782
@echo "$(COLOR_GREEN)$(COLOR_RESET) All components rebuilt and restarted"
783+
@# Re-apply Vertex AI setup if requested (kind-rebuild re-applies manifests which resets ConfigMap)
784+
@if [ "$(LOCAL_VERTEX)" = "true" ]; then \
785+
echo "$(COLOR_BLUE)$(COLOR_RESET) Re-configuring Vertex AI..."; \
786+
ANTHROPIC_VERTEX_PROJECT_ID="$(ANTHROPIC_VERTEX_PROJECT_ID)" \
787+
CLOUD_ML_REGION="$(CLOUD_ML_REGION)" \
788+
GOOGLE_APPLICATION_CREDENTIALS="$(GOOGLE_APPLICATION_CREDENTIALS)" \
789+
./scripts/setup-vertex-kind.sh; \
790+
fi
783791

784792
kind-status: ## Show all kind clusters and their port assignments
785793
@echo "$(COLOR_BOLD)Kind Cluster Status$(COLOR_RESET)"

0 commit comments

Comments
 (0)