image

package
v0.0.0-...-f65cf3b Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2024 License: AGPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDockerHubToken

func GetDockerHubToken(opts *BuildOpts) (string, error)

Docker Hub

func GetECRToken

func GetECRToken(opts *BuildOpts) (string, error)

Amazon Elastic Container Registry Gets the ECR Authorization Token on behalf of the user.

func GetGARToken

func GetGARToken(opts *BuildOpts) (string, error)

Google Artifact Registry

func GetNGCToken

func GetNGCToken(opts *BuildOpts) (string, error)

func GetRegistryToken

func GetRegistryToken(opts *BuildOpts) (string, error)

Check which registry is passed in

Types

type BaseImage

type BaseImage struct {
	Registry string
	Repo     string
	Tag      string
	Digest   string
}

func ExtractImageNameAndTag

func ExtractImageNameAndTag(imageRef string) (BaseImage, error)

func (*BaseImage) String

func (i *BaseImage) String() string

type BuildOpts

type BuildOpts struct {
	BaseImageRegistry  string
	BaseImageName      string
	BaseImageTag       string
	BaseImageCreds     string
	PythonVersion      string
	PythonPackages     []string
	Commands           []string
	BuildSteps         []BuildStep
	ExistingImageUri   string
	ExistingImageCreds map[string]string
	ForceRebuild       bool
	EnvVars            []string
}

func (*BuildOpts) String

func (o *BuildOpts) String() string

type BuildStep

type BuildStep struct {
	Command string
	Type    string
}

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

func NewBuilder

func NewBuilder(config types.AppConfig, registry *common.ImageRegistry, scheduler *scheduler.Scheduler, tailscale *network.Tailscale, containerRepo repository.ContainerRepository) (*Builder, error)

func (*Builder) Build

func (b *Builder) Build(ctx context.Context, opts *BuildOpts, outputChan chan common.OutputMsg) error

Build user image

func (*Builder) Exists

func (b *Builder) Exists(ctx context.Context, imageId string) bool

Check if an image already exists in the registry

func (*Builder) GetImageId

func (b *Builder) GetImageId(opts *BuildOpts) (string, error)

type ImageIdHash

type ImageIdHash struct {
	BaseImageName   string
	BaseImageTag    string
	UserImageTag    string
	PythonVersion   string
	PythonPackages  []string
	ExitingImageUri string
	CommandListHash string
}

type ImageService

type ImageService interface {
	pb.ImageServiceServer
	VerifyImageBuild(ctx context.Context, in *pb.VerifyImageBuildRequest) (*pb.VerifyImageBuildResponse, error)
	BuildImage(in *pb.BuildImageRequest, stream pb.ImageService_BuildImageServer) error
}

func NewRuncImageService

func NewRuncImageService(
	ctx context.Context,
	opts ImageServiceOpts,
) (ImageService, error)

type ImageServiceOpts

type ImageServiceOpts struct {
	Config        types.AppConfig
	ContainerRepo repository.ContainerRepository
	Scheduler     *scheduler.Scheduler
	Tailscale     *network.Tailscale
}

type PythonStandaloneTemplate

type PythonStandaloneTemplate struct {
	PythonVersion string

	// Architecture, OS, and Vendor are determined at runtime
	Architecture string
	OS           string
	Vendor       string
}

PythonStandaloneTemplate is used to render the standalone python install script

type RuncImageService

type RuncImageService struct {
	pb.UnimplementedImageServiceServer
	// contains filtered or unexported fields
}

func (*RuncImageService) BuildImage

func (*RuncImageService) VerifyImageBuild

Jump to

Keyboard shortcuts

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