core_v1alpha

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppActiveVersionId = entity.Id("dev.miren.core/app.active_version")
	AppProjectId       = entity.Id("dev.miren.core/app.project")
)
View Source
const (
	AppVersionAppId            = entity.Id("dev.miren.core/app_version.app")
	AppVersionArtifactId       = entity.Id("dev.miren.core/app_version.artifact")
	AppVersionConfigId         = entity.Id("dev.miren.core/app_version.config")
	AppVersionImageUrlId       = entity.Id("dev.miren.core/app_version.image_url")
	AppVersionManifestId       = entity.Id("dev.miren.core/app_version.manifest")
	AppVersionManifestDigestId = entity.Id("dev.miren.core/app_version.manifest_digest")
	AppVersionVersionId        = entity.Id("dev.miren.core/app_version.version")
)
View Source
const (
	ConfigCommandsId   = entity.Id("dev.miren.core/config.commands")
	ConfigEntrypointId = entity.Id("dev.miren.core/config.entrypoint")
	ConfigPortId       = entity.Id("dev.miren.core/config.port")
	ConfigServicesId   = entity.Id("dev.miren.core/config.services")
	ConfigVariableId   = entity.Id("dev.miren.core/config.variable")
)
View Source
const (
	CommandsCommandId = entity.Id("dev.miren.core/commands.command")
	CommandsServiceId = entity.Id("dev.miren.core/commands.service")
)
View Source
const (
	ServicesDisksId              = entity.Id("dev.miren.core/services.disks")
	ServicesEnvId                = entity.Id("dev.miren.core/services.env")
	ServicesImageId              = entity.Id("dev.miren.core/services.image")
	ServicesNameId               = entity.Id("dev.miren.core/services.name")
	ServicesPortId               = entity.Id("dev.miren.core/services.port")
	ServicesPortNameId           = entity.Id("dev.miren.core/services.port_name")
	ServicesPortTypeId           = entity.Id("dev.miren.core/services.port_type")
	ServicesServiceConcurrencyId = entity.Id("dev.miren.core/services.service_concurrency")
)
View Source
const (
	DisksFilesystemId   = entity.Id("dev.miren.core/disks.filesystem")
	DisksLeaseTimeoutId = entity.Id("dev.miren.core/disks.lease_timeout")
	DisksMountPathId    = entity.Id("dev.miren.core/disks.mount_path")
	DisksNameId         = entity.Id("dev.miren.core/disks.name")
	DisksReadOnlyId     = entity.Id("dev.miren.core/disks.read_only")
	DisksSizeGbId       = entity.Id("dev.miren.core/disks.size_gb")
)
View Source
const (
	EnvKeyId       = entity.Id("dev.miren.core/env.key")
	EnvSensitiveId = entity.Id("dev.miren.core/env.sensitive")
	EnvSourceId    = entity.Id("dev.miren.core/env.source")
	EnvValueId     = entity.Id("dev.miren.core/env.value")
)
View Source
const (
	ServiceConcurrencyModeId                = entity.Id("dev.miren.core/service_concurrency.mode")
	ServiceConcurrencyNumInstancesId        = entity.Id("dev.miren.core/service_concurrency.num_instances")
	ServiceConcurrencyRequestsPerInstanceId = entity.Id("dev.miren.core/service_concurrency.requests_per_instance")
	ServiceConcurrencyScaleDownDelayId      = entity.Id("dev.miren.core/service_concurrency.scale_down_delay")
)
View Source
const (
	VariableKeyId       = entity.Id("dev.miren.core/variable.key")
	VariableSensitiveId = entity.Id("dev.miren.core/variable.sensitive")
	VariableSourceId    = entity.Id("dev.miren.core/variable.source")
	VariableValueId     = entity.Id("dev.miren.core/variable.value")
)
View Source
const (
	ArtifactAppId            = entity.Id("dev.miren.core/artifact.app")
	ArtifactManifestId       = entity.Id("dev.miren.core/artifact.manifest")
	ArtifactManifestDigestId = entity.Id("dev.miren.core/artifact.manifest_digest")
)
View Source
const (
	DeploymentAppNameId      = entity.Id("dev.miren.core/deployment.app_name")
	DeploymentAppVersionId   = entity.Id("dev.miren.core/deployment.app_version")
	DeploymentBuildLogsId    = entity.Id("dev.miren.core/deployment.build_logs")
	DeploymentClusterIdId    = entity.Id("dev.miren.core/deployment.cluster_id")
	DeploymentCompletedAtId  = entity.Id("dev.miren.core/deployment.completed_at")
	DeploymentDeployedById   = entity.Id("dev.miren.core/deployment.deployed_by")
	DeploymentErrorMessageId = entity.Id("dev.miren.core/deployment.error_message")
	DeploymentGitInfoId      = entity.Id("dev.miren.core/deployment.git_info")
	DeploymentPhaseId        = entity.Id("dev.miren.core/deployment.phase")
	DeploymentStatusId       = entity.Id("dev.miren.core/deployment.status")
)
View Source
const (
	DeployedByTimestampId = entity.Id("dev.miren.core/deployed_by.timestamp")
	DeployedByUserEmailId = entity.Id("dev.miren.core/deployed_by.user_email")
	DeployedByUserIdId    = entity.Id("dev.miren.core/deployed_by.user_id")
	DeployedByUserNameId  = entity.Id("dev.miren.core/deployed_by.user_name")
)
View Source
const (
	GitInfoAuthorId            = entity.Id("dev.miren.core/git_info.author")
	GitInfoBranchId            = entity.Id("dev.miren.core/git_info.branch")
	GitInfoCommitAuthorEmailId = entity.Id("dev.miren.core/git_info.commit_author_email")
	GitInfoCommitTimestampId   = entity.Id("dev.miren.core/git_info.commit_timestamp")
	GitInfoIsDirtyId           = entity.Id("dev.miren.core/git_info.is_dirty")
	GitInfoMessageId           = entity.Id("dev.miren.core/git_info.message")
	GitInfoRepositoryId        = entity.Id("dev.miren.core/git_info.repository")
	GitInfoShaId               = entity.Id("dev.miren.core/git_info.sha")
	GitInfoWorkingTreeHashId   = entity.Id("dev.miren.core/git_info.working_tree_hash")
)
View Source
const (
	MetadataLabelsId  = entity.Id("dev.miren.core/metadata.labels")
	MetadataNameId    = entity.Id("dev.miren.core/metadata.name")
	MetadataProjectId = entity.Id("dev.miren.core/metadata.project")
)
View Source
const (
	ProjectOwnerId = entity.Id("dev.miren.core/project.owner")
)

