Skip to content

feat(inference): add support CRUD deployment #2736

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

Merged
merged 50 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
6121310
fix templates
Laure-di Sep 3, 2024
769b63a
fix waiters template defaultRetryInterval
Laure-di Sep 3, 2024
3818f52
fix test templates
Laure-di Sep 3, 2024
3ee54d9
fix sweeper test
Laure-di Sep 3, 2024
916049f
fix sweeper test
Laure-di Sep 3, 2024
7664365
separate sweeper
Laure-di Sep 3, 2024
bbe296a
fix test resource
Laure-di Sep 3, 2024
c4b1b0c
add sweep template and test
Laure-di Sep 6, 2024
bebf2f5
fix resource and helper
Laure-di Sep 6, 2024
03e0e9f
fix name resource
Laure-di Sep 6, 2024
7b2f95a
feat(inference): add support
Laure-di Sep 10, 2024
9636658
fix package name
Laure-di Sep 10, 2024
b57f7f5
add deployment_resource to provider
Laure-di Sep 10, 2024
28f6b25
fix method name
Laure-di Sep 10, 2024
5168bb9
create deployment fix
Laure-di Sep 10, 2024
215ac39
create deployment finish
Laure-di Sep 11, 2024
2c44fed
add testdata create deployment
Laure-di Sep 11, 2024
531e3a6
dev read deployment
Laure-di Sep 11, 2024
c143b3a
Merge branch 'master' into feat-add-support-inference
Laure-di Sep 11, 2024
78b2f01
sweep and sweeper_test
Laure-di Sep 11, 2024
d9f50a1
gofumpt
Laure-di Sep 11, 2024
65da5ae
clean import
Laure-di Sep 11, 2024
dfcfb4b
organize endpoint create
Laure-di Sep 11, 2024
d026fc6
add tests endpoints
Laure-di Sep 11, 2024
06edac4
read set endpoints url
Laure-di Sep 11, 2024
d9d061d
manage endpoints read and auth
Laure-di Sep 11, 2024
a56e7ad
add create_at and updated_at read
Laure-di Sep 11, 2024
ba6c799
gci fix
Laure-di Sep 12, 2024
73e3be9
add checks.go and change tests names
Laure-di Sep 12, 2024
9e587c3
fix type tfprovider-lint
Laure-di Sep 12, 2024
c9da181
fix golangci-lint
Laure-di Sep 12, 2024
7feb5e0
fix tests
Laure-di Sep 17, 2024
caadd43
fix test compute size
Laure-di Oct 10, 2024
67a5a17
fix golangci
Laure-di Oct 10, 2024
f22e85b
Merge branch 'master' into feat-add-support-inference
Laure-di Oct 14, 2024
75b6b6f
Update internal/services/inference/testfuncs/checks.go
Laure-di Oct 14, 2024
fc8d29f
fix review
Laure-di Oct 16, 2024
15598f3
change endpoints
Laure-di Oct 16, 2024
713c990
fix endpoints
Laure-di Oct 22, 2024
adb9c7d
fix lint
Laure-di Oct 23, 2024
0728de0
Merge branch 'master' into feat-add-support-inference
Laure-di Oct 23, 2024
bdb7283
Update internal/services/inference/deployment.go
Laure-di Oct 23, 2024
cf8b820
fix update and min_size, max_size
Laure-di Oct 23, 2024
0e5ac6b
add tests
Laure-di Oct 23, 2024
663fd5e
remove default deployment size
Codelax Oct 24, 2024
afcbf34
lower retry interval
Codelax Oct 24, 2024
7b1d228
update cassettes
Codelax Oct 24, 2024
5390f89
add doc
Codelax Oct 24, 2024
cc2b8aa
improve doc
Codelax Oct 25, 2024
47c753e
Merge branch 'master' into feat-add-support-inference
Laure-di Oct 28, 2024
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
5 changes: 3 additions & 2 deletions cmd/tftemplate/models/resource.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package models

import (
"golang.org/x/text/cases"
"golang.org/x/text/language"
"strings"
"unicode"

"golang.org/x/text/cases"
"golang.org/x/text/language"
)

