rep

package module
v0.0.0-...-6c99632 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2026 License: Apache-2.0 Imports: 24 Imported by: 0

README

Rep

Go Report Card Go Reference

The Rep bids on tasks and schedules them on an associated Executor.

[!NOTE]

This repository should be imported as code.cloudfoundry.org/rep.

Contributing

See the Contributing.md for more information on how to contribute.

Working Group Charter

This repository is maintained by App Runtime Platform under Diego area.

[!IMPORTANT]

Content in this file is managed by the CI task sync-readme and is generated by CI following a convention.

Documentation

Index

Constants

View Source
const (
	LifecycleTag  = "lifecycle"
	ResultFileTag = "result-file"
	DomainTag     = "domain"

	TaskLifecycle = "task"
	LRPLifecycle  = "lrp"

	ProcessGuidTag  = "process-guid"
	InstanceGuidTag = "instance-guid"
	ProcessIndexTag = "process-index"

	VolumeDriversTag = "volume-drivers"
	PlacementTagsTag = "placement-tags"
)
View Source
const (
	LayeringModeSingleLayer = "single-layer"
	LayeringModeTwoLayer    = "two-layer"
)
View Source
const (
	RootFSProviderTypeArbitrary = bbsmodels.RootFSProviderTypeArbitrary
	RootFSProviderTypeFixedSet  = bbsmodels.RootFSProviderTypeFixedSet
)
View Source
const (
	StateRoute            = "STATE"
	ContainerMetricsRoute = "ContainerMetrics"
	PerformRoute          = "PERFORM"

	UpdateLRPInstanceRoute    = "UpdateLRPInstance"
	UpdateLRPInstanceRoute_r0 = "UpdateLRPInstance_r0"
	StopLRPInstanceRoute      = "StopLRPInstance"
	CancelTaskRoute           = "CancelTask"

	SimResetRoute = "RESET"

	PingRoute     = "Ping"
	EvacuateRoute = "Evacuate"
)
View Source
const StackVersionFile = bbsmodels.StackVersionFile

Variables

View Source
var (
	ErrContainerMissingTags = errors.New("container is missing tags")
	ErrInvalidProcessIndex  = errors.New("container does not have a valid process index")
	ErrIntergerOverflow     = errors.New("integer overflow")
)
View Source
var ErrPreloadedRootFSNotFound = fmt.Errorf("preloaded rootfs path not found")

ErrPreloadedRootFSNotFound is returned when the given hostname of the rootFS could not be resolved if the scheme is the PreloadedRootFSScheme or the PreloadedOCIRootFSScheme.

View Source
var ErrorIncompatibleRootfs = bbsmodels.ErrorIncompatibleRootfs
View Source
var NewCellState = bbsmodels.NewCellState
View Source
var NewFixedSetRootFSProvider = bbsmodels.NewFixedSetRootFSProvider
View Source
var NewLRPUpdate = bbsmodels.NewLRPUpdate
View Source
var NewPlacementConstraint = bbsmodels.NewPlacementConstraint
View Source
var NewResource = bbsmodels.NewResource
View Source
var NewResources = bbsmodels.NewResources
View Source
var NewStringSet = bbsmodels.NewStringSet
View Source
var RoutesLocalhostOnly = NewRoutes(false)
View Source
var RoutesNetworkAccessible = NewRoutes(true)

Functions

func ActualLRPInstanceKeyFromContainer

func ActualLRPInstanceKeyFromContainer(container executor.Container, cellID string) (*models.ActualLRPInstanceKey, error)

func ActualLRPKeyFromTags

func ActualLRPKeyFromTags(tags executor.Tags) (*models.ActualLRPKey, error)

func ActualLRPNetInfoFromContainer

func ActualLRPNetInfoFromContainer(container executor.Container) (*models.ActualLRPNetInfo, error)

func ConvertCachedDependencies

func ConvertCachedDependencies(modelDeps []*models.CachedDependency) []executor.CachedDependency

func ConvertCachedDependency

func ConvertCachedDependency(modelDep *models.CachedDependency) executor.CachedDependency

func ConvertPortMappings

func ConvertPortMappings(containerPorts []uint32) []executor.PortMapping

func ConvertPreloadedRootFS

func ConvertPreloadedRootFS(rootFS string, imageLayers []*models.ImageLayer, layeringMode string) (string, []*models.ImageLayer)

ConvertPreloadedRootFS takes in a rootFS URL and a list of image layers and in most cases just returns the same rootFS URL and list of image layers.

In the case where all of the following are true:

  • layeringMode == LayeringModeTwoLayer
  • the rootfs URL has a `preloaded` scheme
  • the list of image layers contains at least one image layer that has an `exclusive` layer type, `tgz` media type, and a `sha256` digest algorithm.

then the rootfs URL will be converted to have a `preloaded+layer` scheme and a query string that references the first image layer that matches all of those restrictions. This image layer will also be removed from the list.

func InternalRoutesToInternalRoutes

func InternalRoutesToInternalRoutes(routes InternalRoutes) internalroutes.InternalRoutes