Variables

View Source
var (
	KindApp        = entity.Id("dev.miren.core/kind.app")
	KindAppVersion = entity.Id("dev.miren.core/kind.app_version")
	KindArtifact   = entity.Id("dev.miren.core/kind.artifact")
	KindDeployment = entity.Id("dev.miren.core/kind.deployment")
	KindMetadata   = entity.Id("dev.miren.core/kind.metadata")
	KindProject    = entity.Id("dev.miren.core/kind.project")
	Schema         = entity.Id("dev.miren.core/schema.v1alpha")
)

Functions

func MigrateAppVersionConcurrency

func MigrateAppVersionConcurrency(ctx context.Context, log *slog.Logger, eac *entityserver_v1alpha.EntityAccessClient) error

MigrateAppVersionConcurrency backfills missing service_concurrency config for all app versions using the same defaults applied at build time.

Types

type App

type App struct {
	ID            entity.Id `json:"id"`
	ActiveVersion entity.Id `cbor:"active_version,omitempty" json:"active_version,omitempty"`
	Project       entity.Id `cbor:"project,omitempty" json:"project,omitempty"`
}

func (*App) Decode

func (o *App) Decode(e entity.AttrGetter)

func (*App) Empty

func (o *App) Empty() bool

func (*App) Encode

func (o *App) Encode() (attrs []entity.Attr)

func (*App) EntityId

func (o *App) EntityId() entity.Id

func (*App) InitSchema

func (o *App) InitSchema(sb *schema.SchemaBuilder)

func (*App) Is

func (o *App) Is(e entity.AttrGetter) bool

func (*App) Kind

func (o *App) Kind() entity.Id

func (*App) ShortKind

func (o *App) ShortKind() string

type AppVersion

type AppVersion struct {
	ID             entity.Id `json:"id"`
	App            entity.Id `cbor:"app,omitempty" json:"app,omitempty"`
	Artifact       entity.Id `cbor:"artifact,omitempty" json:"artifact,omitempty"`
	Config         Config    `cbor:"config,omitempty" json:"config,omitempty"`
	ImageUrl       string    `cbor:"image_url,omitempty" json:"image_url,omitempty"`
	Manifest       string    `cbor:"manifest,omitempty" json:"manifest,omitempty"`
	ManifestDigest string    `cbor:"manifest_digest,omitempty" json:"manifest_digest,omitempty"`
	Version        string    `cbor:"version,omitempty" json:"version,omitempty"`
}

