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/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ for _, p := range params { // stable order by p.Order
- This module is versioned as v9 in the module path. If releasing a new major version, update module path and coordinate with downstream consumers.

## Where to look next / follow-ups
- If you need runtime examples of how these models are consumed, search in the `cyverse-de` organization for imports of `github.com/cyverse-de/model/v9`.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

- If you need runtime examples of how these models are consumed, search in the `cyverse-de` organization for imports of `github.com/cyverse-de/model/**`.
- Add small focused tests for behavioral changes: a happy path + one edge case (e.g., collection trailing slash handling).

If any section is unclear or you'd like the file to include more examples (test examples, typical JSON payloads, or a small quick-start snippet for local testing), tell me which part and I'll iterate.
1 change: 1 addition & 0 deletions container.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ type Container struct {
MinGPUs int64 `json:"min_gpus"` // The minimum number of GPUs the container needs.
MinDiskSpace int64 `json:"min_disk_space"` // The minimum amount of disk space that the container needs.
PIDsLimit int64 `json:"pids_limit"`
GPUModels []string `json:"gpu_models"` // A list of acceptable GPU models. Empty means no limitation.
Image ContainerImage `json:"image"`
EntryPoint string `json:"entrypoint"`
WorkingDir string `json:"working_directory"`
Expand Down
23 changes: 23 additions & 0 deletions container_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,3 +272,26 @@ func TestPorts(t *testing.T) {
t.Error("bind to host was false")
}
}
func TestStepContainerGPUModels(t *testing.T) {
s := inittests(t)
gpumodels := s.Steps[0].Component.Container.GPUModels
nummodels := len(gpumodels)
if nummodels != 1 {
t.Errorf("The number of GPU models was '%d' instead of 1", nummodels)
}

if gpumodels[0] != "NVIDIA-A16" {
t.Errorf("The first GPU model was '%s' instead of 'NVIDIA-A16'", gpumodels[0])
}
}

func TestStepContainerGPUModelsEmpty(t *testing.T) {
s := inittestsFile(t, "test/no_volumes_submission.json")
gpumodels := s.Steps[0].Component.Container.GPUModels
if gpumodels == nil {
gpumodels = []string{}
}
if len(gpumodels) != 0 {
t.Errorf("The number of GPU models was '%d' instead of 0 when not specified", len(gpumodels))
}
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/cyverse-de/model/v9
module github.com/cyverse-de/model/v10

go 1.24

Expand Down
2 changes: 1 addition & 1 deletion jobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"strings"
"time"

"github.com/cyverse-de/model/v9/submitfile"
"github.com/cyverse-de/model/v10/submitfile"
"github.com/spf13/viper"
)

Expand Down
1 change: 1 addition & 0 deletions test/test_submission.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"tag":"latest",
"name":"gims.iplantcollaborative.org:5000/backwards-compat"
},
"gpu_models": ["NVIDIA-A16"],
"container_volumes_from" : [
{
"name":"vf-name1",
Expand Down