Skip to content

Commit 3adf264

Browse files
[ONPREM-1832] Document container runner Windows preview (#225)
* Document container runner Windows preview * Make suggestions to unsafe retries section
1 parent 2f377ea commit 3adf264

File tree

1 file changed

+55
-4
lines changed

1 file changed

+55
-4
lines changed

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

Lines changed: 55 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,17 +258,68 @@ Annotations:
258258
app.circleci.com/container-spec-secondary-4: {"selectionScope":"resource-class","imageMatchType":"default"} <- Corresponds to "cimg/mongo:5"
259259
----
260260

261+
== Windows
262+
263+
NOTE: Windows container support is currently in preview.
264+
265+
Container runner supports running Windows containers on Windows Server nodes within your Kubernetes cluster. The container-agent pod must run on a Linux node. You can add an additional Windows Server node group with taints to prevent non-Windows workloads (such as container agent itself) from being scheduled on those nodes.
266+
267+
Major cloud providers offer documentation for setting up Windows Server node groups:
268+
269+
* https://docs.aws.amazon.com/eks/latest/userguide/windows-support.html[AWS]
270+
* https://cloud.google.com/kubernetes-engine/docs/how-to/creating-a-cluster-windows[GCP]
271+
272+
=== Resource class configuration
273+
274+
The following example shows a Windows container runner resource class configuration that tolerates the Windows node taint and ensures scheduling on Windows nodes:
275+
276+
```yaml
277+
agent:
278+
resourceClasses:
279+
<my-namespace>/<my-windows-resource-class>:
280+
spec:
281+
nodeSelector:
282+
kubernetes.io/os: windows
283+
affinity:
284+
nodeAffinity:
285+
requiredDuringSchedulingIgnoredDuringExecution:
286+
nodeSelectorTerms:
287+
- matchExpressions:
288+
- key: kubernetes.io/arch
289+
operator: In
290+
values:
291+
- amd64
292+
tolerations:
293+
- key: "os"
294+
operator: "Exists"
295+
value: "windows"
296+
effect: "NoSchedule"
297+
```
298+
299+
=== CircleCI job configuration
300+
301+
You can then configure a CircleCI job to use Windows containers as follows:
302+
303+
```yaml
304+
jobs:
305+
windows-job:
306+
docker:
307+
- image: mcr.microsoft.com/powershell:nanoserver-ltsc2022
308+
resource_class: <my-namespace>/<my-windows-resource-class>
309+
shell: pwsh.exe
310+
steps:
311+
- run: Write-Host "Hello from Windows!"
312+
```
313+
261314
[#unsafe-retries]
262315
=== Unsafe retries
263316

317+
CAUTION: Unlike automatic retries on startup, retrying tasks during runtime can be risky. This is because tasks can have arbitrary steps that produce external side effects which are not idempotent or stateless. This includes steps that could impact production environments or databases. Use this feature with care, knowing the risks of rerunning jobs and workflows that may or may not be idempotent.
318+
264319
Unsafe retries enable container runner to automatically rerun tasks that are unexpectedly interrupted during their execution. These disruptions could be due to network connectivity issues, the underlying node shutting down, or other unpredictable causes. Any job failure that would be displayed in the CircleCI web app as an infrastructure fail should be expected to trigger an unsafe retry when enabled.
265320

266321
Unsafe retries is useful when scheduling workloads on spot instances, which often come with cost-saving benefits at the risk of pod preemptions with many Kubernetes providers.
267322

268-
****
269-
This feature is called “unsafe retries” for a reason. Unlike automatic retries on startup, retrying tasks during runtime can be risky. This is because tasks can have arbitrary steps that produce external side effects which are not idempotent or stateless. This includes steps that could impact production environments or databases. Use this feature with care, knowing the risks of rerunning jobs and workflows that may or may not be idempotent.
270-
****
271-
272323
The following sequence shows how unsafe retires work:
273324

274325
. If a pod fails or gets evicted during runtime, container runner will release the task.

0 commit comments

Comments
 (0)