Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
27bf71a
feat(phase-2.1): remove copied InfrastructurePackBuild CRD YAML
ontave May 12, 2026
5a8cfb9
feat(phase-2.3+3.3-3.7): migrate dispatcher types from seam-core to w…
ontave May 12, 2026
6c37e7b
feat(migration-4.1): rename module path wrapper -> dispatcher
ontave May 12, 2026
ffeef42
chore: update replace directive to renamed seam directory
ontave May 12, 2026
c8edcef
migration(phase-5): update guardian GVK group references to guardian.…
ontave May 12, 2026
d5027f5
migration(phase-7.3): update dispatcher test comments from wrapper na…
ontave May 13, 2026
ef1bf5e
docs: session/25m -- Phase 8.3 dispatcher documentation rewrite
ontave May 13, 2026
3ebc64e
fix: update CI workflow (wrapper->dispatcher, seam-core->seam, add se…
ontave May 17, 2026
c0b96ae
feat(dispatcher): implement SeamOperator interface and startup SeamMe…
ontave May 18, 2026
a5a3000
fix(dispatcher): mount kubeconfig secret key as file via SubPath
ontave May 18, 2026
f5e4041
feat(watchdog): add RemediationPolicyRef to PackInstalled, remediatio…
ontave May 18, 2026
b30672e
fix(dispatcher): rename image wrapper->dispatcher in Dockerfile and M…
ontave May 20, 2026
30080fb
fix(dispatcher): post-migration GVK, SA name, and label key fixes
ontave May 20, 2026
938b348
fix(dispatcher): PackDelivery lookup in seam-system, not pe namespace
ontave May 20, 2026
a92a7a2
fix(dispatcher): PermissionSnapshot fallback to snapshot-management f…
ontave May 20, 2026
c0d36f5
fix(dispatcher): read runnerImage from RunnerConfig for pack-deploy Job
ontave May 20, 2026
6b707be
fix: dispatcher-leader lease name; add generated CRDs
ontave May 20, 2026
05e016e
fix(namespaces): replace hardcoded namespace strings with seam/pkg/na…
ontave May 21, 2026
9043f34
fix(dispatcher): correct ILI label to packdelivery-{name} + unit test…
ontave May 21, 2026
62f81f8
Merge remote-tracking branch 'origin/main' into feature/post-migratio…
ontave May 21, 2026
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
20 changes: 11 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
# Dockerfile — Wrapper operator (distroless).
# Dockerfile — Dispatcher operator (distroless).
#
# Wrapper is a long-running Deployment in seam-system. It manages ClusterPack
# compilation and delivery. Distroless: zero attack surface. INV-022.
# wrapper-schema.md §3.
# Dispatcher is a long-running Deployment in seam-system. It manages pack
# delivery and lifecycle. Distroless: zero attack surface. INV-022.
# dispatcher-schema.md §3.

FROM golang:1.25 AS builder
WORKDIR /build
COPY wrapper/ .
COPY dispatcher/ .
COPY conductor/ ../conductor/
COPY seam-core/ ../seam-core/
COPY seam/ ../seam/
COPY seam-sdk/ ../seam-sdk/
COPY conductor-sdk/ ../conductor-sdk/
RUN CGO_ENABLED=0 GOOS=linux go build \
-trimpath \
-ldflags="-s -w" \
-o /bin/wrapper \
-o /bin/dispatcher \
./cmd/wrapper

FROM gcr.io/distroless/base:nonroot
COPY --from=builder /bin/wrapper /usr/local/bin/wrapper
COPY --from=builder /bin/dispatcher /usr/local/bin/dispatcher

USER 65532:65532
ENTRYPOINT ["/usr/local/bin/wrapper"]
ENTRYPOINT ["/usr/local/bin/dispatcher"]
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

CONTROLLER_GEN ?= $(shell which controller-gen 2>/dev/null || echo $(HOME)/go/bin/controller-gen)
IMAGE_REGISTRY ?= 10.20.0.1:5000/ontai-dev
IMAGE_NAME := wrapper
IMAGE_NAME := dispatcher
TAG ?= dev

build:
Expand Down
16 changes: 16 additions & 0 deletions api/seam/v1alpha1/packinstalled_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,22 @@ type PackInstalledSpec struct {
// HelmVersion is the Helm SDK version used to render the pack. Carried from PackDelivery.
// +optional
HelmVersion string `json:"helmVersion,omitempty"`

// RemediationPolicyRef is an optional reference to a RemediationPolicy CR
// (conductor.ontai.dev) in the same namespace. When absent, Conductor Watchdog
// applies the platform defaults (threshold=3, per-reason default strategies,
// MaxAttempts=3, 5m window).
// +optional
RemediationPolicyRef *RemediationPolicyRefSpec `json:"remediationPolicyRef,omitempty"`
}

// RemediationPolicyRefSpec is a name+namespace reference to a RemediationPolicy CR.
type RemediationPolicyRefSpec struct {
// Name is the RemediationPolicy CR name.
Name string `json:"name"`

// Namespace is the namespace of the RemediationPolicy CR.
Namespace string `json:"namespace"`
}

// PackInstalledStatus is the observed state of a PackInstalled.
Expand Down
23 changes: 22 additions & 1 deletion api/seam/v1alpha1/packlog_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,33 @@ type PackLogSpec struct {
WorkloadDigest string `json:"workloadDigest,omitempty"`
}

// RemediationAttemptRecord tracks one remediation attempt series for a specific
// FailureReason. Written by the management Conductor after each remediation Job
// completes. The management Conductor is the sole writer; tenant conductor
// observes failure counts but does not write here.
type RemediationAttemptRecord struct {
// FailureReason is the seam-sdk FailureReason value this record tracks.
// +kubebuilder:validation:Enum=CrashLoopBackOff;OOMKilled;ImagePullBackOff;FailedMount;MultiAttachError
FailureReason string `json:"failureReason"`

// AttemptCount is the total number of remediation Jobs submitted for this reason.
AttemptCount int32 `json:"attemptCount"`

// LastAttemptAt is the time the most recent remediation Job was submitted.
// +optional
LastAttemptAt *metav1.Time `json:"lastAttemptAt,omitempty"`
}

// PackLogStatus is the observed state of a PackLog.
// Currently empty; reserved for future controller-set conditions.
type PackLogStatus struct {
// ObservedGeneration is the last generation processed by any consumer.
// +optional
ObservedGeneration int64 `json:"observedGeneration,omitempty"`

// RemediationAttempts records the Conductor Watchdog remediation attempt history
// per FailureReason. Written by management Conductor exec mode after each Job.
// +optional
RemediationAttempts []RemediationAttemptRecord `json:"remediationAttempts,omitempty"`
}

// +kubebuilder:object:root=true
Expand Down
48 changes: 47 additions & 1 deletion api/seam/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 17 additions & 3 deletions cmd/wrapper/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,23 @@
package main

import (
"context"
"flag"
"os"

"k8s.io/apimachinery/pkg/runtime"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/healthz"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"

seamv1alpha1 "github.com/ontai-dev/seam/api/v1alpha1"
dispatcherv1alpha1 "github.com/ontai-dev/dispatcher/api/seam/v1alpha1"
"github.com/ontai-dev/dispatcher/internal/controller"
"github.com/ontai-dev/dispatcher/internal/identity"
)

var scheme = runtime.NewScheme()
Expand Down Expand Up @@ -60,14 +63,25 @@ func main() {
ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts)))
setupLog := ctrl.Log.WithName("setup")