func (*AppVersion) Decode

func (o *AppVersion) Decode(e entity.AttrGetter)

func (*AppVersion) Empty

func (o *AppVersion) Empty() bool

func (*AppVersion) Encode

func (o *AppVersion) Encode() (attrs []entity.Attr)

func (*AppVersion) EntityId

func (o *AppVersion) EntityId() entity.Id

func (*AppVersion) InitSchema

func (o *AppVersion) InitSchema(sb *schema.SchemaBuilder)

func (*AppVersion) Is

func (o *AppVersion) Is(e entity.AttrGetter) bool

func (*AppVersion) Kind

func (o *AppVersion) Kind() entity.Id

func (*AppVersion) ShortKind

func (o *AppVersion) ShortKind() string

type Artifact

type Artifact struct {
	ID             entity.Id `json:"id"`
	App            entity.Id `cbor:"app,omitempty" json:"app,omitempty"`
	Manifest       string    `cbor:"manifest,omitempty" json:"manifest,omitempty"`
	ManifestDigest string    `cbor:"manifest_digest,omitempty" json:"manifest_digest,omitempty"`
}

func (*Artifact) Decode

func (o *Artifact) Decode(e entity.AttrGetter)

func (*Artifact) Empty

func (o *Artifact) Empty() bool

func (*Artifact) Encode

func (o *Artifact) Encode() (attrs []entity.Attr)

func (*Artifact) EntityId

func (o *Artifact) EntityId() entity.Id

func (*Artifact) InitSchema

func (o *Artifact) InitSchema(sb *schema.SchemaBuilder)

func (*Artifact) Is

func (o *Artifact) Is(e entity.AttrGetter) bool

func (*Artifact) Kind

func (o *Artifact) Kind() entity.Id

func (*Artifact) ShortKind

func (o *Artifact) ShortKind() string

type Commands

type Commands struct {
	Command string `cbor:"command,omitempty" json:"command,omitempty"`
	Service string `cbor:"service,omitempty" json:"service,omitempty"`
}

func (*Commands) Decode

func (o *Commands) Decode(e entity.AttrGetter)

func (*Commands) Empty

func (o *Commands) Empty() bool

func (*Commands) Encode

func (o *Commands) Encode() (attrs []entity.Attr)

func (*Commands) InitSchema

func (o *Commands) InitSchema(sb *schema.SchemaBuilder)

type Config

type Config struct {
	Commands   []Commands `cbor:"commands,omitempty" json:"commands,omitempty"`
	Entrypoint string     `cbor:"entrypoint,omitempty" json:"entrypoint,omitempty"`
	Port       int64      `cbor:"port,omitempty" json:"port,omitempty"`
	Services   []Services `cbor:"services,omitempty" json:"services,omitempty"`
	Variable   []Variable `cbor:"variable,omitempty" json:"variable,omitempty"`
}

func (*Config) Decode

func (o *Config) Decode(e entity.AttrGetter)

func (*Config) Empty

func (o *Config) Empty() bool

func (*Config) Encode

func (o *Config) Encode() (attrs []entity.Attr)

func (*Config) InitSchema

func (o *Config) InitSchema(sb *schema.SchemaBuilder)

type DeployedBy

type DeployedBy struct {
	Timestamp string `cbor:"timestamp,omitempty" json:"timestamp,omitempty"`
	UserEmail string `cbor:"user_email,omitempty" json:"user_email,omitempty"`
	UserId    string `cbor:"user_id,omitempty" json:"user_id,omitempty"`
	UserName  string `cbor:"user_name,omitempty" json:"user_name,omitempty"`
}

func (*DeployedBy) Decode

func (o *DeployedBy) Decode(e entity.AttrGetter)

func (*DeployedBy) Empty

func (o *DeployedBy) Empty() bool

func (*DeployedBy) Encode

func (o *DeployedBy) Encode() (attrs []entity.Attr)

func (*DeployedBy) InitSchema

func (o *DeployedBy) InitSchema(sb *schema.SchemaBuilder)

type Deployment

type Deployment struct {
	ID           entity.Id  `json:"id"`
	AppName      string     `cbor:"app_name,omitempty" json:"app_name,omitempty"`
	AppVersion   string     `cbor:"app_version,omitempty" json:"app_version,omitempty"`
	BuildLogs    string     `cbor:"build_logs,omitempty" json:"build_logs,omitempty"`
	ClusterId    string     `cbor:"cluster_id,omitempty" json:"cluster_id,omitempty"`
	CompletedAt  string     `cbor:"completed_at,omitempty" json:"completed_at,omitempty"`
	DeployedBy   DeployedBy `cbor:"deployed_by,omitempty" json:"deployed_by,omitempty"`
	ErrorMessage string     `cbor:"error_message,omitempty" json:"error_message,omitempty"`
	GitInfo      GitInfo    `cbor:"git_info,omitempty" json:"git_info,omitempty"`
	Phase        string     `cbor:"phase,omitempty" json:"phase,omitempty"`
	Status       string     `cbor:"status,omitempty" json:"status,omitempty"`
}

