Documentation ¶
Index ¶
- Constants
- Variables
- type AWSEC2CopyJob
- type AWSEC2CopyJobResult
- type AWSEC2ShareJob
- type AWSEC2ShareJobResult
- type Client
- type ClientConfig
- type Config
- type ContainerResolveJob
- type ContainerResolveJobResult
- type ContainerSpec
- type DepsolveJob
- type DepsolveJobResult
- type ErrorType
- type FileResolveJob
- type FileResolveJobResult
- type FileResolveJobResultItem
- type Job
- type JobInfo
- type JobResult
- type JobStatus
- type KojiFinalizeJob
- type KojiFinalizeJobResult
- type KojiInitJob
- type KojiInitJobResult
- type ManifestInfo
- type ManifestJobByID
- type ManifestJobByIDResult
- type OSBuildComposerDepModule
- type OSBuildJob
- type OSBuildJobResult
- func (j *OSBuildJobResult) TargetErrors() []*clienterrors.Error
- func (j *OSBuildJobResult) TargetResultsByName(name target.TargetName) []*target.TargetResult
- func (j *OSBuildJobResult) TargetResultsFilterByName(excludeNames []target.TargetName) []*target.TargetResult
- func (j *OSBuildJobResult) UnmarshalJSON(data []byte) error
- type OSTreeResolveJob
- type OSTreeResolveJobResult
- type OSTreeResolveResultSpec
- type OSTreeResolveSpec
- type PipelineNames
- type SbomDoc
- type Server
- func (s *Server) AWSEC2CopyJobInfo(id uuid.UUID, result *AWSEC2CopyJobResult) (*JobInfo, error)
- func (s *Server) AWSEC2ShareJobInfo(id uuid.UUID, result *AWSEC2ShareJobResult) (*JobInfo, error)
- func (s *Server) Cancel(id uuid.UUID) error
- func (s *Server) ContainerResolveJobInfo(id uuid.UUID, result *ContainerResolveJobResult) (*JobInfo, error)
- func (s *Server) DeleteArtifacts(id uuid.UUID) error
- func (s *Server) DepsolveJobInfo(id uuid.UUID, result *DepsolveJobResult) (*JobInfo, error)
- func (s *Server) EnqueueAWSEC2CopyJob(job *AWSEC2CopyJob, parent uuid.UUID, channel string) (uuid.UUID, error)
- func (s *Server) EnqueueAWSEC2ShareJob(job *AWSEC2ShareJob, parent uuid.UUID, channel string) (uuid.UUID, error)
- func (s *Server) EnqueueContainerResolveJob(job *ContainerResolveJob, channel string) (uuid.UUID, error)
- func (s *Server) EnqueueDepsolve(job *DepsolveJob, channel string) (uuid.UUID, error)
- func (s *Server) EnqueueFileResolveJob(job *FileResolveJob, channel string) (uuid.UUID, error)
- func (s *Server) EnqueueKojiFinalize(job *KojiFinalizeJob, initID uuid.UUID, buildIDs []uuid.UUID, channel string) (uuid.UUID, error)
- func (s *Server) EnqueueKojiInit(job *KojiInitJob, channel string) (uuid.UUID, error)
- func (s *Server) EnqueueManifestJobByID(job *ManifestJobByID, dependencies []uuid.UUID, channel string) (uuid.UUID, error)
- func (s *Server) EnqueueOSBuild(arch string, job *OSBuildJob, channel string) (uuid.UUID, error)
- func (s *Server) EnqueueOSBuildAsDependency(arch string, job *OSBuildJob, dependencies []uuid.UUID, channel string) (uuid.UUID, error)
- func (s *Server) EnqueueOSTreeResolveJob(job *OSTreeResolveJob, channel string) (uuid.UUID, error)
- func (s *Server) FileResolveJobInfo(id uuid.UUID, result *FileResolveJobResult) (*JobInfo, error)
- func (s *Server) FinishJob(token uuid.UUID, result json.RawMessage) error
- func (s *Server) Handler() http.Handler
- func (s *Server) JobArtifact(id uuid.UUID, name string) (io.Reader, int64, error)
- func (s *Server) JobChannel(id uuid.UUID) (string, error)
- func (s *Server) JobDependencyChainErrors(id uuid.UUID) (*clienterrors.Error, error)
- func (s *Server) JobType(id uuid.UUID) (string, error)
- func (s *Server) KojiFinalizeJobInfo(id uuid.UUID, result *KojiFinalizeJobResult) (*JobInfo, error)
- func (s *Server) KojiInitJobInfo(id uuid.UUID, result *KojiInitJobResult) (*JobInfo, error)
- func (s *Server) ManifestJobInfo(id uuid.UUID, result *ManifestJobByIDResult) (*JobInfo, error)
- func (s *Server) OSBuildJob(id uuid.UUID, job *OSBuildJob) error
- func (s *Server) OSBuildJobInfo(id uuid.UUID, result *OSBuildJobResult) (*JobInfo, error)
- func (s *Server) OSTreeResolveJobInfo(id uuid.UUID, result *OSTreeResolveJobResult) (*JobInfo, error)
- func (s *Server) RegisterWorker(c, a string) (uuid.UUID, error)
- func (s *Server) RequestJob(ctx context.Context, arch string, jobTypes, channels []string, ...) (uuid.UUID, uuid.UUID, string, json.RawMessage, []json.RawMessage, error)
- func (s *Server) RequestJobById(ctx context.Context, arch string, requestedJobId uuid.UUID) (uuid.UUID, uuid.UUID, string, json.RawMessage, []json.RawMessage, error)
- func (s *Server) RequeueOrFinishJob(token uuid.UUID, maxRetries uint64, result json.RawMessage) error
- func (s *Server) SetFailed(id uuid.UUID, error *clienterrors.Error) error
- func (s *Server) WatchHeartbeats()
- func (s *Server) WatchWorkers()
- func (s *Server) WorkerAvailableForArch(a string) (bool, error)
Constants ¶
const ( JobTypeOSBuild string = "osbuild" JobTypeKojiInit string = "koji-init" JobTypeKojiFinalize string = "koji-finalize" JobTypeDepsolve string = "depsolve" JobTypeManifestIDOnly string = "manifest-id-only" JobTypeContainerResolve string = "container-resolve" JobTypeFileResolve string = "file-resolve" JobTypeOSTreeResolve string = "ostree-resolve" JobTypeAWSEC2Copy string = "aws-ec2-copy" )
Variables ¶
var ErrClientRequestJobTimeout = errors.New("Dequeue timed out, retry")
var ErrInvalidJobType = errors.New("job has invalid type")
var ErrInvalidToken = errors.New("token does not exist")
var ErrJobNotRunning = errors.New("job isn't running")
Functions ¶
This section is empty.
Types ¶
type AWSEC2CopyJob ¶
type AWSEC2CopyJobResult ¶
type AWSEC2ShareJob ¶
type AWSEC2ShareJob struct {}
type AWSEC2ShareJobResult ¶
type AWSEC2ShareJobResult struct {}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(conf ClientConfig) (*Client, error)
func NewClientUnix ¶
func NewClientUnix(conf ClientConfig) *Client
func (*Client) NewRequest ¶
type ClientConfig ¶
type ContainerResolveJob ¶
type ContainerResolveJob struct { Arch string `json:"arch"` Specs []ContainerSpec `json:"specs"` }
type ContainerResolveJobResult ¶
type ContainerResolveJobResult struct { Specs []ContainerSpec `json:"specs"` JobResult }
type ContainerSpec ¶
type DepsolveJob ¶
type DepsolveJob struct { PackageSets map[string][]rpmmd.PackageSet `json:"grouped_package_sets"` ModulePlatformID string `json:"module_platform_id"` Arch string `json:"arch"` Releasever string `json:"releasever"` // NB: for now, the worker supports only a single SBOM type, but keep the options // open for the future by passing the actual type and not just bool. SbomType sbom.StandardType `json:"sbom_type,omitempty"` }
DepsolveJob defines the parameters of one or more depsolve jobs. Each named list of package sets defines a separate job. Lists with multiple package sets are depsolved in a chain, combining the results of sequential depsolves into a single PackageSpec list in the result. Each PackageSet defines the repositories it will be depsolved against.
type DepsolveJobResult ¶
type FileResolveJob ¶
type FileResolveJob struct {
URLs []string `json:"urls"`
}
type FileResolveJobResult ¶
type FileResolveJobResult struct { Success bool `json:"success"` Results []FileResolveJobResultItem `json:"results"` JobResult }
func (*FileResolveJobResult) ResolutionErrors ¶
func (j *FileResolveJobResult) ResolutionErrors() []*clienterrors.Error
type FileResolveJobResultItem ¶
type FileResolveJobResultItem struct { URL string `json:"url"` Content []byte `json:"content"` ResolutionError *clienterrors.Error `json:"target_error,omitempty"` }
type JobResult ¶
type JobResult struct {
JobError *clienterrors.Error `json:"job_error,omitempty"`
}
type KojiFinalizeJob ¶
type KojiFinalizeJob struct { Server string `json:"server"` Name string `json:"name"` Version string `json:"version"` Release string `json:"release"` // TODO: eventually deprecate and remove KojiFilenames, since the image filenames are now set in the KojiTargetResultOptions. KojiFilenames []string `json:"koji_filenames"` KojiDirectory string `json:"koji_directory"` TaskID uint64 `json:"task_id"` /* https://pagure.io/koji/issue/215 */ StartTime uint64 `json:"start_time"` }
type KojiFinalizeJobResult ¶
type KojiInitJob ¶
type KojiInitJobResult ¶
type ManifestInfo ¶
type ManifestInfo struct { OSBuildComposerVersion string `json:"osbuild_composer_version"` // List of relevant modules used by osbuild-composer which // could affect the manifest content. OSBuildComposerDeps []*OSBuildComposerDepModule `json:"osbuild_composer_deps,omitempty"` }
ManifestInfo contains information about the environment in which the manifest was produced and which could affect its content.
type ManifestJobByID ¶
type ManifestJobByID struct{}
type ManifestJobByIDResult ¶
type ManifestJobByIDResult struct { Manifest manifest.OSBuildManifest `json:"data,omitempty"` ManifestInfo ManifestInfo `json:"info,omitempty"` Error string `json:"error"` JobResult }
type OSBuildComposerDepModule ¶
type OSBuildComposerDepModule struct { Path string `json:"path"` Version string `json:"version"` Replace *OSBuildComposerDepModule `json:"replace,omitempty"` }
OSBuildComposerDepModule contains information about a module used by osbuild-composer which could affect the manifest content.
func ComposerDepModuleFromDebugModule ¶
func ComposerDepModuleFromDebugModule(module *debug.Module) *OSBuildComposerDepModule
ComposerDepModuleFromDebugModule converts a debug.Module instance to an OSBuildComposerDepModule instance.
type OSBuildJob ¶
type OSBuildJob struct { Manifest manifest.OSBuildManifest `json:"manifest,omitempty"` // Index of the ManifestJobByIDResult instance in the job's dynamic arguments slice ManifestDynArgsIdx *int `json:"manifest_dyn_args_idx,omitempty"` // Index of the DepsolveJobResult instance in the job's dynamic arguments slice // This is used only for Koji composes, which need to have access to SBOMs produced // as part of the depsolve job, so that they can be uploaded to Koji. DepsolveDynArgsIdx *int `json:"depsolve_dyn_args_idx,omitempty"` Targets []*target.Target `json:"targets,omitempty"` PipelineNames *PipelineNames `json:"pipeline_names,omitempty"` // The ImageBootMode is just copied to the result by the worker, so that // the value can be accessed job which depend on it. // (string representation of distro.BootMode values) ImageBootMode string `json:"image_boot_mode,omitempty"` }
func (OSBuildJob) MarshalJSON ¶
func (j OSBuildJob) MarshalJSON() ([]byte, error)
func (OSBuildJob) OsbuildExports ¶
func (j OSBuildJob) OsbuildExports() []string
OsbuildExports returns a slice of osbuild pipeline names, which should be exported as part of running osbuild image build for the job. The pipeline names are gathered from the targets specified in the job.
func (*OSBuildJob) UnmarshalJSON ¶
func (j *OSBuildJob) UnmarshalJSON(data []byte) error
type OSBuildJobResult ¶
type OSBuildJobResult struct { Success bool `json:"success"` OSBuildOutput *osbuild.Result `json:"osbuild_output,omitempty"` TargetResults []*target.TargetResult `json:"target_results,omitempty"` UploadStatus string `json:"upload_status"` PipelineNames *PipelineNames `json:"pipeline_names,omitempty"` // Host OS of the worker which handled the job HostOS string `json:"host_os"` // Architecture of the worker which handled the job Arch string `json:"arch"` // Boot mode supported by the image // (string representation of distro.BootMode values) ImageBootMode string `json:"image_boot_mode,omitempty"` // Version of the osbuild binary used by the worker to build the image OSBuildVersion string `json:"osbuild_version,omitempty"` JobResult }
func (*OSBuildJobResult) TargetErrors ¶
func (j *OSBuildJobResult) TargetErrors() []*clienterrors.Error
TargetErrors returns a slice of *clienterrors.Error gathered from the job result's target results. If there were no target errors then the returned slice will be empty.
func (*OSBuildJobResult) TargetResultsByName ¶
func (j *OSBuildJobResult) TargetResultsByName(name target.TargetName) []*target.TargetResult
TargetResultsByName iterates over TargetResults attached to the Job result and returns a slice of Target results of the provided name (type). If there were no TargetResults of the desired type attached to the Job results, the returned slice will be empty.
func (*OSBuildJobResult) TargetResultsFilterByName ¶
func (j *OSBuildJobResult) TargetResultsFilterByName(excludeNames []target.TargetName) []*target.TargetResult
TargetResultsFilterByName iterates over TargetResults attached to the Job result and returns a slice of Target results excluding the provided names (types). If there were no TargetResults left after filtering, the returned slice will be empty.
func (*OSBuildJobResult) UnmarshalJSON ¶
func (j *OSBuildJobResult) UnmarshalJSON(data []byte) error
type OSTreeResolveJob ¶
type OSTreeResolveJob struct {
Specs []OSTreeResolveSpec `json:"ostree_resolve_specs"`
}
type OSTreeResolveJobResult ¶
type OSTreeResolveJobResult struct { Specs []OSTreeResolveResultSpec `json:"ostree_resolve_result_specs"` JobResult }
type OSTreeResolveResultSpec ¶
type OSTreeResolveSpec ¶
type PipelineNames ¶
PipelineNames is used to provide two pieces of information related to a job: 1. A categorization of each pipeline into one of two groups 2. A pipeline ordering when the lists are concatenated: build -> os
func (*PipelineNames) All ¶
func (pn *PipelineNames) All() []string
Returns a concatenated list of the pipeline names
type SbomDoc ¶
type SbomDoc struct { DocType sbom.StandardType `json:"type"` Document json.RawMessage `json:"document"` }
SbomDoc represents a single SBOM document result.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) AWSEC2CopyJobInfo ¶
func (*Server) AWSEC2ShareJobInfo ¶
func (*Server) ContainerResolveJobInfo ¶
func (*Server) DeleteArtifacts ¶
Deletes all artifacts for job `id`.
func (*Server) DepsolveJobInfo ¶
func (*Server) EnqueueAWSEC2CopyJob ¶
func (*Server) EnqueueAWSEC2ShareJob ¶
func (*Server) EnqueueContainerResolveJob ¶
func (*Server) EnqueueDepsolve ¶
func (*Server) EnqueueFileResolveJob ¶
func (*Server) EnqueueKojiFinalize ¶
func (*Server) EnqueueKojiInit ¶
func (*Server) EnqueueManifestJobByID ¶
func (*Server) EnqueueOSBuild ¶
func (*Server) EnqueueOSBuildAsDependency ¶
func (*Server) EnqueueOSTreeResolveJob ¶
func (*Server) FileResolveJobInfo ¶
func (*Server) JobArtifact ¶
Provides access to artifacts of a job. Returns an io.Reader for the artifact and the artifact's size.
func (*Server) JobDependencyChainErrors ¶
DependencyChainErrors recursively gathers all errors from job's dependencies, which caused it to fail. If the job didn't fail, `nil` is returned.
func (*Server) KojiFinalizeJobInfo ¶
func (*Server) KojiInitJobInfo ¶
func (*Server) ManifestJobInfo ¶
func (*Server) OSBuildJob ¶
func (s *Server) OSBuildJob(id uuid.UUID, job *OSBuildJob) error
OSBuildJob returns the parameters of an OSBuildJob
func (*Server) OSBuildJobInfo ¶
func (*Server) OSTreeResolveJobInfo ¶
func (*Server) RequestJob ¶
func (*Server) RequestJobById ¶
func (*Server) RequeueOrFinishJob ¶
func (*Server) WatchHeartbeats ¶
func (s *Server) WatchHeartbeats()
With default durations it goes through all running jobs every 30 seconds and fails any unresponsive ones. Unresponsive jobs haven't checked whether or not they're cancelled in the past 2 minutes.
func (*Server) WatchWorkers ¶
func (s *Server) WatchWorkers()
This function should be started as a goroutine Every 5 minutes it goes through all workers, removing any unresponsive ones.
Directories ¶
Path | Synopsis |
---|---|
Package api provides primitives to interact with the openapi HTTP API.
|
Package api provides primitives to interact with the openapi HTTP API. |