ir

package
v0.2.0-beta6 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2022 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Copyright 2022 The envd Authors

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

View Source
var DefaultGraph = NewGraph()

Functions

func Base

func Base(os, language, image string) error

func CRANMirror added in v0.1.0

func CRANMirror(url string) error

func CUDA

func CUDA(version, cudnn string)

func Compile

func Compile(ctx context.Context, envName string, pub string) (*llb.Definition, error)

func CompileEntrypoint added in v0.2.0

func CompileEntrypoint(buildContextDir string) ([]string, error)

func CompileEnviron added in v0.2.0

func CompileEnviron() []string

func CondaChannel added in v0.1.0

func CondaChannel(channel string, useMamba bool) error

func CondaPackage added in v0.1.0

func CondaPackage(deps []string, channel []string, envFile string) error

func Copy added in v0.2.0

func Copy(src, dest string)

func Entrypoint added in v0.2.0

func Entrypoint(args []string)

func ExposedPorts added in v0.2.0

func ExposedPorts() (map[string]struct{}, error)

func GPU added in v0.1.0

func GPU(numGPUs int)

func GPUEnabled

func GPUEnabled() bool

func Git added in v0.1.0

func Git(name, email, editor string) error

func HTTP added in v0.2.0

func HTTP(url, checksum, filename string) error

func JuliaPackage added in v0.2.0

func JuliaPackage(deps []string)

func JuliaPackageServer added in v0.2.0

func JuliaPackageServer(url string) error

func Jupyter

func Jupyter(pwd string, port int64) error

func Labels

func Labels() (map[string]string, error)

func Mount added in v0.2.0

func Mount(src, dest string)

func NumGPUs added in v0.1.0

func NumGPUs() int

func PyPIIndex

func PyPIIndex(url, extraURL string) error

func PyPIPackage

func PyPIPackage(deps []string, requirementsFile string, wheels []string) error

func RPackage added in v0.1.0

func RPackage(deps []string)

func RStudioServer added in v0.2.0

func RStudioServer() error

func Run

func Run(commands []string) error

func RuntimeCommands added in v0.2.0

func RuntimeCommands(commands map[string]string)

func RuntimeDaemon added in v0.2.0

func RuntimeDaemon(commands [][]string)

func RuntimeEnviron added in v0.2.0

func RuntimeEnviron(env map[string]string)

func RuntimeExpose added in v0.2.0

func RuntimeExpose(envdPort, hostPort int, serviceName string) error

func Shell

func Shell(shell string) error

func SystemPackage

func SystemPackage(deps []string)

func UbuntuAPT

func UbuntuAPT(source string) error

UbuntuAPT updates the Ubuntu apt source.list in the image.

func VSCodePlugins

func VSCodePlugins(plugins []string) error

Types

type CondaConfig added in v0.1.0

type CondaConfig struct {
	CondaPackages      []string
	AdditionalChannels []string
	CondaChannel       *string
	CondaEnvFileName   string
	UseMicroMamba      bool
}

type CopyInfo added in v0.2.0

type CopyInfo struct {
	Source      string
	Destination string
}

type ExposeItem added in v0.2.0

type ExposeItem struct {
	EnvdPort    int
	HostPort    int
	ServiceName string
}

type GitConfig added in v0.1.0

type GitConfig struct {
	Name   string
	Email  string
	Editor string
}

type Graph

type Graph struct {
	OS string
	Language
	Image *string

	Shell   string
	CUDA    *string
	CUDNN   *string
	NumGPUs int

	UbuntuAPTSource    *string
	CRANMirrorURL      *string
	JuliaPackageServer *string
	PyPIIndexURL       *string
	PyPIExtraIndexURL  *string

	PublicKeyPath string

	PyPIPackages     []string
	RequirementsFile *string
	PythonWheels     []string
	RPackages        []string
	JuliaPackages    []string
	SystemPackages   []string

	VSCodePlugins []vscode.Plugin

	Exec       []string
	Copy       []CopyInfo
	Mount      []MountInfo
	HTTP       []HTTPInfo
	Entrypoint []string

	*JupyterConfig
	*GitConfig
	*CondaConfig
	*RStudioServerConfig

	Writer compileui.Writer
	// EnvironmentName is the base name of the environment.
	// It is the BaseDir(BuildContextDir)
	// e.g. mnist, streamlit-mnist
	EnvironmentName string

	RuntimeGraph
	// contains filtered or unexported fields
}

A Graph contains the state, such as its call stack and thread-local storage. TODO(gaocegeg): Refactor it to support order.

func NewGraph

func NewGraph() *Graph

func (Graph) CacheID

func (g Graph) CacheID(filename string) string

func (Graph) Compile

func (g Graph) Compile(uid, gid int) (llb.State, error)

func (Graph) CompileCacheDir added in v0.2.0

func (g Graph) CompileCacheDir(root llb.State, cacheDir string) llb.State

func (Graph) CondaEnabled added in v0.1.0

func (g Graph) CondaEnabled() bool

func (Graph) DefaultCacheImporter added in v0.2.0

func (g Graph) DefaultCacheImporter() (*string, error)

func (Graph) EnvString added in v0.2.0

func (g Graph) EnvString() []string

func (Graph) ExposedPorts added in v0.2.0

func (g Graph) ExposedPorts() (map[string]struct{}, error)

func (Graph) GPUEnabled

func (g Graph) GPUEnabled() bool

func (Graph) GetEntrypoint added in v0.2.0

func (g Graph) GetEntrypoint(buildContextDir string) ([]string, error)

func (Graph) Labels

func (g Graph) Labels() (map[string]string, error)

type HTTPInfo added in v0.2.0

type HTTPInfo struct {
	URL      string
	Checksum digest.Digest
	Filename string
}

type JupyterConfig

type JupyterConfig struct {
	Token string
	Port  int64
}

type Language added in v0.1.0

type Language struct {
	Name    string
	Version *string
}

type MountInfo added in v0.2.0

type MountInfo struct {
	Source      string
	Destination string
}

type RStudioServerConfig added in v0.2.0

type RStudioServerConfig struct {
}

type RuntimeGraph added in v0.2.0

type RuntimeGraph struct {
	RuntimeCommands map[string]string
	RuntimeDaemon   [][]string
	RuntimeEnviron  map[string]string
	RuntimeExpose   []ExposeItem
}

The results during runtime should be maintained here

func (*RuntimeGraph) Dump added in v0.2.0

func (rg *RuntimeGraph) Dump() (string, error)

func (*RuntimeGraph) Load added in v0.2.0

func (rg *RuntimeGraph) Load(code []byte) error

Jump to

Keyboard shortcuts

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