func (*Deployment) Decode

func (o *Deployment) Decode(e entity.AttrGetter)

func (*Deployment) Empty

func (o *Deployment) Empty() bool

func (*Deployment) Encode

func (o *Deployment) Encode() (attrs []entity.Attr)

func (*Deployment) EntityId

func (o *Deployment) EntityId() entity.Id

func (*Deployment) InitSchema

func (o *Deployment) InitSchema(sb *schema.SchemaBuilder)

func (*Deployment) Is

func (o *Deployment) Is(e entity.AttrGetter) bool

func (*Deployment) Kind

func (o *Deployment) Kind() entity.Id

func (*Deployment) ShortKind

func (o *Deployment) ShortKind() string

type Disks

type Disks struct {
	Filesystem   string `cbor:"filesystem,omitempty" json:"filesystem,omitempty"`
	LeaseTimeout string `cbor:"lease_timeout,omitempty" json:"lease_timeout,omitempty"`
	MountPath    string `cbor:"mount_path,omitempty" json:"mount_path,omitempty"`
	Name         string `cbor:"name,omitempty" json:"name,omitempty"`
	ReadOnly     bool   `cbor:"read_only,omitempty" json:"read_only,omitempty"`
	SizeGb       int64  `cbor:"size_gb,omitempty" json:"size_gb,omitempty"`
}

func (*Disks) Decode

func (o *Disks) Decode(e entity.AttrGetter)

func (*Disks) Empty

func (o *Disks) Empty() bool

func (*Disks) Encode

func (o *Disks) Encode() (attrs []entity.Attr)

func (*Disks) InitSchema

func (o *Disks) InitSchema(sb *schema.SchemaBuilder)

type Env

type Env struct {
	Key       string `cbor:"key,omitempty" json:"key,omitempty"`
	Sensitive bool   `cbor:"sensitive,omitempty" json:"sensitive,omitempty"`
	Source    string `cbor:"source,omitempty" json:"source,omitempty"`
	Value     string `cbor:"value,omitempty" json:"value,omitempty"`
}

func (*Env) Decode

func (o *Env) Decode(e entity.AttrGetter)

func (*Env) Empty

func (o *Env) Empty() bool

func (*Env) Encode

func (o *Env) Encode() (attrs []entity.Attr)

func (*Env) InitSchema

func (o *Env) InitSchema(sb *schema.SchemaBuilder)

type GitInfo

type GitInfo struct {
	Author            string `cbor:"author,omitempty" json:"author,omitempty"`
	Branch            string `cbor:"branch,omitempty" json:"branch,omitempty"`
	CommitAuthorEmail string `cbor:"commit_author_email,omitempty" json:"commit_author_email,omitempty"`
	CommitTimestamp   string `cbor:"commit_timestamp,omitempty" json:"commit_timestamp,omitempty"`
	IsDirty           bool   `cbor:"is_dirty,omitempty" json:"is_dirty,omitempty"`
	Message           string `cbor:"message,omitempty" json:"message,omitempty"`
	Repository        string `cbor:"repository,omitempty" json:"repository,omitempty"`
	Sha               string `cbor:"sha,omitempty" json:"sha,omitempty"`
	WorkingTreeHash   string `cbor:"working_tree_hash,omitempty" json:"working_tree_hash,omitempty"`
}

func (*GitInfo) Decode

func (o *GitInfo) Decode(e entity.AttrGetter)

func (*GitInfo) Empty

func (o *GitInfo) Empty() bool

func (*GitInfo) Encode

func (o *GitInfo) Encode() (attrs []entity.Attr)

func (*GitInfo) InitSchema

func (o *GitInfo) InitSchema(sb *schema.SchemaBuilder)

type Metadata

type Metadata struct {
	ID      entity.Id    `json:"id"`
	Labels  types.Labels `cbor:"labels,omitempty" json:"labels,omitempty"`
	Name    string       `cbor:"name,omitempty" json:"name,omitempty"`
	Project entity.Id    `cbor:"project,omitempty" json:"project,omitempty"`
}

func MD

func MD(ea entity.AttrGetter) Metadata

