Skip to content

Commit

Permalink
CircleCi resource_class moved to additionalProperties section
Browse files Browse the repository at this point in the history
CircleCi config 2.1 (https://circleci.com/docs/2.0/configuration-reference/#executors-requires-version-21) defines resource_class on the executor level, not docker.

Additionally, resource_class enum extended to values defined in circleci reference.
  • Loading branch information
miqm committed Sep 29, 2020
1 parent 00098e4 commit 036d790
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/schemas/json/circleciconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -346,12 +346,6 @@
"properties": {
"docker": {
"$ref": "#/definitions/dockerExecutor"
},
"resource_class": {
"description": "Amount of CPU and RAM allocated to each container in a job. (Only works with the `docker` key for paid accounts and is subject to change in a future pricing update. **Note:** Paid accounts must request to use this feature by opening a support ticket (or by contacting their Customer Success Manager when applicable) and non-paid users must request to use this feature by opening a ticket at <https://support.circleci.com/hc/en-us/requests/new>.)",
"type": "string",
"default": "medium",
"enum": ["small", "medium", "medium+", "large", "xlarge"]
}
}
},
Expand Down Expand Up @@ -392,6 +386,12 @@
"type": "object",
"$ref": "#/definitions/executorChoice",
"properties": {
"resource_class": {
"description": "Amount of CPU and RAM allocated to each container in a job. Note: A performance plan is required to access this feature.",
"type": "string",
"default": "medium",
"enum": ["small", "medium", "medium+", "large", "xlarge", "2xlarge", "2xlarge+", "gpu.nvidia.small", "gpu.nvidia.medium", "windows.gpu.nvidia.medium"]
},
"shell": {
"description": "Shell to use for execution command in all steps. Can be overridden by shell in each step (default: See [Default Shell Options](https://circleci.com/docs/2.0/configuration-reference/#default-shell-options)",
"type": "string"
Expand Down
42 changes: 42 additions & 0 deletions src/test/circleciconfig/executors.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"version": 2.1,
"executors": {
"docker-executor": {
"docker": [
{
"image": "circleci/ruby:2.5.1-node-browsers",
"auth": {
"username": "mydockerhub-user",
"password": "$DOCKERHUB_PASSWORD"
}
}
],
"resource_class": "small",
"shell": "/bin/bash",
"working_directory": "/workspace"
},
"machine-executor": {
"machine": {
"image": "ubuntu-1604:202007-01",
"docker_layer_caching": true
},
"resource_class": "xlarge+"
},
"macos-executor": {
"macos": {
"xcode": "11.3.0"
},
"shell": "/bin/zsh",
"working_directory": "/projects",
"resource_class": "medium"
}
},
"jobs": {
"my-job": {
"executor": "machine-executor",
"steps": [
"run"
]
}
}
}

0 comments on commit 036d790

Please sign in to comment.