constants

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Default name for Kitfile (otherwise specified via the -f flag in pack)
	DefaultKitfileName = "Kitfile"
	// IgnoreFileName is the name for the Kit ignore file
	IgnoreFileName = ".kitignore"

	// Constants for the directory structure of kit's cached images and credentials
	// Modelkits are stored in $KITOPS_HOME/storage/ and
	// credentials are stored in $KITOPS_HOME/credentials.json
	DefaultConfigSubdir               = "kitops"
	StorageSubpath                    = "storage"
	CacheSubpath                      = "cache"
	CredentialsSubpath                = "credentials.json"
	HarnessSubpath                    = "harness"
	HarnessProcessFile                = "process.pid"
	HarnessLogFile                    = "harness.log"
	UpdateNotificationsConfigFilename = "disable-update-notifications"

	// Kitops-specific annotations for modelkit artifacts
	CliVersionAnnotation = "ml.kitops.modelkit.cli-version"

	// MaxModelRefChain is the maximum number of "parent" modelkits a modelkit may have
	// by e.g. referring to another modelkit in its .model.path
	MaxModelRefChain = 10
)
View Source
const (
	KitopsHomeEnvVar    = "KITOPS_HOME"
	ClientCertEnvVar    = "KITOPS_CLIENT_CERT"
	ClientCertKeyEnvVar = "KITOPS_CLIENT_KEY"
)
View Source
const (
	ConfigType    = "config"
	ModelType     = "model"
	ModelPartType = "modelpart"
	DatasetType   = "dataset"
	CodeType      = "code"
	DocsType      = "docs"
)
View Source
const (
	NoneCompression        = "none"
	GzipCompression        = "gzip"
	GzipFastestCompression = "gzip-fastest"
)

Variables

View Source
var (
	Version   = "unknown"
	GitCommit = "unknown"
	BuildTime = "unknown"
	GoVersion = runtime.Version()
)

Default build-time variables These values are overridden via ldflags

View Source
var ModelConfigMediaType = MediaType{
	BaseType: ConfigType,
}

Functions

func CachePath

func CachePath(configBase string) string

func CredentialsPath

func CredentialsPath(configBase string) string

func DefaultConfigPath

func DefaultConfigPath() (string, error)

DefaultConfigPath returns the default configuration and cache directory for the CLI. This is platform-dependent, using

  • $XDG_DATA_HOME/kitops on Linux, with fall back to $HOME/.local/share/kitops
  • ~/Library/Caches/kitops on MacOS
  • %LOCALAPPDATA%\kitops

func DefaultKitfileNames

func DefaultKitfileNames() []string

func FileIsLocalIndex

func FileIsLocalIndex(indexPath string) bool

func FormatMediaTypeForUser

func FormatMediaTypeForUser(mediaType string) string

func HarnessPath

func HarnessPath(configBase string) string

func IndexJsonPath

func IndexJsonPath(storageBase string) string

IndexJsonPath is a wrapper for getting the index.json path for a local OCI index, based off the base path of the index.

func IndexJsonPathForRepo

func IndexJsonPathForRepo(storageBase, repo string) string

IndexJsonPathForRepo returns the path to an index.json that is scoped for a specific repo (org/name)

func IngestPath

func IngestPath(storageBase string) string

func IsDefaultKitfileName

func IsDefaultKitfileName(filename string) bool

func IsValidCompression

func IsValidCompression(compression string) error

func RepoForIndexJsonPath

func RepoForIndexJsonPath(indexPath string) (string, error)

RepoForIndexJsonPath returns the repository for an OCI index JSON file as generated by IndexJsonPathForRepo

func StoragePath

func StoragePath(configBase string) string

func TagIndexPathForRepo

func TagIndexPathForRepo(storageBase, repo string) string

Types

type ConfigKey

type ConfigKey struct{}

type MediaType

type MediaType struct {
	BaseType    string
	Compression string
}

func ParseMediaType

func ParseMediaType(s string) MediaType

func (MediaType) String

func (t MediaType) String() string

Jump to

Keyboard shortcuts

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