dockerfile

package
v0.11.0-alpha1 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const BaseImageRegistry = "r8.im"
View Source
const CFlags = "ENV CFLAGS=\"-O3 -funroll-loops -fno-strict-aliasing -flto -S\""
View Source
const DockerignoreHeader = `` /* 231-byte string literal not displayed */
View Source
const LDConfigCacheBuildCommand = "RUN find / -type f -name \"*python*.so\" -printf \"%h\\n\" | sort -u > /etc/ld.so.conf.d/cog.conf && ldconfig"
View Source
const MinimumCUDAVersion = "11.6"
View Source
const MinimumPythonVersion = "3.8"
View Source
const MinimumTorchVersion = "1.13.1"
View Source
const PrecompilePythonCommand = "" /* 247-byte string literal not displayed */
View Source
const StripDebugSymbolsCommand = "find / -type f -name \"*python*.so\" -not -name \"*cpython*.so\" -exec strip -S {} \\;"

Variables

This section is empty.

Functions

func BaseImageConfigurationExists added in v0.9.7

func BaseImageConfigurationExists(cudaVersion, pythonVersion, torchVersion string) (bool, string, string, string)

func BaseImageName added in v0.9.7

func BaseImageName(cudaVersion string, pythonVersion string, torchVersion string) string

Types

type AvailableBaseImageConfigurations added in v0.9.10

type AvailableBaseImageConfigurations struct {
	PythonVersions []PythonVersion `json:"python_versions"`
}

type BaseImageConfiguration added in v0.9.7

type BaseImageConfiguration struct {
	CUDAVersion   string `json:"cuda_version" yaml:"cuda_version"`
	PythonVersion string `json:"python_version" yaml:"python_version"`
	TorchVersion  string `json:"torch_version" yaml:"torch_version"`
}

func BaseImageConfigurations added in v0.9.7

func BaseImageConfigurations() []BaseImageConfiguration

BaseImageConfigurations returns a list of CUDA/Python/Torch versions

func (BaseImageConfiguration) MarshalJSON added in v0.9.7

func (b BaseImageConfiguration) MarshalJSON() ([]byte, error)

type BaseImageGenerator added in v0.9.7

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

func NewBaseImageGenerator added in v0.9.7

func NewBaseImageGenerator(cudaVersion string, pythonVersion string, torchVersion string) (*BaseImageGenerator, error)

func (*BaseImageGenerator) GenerateDockerfile added in v0.9.7

func (g *BaseImageGenerator) GenerateDockerfile() (string, error)

type CUDAVersion added in v0.9.10

type CUDAVersion struct {
	Version string `json:"versions"`
}

type Generator added in v0.0.16

type Generator struct {
	Config *config.Config
	Dir    string

	// these are here to make this type testable
	GOOS   string
	GOARCH string
	// contains filtered or unexported fields
}

func NewGenerator

func NewGenerator(config *config.Config, dir string) (*Generator, error)

func (*Generator) BaseImage added in v0.9.10

func (g *Generator) BaseImage() (string, error)

func (*Generator) Cleanup added in v0.0.16

func (g *Generator) Cleanup() error

func (*Generator) GenerateDockerfileWithoutSeparateWeights added in v0.8.0

func (g *Generator) GenerateDockerfileWithoutSeparateWeights() (string, error)

GenerateDockerfileWithoutSeparateWeights generates a Dockerfile that doesn't write model weights to a separate layer.

func (*Generator) GenerateModelBase added in v0.9.7

func (g *Generator) GenerateModelBase() (string, error)

func (*Generator) GenerateModelBaseWithSeparateWeights added in v0.9.7

func (g *Generator) GenerateModelBaseWithSeparateWeights(imageName string) (weightsBase string, dockerfile string, dockerignoreContents string, err error)

GenerateModelBaseWithSeparateWeights creates the Dockerfile and .dockerignore file contents for model weights It returns four values: - weightsBase: The base image used for Dockerfile generation for model weights. - dockerfile: A string that represents the Dockerfile content generated by the function. - dockerignoreContents: A string that represents the .dockerignore content. - err: An error object if an error occurred during Dockerfile generation; otherwise nil.

func (*Generator) GenerateWeightsManifest added in v0.8.3

func (g *Generator) GenerateWeightsManifest() (*weights.Manifest, error)

func (*Generator) IsUsingCogBaseImage added in v0.9.10

func (g *Generator) IsUsingCogBaseImage() bool

func (*Generator) SetPrecompile added in v0.9.24

func (g *Generator) SetPrecompile(precompile bool)

func (*Generator) SetStrip added in v0.9.21

func (g *Generator) SetStrip(strip bool)

func (*Generator) SetUseCogBaseImage added in v0.9.7

func (g *Generator) SetUseCogBaseImage(useCogBaseImage bool)

func (*Generator) SetUseCudaBaseImage added in v0.8.2

func (g *Generator) SetUseCudaBaseImage(argumentValue string)

type PyTorchVersion added in v0.9.10

type PyTorchVersion struct {
	Version string `json:"version"`
}

type PythonVersion added in v0.9.10

type PythonVersion struct {
	Version string           `json:"version"`
	PyTorch []PyTorchVersion `json:"pytorch"`
	CUDA    []CUDAVersion    `json:"cuda"`
}

Jump to

Keyboard shortcuts

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