Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ jobs:
- name: Golangci lint
uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9.3.0
with:
version: v2.4
version: v2.15.0
args: --verbose --timeout=10m
8 changes: 4 additions & 4 deletions pkg/modelfile/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -480,10 +480,10 @@ func InferFileType(filename string, fileSize int64) FileType {

const (
// File size thresholds and workspace limits
WeightFileSizeThreshold int64 = 128 * humanize.MByte // 128MB - threshold for considering file as weight file
MaxSingleFileSize int64 = 128 * humanize.GByte // 128GB - maximum size for a single file
MaxWorkspaceFileCount int = 2048 // 2048 files - maximum number of files in workspace
MaxTotalWorkspaceSize int64 = 8 * humanize.TByte // 8TB - maximum total workspace size
WeightFileSizeThreshold int64 = 512 * humanize.MByte // 512MB - threshold for considering file as weight file
MaxSingleFileSize int64 = 512 * humanize.GByte // 512GB - maximum size for a single file
MaxWorkspaceFileCount int = 4096 // 4096 files - maximum number of files in workspace
MaxTotalWorkspaceSize int64 = 32 * humanize.TByte // 32TB - maximum total workspace size
)

// IsFileType checks if the filename matches any of the given patterns
Expand Down
8 changes: 4 additions & 4 deletions pkg/modelfile/constants_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,10 @@ func TestInferFileType(t *testing.T) {
{"no extension small", "unknown_file", 1024, FileTypeCode},
{"unknown ext small", "data.xyz", 50 * 1024, FileTypeCode},

// Unrecognized - large files fallback to model
{"dotfile large", ".metadata", 200 * 1024 * 1024, FileTypeModel},
{"no extension large", "unknown_file", 200 * 1024 * 1024, FileTypeModel},
{"unknown ext large", "data.xyz", 200 * 1024 * 1024, FileTypeModel},
// Unrecognized - large files fallback to model (use threshold-bound size so cases stay valid when threshold changes)
{"dotfile large", ".metadata", WeightFileSizeThreshold + 1, FileTypeModel},
{"no extension large", "unknown_file", WeightFileSizeThreshold + 1, FileTypeModel},
{"unknown ext large", "data.xyz", WeightFileSizeThreshold + 1, FileTypeModel},

// Edge case: exactly at threshold (WeightFileSizeThreshold = 128*1000*1000) should be code
{"at threshold", "borderline", WeightFileSizeThreshold, FileTypeCode},
Expand Down
Loading