Skip to content

Commit a381d3c

Browse files
Add resource class naming conventions to machine provisioner guide (#10504)
* Add resource class naming conventions to machine provisioner guide - Document regex requirements for namespace (lowercase, numbers, underscore, dash) - Document regex requirements for class portion (alphanumeric, colon, underscore, dash, plus) - Include examples of valid resource class names - Resolves DOC-34 Co-authored-by: Rosie Yohannan <rosieyohannan@users.noreply.github.com> * Add resource class naming conventions to runner setup docs - Document naming requirements in web app installation steps - Document naming requirements in CLI installation steps - Include practical examples in CLI steps - Namespace: lowercase letters, numbers, underscores, dashes - Resource class: alphanumeric, colons, underscores, dashes, plus signs Resolves DOC-34 Co-authored-by: Rosie Yohannan <rosieyohannan@users.noreply.github.com> * remove guidance misplaced in machine provisioner docs and add to runner provisioner docs * style fixes * remove confusing references to provisioner docs * add in creating namespace and resource class as first step * refine runner setup partials * improve consistency --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Rosie Yohannan <rosieyohannan@users.noreply.github.com>
1 parent 368844c commit a381d3c

3 files changed

Lines changed: 61 additions & 30 deletions

File tree

docs/guides/modules/ROOT/partials/runner/install-with-cli-steps.adoc

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,29 @@ ifdef::machine[]
55
NOTE: If you are installing **self-hosted runners for server**, the CircleCI CLI needs to be configured using your server API key. Run `circleci setup` to configure the CLI and access the option to supply a new API token if required.
66
endif::[]
77

8-
In order to install self-hosted runners, you will need to create a namespace and authentication token by performing the steps listed below.
8+
To install self-hosted runners, you need to create a CircleCI namespace and resource class. Once set up you will receive a resource class token. You must be an organization admin to complete this process. View your installed runners on the inventory page in the link:https://app.circleci.com/[web app] by selecting *Runners* from the sidebar.
99

10-
NOTE: To create resource classes and tokens you need to be an organization administrator in the VCS provider.
10+
TIP: If you already create orb in your organization you will already have a namespace configured. You must use this same namespace for runners. Each organization can only create a single namespace.
1111

12-
You can view your installed runners on the inventory page in the link:https://app.circleci.com/[web app] or your CircleCI server app, by selecting *Runners* from the sidebar.
13-
14-
. Create a namespace for your organization's self-hosted runners. *Each organization can only create a single namespace*. We suggest using a lowercase representation of your CircleCI organization's account name. If you already use orbs, this namespace should be the same namespace orbs use.
15-
+
16-
Use the following command to create a namespace:
12+
. Create a namespace for your organization's self-hosted runners if you do not already have one configured. We suggest using a lowercase representation of your CircleCI organization's account name.
1713
+
18-
```
19-
circleci namespace create <name> --org-id <your-organization-id>
20-
```
14+
Use the following command to create your CircleCI organization's namespace:
2115
+
22-
TIP: If your organization already has a namespace, you will receive an error if you run the above command to create a _different_ namespace. The error message returns the name of the existing namespace. In this case, move on to step 2 below, using your existing namespace.
16+
[source,console]
17+
$ circleci namespace create <name> --org-id <your-organization-id>
2318

24-
. Create a resource class for your self-hosted runner's namespace using the following command:
19+
. Create a resource class for your runner using the following command. You will configure jobs to use this resource class when you want them to run on your slef-hosted runner:
20+
+
21+
[source,console]
22+
$ circleci runner resource-class create <namespace>/<resource-class> <description> --generate-token
2523
+
26-
```
27-
circleci runner resource-class create <namespace>/<resource-class> <description> --generate-token
28-
```
24+
Make sure to replace `<namespace>` and `<resource-class>` with your org namespace and desired resource class name, respectively. You can add a description but this is optional.
2925
+
30-
Make sure to replace `<namespace>` and `<resource-class>` with your org namespace and desired resource class name, respectively. You may optionally add a description.
26+
Resource class names must follow specific naming conventions.
3127
+
32-
Example: `circleci runner resource-class create my-namespace/my-resource-class my-description --generate-token`.
28+
** The *namespace* can contain lowercase letters, numbers, underscores, and dashes.
29+
** The *resource class name* can contain uppercase and lowercase letters, numbers, colons, underscores, dashes, and plus signs.
3330
+
3431
The resource class token is returned after the runner resource class is successfully created.
3532
+
36-
CAUTION: The token cannot be retrieved again, so be sure to store it safely.
33+
CAUTION: The token is only displayed once, so be sure to store it safely.

docs/guides/modules/ROOT/partials/runner/install-with-web-app-steps.adoc

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,32 @@
11
//== CircleCI web app installation: pre-steps
2-
In order to install self-hosted runners, you will need to create a namespace and resource class token. To create resource classes and tokens, you need to be an organization admin in the VCS provider. You can read about namespaces and resource classes on the <<runner-concepts#namespaces-and-resource-classes,Concepts>> page.
2+
To install self-hosted runners, you need to create a CircleCI namespace and resource class. Once set up you will receive a resource class token. You must be an organization admin to complete this process. View your installed runners on the inventory page in the link:https://app.circleci.com/[web app] by selecting *Runners* from the sidebar.
33

4-
You can view your installed runners on the inventory page, by selecting *Runners* from the sidebar.
4+
TIP: If you already create orb in your organization you will already have a namespace configured. You must use this same namespace for runners. Each organization can only create a single namespace.
55

66
. On the https://app.circleci.com/[CircleCI web app], navigate to *Runners* and select btn:[Create Resource Class].
77
+
8+
.Runner set up, step one - Get started
89
image::guides:ROOT:runner/runner-ui-step-one.png[Runner set up, step one - Get started]
910

10-
. Next, you will create a custom xref:guides:execution-managed:resource-class-overview.adoc[resource class] to use when configuring jobs to use your self-hosted runners. If this is your organization's first time using self-hosted runners, you will need to create or enter a namespace. If your organization already creates orbs, do not create a new namespace, but instead enter the namespace your organization uses for orbs here too. Enter a name for your self-hosted runner resource class.
11+
. Create a custom xref:guides:execution-managed:resource-class-overview.adoc[Resource Class]. You will configure jobs to use this resource class when you want them to run on your self-hosted runner.
1112
+
12-
TIP: *Each organization can only create a single namespace*. While not required, we suggest using a lowercase representation of your CircleCI account name. CircleCI will populate your org name as the suggested namespace by default in the UI.
13+
We suggest using a lowercase representation of your CircleCI account name for your namespace. CircleCI will populate your org name as the suggested namespace by default in the UI.
1314
+
15+
Namespace and resource classes must follow specific naming conventions:
16+
+
17+
** The *namespace* can contain lowercase letters, numbers, underscores, and dashes.
18+
** The *resource class name* can contain uppercase and lowercase letters, numbers, colons, underscores, dashes, and plus signs.
19+
+
20+
.Runner set up, step two - Create a namespace and resource class
1421
image::guides:ROOT:runner/runner-ui-step-two.png[Runner set up, step two - Create a namespace and resource class]
1522

23+
. Enter a description for your resource class. This is an optional field.
24+
. Select btn:[Save and continue] to save and view your resource class token.
1625
. Copy and save the resource class token. Self-hosted runners use this token to claim work for the associated resource class.
1726
+
18-
CAUTION: The token cannot be retrieved again, be sure to store it safely.
27+
CAUTION: The token is only displayed once, be sure to store it safely.
1928
+
29+
.Runner set up, step three - Create a resource class token
2030
image::guides:ROOT:runner/runner-ui-step-three.png[Runner set up, step three - Create a resource class token]
2131

2232
ifdef::container[]
@@ -32,3 +42,9 @@ ifdef::machine[]
3242
. Select the **Machine** tab and progress on to the platform-specific instructions in the next section of this installation guide.
3343
+
3444
endif::[]
45+
46+
ifdef::provisioner[]
47+
+
48+
. Select btn:[Continue] to complete the setup.
49+
+
50+
endif::[]

docs/guides/modules/execution-runner/pages/runner-provisioner.adoc

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,12 @@ Do not open a support ticket for issues with Runner Provisioner. Issues are rout
3838
* A Kubernetes cluster with KubeVirt installed. Refer to the link:https://github.com/kubevirt/kubevirt/blob/main/docs/compatibility.md[KubeVirt compatibility matrix] for the appropriate version for your cluster. Runner Provisioner has been tested with v1.8.
3939
* `kubectl` configured against your cluster.
4040
* `helm` v3+.
41-
* A CircleCI runner resource class and its associated resource class token. Create one in the CircleCI web app under **Self-Hosted Runners**. This token is used by the agent running on the VM to authenticate with CircleCI and claim and execute jobs for that resource class.
42-
* A CircleCI API token with permission to query runner tasks. This may be a personal API token or a project API token with read-only access.
41+
* A CircleCI API token with permission to query runner tasks. This may be a personal API token or a project API token with read-only access. See the xref:toolkit:managing-api-tokens.adoc[Managing API Tokens] page for more information.
4342

4443
=== Cluster requirements
4544

45+
The following sections cover the cluster requirements for running Runner Provisioner on a Kubernetes cluster.
46+
4647
==== Nested virtualization
4748

4849
KubeVirt runs VMs inside Kubernetes pods. Each node that will host runner VMs must expose `/dev/kvm` — the node itself must support hardware-accelerated virtualization (either bare metal, or a cloud VM with nested virtualization enabled).
@@ -256,8 +257,24 @@ $ kubectl label nodes -l agentpool=<nodepool-name> node-role.kubernetes.io/contr
256257

257258
== Quickstart
258259

260+
=== 1. Create CircleCI namespace and resource class
261+
262+
[tabs]
263+
====
264+
Web app installation::
265+
+
266+
--
267+
include::ROOT:partial$runner/install-with-web-app-steps.adoc[]
268+
--
269+
CLI installation::
270+
+
271+
--
272+
include::ROOT:partial$runner/install-with-cli-steps.adoc[]
273+
--
274+
====
275+
259276
[#create-namespace]
260-
=== 1. Create the namespace
277+
=== 3. Create the Kubernetes namespace
261278

262279
[source,console]
263280
----
@@ -310,7 +327,7 @@ provisioner:
310327
The image `quay.io/containerdisks/ubuntu:22.04` is an official container disk maintained by the KubeVirt project, providing a pre-built Ubuntu 22.04 OS image for running virtual machines on Kubernetes.
311328

312329
[#install-helm-chart]
313-
=== 3. Install the Helm chart
330+
=== 4. Install the Helm chart
314331

315332
[source,console]
316333
----
@@ -322,7 +339,7 @@ $ helm install runner-provisioner circleci_runner-provisioner \
322339
----
323340

324341
[#verify-deployment]
325-
=== 4. Verify the deployment
342+
=== 5. Verify the deployment
326343

327344
[source,console]
328345
----
@@ -445,7 +462,7 @@ When enabled, the provisioner attaches a containerDisk that ships the `circleci-
445462

446463
| `namespace`
447464
| `runner-provisioner`
448-
| Namespace where runner VMs are created
465+
| Namespace where runner VMs are created.
449466

450467
| `circleToken`
451468
| `""`
@@ -470,7 +487,8 @@ When enabled, the provisioner attaches a containerDisk that ships the `circleci-
470487

471488
| `name`
472489
| `""`
473-
| Resource class in `namespace/name` format (required)
490+
| Resource class in `namespace/name` format (required). The namespace can contain lowercase letters, numbers, underscores, and dashes. The resource class name can contain uppercase and lowercase letters, numbers, colons, underscores, dashes, and plus signs.
491+
Valid examples: `my-org/medium`, `acme_corp/large-gpu`, `dev-team/custom:arm64`.
474492

475493
| `token`
476494
| `""`

0 commit comments

Comments
 (0)