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 pkgs/defang/cli.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildGo124Module {
pname = "defang-cli";
version = "git";
src = lib.cleanSource ../../src;
vendorHash = "sha256-A+DwCvfNUKY8TjxyAe+abiT9xIyy5p7VIh5T5ofeZIg="; # TODO: use fetchFromGitHub
vendorHash = "sha256-A5bRWHhwZQ+/m9KE07rLQzJrN9D6N1mRIMG3Uh4AcUw="; # TODO: use fetchFromGitHub

subPackages = [ "cmd/cli" ];

Expand Down
6 changes: 3 additions & 3 deletions src/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,11 @@ require (
github.com/aws/smithy-go v1.24.0
github.com/awslabs/goformation/v7 v7.14.9
github.com/bufbuild/connect-go v1.10.0
github.com/compose-spec/compose-go/v2 v2.7.2-0.20250715094302-8da9902241f9
github.com/compose-spec/compose-go/v2 v2.10.1
github.com/digitalocean/godo v1.131.1
github.com/docker/cli v27.3.1+incompatible
github.com/docker/docker v28.0.0+incompatible
github.com/firebase/genkit/go v1.2.0
github.com/goccy/go-yaml v1.17.1
github.com/golang-jwt/jwt/v5 v5.2.2
github.com/google/uuid v1.6.0
github.com/googleapis/gax-go/v2 v2.14.2
Expand All @@ -61,7 +60,7 @@ require (
github.com/spf13/cobra v1.8.0
github.com/spf13/pflag v1.0.6
github.com/stretchr/testify v1.10.0
go.yaml.in/yaml/v3 v3.0.4
go.yaml.in/yaml/v4 v4.0.0-rc.4
golang.org/x/mod v0.29.0
golang.org/x/oauth2 v0.30.0
golang.org/x/sys v0.38.0
Expand Down Expand Up @@ -99,6 +98,7 @@ require (
github.com/envoyproxy/protoc-gen-validate v1.2.1 // indirect
github.com/go-jose/go-jose/v4 v4.1.0 // indirect
github.com/go-viper/mapstructure/v2 v2.4.0 // indirect
github.com/goccy/go-yaml v1.17.1 // indirect
github.com/google/dotprompt/go v0.0.0-20251014011017-8d056e027254 // indirect
github.com/google/go-cmp v0.7.0 // indirect
github.com/google/go-querystring v1.1.0 // indirect
Expand Down
8 changes: 4 additions & 4 deletions src/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UF
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cncf/xds/go v0.0.0-20250326154945-ae57f3c0d45f h1:C5bqEmzEPLsHm9Mv73lSE9e9bKV23aB1vxOsmZrkl3k=
github.com/cncf/xds/go v0.0.0-20250326154945-ae57f3c0d45f/go.mod h1:W+zGtBO5Y1IgJhy4+A9GOqVhqLpfZi+vwmdNXUehLA8=
github.com/compose-spec/compose-go/v2 v2.7.2-0.20250715094302-8da9902241f9 h1:kqvhWCmg3fVAPbfE8aJdV+qX1VqK4oK/DRI5yxeVd4E=
github.com/compose-spec/compose-go/v2 v2.7.2-0.20250715094302-8da9902241f9/go.mod h1:veko/VB7URrg/tKz3vmIAQDaz+CGiXH8vZsW79NmAww=
github.com/compose-spec/compose-go/v2 v2.10.1 h1:mFbXobojGRFIVi1UknrvaDAZ+PkJfyjqkA1yseh+vAU=
github.com/compose-spec/compose-go/v2 v2.10.1/go.mod h1:Ohac1SzhO/4fXXrzWIztIVB6ckmKBv1Nt5Z5mGVESUg=
github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I=
github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo=
github.com/containerd/typeurl/v2 v2.2.0 h1:6NBDbQzr7I5LHgp34xAXYF5DOTQDn05X58lsPEmzLso=
Expand Down Expand Up @@ -400,8 +400,8 @@ go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lI
go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=
go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=
go.yaml.in/yaml/v4 v4.0.0-rc.4 h1:UP4+v6fFrBIb1l934bDl//mmnoIZEDK0idg1+AIvX5U=
go.yaml.in/yaml/v4 v4.0.0-rc.4/go.mod h1:aZqd9kCMsGL7AuUv/m/PvWLdg5sjJsZ4oHDEnfPPfY0=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
Expand Down
2 changes: 1 addition & 1 deletion src/pkg/cli/client/byoc/gcp/byoc.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"github.com/DefangLabs/defang/src/pkg/types"
defangv1 "github.com/DefangLabs/defang/src/protos/io/defang/v1"
"github.com/bufbuild/connect-go"
"go.yaml.in/yaml/v3"
"go.yaml.in/yaml/v4"
gcpdns "google.golang.org/api/dns/v1"
"google.golang.org/api/googleapi"
auditpb "google.golang.org/genproto/googleapis/cloud/audit"
Expand Down
2 changes: 1 addition & 1 deletion src/pkg/cli/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/DefangLabs/defang/src/pkg/term"
"github.com/DefangLabs/defang/src/pkg/types"
defangv1 "github.com/DefangLabs/defang/src/protos/io/defang/v1"
"go.yaml.in/yaml/v3"
"go.yaml.in/yaml/v4"
"google.golang.org/protobuf/encoding/protojson"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/types/known/timestamppb"
Expand Down
2 changes: 1 addition & 1 deletion src/pkg/cli/compose/load_content_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func TestRoundTrip(t *testing.T) {
if err != nil {
t.Fatal(err)
}
rt, err := LoadFromContent(t.Context(), content, "should-not-be-used")
rt, err := LoadFromContent(t.Context(), content, "**invalid name**")
if err != nil {
t.Fatal(err)
}
Expand Down
2 changes: 1 addition & 1 deletion src/pkg/cli/compose/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"github.com/compose-spec/compose-go/v2/template"
composeTypes "github.com/compose-spec/compose-go/v2/types"
"github.com/sirupsen/logrus"
"go.yaml.in/yaml/v3"
"go.yaml.in/yaml/v4"
)

type Project = composeTypes.Project
Expand Down
2 changes: 1 addition & 1 deletion src/pkg/cli/compose/marshal.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"bytes"
"regexp"

"go.yaml.in/yaml/v3"
"go.yaml.in/yaml/v4"
)

func MarshalYAML(p *Project) ([]byte, error) {
Expand Down
4 changes: 0 additions & 4 deletions src/pkg/cli/compose/marshal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@ func TestMarshalYAML(t *testing.T) {
environment:
FLOAT: 1.23
GITSHA: 65e1234 # too big to fit in 64-bit float
INF: .inf # go-yaml will turn this into string "+Inf" which is not a YAML number
INTEGER: 1234
LARGE: 1_000_000_000_000_000_000
NAN: .nan # go-yaml will turn this into string "NaN" which is not a YAML number
OCTAL: 01234
OCTALO: 0o1234
STRING: hello world
Expand All @@ -39,10 +37,8 @@ services:
environment:
FLOAT: "1.23"
GITSHA: "65e1234"
INF: +Inf
INTEGER: "1234"
LARGE: "1000000000000000000"
NAN: NaN
OCTAL: "668"
OCTALO: "668"
STRING: hello world
Expand Down
2 changes: 1 addition & 1 deletion src/pkg/clouds/aws/ecs/cfn/template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/DefangLabs/defang/src/pkg/clouds"
"github.com/stretchr/testify/assert"
"go.yaml.in/yaml/v3"
"go.yaml.in/yaml/v4"
)

func TestGetCacheRepoPrefix(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion src/pkg/clouds/gcp/cloudbuild.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
cloudbuild "cloud.google.com/go/cloudbuild/apiv1/v2"
cloudbuildpb "cloud.google.com/go/cloudbuild/apiv1/v2/cloudbuildpb"
"github.com/DefangLabs/defang/src/pkg/cli/client"
"github.com/goccy/go-yaml"
"go.yaml.in/yaml/v4"
"google.golang.org/protobuf/types/known/durationpb"
)

Expand Down
2 changes: 1 addition & 1 deletion src/pkg/migrate/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/DefangLabs/defang/src/pkg/surveyor"
"github.com/DefangLabs/defang/src/pkg/term"
defangv1 "github.com/DefangLabs/defang/src/protos/io/defang/v1"
"go.yaml.in/yaml/v3"
"go.yaml.in/yaml/v4"
)

func InteractiveSetup(ctx context.Context, fabric client.FabricClient, surveyor surveyor.Surveyor, heroku HerokuClientInterface, sourcePlatform SourcePlatform) (string, error) {
Expand Down
11 changes: 8 additions & 3 deletions src/testdata/models/compose.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
services:
app:
modelmap:
image: app
models: # per docs, should support list as well
ai_model: {}
models:
ai_model:
modellist:
image: app
models:
- ai_model
x-defang-llm: true
withendpoint:
image: app
models:
Expand Down
20 changes: 18 additions & 2 deletions src/testdata/models/compose.yaml.fixup
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
}
]
},
"app": {
"modellist": {
"command": null,
"entrypoint": null,
"environment": {
Expand All @@ -26,7 +26,23 @@
},
"image": "app",
"models": {
"ai_model": {}
"ai_model": null
},
"networks": {
"default": null,
"model_provider_private": null
}
},
"modelmap": {
"command": null,
"entrypoint": null,
"environment": {
"AI_MODEL_MODEL": "ai/model",
"AI_MODEL_URL": "http://mock-ai-model/api/v1/"
},
"image": "app",
"models": {
"ai_model": null
},
"networks": {
"default": null,
Expand Down
11 changes: 9 additions & 2 deletions src/testdata/models/compose.yaml.golden
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
name: models
services:
app:
modellist:
image: app
models:
ai_model: {}
ai_model: null
networks:
default: null
x-defang-llm: true
modelmap:
image: app
models:
ai_model: null
networks:
default: null
withendpoint:
Expand Down
3 changes: 2 additions & 1 deletion src/testdata/models/compose.yaml.warnings
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
! service "ai_model": missing memory reservation; using provider-specific defaults. Specify deploy.resources.reservations.memory to avoid out-of-memory errors
! service "app": missing memory reservation; using provider-specific defaults. Specify deploy.resources.reservations.memory to avoid out-of-memory errors
! service "modellist": missing memory reservation; using provider-specific defaults. Specify deploy.resources.reservations.memory to avoid out-of-memory errors
! service "modelmap": missing memory reservation; using provider-specific defaults. Specify deploy.resources.reservations.memory to avoid out-of-memory errors
! service "my_model": missing memory reservation; using provider-specific defaults. Specify deploy.resources.reservations.memory to avoid out-of-memory errors
! service "withendpoint": missing memory reservation; using provider-specific defaults. Specify deploy.resources.reservations.memory to avoid out-of-memory errors
Loading