type ResourceTemplate struct {
Expand Down
2 changes: 1 addition & 1 deletion cmd/tftemplate/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package main
import (
"log"
"os"
"strings"
"text/template"

"strings"
"tftemplate/models"
)

Expand Down
72 changes: 72 additions & 0 deletions docs/resources/inference_deployment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
subcategory: "Inference"
page_title: "Scaleway: scaleway_inference_deployment"
---

# Resource: scaleway_inference_deployment

Creates and manages Scaleway Managed Inference deployments.
For more information, see [the documentation](https://www.scaleway.com/en/developers/api/inference/).

## Example Usage

### Basic

```terraform
resource "scaleway_inference_deployment" "deployment" {
name = "tf-inference-deployment"
node_type = "L4"
model_name = "meta/llama-3.1-8b-instruct:fp8"
public_endpoint {
is_enabled = true
}
accept_eula = true
}
```

## Argument Reference

- `model_name` - (Required) The model name to use for the deployment. Model names can be found in Console or using Scaleway's CLI (`scw inference model list`)
- `node_type` - (Required) The node type to use for the deployment. Node types can be found using Scaleway's CLI (`scw inference node-type list`)
- `name` - (Optional) The deployment name.
- `accept_eula` - (Optional) Some models (e.g Meta Llama) require end-user license agreements. Set `true` to accept.
- `tags` - (Optional) The tags associated with the deployment.
- `min_size` - (Optional) The minimum size of the pool.
- `max_size` - (Optional) The maximum size of the pool.
- `private_endpoint` - (Optional) Configuration of the deployment's private endpoint.
- `private_network_id` - (Optional) The ID of the private network to use.
- `disable_auth` - (Optional) Disable the authentication on the endpoint.
- `public_endpoint` - (Optional) Configuration of the deployment's public endpoint.
- `is_enabled` - (Optional) Enable or disable public endpoint.
- `disable_auth` - (Optional) Disable the authentication on the endpoint.

- `region` - (Defaults to [provider](../index.md#region) `region`) The [region](../guides/regions_and_zones.md#regions) in which the deployment is created.
- `project_id` - (Defaults to [provider](../index.md#project_id) `project_id`) The ID of the project the deployment is associated with.

## Attributes Reference

In addition to all arguments above, the following attributes are exported:

- `id` - The ID of the deployment.
- `model_id` - The model id used for the deployment.
- `size` - The size of the pool.
- `status` - The status of the deployment.
- `created_at` - The date and time of the creation of the deployment.
- `updated_at` - The date and time of the last update of the deployment.
- `private_endpoint` - Private endpoint's attributes.
- `id` - (Optional) The id of the private endpoint.
- `url` - (Optional) The URL of the endpoint.
- `public_endpoint` - (Optional) Public endpoint's attributes.
- `id` - (Optional) The id of the public endpoint.
- `url` - (Optional) The URL of the endpoint.

~> **Important:** Deployments' IDs are [regional](../guides/regions_and_zones.md#resource-ids), which means they are of the form `{region}/{id}`, e.g. `fr-par/11111111-1111-1111-1111-111111111111`.


## Import

Functions can be imported using, `{region}/{id}`, as shown below:

```bash
terraform import scaleway_inference_deployment.deployment fr-par/11111111-1111-1111-1111-111111111111
```
2 changes: 2 additions & 0 deletions internal/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"github.com/scaleway/terraform-provider-scaleway/v2/internal/services/flexibleip"
"github.com/scaleway/terraform-provider-scaleway/v2/internal/services/function"
"github.com/scaleway/terraform-provider-scaleway/v2/internal/services/iam"
"github.com/scaleway/terraform-provider-scaleway/v2/internal/services/inference"
"github.com/scaleway/terraform-provider-scaleway/v2/internal/services/instance"
"github.com/scaleway/terraform-provider-scaleway/v2/internal/services/iot"
"github.com/scaleway/terraform-provider-scaleway/v2/internal/services/ipam"
Expand Down Expand Up @@ -150,6 +151,7 @@ func Provider(config *Config) plugin.ProviderFunc {
"scaleway_iam_policy": iam.ResourcePolicy(),
"scaleway_iam_ssh_key": iam.ResourceSSKKey(),
"scaleway_iam_user": iam.ResourceUser(),
"scaleway_inference_deployment": inference.ResourceDeployment(),
"scaleway_instance_image": instance.ResourceImage(),
"scaleway_instance_ip": instance.ResourceIP(),
"scaleway_instance_ip_reverse_dns": instance.ResourceIPReverseDNS(),
Expand Down
Loading
Loading