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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 4 additions & 4 deletions .github/workflows/validation-lambdalabs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ on:
# Allow manual triggering
pull_request:
paths:
- 'internal/lambdalabs/**'
- 'v1/providers/lambdalabs/**'
- 'internal/validation/**'
- 'pkg/v1/**'
- 'v1/**'
branches: [ main ]

jobs:
Expand Down Expand Up @@ -47,7 +47,7 @@ jobs:
TEST_PUBLIC_KEY_BASE64: ${{ secrets.TEST_PUBLIC_KEY_BASE64 }}
VALIDATION_TEST: true
run: |
cd internal/lambdalabs
cd v1/providers/lambdalabs
go test -v -short=false -timeout=30m ./...

- name: Upload test results
Expand All @@ -56,4 +56,4 @@ jobs:
with:
name: lambdalabs-validation-results
path: |
internal/lambdalabs/coverage.out
v1/providers/lambdalabs/coverage.out
8 changes: 4 additions & 4 deletions .github/workflows/validation-shadeform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ on:
# Allow manual triggering
pull_request:
paths:
- 'internal/shadeform/**'
- 'v1/providers/shadeform/**'
- 'internal/validation/**'
- 'pkg/v1/**'
- 'v1/**'
branches: [ main ]

jobs:
Expand Down Expand Up @@ -47,7 +47,7 @@ jobs:
TEST_PUBLIC_KEY_BASE64: ${{ secrets.TEST_PUBLIC_KEY_BASE64 }}
VALIDATION_TEST: true
run: |
cd internal/shadeform
cd v1/providers/shadeform
go test -v -short=false -timeout=30m ./...

- name: Upload test results
Expand All @@ -56,4 +56,4 @@ jobs:
with:
name: shadeform-validation-results
path: |
internal/shadeform/coverage.out
v1/providers/shadeform/coverage.out
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module github.com/brevdev/cloud

go 1.25.0
go 1.24.0

toolchain go1.24.6

require (
github.com/alecthomas/units v0.0.0-20240927000941-0f3dac36c52b
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions internal/validation/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"testing"
"time"

"github.com/brevdev/cloud/pkg/ssh"
v1 "github.com/brevdev/cloud/pkg/v1"
"github.com/brevdev/cloud/internal/ssh"
"github.com/brevdev/cloud/v1"
"github.com/stretchr/testify/require"
)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion pkg/v1/image.go → v1/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strings"
"time"

"github.com/brevdev/cloud/pkg/ssh"
"github.com/brevdev/cloud/internal/ssh"
)

type CloudMachineImage interface {
Expand Down
2 changes: 1 addition & 1 deletion pkg/v1/instance.go → v1/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"github.com/alecthomas/units"
"github.com/brevdev/cloud/internal/collections"
"github.com/brevdev/cloud/pkg/ssh"
"github.com/brevdev/cloud/internal/ssh"
"github.com/google/uuid"
)

Expand Down
1 change: 1 addition & 0 deletions pkg/v1/instancetype.go → v1/instancetype.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ type InstanceType struct {
NotPrivileged bool
EstimatedDeployTime *time.Duration
Provider string
CloudBroker string
CanModifyFirewallRules bool
}

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package v1
import (
"context"

"github.com/brevdev/cloud/pkg/v1"
"github.com/brevdev/cloud/v1"
)

func (c *FluidStackClient) GetCapabilities(_ context.Context) (v1.Capabilities, error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"fmt"
"net/http"

openapi "github.com/brevdev/cloud/internal/fluidstack/gen/fluidstack"
"github.com/brevdev/cloud/pkg/v1"
"github.com/brevdev/cloud/v1"
openapi "github.com/brevdev/cloud/v1/providers/fluidstack/gen/fluidstack"
)

const CloudProviderID = "fluidstack"
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"context"
"fmt"

openapi "github.com/brevdev/cloud/internal/fluidstack/gen/fluidstack"
"github.com/brevdev/cloud/pkg/v1"
"github.com/brevdev/cloud/v1"
openapi "github.com/brevdev/cloud/v1/providers/fluidstack/gen/fluidstack"
)

