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
6 changes: 6 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ formatters:
enable:
- gofmt
- goimports
- gci
settings:
gci:
sections:
- standard # stdlib
- default # everything else
Comment on lines +11 to +15
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The settings block for gci is incorrectly placed. According to the golangci-lint documentation, formatter settings should be under a top-level formatters-settings block, not nested within formatters.

Please remove this block and add the settings under formatters-settings like this:

formatters-settings:
  gci:
    sections:
      - standard # stdlib
      - default  # everything else

Copy link
Contributor Author

Choose a reason for hiding this comment

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


linters:
enable:
Expand Down
5 changes: 2 additions & 3 deletions cmd/cli/commands/compose.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@ import (
"strconv"
"strings"

"github.com/docker/model-runner/cmd/cli/pkg/types"
"github.com/spf13/pflag"

"github.com/docker/model-runner/cmd/cli/desktop"
"github.com/docker/model-runner/cmd/cli/pkg/types"
"github.com/docker/model-runner/pkg/inference"
"github.com/docker/model-runner/pkg/inference/backends/llamacpp"
dmrm "github.com/docker/model-runner/pkg/inference/models"
"github.com/docker/model-runner/pkg/inference/scheduling"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
)

func newComposeCmd() *cobra.Command {
Expand Down
1 change: 0 additions & 1 deletion cmd/cli/commands/inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"github.com/docker/model-runner/cmd/cli/commands/completion"
"github.com/docker/model-runner/cmd/cli/commands/formatter"
"github.com/docker/model-runner/cmd/cli/desktop"

"github.com/spf13/cobra"
)

Expand Down
6 changes: 2 additions & 4 deletions cmd/cli/commands/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,16 @@ import (
"os"
"path/filepath"

"github.com/docker/model-runner/cmd/cli/commands/completion"
"github.com/docker/model-runner/cmd/cli/desktop"
"github.com/docker/model-runner/pkg/distribution/builder"
"github.com/docker/model-runner/pkg/distribution/distribution"
"github.com/docker/model-runner/pkg/distribution/packaging"
"github.com/docker/model-runner/pkg/distribution/registry"
"github.com/docker/model-runner/pkg/distribution/tarball"
"github.com/docker/model-runner/pkg/distribution/types"

"github.com/docker/model-runner/pkg/go-containerregistry/pkg/name"
"github.com/spf13/cobra"

"github.com/docker/model-runner/cmd/cli/commands/completion"
"github.com/docker/model-runner/cmd/cli/desktop"
)

// validateAbsolutePath validates that a path is absolute and returns the cleaned path
Expand Down
1 change: 0 additions & 1 deletion cmd/cli/commands/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (

"github.com/docker/model-runner/cmd/cli/commands/completion"
"github.com/docker/model-runner/cmd/cli/desktop"

"github.com/spf13/cobra"
)

Expand Down
1 change: 0 additions & 1 deletion cmd/cli/commands/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (

"github.com/docker/model-runner/cmd/cli/commands/completion"
"github.com/docker/model-runner/cmd/cli/desktop"

"github.com/spf13/cobra"
)

Expand Down
1 change: 0 additions & 1 deletion cmd/cli/commands/rm.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"fmt"

"github.com/docker/model-runner/cmd/cli/commands/completion"

"github.com/spf13/cobra"
)

Expand Down
3 changes: 1 addition & 2 deletions cmd/cli/commands/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ import (
"github.com/docker/model-runner/cmd/cli/commands/completion"
"github.com/docker/model-runner/cmd/cli/desktop"
"github.com/docker/model-runner/cmd/cli/readline"
"github.com/muesli/termenv"

"github.com/fatih/color"
"github.com/muesli/termenv"
"github.com/spf13/cobra"
"golang.org/x/term"
)
Expand Down
1 change: 0 additions & 1 deletion cmd/cli/commands/unload.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (

"github.com/docker/model-runner/cmd/cli/commands/completion"
"github.com/docker/model-runner/cmd/cli/desktop"

"github.com/spf13/cobra"
)

