builder

package
v1.5.5 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 20 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Go118Version = "1.18.10"
	Go119Version = "1.19.13"
	Go120Version = "1.20.14"
	Go121Version = "1.21.7"
	Go122Version = "1.22.0"

	// When updating alpine image, ensure all golang build image combinations below exist
	LatestAlpineImageVersion = "3.19"
)

To add a new go version, add to `ADD NEW GO VERSION` [1], [2], [3], and [4]

Variables

View Source
var (
	// ADD NEW GO VERSION [2]
	// golang official dockerhub images to use for cosmos builds
	// Find from https://hub.docker.com/_/golang
	Go118Image = GolangAlpineImage(Go118Version, "3.17") // Go 1.18 is now deprecated, pinning to 3.17
	Go119Image = GolangAlpineImage(Go119Version, "3.18") // Go 1.19 is now deprecated, pinning to 3.18
	Go120Image = GolangAlpineImage(Go120Version, LatestAlpineImageVersion)
	Go121Image = GolangAlpineImage(Go121Version, LatestAlpineImageVersion)
	Go122Image = GolangAlpineImage(Go122Version, LatestAlpineImageVersion)

	// ADD NEW GO VERSION [3] - update GoDefaultVersion and GoDefaultImage to latest
	GoDefaultVersion = Go122Version
	GoDefaultImage   = Go122Image // default image for cosmos go builds if go.mod parse fails
)
View Source
var GoImageForVersion = map[string]GoVersion{
	"1.18": GoVersion{Version: Go118Version, Image: Go118Image},
	"1.19": GoVersion{Version: Go119Version, Image: Go119Image},
	"1.20": GoVersion{Version: Go120Version, Image: Go120Image},
	"1.21": GoVersion{Version: Go121Version, Image: Go121Image},
	"1.22": GoVersion{Version: Go122Version, Image: Go122Image},
}

GoImageForVersion is a map of go version to the builder image. Add new go versions here

Functions

func GolangAlpineImage added in v1.5.0

func GolangAlpineImage(goVersion, alpineVersion string) string

Types

type ChainNodeConfig

type ChainNodeConfig struct {
	Name               string         `yaml:"name"`
	RepoHost           string         `yaml:"repo-host"`
	GithubOrganization string         `yaml:"github-organization"`
	GithubRepo         string         `yaml:"github-repo"`
	Language           DockerfileType `yaml:"language"` // DEPRECATED, use "dockerfile" instead
	Dockerfile         DockerfileType `yaml:"dockerfile"`
	BuildTarget        string         `yaml:"build-target"`
	FinalImage         string         `yaml:"final-image"`
	BuildDir           string         `yaml:"build-dir"`
	Binaries           []string       `yaml:"binaries"`
	Libraries          []string       `yaml:"libraries"`
	TargetLibraries    []string       `yaml:"target-libraries"`
	Directories        []string       `yaml:"directories"`
	PreBuild           string         `yaml:"pre-build"`
	Platforms          []string       `yaml:"platforms"`
	BuildEnv           []string       `yaml:"build-env"`
	BaseImage          string         `yaml:"base-image"`
}

type ChainNodeDockerBuildConfig

type ChainNodeDockerBuildConfig struct {
	Build  ChainNodeConfig
	Ref    string
	Tag    string
	Latest bool
}

type DockerfileType

type DockerfileType string
const (
	DockerfileTypeCosmos    DockerfileType = "cosmos"
	DockerfileTypeAvalanche DockerfileType = "avalanche"
	DockerfileTypeCargo     DockerfileType = "cargo"
	DockerfileTypeImported  DockerfileType = "imported"

	DockerfileTypeGo   DockerfileType = "go"   // DEPRECATED, use "cosmos" instead
	DockerfileTypeRust DockerfileType = "rust" // DEPRECATED, use "cargo" instead
)

type GoVersion added in v1.2.0

type GoVersion struct {
	Version string
	Image   string
}

func GetImageAndVersionForGoVersion added in v1.2.0

func GetImageAndVersionForGoVersion(goVersion string, alpineVersion string) GoVersion

GetImageForGoVersion will return the build docker image for the provided go version

type HeighlinerBuilder

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

func NewHeighlinerBuilder

func NewHeighlinerBuilder(
	buildConfig HeighlinerDockerBuildConfig,
	parallel int16,
	local bool,
	race bool,
) *HeighlinerBuilder

func (*HeighlinerBuilder) AddToQueue

func (h *HeighlinerBuilder) AddToQueue(chainBuilds ...HeighlinerQueuedChainBuilds)

func (*HeighlinerBuilder) BuildImages

func (h *HeighlinerBuilder) BuildImages()

func (*HeighlinerBuilder) QueueLen added in v1.2.0

func (h *HeighlinerBuilder) QueueLen() int

type HeighlinerDockerBuildConfig

type HeighlinerDockerBuildConfig struct {
	ContainerRegistry string
	SkipPush          bool
	TarExportPath     string
	UseBuildKit       bool
	BuildKitAddr      string
	Platform          string
	NoCache           bool
	NoBuildCache      bool
	GoVersion         string
	AlpineVersion     string
}

type HeighlinerQueuedChainBuilds

type HeighlinerQueuedChainBuilds struct {
	ChainConfigs []ChainNodeDockerBuildConfig
}

Jump to

Keyboard shortcuts

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