Documentation ¶
Index ¶
Constants ¶
const ( LcaPrecacheServiceAccount string = "lifecycle-agent-controller-manager" LcaPrecacheResourceName string = "lca-prep-precache" LcaPrecacheFinalizer = "lca.openshift.io/precache-finalizer" )
LCA Resources
const ( PrecachingSpecFilepath string = "/tmp/" PrecachingSpecFilename string = "images.txt" )
Image paths
const ( EnvLcaPrecacheImage string = "PRECACHE_WORKLOAD_IMG" EnvPrecacheSpecFile string = "PRECACHE_SPEC_FILE" EnvMaxPullThreads string = "MAX_PULL_THREADS" EnvPrecacheBestEffort string = "PRECACHE_BEST_EFFORT" ImageListFile = "var/tmp/imageListFile" )
Environment variable names
const ( BackoffLimit int32 = 0 // Allow 0 automatic retry for failed pre-caching job DefaultMode int32 = 420 RunAsUser int64 = 0 // Run as root user Privileged bool = true HostDirPathType = corev1.HostPathDirectory )
Precaching job specs
const ( RequestResourceCPU string = "10m" RequestResourceMemory string = "512Mi" )
Resource Limits for Job
const ( MinNicePriority int = -20 MaxNicePriority int = 19 )
Nice priority range
const ( IoNiceClassNone int = 0 IoNiceClassRealTime int = 1 IoNiceClassBestEffort int = 2 IoNiceClassIdle int = 3 )
IoNice class values
const ( MinIoNicePriority int = 0 MaxIoNicePriority int = 7 )
IoNice priority range
const ( DefaultMaxConcurrentPulls int = 10 DefaultNicePriority int = 0 DefaultIoNiceClass = IoNiceClassBestEffort DefaultIoNicePriority int = 4 )
Default precaching config values
const StatusFile = utils.IBUWorkspacePath + "/precache_status.json"
StatusFile is the filename for persisting the precaching progress tracker
Variables ¶
This section is empty.
Functions ¶
func GetPrecacheStatusFileContent ¶
func GetPrecacheStatusFileContent() string
GetPrecacheStatusFileContent try to read the content for additional in progress status msg
Types ¶
type Config ¶
type Config struct { ImageList []string NumConcurrentPulls int // To run pre-caching job with an adjusted niceness, which affects process scheduling. // Niceness values range from -20 (most favorable to the process) to 19 (least favorable to the process). NicePriority int // To configure the I/O-scheduling class and priority of a process. IoNiceClass int // 0: none, 1: realtime, 2: best-effort, 3: idle IoNicePriority int // priority (0..7) in the specified scheduling class, only for the realtime and best-effort classes // Allow for environment variables to be passed in EnvVars []corev1.EnvVar }
Config defines the configuration options for a pre-caching job.
func NewConfig ¶
NewConfig creates a new Config instance with the provided imageList and optional configuration parameters. It initializes the Config with default values and updates specific fields using key-value pairs in args. Supported configuration options in args:
- "NumConcurrentPulls" (int): Number of concurrent pulls for pre-caching.
- "NicePriority" (int): Nice priority for pre-caching.
- "IoNiceClass" (int): I/O nice class for pre-caching.
- "IoNicePriority" (int): I/O nice priority for pre-caching.
Example usage:
config := NewConfig(imageList, "NumConcurrentPulls", 10, "NicePriority", 5)
type PHandler ¶
PHandler handles the precaching job
func (*PHandler) CreateJobAndConfigMap ¶
func (h *PHandler) CreateJobAndConfigMap(ctx context.Context, config *Config, ibu *ibuv1.ImageBasedUpgrade) error
CreateJobAndConfigMap creates a new precache job.