Skip to content

Commit 9432dc3

Browse files
authored
fix(inference): attach private network (#4524)
1 parent 3e7b5be commit 9432dc3

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

internal/namespaces/inference/v1beta1/custom_endpoint.go

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,19 @@ func endpointCreateBuilder(c *core.Command) *core.Command {
3232
createEndpointCustomRequest := argsI.(*createEndpointRequestCustom)
3333
createEndpointreq := createEndpointCustomRequest.CreateEndpointRequest
3434
endpoint := createEndpointCustomRequest.Endpoint
35+
endpointToCreate := inference.EndpointSpec{
36+
Public: nil,
37+
PrivateNetwork: nil,
38+
DisableAuth: endpoint.DisableAuth,
39+
}
3540
if endpoint.IsPublic {
3641
publicEndpoint := &inference.EndpointSpecPublic{}
37-
endpointToCreate := inference.EndpointSpec{
38-
Public: publicEndpoint,
39-
PrivateNetwork: nil,
40-
DisableAuth: endpoint.DisableAuth,
41-
}
42-
createEndpointreq.Endpoint = &endpointToCreate
42+
endpointToCreate.Public = publicEndpoint
43+
}
44+
if endpoint.PrivateNetwork != nil && endpoint.PrivateNetwork.PrivateNetworkID != "" {
45+
endpointToCreate.PrivateNetwork = &inference.EndpointSpecPrivateNetwork{PrivateNetworkID: endpoint.PrivateNetwork.PrivateNetworkID}
4346
}
47+
createEndpointreq.Endpoint = &endpointToCreate
4448

4549
return runner(ctx, createEndpointreq)
4650
}

internal/namespaces/inference/v1beta1/helper_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ import "github.com/scaleway/scaleway-cli/v2/core"
55
func CreateDeploymentPublicEndpoint() core.BeforeFunc {
66
return core.ExecStoreBeforeCmd(
77
"DEPLOYMENT",
8-
"scw inference deployment create node-type=H100 accept-eula=true model-name=meta/llama-2-70b-chat:fp8 -w",
8+
"scw inference deployment create node-type=H100 accept-eula=true model-name=mistral/mistral-7b-instruct-v0.3:bf16 -w",
99
)
1010
}
1111

1212
func CreateDeploymentPrivateEndpoint() core.BeforeFunc {
1313
return core.ExecStoreBeforeCmd(
1414
"DEPLOYMENT",
15-
"scw inference deployment create node-type=H100 accept-eula=true model-name=meta/llama-2-70b-chat:fp8 endpoints.0.private-network.private-network-id={{ .PN.ID }} -w",
15+
"scw inference deployment create node-type=H100 accept-eula=true model-name=mistral/mistral-7b-instruct-v0.3:bf16 endpoints.0.private-network.private-network-id={{ .PN.ID }} -w",
1616
)
1717
}
1818

0 commit comments

Comments
 (0)