// CI-INV-004: leader election required. Lease name: wrapper-leader.
cfg := ctrl.GetConfigOrDie()
startupClient, err := client.New(cfg, client.Options{Scheme: scheme})
if err != nil {
setupLog.Error(err, "unable to create startup client")
os.Exit(1)
}
if err := identity.EnsureSeamMembership(context.Background(), startupClient); err != nil {
setupLog.Error(err, "unable to ensure SeamMembership")
os.Exit(1)
}

// CI-INV-004: leader election required. Lease name: dispatcher-leader.
// Lease namespace: seam-system (canonical operator namespace).
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
mgr, err := ctrl.NewManager(cfg, ctrl.Options{
Scheme: scheme,
Metrics: metricsserver.Options{BindAddress: metricsAddr},
HealthProbeBindAddress: healthProbeAddr,
LeaderElection: enableLeaderElection,
LeaderElectionID: "wrapper-leader",
LeaderElectionID: "dispatcher-leader",
LeaderElectionNamespace: "seam-system",
})
if err != nil {
Expand Down
3 changes: 3 additions & 0 deletions config/crd/bases/seam.ontai.dev_packdeliveries.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
<<<<<<<< HEAD:config/crd/seam.ontai.dev_packdeliveries.yaml
========
labels:
infrastructure.ontai.dev/lineage-root: "true"
>>>>>>>> origin/main:config/crd/bases/seam.ontai.dev_packdeliveries.yaml
name: packdeliveries.seam.ontai.dev
spec:
group: seam.ontai.dev
Expand Down
Loading
Loading