Skip to content

Commit 8f09d00

Browse files
authored
feat(apple_silicon): add CI-CD runner installation APIs (#5020)
1 parent c5d935c commit 8f09d00

File tree

6 files changed

+92
-14
lines changed

6 files changed

+92
-14
lines changed

cmd/scw/testdata/test-all-usage-apple-silicon-server-create-usage.golden

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,18 @@ USAGE:
66
scw apple-silicon server create [arg=value ...]
77

88
ARGS:
9-
[name=<generated>] Create a server with this given name
10-
[project-id] Project ID to use. If none is passed the default project ID will be used
11-
[type] Create a server of the given type
12-
[os-id] Create a server with the given os_id
13-
[enable-vpc] Activate the Private Network feature for this server
14-
[commitment-type] Activate commitment for this server (duration_24h | renewed_monthly | none)
15-
[public-bandwidth-bps] Public bandwidth to configure for this server. Expressed in bits per second.
16-
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-3)
9+
[name=<generated>] Create a server with this given name
10+
[project-id] Project ID to use. If none is passed the default project ID will be used
11+
[type] Create a server of the given type
12+
[os-id] Create a server with the given os_id
13+
[enable-vpc] Activate the Private Network feature for this server
14+
[commitment-type] Activate commitment for this server (duration_24h | renewed_monthly | none)
15+
[public-bandwidth-bps] Public bandwidth to configure for this server. Expressed in bits per second.
16+
[runner-configuration.name]
17+
[runner-configuration.url]
18+
[runner-configuration.token]
19+
[runner-configuration.provider] (unknown_provider | github | gitlab)
20+
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-3)
1721

1822
FLAGS:
1923
-h, --help help for create

cmd/scw/testdata/test-all-usage-apple-silicon-server-reinstall-usage.golden

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,13 @@ USAGE:
66
scw apple-silicon server reinstall <server-id ...> [arg=value ...]
77

88
ARGS:
9-
server-id UUID of the server you want to reinstall
10-
[os-id] Reinstall the server with the OS corresponding to the os_id
11-
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-3)
9+
server-id UUID of the server you want to reinstall
10+
[os-id] Reinstall the server with the OS corresponding to the os_id
11+
[runner-configuration.name]
12+
[runner-configuration.url]
13+
[runner-configuration.token]
14+
[runner-configuration.provider] (unknown_provider | github | gitlab)
15+
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-3)
1216

1317
FLAGS:
1418
-h, --help help for reinstall

docs/commands/apple-silicon.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,10 @@ scw apple-silicon server create [arg=value ...]
197197
| enable-vpc | | Activate the Private Network feature for this server |
198198
| commitment-type | One of: `duration_24h`, `renewed_monthly`, `none` | Activate commitment for this server |
199199
| public-bandwidth-bps | | Public bandwidth to configure for this server. Expressed in bits per second. |
200+
| runner-configuration.name | | |
201+
| runner-configuration.url | | |
202+
| runner-configuration.token | | |
203+
| runner-configuration.provider | One of: `unknown_provider`, `github`, `gitlab` | |
200204
| zone | Default: `fr-par-1`<br />One of: `fr-par-3` | Zone to target. If none is passed will use default zone from the config |
201205

202206

@@ -300,6 +304,10 @@ scw apple-silicon server reinstall <server-id ...> [arg=value ...]
300304
|------|---|-------------|
301305
| server-id | Required | UUID of the server you want to reinstall |
302306
| os-id | | Reinstall the server with the OS corresponding to the os_id |
307+
| runner-configuration.name | | |
308+
| runner-configuration.url | | |
309+
| runner-configuration.token | | |
310+
| runner-configuration.provider | One of: `unknown_provider`, `github`, `gitlab` | |
303311
| zone | Default: `fr-par-1`<br />One of: `fr-par-3` | Zone to target. If none is passed will use default zone from the config |
304312