func (c *FluidStackClient) CreateInstance(ctx context.Context, attrs v1.CreateInstanceAttrs) (*v1.Instance, error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (

"github.com/alecthomas/units"
"github.com/bojanz/currency"
openapi "github.com/brevdev/cloud/internal/fluidstack/gen/fluidstack"
"github.com/brevdev/cloud/pkg/v1"
"github.com/brevdev/cloud/v1"
openapi "github.com/brevdev/cloud/v1/providers/fluidstack/gen/fluidstack"
)

func (c *FluidStackClient) GetInstanceTypes(ctx context.Context, _ v1.GetInstanceTypeArgs) ([]v1.InstanceType, error) {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package v1
import (
"context"

v1 "github.com/brevdev/cloud/pkg/v1"
v1 "github.com/brevdev/cloud/v1"
)

// getLambdaLabsCapabilities returns the unified capabilities for Lambda Labs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

v1 "github.com/brevdev/cloud/pkg/v1"
v1 "github.com/brevdev/cloud/v1"
)

func TestLambdaLabsClient_GetCapabilities(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"net/http"
"time"

openapi "github.com/brevdev/cloud/internal/lambdalabs/gen/lambdalabs"
v1 "github.com/brevdev/cloud/pkg/v1"
v1 "github.com/brevdev/cloud/v1"
openapi "github.com/brevdev/cloud/v1/providers/lambdalabs/gen/lambdalabs"
"github.com/cenkalti/backoff/v4"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

openapi "github.com/brevdev/cloud/internal/lambdalabs/gen/lambdalabs"
v1 "github.com/brevdev/cloud/pkg/v1"
v1 "github.com/brevdev/cloud/v1"
openapi "github.com/brevdev/cloud/v1/providers/lambdalabs/gen/lambdalabs"
)

func TestLambdaLabsClient_GetAPIType(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package v1

import (
openapi "github.com/brevdev/cloud/internal/lambdalabs/gen/lambdalabs"
openapi "github.com/brevdev/cloud/v1/providers/lambdalabs/gen/lambdalabs"
"github.com/cenkalti/backoff/v4"
"github.com/jarcoal/httpmock"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"crypto/sha256"
"fmt"

v1 "github.com/brevdev/cloud/pkg/v1"
v1 "github.com/brevdev/cloud/v1"
)

const CloudProviderID = "lambda-labs"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

v1 "github.com/brevdev/cloud/pkg/v1"
v1 "github.com/brevdev/cloud/v1"
)

func TestLambdaLabsCredential_GetReferenceID(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"net/http"
"strings"

openapi "github.com/brevdev/cloud/internal/lambdalabs/gen/lambdalabs"
v1 "github.com/brevdev/cloud/pkg/v1"
v1 "github.com/brevdev/cloud/v1"
openapi "github.com/brevdev/cloud/v1/providers/lambdalabs/gen/lambdalabs"
"github.com/cenkalti/backoff/v4"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

openapi "github.com/brevdev/cloud/internal/lambdalabs/gen/lambdalabs"
v1 "github.com/brevdev/cloud/pkg/v1"
v1 "github.com/brevdev/cloud/v1"
openapi "github.com/brevdev/cloud/v1/providers/lambdalabs/gen/lambdalabs"
)

func TestHandleAPIError_InstanceNotFound(t *testing.T) {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/stretchr/testify/assert"

v1 "github.com/brevdev/cloud/pkg/v1"
v1 "github.com/brevdev/cloud/v1"
)

func TestConvertLambdaLabsInstanceToV1Instance(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (

"github.com/alecthomas/units"
"github.com/brevdev/cloud/internal/collections"
openapi "github.com/brevdev/cloud/internal/lambdalabs/gen/lambdalabs"
v1 "github.com/brevdev/cloud/pkg/v1"
v1 "github.com/brevdev/cloud/v1"
openapi "github.com/brevdev/cloud/v1/providers/lambdalabs/gen/lambdalabs"
)

const lambdaLabsTimeNameFormat = "2006-01-02-15-04-05Z07-00"
Expand Down Expand Up @@ -90,6 +90,7 @@ func (c *LambdaLabsClient) TerminateInstance(ctx context.Context, instanceID v1.
InstanceIds: []string{string(instanceID)},
}

// TODO: since "createInstance" also creates an SSH key, we should consider cleaning up the key pair here
_, err := c.terminateInstance(ctx, request)
if err != nil {
return fmt.Errorf("failed to terminate instance: %w", err)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"github.com/stretchr/testify/require"

"github.com/brevdev/cloud/internal/collections"
openapi "github.com/brevdev/cloud/internal/lambdalabs/gen/lambdalabs"
v1 "github.com/brevdev/cloud/pkg/v1"
v1 "github.com/brevdev/cloud/v1"
openapi "github.com/brevdev/cloud/v1/providers/lambdalabs/gen/lambdalabs"
)

func TestLambdaLabsClient_CreateInstance_Success(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"github.com/alecthomas/units"
"github.com/bojanz/currency"
"github.com/brevdev/cloud/internal/collections"
openapi "github.com/brevdev/cloud/internal/lambdalabs/gen/lambdalabs"
v1 "github.com/brevdev/cloud/pkg/v1"
v1 "github.com/brevdev/cloud/v1"
openapi "github.com/brevdev/cloud/v1/providers/lambdalabs/gen/lambdalabs"
)

// GetInstanceTypePollTime returns the polling interval for instance types
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

openapi "github.com/brevdev/cloud/internal/lambdalabs/gen/lambdalabs"
v1 "github.com/brevdev/cloud/pkg/v1"
v1 "github.com/brevdev/cloud/v1"
openapi "github.com/brevdev/cloud/v1/providers/lambdalabs/gen/lambdalabs"
)

func TestLambdaLabsClient_GetInstanceTypes_Success(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"encoding/json"
"fmt"

v1 "github.com/brevdev/cloud/pkg/v1"
v1 "github.com/brevdev/cloud/v1"
)

const lambdaLocationsData = `[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"

"github.com/brevdev/cloud/internal/validation"
v1 "github.com/brevdev/cloud/pkg/v1"
v1 "github.com/brevdev/cloud/v1"
)

func TestValidationFunctions(t *testing.T) {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading
Loading