Documentation
¶
Index ¶
- Constants
- Variables
- func AskForPythonVersion(defaultVersionId string, baseImageTypes []tensorleapapi.GenericBaseImage) (string, error)
- func BundleCodeIntoTempFile(filesDir string, workspaceConfig *workspace.WorkspaceConfig) (close func(), tarGzFile *os.File, err error)
- func CloneCodeSnapshot(ctx context.Context, codeSnapshot *tensorleapapi.CodeSnapshot, ...) ([]string, error)
- func CompareCodeVersion(ctx context.Context, compareVersion *CodeSnapshot, tarGzFile *os.File, ...) (bool, error)
- func CreateOrSelectBranch(branch string, branches []string, defaultBranch string) (selectedBranch string, err error)
- func DownloadCodeSnapshotArchive(ctx context.Context, codeSnapshot *tensorleapapi.CodeSnapshot, ...) error
- func FetchFileFromTarGz(blobURL string, filename string) (string, error)
- func GetCodeSnapshotUploadUrl(ctx context.Context, projectId string) (string, error)
- func GetLastEngineErrors(ctx context.Context, jobId string, count int) ([]string, error)
- func GetPythonVersionFromFlag(ctx context.Context, flag string) (string, error)
- func GetPythonVersions(ctx context.Context) ([]tensorleapapi.GenericBaseImage, string, error)
- func IsCodeEnded(codeSnapshot *CodeSnapshot) bool
- func IsCodeFinished(codeSnapshot *CodeSnapshot) bool
- func IsCodeParseFailed(codeSnapshot *CodeSnapshot) bool
- func PushCode(ctx context.Context, tarGzFile *os.File, ...) (pushed bool, current *tensorleapapi.PushCodeSnapshotResponse, err error)
- func PushCodeSnapshot(ctx context.Context, tarGzFile io.Reader, fileSize int64, ...) (*tensorleapapi.PushCodeSnapshotResponse, error)
- func SelectBranch(branches []string, defaultBranch string) (selectedBranch string, err error)
- func ShowReportInteractive(report *CodeSnapshotParserErr) error
- func SyncBranchFromFlagAndConfig(flagBranch string, workspaceConfig *workspace.WorkspaceConfig) (string, error)
- func SyncPythonVersionFromFlagAndConfig(ctx context.Context, flag string, workspaceConfig *workspace.WorkspaceConfig) (string, error)
- func WaitForCodeIntegrationStatus(ctx context.Context, projectId, codeSnapshotId string) (bool, error)
- type BinderError
- type CodeSnapshot
- type CodeSnapshotParserErr
- type CodeSnapshotParserErrs
- type EmptyPageContent
- type LargeFilesResult
- type ParserErrorsPageContent
Constants ¶
const TIMEOUT_FOR_CODE_INTEGRATION_STATUS = 90 * time.Minute
Variables ¶
var ErrCodeIntegrationTimeout = fmt.Errorf("timeout occurred while waiting for the integration code status")
var ErrEmptyCodeSnapshot = fmt.Errorf("CodeIntegration is empty")
var LargeFileDirPatterns = []string{
".git",
}
LargeFileDirPatterns contains directory patterns for typically large/state directories
var LargeFileExtensions = []string{
".onnx",
".pth", ".pt", ".ckpt", ".bin",
".safetensors",
".pb", ".tflite",
".h5", ".hdf5", ".keras",
".pkl", ".pickle", ".joblib",
".npz", ".npy",
".mlx", ".gguf", ".ggml",
".trt", ".engine",
".tar", ".tar.gz", ".tgz",
".png", ".jpg", ".jpeg", ".gif", ".bmp", ".tiff", ".webp", ".ico",
".psd", ".ai", ".sketch",
".mp4", ".mov", ".avi", ".mkv", ".webm",
".mp3", ".wav", ".flac", ".ogg", ".m4a",
".stl", ".obj", ".fbx", ".glb", ".gltf",
".jsonl", ".parquet", ".arrow", ".orc", ".feather",
".db", ".sqlite", ".sqlite3",
".zip", ".7z", ".rar",
".dump", ".bak",
}
LargeFileExtensions contains extensions for files that are typically large and may indicate model weights, media files, datasets, or other binary data
var RequirementsFiles = []string{
"pyproject.toml",
"requirements.txt",
"tensorleap_requirements.txt",
}
Functions ¶
func AskForPythonVersion ¶ added in v0.0.92
func AskForPythonVersion(defaultVersionId string, baseImageTypes []tensorleapapi.GenericBaseImage) (string, error)
func BundleCodeIntoTempFile ¶ added in v0.0.20
func CloneCodeSnapshot ¶ added in v0.0.129
func CloneCodeSnapshot(ctx context.Context, codeSnapshot *tensorleapapi.CodeSnapshot, outputDir string, specificFileName string) ([]string, error)
func CompareCodeVersion ¶ added in v0.0.23
func CreateOrSelectBranch ¶ added in v0.0.84
func DownloadCodeSnapshotArchive ¶ added in v0.0.133
func DownloadCodeSnapshotArchive(ctx context.Context, codeSnapshot *tensorleapapi.CodeSnapshot, outputPath string) error
func FetchFileFromTarGz ¶ added in v0.0.26
func GetCodeSnapshotUploadUrl ¶ added in v0.0.129
func GetLastEngineErrors ¶ added in v0.0.139
func GetPythonVersionFromFlag ¶ added in v0.0.92
func GetPythonVersions ¶ added in v0.0.92
func GetPythonVersions(ctx context.Context) ([]tensorleapapi.GenericBaseImage, string, error)
func IsCodeEnded ¶ added in v0.0.129
func IsCodeEnded(codeSnapshot *CodeSnapshot) bool
func IsCodeFinished ¶ added in v0.0.129
func IsCodeFinished(codeSnapshot *CodeSnapshot) bool
func IsCodeParseFailed ¶ added in v0.0.23
func IsCodeParseFailed(codeSnapshot *CodeSnapshot) bool
func PushCode ¶ added in v0.0.23
func PushCode(ctx context.Context, tarGzFile *os.File, entryFile, secretId, pythonVersion, versionName, projectId, branch string, overwriteVersionId string) (pushed bool, current *tensorleapapi.PushCodeSnapshotResponse, err error)
func PushCodeSnapshot ¶ added in v0.0.129
func PushCodeSnapshot( ctx context.Context, tarGzFile io.Reader, fileSize int64, entryFile, secretId, pythonVersion, versionName, projectId, branch string, overwriteVersionId string, ) (*tensorleapapi.PushCodeSnapshotResponse, error)
func SelectBranch ¶ added in v0.0.84
func ShowReportInteractive ¶ added in v0.0.139
func ShowReportInteractive(report *CodeSnapshotParserErr) error
ShowReportInteractive displays the report in an interactive tabbed interface
func SyncBranchFromFlagAndConfig ¶ added in v0.0.84
func SyncBranchFromFlagAndConfig(flagBranch string, workspaceConfig *workspace.WorkspaceConfig) (string, error)
func SyncPythonVersionFromFlagAndConfig ¶ added in v0.0.92
Types ¶
type BinderError ¶ added in v0.0.139
type BinderError struct {
// contains filtered or unexported fields
}
type CodeSnapshot ¶ added in v0.0.129
type CodeSnapshot = tensorleapapi.CodeSnapshot
func GetCodeSnapshot ¶ added in v0.0.129
func GetCodeSnapshot(ctx context.Context, projectId, id string) (*CodeSnapshot, error)
type CodeSnapshotParserErr ¶ added in v0.0.139
type CodeSnapshotParserErr struct {
TopLogs []string
// contains filtered or unexported fields
}
func CollectErrorsOnCodeParseFailed ¶ added in v0.0.139
func CollectErrorsOnCodeParseFailed(ctx context.Context, jobId string, codeSnapshot *tensorleapapi.CodeSnapshot, commandStartTime time.Time) (*CodeSnapshotParserErr, error)
func (*CodeSnapshotParserErr) Init ¶ added in v0.0.139
func (r *CodeSnapshotParserErr) Init() tea.Cmd
func (*CodeSnapshotParserErr) ToReportPages ¶ added in v0.0.139
func (r *CodeSnapshotParserErr) ToReportPages() *interactive_pages.ReportPages
ToReportPages converts a CodeSnapshotParserErr to an interactive ReportPages for displaying in a tabbed interface
func (*CodeSnapshotParserErr) View ¶ added in v0.0.139
func (r *CodeSnapshotParserErr) View() string
type CodeSnapshotParserErrs ¶ added in v0.0.139
type CodeSnapshotParserErrs struct {
// contains filtered or unexported fields
}
func CollectCodeSnapshotParserErr ¶ added in v0.0.139
func CollectCodeSnapshotParserErr(civ *CodeSnapshot) *CodeSnapshotParserErrs
func (*CodeSnapshotParserErrs) View ¶ added in v0.0.139
func (r *CodeSnapshotParserErrs) View() string
type EmptyPageContent ¶ added in v0.0.139
type EmptyPageContent struct {
// contains filtered or unexported fields
}
--------------------------- Empty Page Content ---------------------------
func (*EmptyPageContent) Init ¶ added in v0.0.139
func (e *EmptyPageContent) Init() tea.Cmd
func (*EmptyPageContent) View ¶ added in v0.0.139
func (e *EmptyPageContent) View() string
type LargeFilesResult ¶ added in v0.0.133
type LargeFilesResult struct {
TotalSize int64 // Total size of all large files in bytes
SizePerPattern map[string]int64 // Size sum per glob pattern (e.g., "*.png" -> 1024)
MatchedPatterns map[string][]string // Map of glob pattern (e.g., "*.png", ".git/**") -> list of matching file paths
RemainingFiles []string // Files that don't match any large file pattern
}
LargeFilesResult holds the result of scanning for large files
func SumLargeFilesSize ¶ added in v0.0.133
func SumLargeFilesSize(filesDir string, filePaths []string) (*LargeFilesResult, error)
SumLargeFilesSize calculates the total size of files that match large file extensions or are inside state directories like .git Returns: - LargeFilesResult containing total size, matched patterns with their files, and remaining files - error if any
type ParserErrorsPageContent ¶ added in v0.0.139
type ParserErrorsPageContent struct {
// contains filtered or unexported fields
}
--------------------------- Parser Errors Page Content ---------------------------
func (*ParserErrorsPageContent) Init ¶ added in v0.0.139
func (p *ParserErrorsPageContent) Init() tea.Cmd
func (*ParserErrorsPageContent) View ¶ added in v0.0.139
func (p *ParserErrorsPageContent) View() string