Expand Down
1 change: 0 additions & 1 deletion cmd/cli/desktop/progress.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (

"github.com/docker/docker/pkg/jsonmessage"
"github.com/docker/go-units"

"github.com/docker/model-runner/cmd/cli/pkg/standalone"
)

Expand Down
3 changes: 1 addition & 2 deletions pkg/distribution/builder/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ import (
"fmt"
"io"

v1 "github.com/docker/model-runner/pkg/go-containerregistry/pkg/v1"

"github.com/docker/model-runner/pkg/distribution/internal/gguf"
"github.com/docker/model-runner/pkg/distribution/internal/mutate"
"github.com/docker/model-runner/pkg/distribution/internal/partial"
"github.com/docker/model-runner/pkg/distribution/internal/safetensors"
"github.com/docker/model-runner/pkg/distribution/types"
v1 "github.com/docker/model-runner/pkg/go-containerregistry/pkg/v1"
)

// Builder builds a model artifact
Expand Down
5 changes: 2 additions & 3 deletions pkg/distribution/distribution/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ import (
"slices"
"strings"

"github.com/docker/model-runner/pkg/internal/utils"
"github.com/sirupsen/logrus"

"github.com/docker/model-runner/pkg/distribution/internal/progress"
"github.com/docker/model-runner/pkg/distribution/internal/store"
"github.com/docker/model-runner/pkg/distribution/registry"
Expand All @@ -20,6 +17,8 @@ import (
"github.com/docker/model-runner/pkg/go-containerregistry/pkg/authn"
"github.com/docker/model-runner/pkg/go-containerregistry/pkg/v1/remote"
"github.com/docker/model-runner/pkg/inference/platform"
"github.com/docker/model-runner/pkg/internal/utils"
"github.com/sirupsen/logrus"
)

// Client provides model distribution functionality
Expand Down
9 changes: 4 additions & 5 deletions pkg/distribution/distribution/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,16 @@ import (
"strings"
"testing"

"github.com/docker/model-runner/pkg/go-containerregistry/pkg/name"
"github.com/docker/model-runner/pkg/go-containerregistry/pkg/registry"
"github.com/docker/model-runner/pkg/go-containerregistry/pkg/v1/remote"
"github.com/sirupsen/logrus"

"github.com/docker/model-runner/pkg/distribution/internal/gguf"
"github.com/docker/model-runner/pkg/distribution/internal/mutate"
"github.com/docker/model-runner/pkg/distribution/internal/progress"
"github.com/docker/model-runner/pkg/distribution/internal/safetensors"
mdregistry "github.com/docker/model-runner/pkg/distribution/registry"
"github.com/docker/model-runner/pkg/go-containerregistry/pkg/name"
"github.com/docker/model-runner/pkg/go-containerregistry/pkg/registry"
"github.com/docker/model-runner/pkg/go-containerregistry/pkg/v1/remote"
"github.com/docker/model-runner/pkg/inference/platform"
"github.com/sirupsen/logrus"
)

var (
Expand Down
5 changes: 2 additions & 3 deletions pkg/distribution/internal/gguf/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ import (
"strings"
"time"

v1 "github.com/docker/model-runner/pkg/go-containerregistry/pkg/v1"
parser "github.com/gpustack/gguf-parser-go"

"github.com/docker/model-runner/pkg/distribution/internal/partial"
"github.com/docker/model-runner/pkg/distribution/types"
v1 "github.com/docker/model-runner/pkg/go-containerregistry/pkg/v1"
parser "github.com/gpustack/gguf-parser-go"
)

func NewModel(path string) (*Model, error) {
Expand Down
5 changes: 2 additions & 3 deletions pkg/distribution/internal/mutate/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ import (
"encoding/json"
"fmt"

"github.com/docker/model-runner/pkg/distribution/internal/partial"
"github.com/docker/model-runner/pkg/distribution/types"
v1 "github.com/docker/model-runner/pkg/go-containerregistry/pkg/v1"
ggcrpartial "github.com/docker/model-runner/pkg/go-containerregistry/pkg/v1/partial"
ggcr "github.com/docker/model-runner/pkg/go-containerregistry/pkg/v1/types"

"github.com/docker/model-runner/pkg/distribution/internal/partial"
"github.com/docker/model-runner/pkg/distribution/types"
)

type model struct {
Expand Down
3 changes: 1 addition & 2 deletions pkg/distribution/internal/mutate/mutate.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package mutate

import (
"github.com/docker/model-runner/pkg/distribution/types"
v1 "github.com/docker/model-runner/pkg/go-containerregistry/pkg/v1"
ggcr "github.com/docker/model-runner/pkg/go-containerregistry/pkg/v1/types"

"github.com/docker/model-runner/pkg/distribution/types"
)

func AppendLayers(mdl types.ModelArtifact, layers ...v1.Layer) types.ModelArtifact {
Expand Down
5 changes: 2 additions & 3 deletions pkg/distribution/internal/mutate/mutate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ import (
"path/filepath"
"testing"

"github.com/docker/model-runner/pkg/go-containerregistry/pkg/v1/static"
ggcr "github.com/docker/model-runner/pkg/go-containerregistry/pkg/v1/types"

"github.com/docker/model-runner/pkg/distribution/internal/gguf"
"github.com/docker/model-runner/pkg/distribution/internal/mutate"
"github.com/docker/model-runner/pkg/distribution/types"
"github.com/docker/model-runner/pkg/go-containerregistry/pkg/v1/static"
ggcr "github.com/docker/model-runner/pkg/go-containerregistry/pkg/v1/types"
)

func TestAppendLayer(t *testing.T) {
Expand Down
3 changes: 1 addition & 2 deletions pkg/distribution/internal/partial/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ import (
"encoding/json"
"fmt"

"github.com/docker/model-runner/pkg/distribution/types"
v1 "github.com/docker/model-runner/pkg/go-containerregistry/pkg/v1"
"github.com/docker/model-runner/pkg/go-containerregistry/pkg/v1/partial"
ggcr "github.com/docker/model-runner/pkg/go-containerregistry/pkg/v1/types"

"github.com/docker/model-runner/pkg/distribution/types"
)

// BaseModel provides a common implementation for model types.
Expand Down
3 changes: 1 addition & 2 deletions pkg/distribution/internal/partial/partial.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ import (
"encoding/json"
"fmt"

"github.com/docker/model-runner/pkg/distribution/types"
v1 "github.com/docker/model-runner/pkg/go-containerregistry/pkg/v1"
"github.com/docker/model-runner/pkg/go-containerregistry/pkg/v1/partial"
ggcr "github.com/docker/model-runner/pkg/go-containerregistry/pkg/v1/types"

"github.com/docker/model-runner/pkg/distribution/types"
)

type WithRawConfigFile interface {
Expand Down
3 changes: 1 addition & 2 deletions pkg/distribution/internal/progress/reporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ import (
"testing"
"time"

"github.com/docker/model-runner/pkg/distribution/types"
v1 "github.com/docker/model-runner/pkg/go-containerregistry/pkg/v1"
v1types "github.com/docker/model-runner/pkg/go-containerregistry/pkg/v1/types"

"github.com/docker/model-runner/pkg/distribution/types"
)

// mockLayer implements v1.Layer for testing
Expand Down
3 changes: 1 addition & 2 deletions pkg/distribution/internal/safetensors/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ import (
"strconv"
"time"

v1 "github.com/docker/model-runner/pkg/go-containerregistry/pkg/v1"

"github.com/docker/model-runner/pkg/distribution/internal/partial"
"github.com/docker/model-runner/pkg/distribution/types"
v1 "github.com/docker/model-runner/pkg/go-containerregistry/pkg/v1"
)

var (
Expand Down
1 change: 0 additions & 1 deletion pkg/distribution/internal/store/blobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"unicode"

"github.com/docker/model-runner/pkg/distribution/internal/progress"

v1 "github.com/docker/model-runner/pkg/go-containerregistry/pkg/v1"
)

Expand Down
3 changes: 1 addition & 2 deletions pkg/distribution/internal/store/bundles.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ import (
"os"
"path/filepath"

v1 "github.com/docker/model-runner/pkg/go-containerregistry/pkg/v1"

"github.com/docker/model-runner/pkg/distribution/internal/bundle"
"github.com/docker/model-runner/pkg/distribution/types"
v1 "github.com/docker/model-runner/pkg/go-containerregistry/pkg/v1"
)

const (
Expand Down
3 changes: 1 addition & 2 deletions pkg/distribution/internal/store/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ import (
"path/filepath"
"strings"

"github.com/docker/model-runner/pkg/go-containerregistry/pkg/name"

"github.com/docker/model-runner/pkg/distribution/registry"
"github.com/docker/model-runner/pkg/go-containerregistry/pkg/name"
)

// Index represents the index of all models in the store
Expand Down
5 changes: 2 additions & 3 deletions pkg/distribution/internal/store/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ import (
"fmt"
"os"

mdpartial "github.com/docker/model-runner/pkg/distribution/internal/partial"
mdtypes "github.com/docker/model-runner/pkg/distribution/types"
v1 "github.com/docker/model-runner/pkg/go-containerregistry/pkg/v1"
"github.com/docker/model-runner/pkg/go-containerregistry/pkg/v1/partial"
"github.com/docker/model-runner/pkg/go-containerregistry/pkg/v1/types"

mdpartial "github.com/docker/model-runner/pkg/distribution/internal/partial"
mdtypes "github.com/docker/model-runner/pkg/distribution/types"
)

var _ v1.Image = &Model{}
Expand Down
3 changes: 1 addition & 2 deletions pkg/distribution/internal/store/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ import (
"sync"
"time"

v1 "github.com/docker/model-runner/pkg/go-containerregistry/pkg/v1"

"github.com/docker/model-runner/pkg/distribution/internal/progress"
v1 "github.com/docker/model-runner/pkg/go-containerregistry/pkg/v1"
)

const (
Expand Down
5 changes: 2 additions & 3 deletions pkg/distribution/registry/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@ import (
"strings"
"sync"

"github.com/docker/model-runner/pkg/distribution/internal/progress"
"github.com/docker/model-runner/pkg/distribution/types"
"github.com/docker/model-runner/pkg/go-containerregistry/pkg/authn"
"github.com/docker/model-runner/pkg/go-containerregistry/pkg/name"
v1 "github.com/docker/model-runner/pkg/go-containerregistry/pkg/v1"
"github.com/docker/model-runner/pkg/go-containerregistry/pkg/v1/remote"
"github.com/docker/model-runner/pkg/go-containerregistry/pkg/v1/remote/transport"

"github.com/docker/model-runner/pkg/distribution/internal/progress"
"github.com/docker/model-runner/pkg/distribution/types"
)

const (
Expand Down
3 changes: 1 addition & 2 deletions pkg/distribution/tarball/target.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ import (
"io"
"path/filepath"

v1 "github.com/docker/model-runner/pkg/go-containerregistry/pkg/v1"

"github.com/docker/model-runner/pkg/distribution/internal/progress"
"github.com/docker/model-runner/pkg/distribution/types"
v1 "github.com/docker/model-runner/pkg/go-containerregistry/pkg/v1"
)

// Target stores an artifact as a TAR archive
Expand Down
3 changes: 1 addition & 2 deletions pkg/distribution/tarball/target_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ import (
"path/filepath"
"testing"

v1 "github.com/docker/model-runner/pkg/go-containerregistry/pkg/v1"

"github.com/docker/model-runner/pkg/distribution/internal/gguf"
"github.com/docker/model-runner/pkg/distribution/tarball"
v1 "github.com/docker/model-runner/pkg/go-containerregistry/pkg/v1"
)

func TestTarget(t *testing.T) {
Expand Down
1 change: 0 additions & 1 deletion pkg/inference/backends/llamacpp/llamacpp_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"testing"

"github.com/docker/model-runner/pkg/distribution/types"

"github.com/docker/model-runner/pkg/inference"
)

Expand Down
1 change: 0 additions & 1 deletion pkg/inference/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package config

import (
"github.com/docker/model-runner/pkg/distribution/types"

"github.com/docker/model-runner/pkg/inference"
)

Expand Down
Loading
Loading