305313

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ require (
2323
github.com/mattn/go-isatty v0.0.20
2424
github.com/moby/buildkit v0.24.0
2525
github.com/opencontainers/go-digest v1.0.0
26-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.35.0.20250917154444-1d3cdbf4ce0d
26+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.35.0.20250929084830-e251d5dd081b
2727
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
2828
github.com/spf13/cobra v1.10.1
2929
github.com/spf13/pflag v1.0.10

go.sum

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,8 @@ github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre
258258
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
259259
github.com/go-viper/mapstructure/v2 v2.4.0 h1:EBsztssimR/CONLSZZ04E8qAkxNYq4Qp9LvH92wZUgs=
260260
github.com/go-viper/mapstructure/v2 v2.4.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
261+
github.com/goccy/go-yaml v1.18.0 h1:8W7wMFS12Pcas7KU+VVkaiCng+kG8QiFeFwzFb+rwuw=
262+
github.com/goccy/go-yaml v1.18.0/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=
261263
github.com/gofrs/flock v0.12.1 h1:MTLVXXHf8ekldpJk3AKicLij9MdwOWkZ+a/jHHZby9E=
262264
github.com/gofrs/flock v0.12.1/go.mod h1:9zxTsyu5xtJ9DK+1tFZyibEV7y3uwDxPPfbxeeHCoD0=
263265
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
@@ -460,8 +462,8 @@ github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7
460462
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
461463
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 h1:OkMGxebDjyw0ULyrTYWeN0UNCCkmCWfjPnIA2W6oviI=
462464
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06/go.mod h1:+ePHsJ1keEjQtpvf9HHw0f4ZeJ0TLRsxhunSI2hYJSs=
463-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.35.0.20250917154444-1d3cdbf4ce0d h1:9tZdwRedm970w1MsuDvYP4jxdzb7Oa4/WOwhPV8XNvA=
464-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.35.0.20250917154444-1d3cdbf4ce0d/go.mod h1:47B1d/YXmSAxlJxUJxClzHR6b3T4M1WyCvwENPQNBWc=
465+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.35.0.20250929084830-e251d5dd081b h1:ol5HdwkC17jR76fR49CsnqwUab9JIpmhGl6X6r2B5es=
466+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.35.0.20250929084830-e251d5dd081b/go.mod h1:DVB9HV7nK7TdTRqlpdxw6T0Wxg+aB9xPBEpO3aM2iqQ=
465467
github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8=
466468
github.com/sclevine/spec v1.4.0/go.mod h1:LvpgJaFyvQzRvc1kaDs0bulYwzC70PbiYjC4QnFHkOM=
467469
github.com/secure-systems-lab/go-securesystemslib v0.8.0 h1:mr5An6X45Kb2nddcFlbmfHkLguCE9laoZCUzEEpIZXA=
@@ -683,6 +685,8 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8
683685
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
684686
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
685687
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
688+
gopkg.in/dnaeon/go-vcr.v4 v4.0.5 h1:I0hpTIvD5rII+8LgYGrHMA2d4SQPoL6u7ZvJakWKsiA=
689+
gopkg.in/dnaeon/go-vcr.v4 v4.0.5/go.mod h1:dRos81TkW9C1WJt6tTaE+uV2Lo8qJT3AG2b35+CB/nQ=
686690
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
687691
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
688692
gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME=

internal/namespaces/applesilicon/v1alpha1/applesilicon_cli.go

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,35 @@ func appleSiliconServerCreate() *core.Command {
203203
Deprecated: false,
204204
Positional: false,
205205
},
206+
{
207+
Name: "runner-configuration.name",
208+
Required: false,
209+
Deprecated: false,
210+
Positional: false,
211+
},
212+
{
213+
Name: "runner-configuration.url",
214+
Required: false,
215+
Deprecated: false,
216+
Positional: false,
217+
},
218+
{
219+
Name: "runner-configuration.token",
220+
Required: false,
221+
Deprecated: false,
222+
Positional: false,
223+
},
224+
{
225+
Name: "runner-configuration.provider",
226+
Required: false,
227+
Deprecated: false,
228+
Positional: false,
229+
EnumValues: []string{
230+
"unknown_provider",
231+
"github",
232+
"gitlab",
233+
},
234+
},
206235
core.ZoneArgSpec(scw.ZoneFrPar3),
207236
},
208237
Run: func(ctx context.Context, args any) (i any, e error) {
@@ -545,6 +574,35 @@ func appleSiliconServerReinstall() *core.Command {
545574
Deprecated: false,
546575
Positional: false,
547576
},
577+
{
578+
Name: "runner-configuration.name",
579+
Required: false,
580+
Deprecated: false,
581+
Positional: false,
582+
},
583+
{
584+
Name: "runner-configuration.url",
585+
Required: false,
586+
Deprecated: false,
587+
Positional: false,
588+
},
589+
{
590+
Name: "runner-configuration.token",
591+
Required: false,
592+
Deprecated: false,
593+
Positional: false,
594+
},
595+
{
596+
Name: "runner-configuration.provider",
597+
Required: false,
598+
Deprecated: false,
599+
Positional: false,
600+
EnumValues: []string{
601+
"unknown_provider",
602+
"github",
603+
"gitlab",
604+
},
605+
},
548606
core.ZoneArgSpec(scw.ZoneFrPar3),
549607
},
550608
Run: func(ctx context.Context, args any) (i any, e error) {

0 commit comments

Comments
 (0)