Skip to content

Commit 4a2238f

Browse files
authored
chore(serverless): add fields for advanced scaling options (scaleway#4208)
1 parent a376f46 commit 4a2238f

File tree

6 files changed

+68
-48
lines changed

6 files changed

+68
-48
lines changed

cmd/scw/testdata/test-all-usage-container-container-create-usage.golden

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,30 @@ USAGE:
66
scw container container create [arg=value ...]
77

88
ARGS:
9-
[namespace-id] UUID of the namespace the container belongs to
10-
[name] Name of the container
11-
[environment-variables.{key}] Environment variables of the container
12-
[min-scale] Minimum number of instances to scale the container to
13-
[max-scale] Maximum number of instances to scale the container to
14-
[memory-limit] Memory limit of the container in MB
15-
[cpu-limit] CPU limit of the container in mvCPU
16-
[timeout] Processing time limit for the container
17-
[privacy] Privacy setting of the container (unknown_privacy | public | private)
18-
[description] Description of the container
19-
[registry-image] Name of the registry image (e.g. "rg.fr-par.scw.cloud/something/image:tag").
20-
[max-concurrency] Number of maximum concurrent executions of the container
21-
[protocol] Protocol the container uses (unknown_protocol | http1 | h2c)
22-
[port] Port the container listens on
23-
[secret-environment-variables.{index}.key]
24-
[secret-environment-variables.{index}.value]
25-
[http-option=enabled] Configure how HTTP and HTTPS requests are handled (unknown_http_option | enabled | redirected)
26-
[sandbox] Execution environment of the container (unknown_sandbox | v1 | v2)
27-
[local-storage-limit] Local storage limit of the container (in MB)
28-
[deploy=true] Deploy container after creation
29-
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
9+
[namespace-id] UUID of the namespace the container belongs to
10+
[name] Name of the container
11+
[environment-variables.{key}] Environment variables of the container
12+
[min-scale] Minimum number of instances to scale the container to
13+
[max-scale] Maximum number of instances to scale the container to
14+
[memory-limit] Memory limit of the container in MB
15+
[cpu-limit] CPU limit of the container in mvCPU
16+
[timeout] Processing time limit for the container
17+
[privacy] Privacy setting of the container (unknown_privacy | public | private)
18+
[description] Description of the container
19+
[registry-image] Name of the registry image (e.g. "rg.fr-par.scw.cloud/something/image:tag").
20+
[protocol] Protocol the container uses (unknown_protocol | http1 | h2c)
21+
[port] Port the container listens on
22+
[secret-environment-variables.{index}.key]
23+
[secret-environment-variables.{index}.value]
24+
[http-option=enabled] Configure how HTTP and HTTPS requests are handled (unknown_http_option | enabled | redirected)
25+
[sandbox] Execution environment of the container (unknown_sandbox | v1 | v2)
26+
[local-storage-limit] Local storage limit of the container (in MB)
27+
[scaling-option.concurrent-requests-threshold]
28+
[deploy=true] Deploy container after creation
29+
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
30+
31+
DEPRECATED ARGS:
32+
[max-concurrency] Number of maximum concurrent executions of the container
3033

3134
FLAGS:
3235
-h, --help help for create

cmd/scw/testdata/test-all-usage-container-container-update-usage.golden

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,29 @@ USAGE:
66
scw container container update <container-id ...> [arg=value ...]
77

88
ARGS:
9-
container-id UUID of the container to update
10-
[environment-variables.{key}] Environment variables of the container
11-
[min-scale] Minimum number of instances to scale the container to
12-
[max-scale] Maximum number of instances to scale the container to
13-
[memory-limit] Memory limit of the container in MB
14-
[cpu-limit] CPU limit of the container in mvCPU
15-
[timeout] Processing time limit for the container
16-
[redeploy] Defines whether to redeploy failed containers
17-
[privacy] Privacy settings of the container (unknown_privacy | public | private)
18-
[description] Description of the container
19-
[registry-image] Name of the registry image (e.g. "rg.fr-par.scw.cloud/something/image:tag").
20-
[max-concurrency] Number of maximum concurrent executions of the container
21-
[protocol] (unknown_protocol | http1 | h2c)
22-
[port]
23-
[secret-environment-variables.{index}.key]
24-
[secret-environment-variables.{index}.value]
25-
[http-option] Configure how HTTP and HTTPS requests are handled (unknown_http_option | enabled | redirected)
26-
[sandbox] Execution environment of the container (unknown_sandbox | v1 | v2)
27-
[local-storage-limit] Local storage limit of the container (in MB)
28-
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
9+
container-id UUID of the container to update
10+
[environment-variables.{key}] Environment variables of the container
11+
[min-scale] Minimum number of instances to scale the container to
12+
[max-scale] Maximum number of instances to scale the container to
13+
[memory-limit] Memory limit of the container in MB
14+
[cpu-limit] CPU limit of the container in mvCPU
15+
[timeout] Processing time limit for the container
16+
[redeploy] Defines whether to redeploy failed containers
17+
[privacy] Privacy settings of the container (unknown_privacy | public | private)
18+
[description] Description of the container
19+
[registry-image] Name of the registry image (e.g. "rg.fr-par.scw.cloud/something/image:tag").
20+
[protocol] (unknown_protocol | http1 | h2c)
21+
[port]
22+
[secret-environment-variables.{index}.key]
23+
[secret-environment-variables.{index}.value]
24+
[http-option] Configure how HTTP and HTTPS requests are handled (unknown_http_option | enabled | redirected)
25+
[sandbox] Execution environment of the container (unknown_sandbox | v1 | v2)
26+
[local-storage-limit] Local storage limit of the container (in MB)
27+
[scaling-option.concurrent-requests-threshold]
28+
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
29+
30+
DEPRECATED ARGS:
31+
[max-concurrency] Number of maximum concurrent executions of the container
2932

3033
FLAGS:
3134
-h, --help help for update

docs/commands/container.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,15 @@ scw container container create [arg=value ...]
7171
| privacy | One of: `unknown_privacy`, `public`, `private` | Privacy setting of the container |
7272
| description | | Description of the container |
7373
| registry-image | | Name of the registry image (e.g. "rg.fr-par.scw.cloud/something/image:tag"). |
74-
| max-concurrency | | Number of maximum concurrent executions of the container |
74+
| ~~max-concurrency~~ | Deprecated | Number of maximum concurrent executions of the container |
7575
| protocol | One of: `unknown_protocol`, `http1`, `h2c` | Protocol the container uses |
7676
| port | | Port the container listens on |
7777
| secret-environment-variables.{index}.key | | |
7878
| secret-environment-variables.{index}.value | | |
7979
| http-option | Default: `enabled`<br />One of: `unknown_http_option`, `enabled`, `redirected` | Configure how HTTP and HTTPS requests are handled |
8080
| sandbox | One of: `unknown_sandbox`, `v1`, `v2` | Execution environment of the container |
8181
| local-storage-limit | | Local storage limit of the container (in MB) |
82+
| scaling-option.concurrent-requests-threshold | | |
8283
| deploy | Default: `true` | Deploy container after creation |
8384
| region | Default: `fr-par`<br />One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config |
8485

@@ -194,14 +195,15 @@ scw container container update <container-id ...> [arg=value ...]
194195
| privacy | One of: `unknown_privacy`, `public`, `private` | Privacy settings of the container |
195196
| description | | Description of the container |
196197
| registry-image | | Name of the registry image (e.g. "rg.fr-par.scw.cloud/something/image:tag"). |
197-
| max-concurrency | | Number of maximum concurrent executions of the container |
198+
| ~~max-concurrency~~ | Deprecated | Number of maximum concurrent executions of the container |
198199
| protocol | One of: `unknown_protocol`, `http1`, `h2c` | |
199200
| port | | |
200201
| secret-environment-variables.{index}.key | | |
201202
| secret-environment-variables.{index}.value | | |
202203
| http-option | One of: `unknown_http_option`, `enabled`, `redirected` | Configure how HTTP and HTTPS requests are handled |
203204
| sandbox | One of: `unknown_sandbox`, `v1`, `v2` | Execution environment of the container |
204205
| local-storage-limit | | Local storage limit of the container (in MB) |
206+
| scaling-option.concurrent-requests-threshold | | |
205207
| region | Default: `fr-par`<br />One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config |
206208

207209

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ require (
2626
github.com/mattn/go-isatty v0.0.20
2727
github.com/moby/buildkit v0.13.2
2828
github.com/opencontainers/go-digest v1.0.0
29-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20241021115642-2d127a2d76c7
29+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20241021142112-037d5d27298e
3030
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
3131
github.com/spf13/cobra v1.8.1
3232
github.com/spf13/pflag v1.0.5

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,8 +465,8 @@ github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUz
465465
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
466466
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 h1:OkMGxebDjyw0ULyrTYWeN0UNCCkmCWfjPnIA2W6oviI=
467467
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06/go.mod h1:+ePHsJ1keEjQtpvf9HHw0f4ZeJ0TLRsxhunSI2hYJSs=
468-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20241021115642-2d127a2d76c7 h1:mWi3yS37Lhf73OP2Z4CboKtXJM4mWDAUWFHKSx2WK7k=
469-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20241021115642-2d127a2d76c7/go.mod h1:3jrRJM7638J+P33hKy9MBvfOBxNo8pEGNQQoIv65Ihg=
468+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20241021142112-037d5d27298e h1:zoeTDRF5ycn1pdpxiLtRPSAmJ5WrUVaD9/7yYeUnHgs=
469+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20241021142112-037d5d27298e/go.mod h1:3jrRJM7638J+P33hKy9MBvfOBxNo8pEGNQQoIv65Ihg=
470470
github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8=
471471
github.com/sclevine/spec v1.4.0/go.mod h1:LvpgJaFyvQzRvc1kaDs0bulYwzC70PbiYjC4QnFHkOM=
472472
github.com/secure-systems-lab/go-securesystemslib v0.8.0 h1:mr5An6X45Kb2nddcFlbmfHkLguCE9laoZCUzEEpIZXA=

internal/namespaces/container/v1beta1/container_cli.go

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ func containerContainerCreate() *core.Command {
544544
Name: "max-concurrency",
545545
Short: `Number of maximum concurrent executions of the container`,
546546
Required: false,
547-
Deprecated: false,
547+
Deprecated: true,
548548
Positional: false,
549549
},
550550
{
@@ -598,6 +598,12 @@ func containerContainerCreate() *core.Command {
598598
Deprecated: false,
599599
Positional: false,
600600
},
601+
{
602+
Name: "scaling-option.concurrent-requests-threshold",
603+
Required: false,
604+
Deprecated: false,
605+
Positional: false,
606+
},
601607
core.RegionArgSpec(scw.RegionFrPar, scw.RegionNlAms, scw.RegionPlWaw),
602608
},
603609
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
@@ -703,7 +709,7 @@ func containerContainerUpdate() *core.Command {
703709
Name: "max-concurrency",
704710
Short: `Number of maximum concurrent executions of the container`,
705711
Required: false,
706-
Deprecated: false,
712+
Deprecated: true,
707713
Positional: false,
708714
},
709715
{
@@ -754,6 +760,12 @@ func containerContainerUpdate() *core.Command {
754760
Deprecated: false,
755761
Positional: false,
756762
},
763+
{
764+
Name: "scaling-option.concurrent-requests-threshold",
765+
Required: false,
766+
Deprecated: false,
767+
Positional: false,
768+
},
757769
core.RegionArgSpec(scw.RegionFrPar, scw.RegionNlAms, scw.RegionPlWaw),
758770
},
759771
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {

0 commit comments

Comments
 (0)