Skip to content

Commit b264d72

Browse files
greyscaledsreyaEmyrklilshoffSean Smith
authored
Release 1.17.2 (coder#219)
Summary: Releases changelog and documentation for major features in Coder version 1.17.2 Details: * 🆕 Workspaces As Code documentation Recognition: * The entire workspaces as code team for bringing the infrastructure as code paradigm into Coder! - Jon Ayers <jon@coder.com> - Steven Masley <Emyrk@users.noreply.github.com> - Lily Hoffman <78573475+lilshoff@users.noreply.github.com> - Sean Smith <sean@coder.com> - Grey Barkans <grey@coder.com> * Jon Ayers for leading the wac team and ensuring the 1.17.2 release as release manager * Jonathan Yu for debugging and fixing GitLab OIDC, and reviewing and helping out with many parts of the release effor * Katie Horne for documenting workspaces as code Co-authored-by: Jon Ayers <jon@coder.com> Co-authored-by: Steven Masley <Emyrk@users.noreply.github.com> Co-authored-by: Lily Hoffman <78573475+lilshoff@users.noreply.github.com> Co-authored-by: Sean Smith <sean@coder.com> Co-authored-by: Jonathan Yu <jonathan@coder.com> Co-authored-by: Katie Horne <katie@coder.com>
1 parent 9e3f90f commit b264d72

File tree

7 files changed

+306
-2
lines changed

7 files changed

+306
-2
lines changed

admin/templates.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
title: Templates
3+
description:
4+
Learn how to create an embeddable "Open In Coder" button for your Workspaces
5+
As Code Template
6+
---
7+
8+
The **Templates** tab features a form you can use for generating an embeddable
9+
button. This button makes it easy for developers to use your
10+
[workspace template](../environments/workspaces-as-code/index.md).
11+
12+
To create your button:
13+
14+
1. Go to **Manage** > **Admin** > **Templates**.
15+
1. Fill out the fields.
16+
17+
Once you've filled out the form, Coder generates a custom Markdown snippet,
18+
which you can then add to your repository's `README.md`.
19+
20+
![Open In Coder Button](../assets/wac-badge.png)

assets/wac-badge.png

240 KB
Loading

assets/wac-location.png

30.7 KB
Loading

changelog/1.17.2.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
title: "1.17.2"
3+
description: "Released on 03/30/21"
4+
---
5+
6+
### Breaking Changes ❗
7+
8+
There are no breaking changes in 1.17.2.
9+
10+
### Features ✨
11+
12+
- Workspaces As Code (**WAC**): Workspaces as code (WAC) brings the
13+
_Infrastructure As Code_ paradigm to Coder environments. WAC allows you to
14+
define and create new environments using **workspace templates**.
15+
- web: New page available via **Admin** > **Templates** for creating an
16+
embeddable quickstart button.
17+
- web: New options available when clicking **New Environment** from the
18+
**Environments** page
19+
- web: **workspace template** information is now displayed on the
20+
**Environments** page for environments built from a template.
21+
- web: Added _Cordon_ and _Uncordon_ actions to _Provider_ audit logs
22+
23+
### Bug Fixes 🐛
24+
25+
- infra: Fixes an issue whereby using `coder/configure` to create Dev URLs would
26+
fail
27+
- infra: Fixes an issue authenticating using OpenID Connect Identity Providers
28+
(IdPs) that omit name information, such as GitLab. In this case, Coder will
29+
use the email address as the user's name.
30+
- infra: Improved validation for environment names. Previously, a long
31+
environment name may have caused build errors.
32+
- web: The Dev URLs card on the **Environments** page now refreshes after an
33+
environment finishes building
34+
- jetbrains: Fixed an issue whereby Jetbrains IDE processes would start and
35+
always run. They now start on request when opening Jetbrains IDEs.
36+
- web: Improved reliability of the workspace provider ping indicator
37+
- web: Fixed incorrect timestamps in an image's _Available Tags_ table
38+
39+
### Security Updates 🔐
40+
41+
There are no security updates in 1.17.2.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
title: "Workspaces as code"
3+
description: "Learn how to describe environment configuration as code."
4+
state: beta
5+
---
6+
7+
Workspaces as code (WAC) brings the _Infrastructure As Code_ paradigm to Coder
8+
environments. WAC allows you to define and create new environments using
9+
**workspace templates**.
10+
11+
[Workspace Templates](./templates.md) are declarative YAML files that describe
12+
how to configure environments and their supporting infrastructure.
13+
14+
## Requirements
15+
16+
- You must configure a [GitHub or GitLab OAuth service](../../admin/git.md)
17+
- The image you use in your template **must** have been
18+
[imported](../../images/importing.md) into Coder
19+
20+
## Creating a workspace template
21+
22+
You can find a fully populated workspace template and descriptions of each field
23+
in our [syntax guide](templates.md).
24+
25+
## Adding an Embeddable Button
26+
27+
To make it easy for your developers to use your template, you can generate an
28+
embeddable Markdown button for use in your repo. See the
29+
[admin guide](../../admin/templates.md) for details.
Lines changed: 206 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,206 @@
1+
---
2+
title: "Workspace templates"
3+
description: "Learn how to write a template for creating environments."
4+
state: beta
5+
---
6+
7+
Workspaces as code (WAC) allows you to define and create new environments using
8+
**workspace templates**.
9+
10+
Workspace templates are written as YAML and have a `.yaml` or `.yml` extension.
11+
Coder looks for your workspace template at the following path:
12+
13+
```text
14+
<repository-root>/.coder/coder.yaml
15+
```
16+
17+
![Template Location](../../assets/wac-location.png)
18+
19+
## Workspace template sample
20+
21+
The following is a sample workspace template that makes use of all available
22+
fields. Depending on your use case, you may not need all of the options
23+
available.
24+
25+
For detailed information on the fields available, see the
26+
[subsequent sections](#workspace-template-fields) of this article
27+
28+
```yaml
29+
version: 0.1
30+
workspace:
31+
type: kubernetes
32+
spec:
33+
image: index.docker.io/ubuntu:18.04
34+
container-based-vm: true
35+
cpu: 4
36+
memory: 16
37+
disk: 128
38+
gpuCount: 1
39+
labels:
40+
com.coder.custom.hello: "hello"
41+
com.coder.custom.world: "world"
42+
tolerations:
43+
- key: my-key
44+
operator: Equal
45+
value: my-value
46+
effect: NoExecute
47+
tolerationSeconds: 3600
48+
configure:
49+
- name: "install curl"
50+
run: |
51+
apt update
52+
apt install -y curl
53+
- name: "install Go binary"
54+
run: "go install"
55+
directory: /home/coder/go/src/github.com/my-project
56+
shell: "bash"
57+
env:
58+
GOPATH: /home/coder/go
59+
```
60+
61+
## Workspace template fields
62+
63+
### version
64+
65+
The version number of the config file being used. The current version is `0.1`.
66+
67+
### workspace
68+
69+
**Required**. The section containing all configuration information related to
70+
the environment.
71+
72+
#### workspace.type
73+
74+
**Required**. Determines the type of workspace to be created. Currently, the
75+
only accepted value is `kubernetes`.
76+
77+
#### workspace.spec
78+
79+
**Required**. This section contains configuration information specific to the
80+
`workspace.type`.
81+
82+
#### workspace.spec.image
83+
84+
**Required**. The image to use for the environment. The image should include the
85+
registry and (optionally) the tag, i.e. `docker.io/ubuntu:18.04`. If you omit
86+
the tag, Coder uses the default value of `latest`.
87+
88+
You must have [imported the image](../../images/importing.md) into Coder,
89+
otherwise the environment will fail to build.
90+
91+
#### workspace.spec.labels
92+
93+
The
94+
[Kubernetes labels](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/)
95+
to be added to the environment pod.
96+
97+
```yaml
98+
workspace:
99+
labels:
100+
com.coder.custom.hello: hello
101+
com.coder.custom.world: world
102+
```
103+
104+
#### workspace.spec.tolerations
105+
106+
This section defines the
107+
[Kubernetes tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/)
108+
to be added to the pod hosting the environment.
109+
110+
```yaml
111+
workspace:
112+
tolerations:
113+
- key: my-key
114+
operator: equals
115+
value: my-value
116+
effect: NoExecute
117+
tolerationSeconds: 3600
118+
```
119+
120+
#### workspace.spec.gpucount
121+
122+
The number of GPUs to inject into the environment.
123+
124+
#### workspace.spec.container-based-vm
125+
126+
Determines whether the environment should be created as a
127+
[container-based virtual machine (CVM)](../cvms.md). Default is `false`.
128+
129+
#### workspace.spec.cpu
130+
131+
**Required**. The number of cores to allocate to the environment.
132+
133+
#### workspace.spec.memory
134+
135+
**Required**. The amount of memory (in GB) to allocate to the environment.
136+
137+
#### workspace.spec.disk
138+
139+
**Required**. The amount of disk space (in GB) to allocate to the environment.
140+
141+
#### workspace.configure
142+
143+
This section lists the commands that run within the environment after Coder
144+
builds the environment. See [Configure](../../images/configure.md) for more
145+
information.
146+
147+
#### workspace.configure.start
148+
149+
The list of commands to run when Coder _starts_ an environment.
150+
151+
#### workspace.configure.start[*].command
152+
153+
**Required**. Runs the provided command within the environment (Coder supports
154+
the use of both single-line and multi-line commands).
155+
156+
- Single-line command:
157+
158+
```yaml
159+
- name: Install curl
160+
run: apt install -y curl
161+
```
162+
163+
- Multi-line command:
164+
165+
```yaml
166+
- name: Update and install curl
167+
run: |
168+
apt update
169+
apt install -y curl
170+
```
171+
172+
#### workspace.configure.start[*].name
173+
174+
The name of the command being run.
175+
176+
#### workspace.configure.start[*].shell
177+
178+
The shell Coder should use to run the command.
179+
180+
```yaml
181+
start:
182+
- name: First step
183+
shell: /bin/bash
184+
```
185+
186+
#### workspace.configure.start[*].directory
187+
188+
The working directory from which Coder should run the command.
189+
190+
```yaml
191+
start:
192+
- name: First step
193+
directory: /home/coder
194+
```
195+
196+
#### workspace.configure.start[*].env
197+
198+
The map of environment variables to set for the command.
199+
200+
```yaml
201+
start:
202+
- name: First step
203+
env:
204+
HOME: /home/coder
205+
GOPATH: /home/coder/go
206+
```

manifest.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,13 @@
2222
{ "path": "./environments/personalization.md" },
2323
{ "path": "./environments/preferences.md" },
2424
{ "path": "./environments/pwa.md" },
25-
{ "path": "./environments/ssh.md" }
25+
{ "path": "./environments/ssh.md" },
26+
{
27+
"path": "./environments/workspaces-as-code/index.md",
28+
"children": [
29+
{ "path": "./environments/workspaces-as-code/templates.md" }
30+
]
31+
}
2632
]
2733
},
2834
{
@@ -109,7 +115,8 @@
109115
{ "path": "./admin/devurls.md" },
110116
{ "path": "./admin/git.md" },
111117
{ "path": "./admin/metrics.md" },
112-
{ "path": "./admin/telemetry.md" }
118+
{ "path": "./admin/telemetry.md" },
119+
{ "path": "./admin/templates.md" }
113120
]
114121
},
115122
{
@@ -165,6 +172,7 @@
165172
{
166173
"path": "./changelog/index.md",
167174
"children": [
175+
{ "path": "./changelog/1.17.2.md" },
168176
{ "path": "./changelog/1.17.1.md" },
169177
{ "path": "./changelog/1.17.0.md" },
170178
{ "path": "./changelog/1.16.3.md" },

0 commit comments

Comments
 (0)