Skip to content

wip: Scaleway #1249

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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: 2 additions & 0 deletions src/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ require (
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/rivo/uniseg v0.4.2 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.33 // indirect
github.com/sergi/go-diff v1.3.1 // indirect
github.com/spiffe/go-spiffe/v2 v2.5.0 // indirect
github.com/xhit/go-str2duration/v2 v2.1.0 // indirect
Expand All @@ -112,6 +113,7 @@ require (
google.golang.org/genproto/googleapis/api v0.0.0-20250422160041-2d3770c4ea7f // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250414145226-207652e42e2e // indirect
gopkg.in/ini.v1 v1.66.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
)

require (
Expand Down
2 changes: 2 additions & 0 deletions src/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,8 @@ github.com/ross96D/cancelreader v0.2.6 h1:XLPWassoMWRTlHvEoVKS3z0N0a7jHcIupGU0U1
github.com/ross96D/cancelreader v0.2.6/go.mod h1:sSs12d88ds2FFb9aOsKYyhTJCJDQDOll6gpyILZwIzc=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.33 h1:KhF0WejiUTDbL5X55nXowP7zNopwpowa6qaMAWyIE+0=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.33/go.mod h1:792k1RTU+5JeMXm35/e2Wgp71qPH/DmDoZrRc+EFZDk=
github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8=
github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
Expand Down
21 changes: 21 additions & 0 deletions src/pkg/cli/client/byoc/scaleway/byoc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package scaleway

import (
"context"

"github.com/DefangLabs/defang/src/pkg/cli/client"
"github.com/DefangLabs/defang/src/pkg/cli/client/byoc"
"github.com/DefangLabs/defang/src/pkg/types"
)

type ByocScaleway struct {
*byoc.ByocBaseClient
}

func NewByocProvider(ctx context.Context, tenantName types.TenantName) *ByocScaleway {
b := &ByocScaleway{}
b.ByocBaseClient = byoc.NewByocBaseClient(ctx, tenantName, b)
return b
}

var _ client.Provider = (*ByocScaleway)(nil)
8 changes: 8 additions & 0 deletions src/pkg/cli/client/provider_id.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const (
ProviderAWS ProviderID = "aws"
ProviderDO ProviderID = "digitalocean"
ProviderGCP ProviderID = "gcp"
ProviderSW ProviderID = "scaleway"
// ProviderAzure ProviderID = "azure"
)

Expand All @@ -24,6 +25,7 @@ var allProviders = []ProviderID{
ProviderAWS,
ProviderDO,
ProviderGCP,
ProviderSW,
// ProviderAzure,
}

Expand All @@ -47,6 +49,8 @@ func (p ProviderID) Name() string {
return "DigitalOcean"
case ProviderGCP:
return "Google Cloud Platform"
case ProviderSW:
return "Scaleway"
default:
return p.String()
}
Expand All @@ -62,6 +66,8 @@ func (p ProviderID) Value() defangv1.Provider {
return defangv1.Provider_DIGITALOCEAN
case ProviderGCP:
return defangv1.Provider_GCP
case ProviderSW:
return defangv1.Provider_SCALEWAY
default:
return defangv1.Provider_PROVIDER_UNSPECIFIED
}
Expand Down Expand Up @@ -89,6 +95,8 @@ func (p *ProviderID) SetValue(val defangv1.Provider) {
*p = ProviderDO
case defangv1.Provider_GCP:
*p = ProviderGCP
case defangv1.Provider_SCALEWAY:
*p = ProviderSW
default:
*p = ProviderAuto
}
Expand Down
24 changes: 24 additions & 0 deletions src/pkg/clouds/scaleway/driver.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package scaleway

import "github.com/scaleway/scaleway-sdk-go/scw"

type Scaleway struct {
client *scw.Client
}

func New() (*Scaleway, error) {
client, err := scw.NewClient()
if err != nil {
return nil, err
}
return &Scaleway{
client: client,
}, nil
}

func (s *Scaleway) Run() {

}

func (s *Scaleway) CreateUploadURL() (string, error) {
}
Loading
Loading