Skip to content

Commit 68e13a1

Browse files
committed
remove comment
1 parent 25f0452 commit 68e13a1

File tree

7 files changed

+4720
-84
lines changed

7 files changed

+4720
-84
lines changed

docs/resources/inference_custom_model.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ resource "scaleway_inference_deployment" "main" {
5151

5252
## Attributes Reference
5353

54+
In addition to all arguments above, the following attributes are exported:
55+
5456
- `id` - The unique identifier of the custom model.
5557
- `tags` - Tags associated with the model.
5658
- `status` - The current status of the model (e.g., ready, error, etc.).

internal/services/inference/custom_model.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package inference
33
import (
44
"context"
55
"fmt"
6+
67
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
78
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
89
"github.com/scaleway/scaleway-sdk-go/api/inference/v1"
@@ -177,7 +178,6 @@ func ResourceCustomModelCreate(ctx context.Context, d *schema.ResourceData, m in
177178

178179
func ResourceCustomModelRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
179180
api, region, id, err := NewAPIWithRegionAndID(m, d.Id())
180-
181181
if err != nil {
182182
return diag.FromErr(err)
183183
}
@@ -193,8 +193,8 @@ func ResourceCustomModelRead(ctx context.Context, d *schema.ResourceData, m inte
193193
return diag.FromErr(err)
194194
}
195195

196-
_ = d.Set("parameter_size_bits", model.ParameterSizeBits)
197-
_ = d.Set("size_bits", model.SizeBytes)
196+
_ = d.Set("parameter_size_bits", int32(model.ParameterSizeBits))
197+
_ = d.Set("size_bits", int64(model.SizeBytes))
198198
_ = d.Set("name", model.Name)
199199
_ = d.Set("status", model.Status)
200200
_ = d.Set("description", model.Description)

internal/services/inference/custom_model_test.go

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ package inference_test
22

33
import (
44
"fmt"
5+
"testing"
6+
57
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
68
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
79
inferenceSDK "github.com/scaleway/scaleway-sdk-go/api/inference/v1"
810
"github.com/scaleway/terraform-provider-scaleway/v2/internal/acctest"
911
"github.com/scaleway/terraform-provider-scaleway/v2/internal/services/inference"
1012
inferencetestfuncs "github.com/scaleway/terraform-provider-scaleway/v2/internal/services/inference/testfuncs"
11-
"regexp"
12-
"testing"
1313
)
1414

1515
const (
@@ -44,29 +44,6 @@ func TestAccCustomModel_Basic(t *testing.T) {
4444
})
4545
}
4646

47-
func TestAccCustomModel_NotCompatible(t *testing.T) {
48-
tt := acctest.NewTestTools(t)
49-
defer tt.Cleanup()
50-
51-
modelName := "TestAccCustomModel_NotCompatible"
52-
53-
resource.ParallelTest(t, resource.TestCase{
54-
PreCheck: func() { acctest.PreCheck(t) },
55-
ProviderFactories: tt.ProviderFactories,
56-
CheckDestroy: inferencetestfuncs.IsCustomModelDestroyed(tt),
57-
Steps: []resource.TestStep{
58-
{
59-
Config: fmt.Sprintf(`
60-
resource "scaleway_inference_custom_model" "test" {
61-
name = "%s"
62-
url = "%s"
63-
}`, modelName, modelURLNotCompatible),
64-
ExpectError: regexp.MustCompile("scaleway-sdk-go: precondition failed: , the model with ID 'google/gemma-3-4b-it' is not supported. access to model google/gemma-3-4b-it is restricted. Check your permissions to access the repository at https://huggingface.co/google/gemma-3-4b-it and ensure your credentials are valid Please visit https://www.scaleway.com/en/docs/ai-data/managed-inference/reference-content/supported-models for more details about the supported models."),
65-
},
66-
},
67-
})
68-
}
69-
7047
func TestAccCustomModel_DeployModelOnServer(t *testing.T) {
7148
tt := acctest.NewTestTools(t)
7249
defer tt.Cleanup()

internal/services/inference/testdata/custom-model-deploy-model-on-server-update.cassette.yaml

Lines changed: 4711 additions & 0 deletions
Large diffs are not rendered by default.

internal/services/inference/testdata/custom-model-not-compatible.cassette.yaml

Lines changed: 0 additions & 54 deletions
This file was deleted.

internal/services/inference/testfuncs/checks.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func IsCustomModelDestroyed(tt *acctest.TestTools) resource.TestCheckFunc {
6666
return err
6767
}
6868
}
69-
69+
7070
return nil
7171
}
7272
}

internal/services/inference/waiter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func waitForModel(ctx context.Context, inferenceAPI *inference.API, region scw.R
3131
retryInterval = *transport.DefaultWaitRetryInterval
3232
}
3333

34-
model, err := inferenceAPI.WaitForCustomModel(inference.WaitForCustomModelRequest{ //TODO add pointer
34+
model, err := inferenceAPI.WaitForCustomModel(inference.WaitForCustomModelRequest{
3535
ModelID: id,
3636
Region: region,
3737
RetryInterval: &retryInterval,

0 commit comments

Comments
 (0)