Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to sigs.k8s.io/yaml instead of default; fixup jozufile struct #16

Merged
merged 2 commits into from
Feb 13, 2024
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 examples/onnx/Jozufile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
manifestVersion: 1.0
manifestVersion: v1.0.0
package:
name: Densenet-ONNX
description: >-
Expand Down
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ require (
github.com/opencontainers/go-digest v1.0.0
github.com/opencontainers/image-spec v1.1.0-rc5
github.com/spf13/cobra v1.8.0
gopkg.in/yaml.v3 v3.0.1
oras.land/oras-go/v2 v2.3.1
sigs.k8s.io/yaml v1.4.0
)

require (
Expand All @@ -30,6 +30,7 @@ require (
golang.org/x/sys v0.15.0 // indirect
golang.org/x/text v0.14.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

require (
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,5 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
oras.land/oras-go/v2 v2.3.1 h1:lUC6q8RkeRReANEERLfH86iwGn55lbSWP20egdFHVec=
oras.land/oras-go/v2 v2.3.1/go.mod h1:5AQXVEu1X/FKp1F9DMOb5ZItZBOa0y5dha0yCm4NR9c=
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=
61 changes: 31 additions & 30 deletions pkg/artifact/jozu_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,58 +5,59 @@ import (
"io"
"os"

"gopkg.in/yaml.v3"
"sigs.k8s.io/yaml"
)

type (
JozuFile struct {
ManifestVersion string `yaml:"manifestVersion"`
Package Package `yaml:"package"`
Code []Code `yaml:"code"`
DataSets []DataSet `yaml:"datasets"`
Models []TrainedModel `yaml:"models"`
ManifestVersion string `json:"manifestVersion"`
Package Package `json:"package,omitempty"`
Code []Code `json:"code,omitempty"`
DataSets []DataSet `json:"datasets,omitempty"`
Models []TrainedModel `json:"models,omitempty"`
}

Package struct {
Name string `yaml:"name"`
Version string `yaml:"version"`
Description string `yaml:"description"`
Authors []string `yaml:"authors"`
Name string `json:"name,omitempty"`
Version string `json:"version,omitempty"`
Description string `json:"description,omitempty"`
License string `json:"license,omitempty"`
Authors []string `json:"authors,omitempty"`
}

Code struct {
Path string `yaml:"path"`
License string `yaml:"license"`
Description string `yaml:"description"`
Path string `json:"path,omitempty"`
License string `json:"license,omitempty"`
Description string `json:"description,omitempty"`
}

DataSet struct {
Name string `yaml:"name"`
Path string `yaml:"path"`
Description string `yaml:"description"`
License string `yaml:"license"`
Preprocessing string `yaml:"preprocessing"`
Name string `json:"name,omitempty"`
Path string `json:"path,omitempty"`
Description string `json:"description,omitempty"`
License string `json:"license,omitempty"`
Preprocessing string `json:"preprocessing,omitempty"`
}

TrainedModel struct {
Name string `yaml:"name"`
Path string `yaml:"path"`
Framework string `yaml:"framework"`
Version string `yaml:"version"`
Description string `yaml:"description"`
License string `yaml:"license"`
Training Training `yaml:"training"`
Validation Validation `yaml:"validation"`
Name string `json:"name,omitempty"`
Path string `json:"path,omitempty"`
Framework string `json:"framework,omitempty"`
Version string `json:"version,omitempty"`
Description string `json:"description,omitempty"`
License string `json:"license,omitempty"`
Training *Training `json:"training,omitempty"`
Validation *Validation `json:"validation,omitempty"`
}

Training struct {
DataSet string `yaml:"dataset"`
Parameters map[string]interface{} `yaml:"parameters"`
DataSet string `json:"dataset,omitempty"`
Parameters map[string]interface{} `json:"parameters,omitempty"`
}

Validation struct {
DataSet string `yaml:"dataset"`
Metrics map[string]interface{} `yaml:"metrics"`
DataSet string `json:"dataset,omitempty"`
Metrics map[string]interface{} `json:"metrics,omitempty"`
}
)

Expand Down