InternalRoutesToInternalRoutes converts bbs/models.InternalRoutes to routing-info.InternalRoutes. This conversion is necessary because both types have the same structure but are distinct types in Go.

func LRPContainerGuid

func LRPContainerGuid(processGuid, instanceGuid string) string

func NewRoutes

func NewRoutes(networkAccessible bool) rata.Routes

Types

type ArbitraryRootFSProvider

type ArbitraryRootFSProvider = bbsmodels.ArbitraryRootFSProvider

type CellState

type CellState = bbsmodels.CellState

type Client

type Client = models.RepClient

Client is the rep client interface. Also available as code.cloudfoundry.org/bbs/models.RepClient.

type ClientFactory

type ClientFactory = models.RepClientFactory

ClientFactory is the rep client factory interface. Also available as code.cloudfoundry.org/bbs/models.RepClientFactory.

func NewClientFactory

func NewClientFactory(httpClient, stateClient *http.Client, tlsConfig *TLSConfig) (ClientFactory, error)

type ContainerMetricsCollection

type ContainerMetricsCollection struct {
	CellID string       `json:"cell_id"`
	LRPs   []LRPMetric  `json:"lrps"`
	Tasks  []TaskMetric `json:"tasks"`
}

type ContainerMetricsProvider

type ContainerMetricsProvider interface {
	Metrics() map[string]*containermetrics.CachedContainerMetrics
}

type FixedSetRootFSProvider

type FixedSetRootFSProvider = bbsmodels.FixedSetRootFSProvider

type InsufficientResourcesError

type InsufficientResourcesError = bbsmodels.InsufficientResourcesError

type InternalRoute

type InternalRoute = bbsmodels.InternalRoute

type InternalRoutes

type InternalRoutes = bbsmodels.InternalRoutes

type LRP

type LRPMetric

type LRPMetric struct {
	InstanceGUID string `json:"instance_guid"`
	ProcessGUID  string `json:"process_guid"`
	Index        int32  `json:"index"`
	containermetrics.CachedContainerMetrics
}

type LRPUpdate

type LRPUpdate = bbsmodels.LRPUpdate

type PlacementConstraint

type PlacementConstraint = bbsmodels.PlacementConstraint

type Resource

type Resource = bbsmodels.Resource

type Resources

type Resources = bbsmodels.Resources

type RootFSProvider

type RootFSProvider = bbsmodels.RootFSProvider

type RootFSProviderType

type RootFSProviderType = bbsmodels.RootFSProviderType

type RootFSProviders

type RootFSProviders = bbsmodels.RootFSProviders

type RunRequestConversionHelper

type RunRequestConversionHelper struct {
	ECRHelper ecrhelper.ECRHelper
}

func (RunRequestConversionHelper) NewRunRequestFromDesiredLRP

func (rrch RunRequestConversionHelper) NewRunRequestFromDesiredLRP(
	containerGuid string,
	desiredLRP *models.DesiredLRP,
	lrpKey *models.ActualLRPKey,
	lrpInstanceKey *models.ActualLRPInstanceKey,
	stackPathMap StackPathMap,
	layeringMode string,
) (executor.RunRequest, error)

func (RunRequestConversionHelper) NewRunRequestFromTask

func (rrch RunRequestConversionHelper) NewRunRequestFromTask(task *models.Task, stackPathMap StackPathMap, layeringMode string) (executor.RunRequest, error)

type SimClient

type SimClient = models.RepSimClient

SimClient extends Client with simulation capabilities. Also available as code.cloudfoundry.org/bbs/models.RepSimClient.

type StackPathMap

type StackPathMap map[string]string

StackPathMap maps aliases to rootFS paths on the system.

func (StackPathMap) PathForRootFS

func (m StackPathMap) PathForRootFS(rootFS string) (string, error)

PathForRootFS resolves the hostname portion of the RootFS URL to the actual path to the preloaded rootFS on the system according to the StackPathMap.

func (StackPathMap) StackVersionList

func (m StackPathMap) StackVersionList() []string

type StringSet

type StringSet = bbsmodels.StringSet

type TLSConfig

type TLSConfig struct {
	RequireTLS                    bool
	CertFile, KeyFile, CaCertFile string
	ClientCacheSize               int // the tls client cache size, 0 means use golang default value
}

capture the behavior described in the comment of this story https://www.pivotaltracker.com/story/show/130664747/comments/152863773

type Task

type TaskMetric

type TaskMetric struct {
	TaskGUID string `json:"task_guid"`
	containermetrics.CachedContainerMetrics
}

type Work

type Work = bbsmodels.Work

Directories

Path Synopsis
auctioncellrepfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
cmd
gocurl command
rep command
evacuation_context/fake_evacuation_context
Code generated by counterfeiter.
Code generated by counterfeiter.
generator creates operations for container processing
generator creates operations for container processing
fake_generator
Code generated by counterfeiter.
Code generated by counterfeiter.
internal/fake_internal
Code generated by counterfeiter.
Code generated by counterfeiter.
handlersfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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