func (*Metadata) Decode

func (o *Metadata) Decode(e entity.AttrGetter)

func (*Metadata) Empty

func (o *Metadata) Empty() bool

func (*Metadata) Encode

func (o *Metadata) Encode() (attrs []entity.Attr)

func (*Metadata) EntityId

func (o *Metadata) EntityId() entity.Id

func (*Metadata) InitSchema

func (o *Metadata) InitSchema(sb *schema.SchemaBuilder)

func (*Metadata) Is

func (o *Metadata) Is(e entity.AttrGetter) bool

func (*Metadata) Kind

func (o *Metadata) Kind() entity.Id

func (*Metadata) ShortKind

func (o *Metadata) ShortKind() string

type Project

type Project struct {
	ID    entity.Id `json:"id"`
	Owner string    `cbor:"owner,omitempty" json:"owner,omitempty"`
}

func (*Project) Decode

func (o *Project) Decode(e entity.AttrGetter)

func (*Project) Empty

func (o *Project) Empty() bool

func (*Project) Encode

func (o *Project) Encode() (attrs []entity.Attr)

func (*Project) EntityId

func (o *Project) EntityId() entity.Id

func (*Project) InitSchema

func (o *Project) InitSchema(sb *schema.SchemaBuilder)

func (*Project) Is

func (o *Project) Is(e entity.AttrGetter) bool

func (*Project) Kind

func (o *Project) Kind() entity.Id

func (*Project) ShortKind

func (o *Project) ShortKind() string

type ServiceConcurrency

type ServiceConcurrency struct {
	Mode                string `cbor:"mode,omitempty" json:"mode,omitempty"`
	NumInstances        int64  `cbor:"num_instances,omitempty" json:"num_instances,omitempty"`
	RequestsPerInstance int64  `cbor:"requests_per_instance,omitempty" json:"requests_per_instance,omitempty"`
	ScaleDownDelay      string `cbor:"scale_down_delay,omitempty" json:"scale_down_delay,omitempty"`
}

func GetServiceConcurrency

func GetServiceConcurrency(ver *AppVersion, serviceName string) (ServiceConcurrency, error)

GetServiceConcurrency returns the concurrency configuration for a named service. Returns an error if the service is not found - all service configs should be hydrated with defaults during app version creation.

func (*ServiceConcurrency) Decode

func (o *ServiceConcurrency) Decode(e entity.AttrGetter)

func (*ServiceConcurrency) Empty

func (o *ServiceConcurrency) Empty() bool

func (*ServiceConcurrency) Encode

func (o *ServiceConcurrency) Encode() (attrs []entity.Attr)

func (*ServiceConcurrency) InitSchema

func (o *ServiceConcurrency) InitSchema(sb *schema.SchemaBuilder)

type Services

type Services struct {
	Disks              []Disks            `cbor:"disks,omitempty" json:"disks,omitempty"`
	Env                []Env              `cbor:"env,omitempty" json:"env,omitempty"`
	Image              string             `cbor:"image,omitempty" json:"image,omitempty"`
	Name               string             `cbor:"name,omitempty" json:"name,omitempty"`
	Port               int64              `cbor:"port,omitempty" json:"port,omitempty"`
	PortName           string             `cbor:"port_name,omitempty" json:"port_name,omitempty"`
	PortType           string             `cbor:"port_type,omitempty" json:"port_type,omitempty"`
	ServiceConcurrency ServiceConcurrency `cbor:"service_concurrency,omitempty" json:"service_concurrency,omitempty"`
}

func (*Services) Decode

func (o *Services) Decode(e entity.AttrGetter)

func (*Services) Empty

func (o *Services) Empty() bool

func (*Services) Encode

func (o *Services) Encode() (attrs []entity.Attr)

func (*Services) InitSchema

func (o *Services) InitSchema(sb *schema.SchemaBuilder)

type Variable

type Variable struct {
	Key       string `cbor:"key,omitempty" json:"key,omitempty"`
	Sensitive bool   `cbor:"sensitive,omitempty" json:"sensitive,omitempty"`
	Source    string `cbor:"source,omitempty" json:"source,omitempty"`
	Value     string `cbor:"value,omitempty" json:"value,omitempty"`
}

func (*Variable) Decode

func (o *Variable) Decode(e entity.AttrGetter)

func (*Variable) Empty

func (o *Variable) Empty() bool

func (*Variable) Encode

func (o *Variable) Encode() (attrs []entity.Attr)

func (*Variable) InitSchema

func (o *Variable) InitSchema(sb *schema.SchemaBuilder)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL