Documentation
¶
Overview ¶
Package prober is the gateway half of the agent probe handoff (pkg/devbox/probe): it watches the operator's probe request ConfigMaps, runs each probe in an actor resumed from the revision's golden tag and writes the result back.
The probe actor is a pseudo-instance: it isn't a console instance, so its only credential is the box-scoped AI proxy token the operator minted, registered with egress as a static credential, and its egress policy allows nothing but the AI proxy host. Prober resolves its actors for egress (ResolveActor); chain it in front of the core with Chain.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Chain ¶
func Chain(resolvers ...egress.ActorResolver) egress.ActorResolver
Chain resolves an actor with the first resolver that knows it.
func InstanceID ¶
InstanceID is the egress pseudo-instance of a probe request.
Types ¶
type Actors ¶
type Actors interface {
CreateActor(ctx context.Context, spec actors.Spec) (*ateapi.Actor, error)
ApplyEgressPolicy(ctx context.Context, ref actors.Ref, rules []*ateapi.EgressRule) error
Resume(ctx context.Context, ref actors.Ref) error
WaitState(ctx context.Context, ref actors.Ref, states ...ateapi.ActorState) (*ateapi.Actor, error)
DeleteActor(ctx context.Context, ref actors.Ref) error
}
Actors is the Substrate subset the prober uses (*actors.Client).
type Config ¶
type Config struct {
// Namespace holds the probe ConfigMaps and the token Secret (the operator namespace).
Namespace string
// Holder identifies this replica in claims, normally the pod name.
Holder string
ConsoleURL string
AIProxyURL string
AttemptTimeout time.Duration
Attempts int
RetryDelay time.Duration
// Resync re-lists pending requests, catching anything a dropped watch missed and abandoned claims.
Resync time.Duration
}
type Credentials ¶
type Credentials interface {
SetStaticCredential(instanceID, kind, token string, expiresAt time.Time) error
Invalidate(instanceID string)
}
Credentials registers the probe token with egress (*egress.Service).
type Daemons ¶
type Daemons interface {
Daemon(actor string) devboxv1.DaemonClient
}
Daemons reaches an actor's daemon (*router.Router).
type Prober ¶
type Prober struct {
// contains filtered or unexported fields
}
func (*Prober) ResolveActor ¶
ResolveActor resolves the actors of running probes; anything else is egress.ErrUnknownActor.
func (*Prober) Run ¶
Run watches probe requests until ctx is done, then waits for running probes to clean up.
func (*Prober) UseCredentials ¶
func (p *Prober) UseCredentials(c Credentials)
UseCredentials sets the egress service once it exists; egress needs the prober as a resolver first.