Skip to content

Commit 4447e68

Browse files
committed
make fmt
1 parent 9488d6a commit 4447e68

18 files changed

+582
-597
lines changed

docs/templates/agent-metadata.md

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,23 @@
22

33
![agent-metadata](../images/agent-metadata.png)
44

5-
You can show live operational metrics to workspace users with agent
6-
metadata. It is the dynamic complement of [Resource
7-
Metadata](./resource-metadata.md).
5+
You can show live operational metrics to workspace users with agent metadata. It
6+
is the dynamic complement of [Resource Metadata](./resource-metadata.md).
87

98
You specify agent metadata in the
109
[`coder_agent`](https://registry.terraform.io/providers/coder/coder/latest/docs/resources/agent).
1110

1211
## Examples
1312

14-
All of these examples use [heredoc
15-
strings](https://developer.hashicorp.com/terraform/language/expressions/strings#heredoc-strings)
16-
for the script declaration. With heredoc strings, you can script
17-
without messy escape codes, just as if you were working in your
18-
terminal.
13+
All of these examples use
14+
[heredoc strings](https://developer.hashicorp.com/terraform/language/expressions/strings#heredoc-strings)
15+
for the script declaration. With heredoc strings, you can script without messy
16+
escape codes, just as if you were working in your terminal.
1917

20-
Some of the examples use the [`coder stat`](../cli/stat.md) command.
21-
This is useful for determining CPU and memory usage of the VM or
22-
container that the workspace is running in, which is more accurate
23-
than resource usage about the workspace's host.
18+
Some of the examples use the [`coder stat`](../cli/stat.md) command. This is
19+
useful for determining CPU and memory usage of the VM or container that the
20+
workspace is running in, which is more accurate than resource usage about the
21+
workspace's host.
2422

2523
Here's a standard set of metadata snippets for Linux agents:
2624

@@ -92,30 +90,30 @@ resource "coder_agent" "main" {
9290

9391
You can also show agent metadata for information about the workspace's host.
9492

95-
[top](https://linux.die.net/man/1/top) is available in most Linux
96-
distributions and provides virtual memory, CPU and IO statistics.
97-
Running `top` produces output that looks like:
93+
[top](https://linux.die.net/man/1/top) is available in most Linux distributions
94+
and provides virtual memory, CPU and IO statistics. Running `top` produces
95+
output that looks like:
9896

9997
```text
10098
%Cpu(s): 65.8 us, 4.4 sy, 0.0 ni, 29.3 id, 0.3 wa, 0.0 hi, 0.2 si, 0.0 st
10199
MiB Mem : 16009.0 total, 493.7 free, 4624.8 used, 10890.5 buff/cache
102100
MiB Swap: 0.0 total, 0.0 free, 0.0 used. 11021.3 avail Mem
103101
```
104102

105-
[vmstat](https://linux.die.net/man/8/vmstat) is available in most
106-
Linux distributions and provides virtual memory, CPU and IO
107-
statistics. Running `vmstat` produces output that looks like:
103+
[vmstat](https://linux.die.net/man/8/vmstat) is available in most Linux
104+
distributions and provides virtual memory, CPU and IO statistics. Running
105+
`vmstat` produces output that looks like:
108106

109107
```text
110108
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
111109
r b swpd free buff cache si so bi bo in cs us sy id wa st
112110
0 0 19580 4781680 12133692 217646944 0 2 4 32 1 0 1 1 98 0 0
113111
```
114112

115-
[dstat](https://linux.die.net/man/1/dstat) is considerably more
116-
parseable than `vmstat` but often not included in base images. It is
117-
easily installed by most package managers under the name `dstat`. The
118-
output of running `dstat 1 1` looks like:
113+
[dstat](https://linux.die.net/man/1/dstat) is considerably more parseable than
114+
`vmstat` but often not included in base images. It is easily installed by most
115+
package managers under the name `dstat`. The output of running `dstat 1 1` looks
116+
like:
119117

120118
```text
121119
--total-cpu-usage-- -dsk/total- -net/total- ---paging-- ---system--
@@ -125,9 +123,9 @@ usr sys idl wai stl| read writ| recv send| in out | int csw
125123

126124
## Managing the database load
127125

128-
Agent metadata can generate a significant write load and overwhelm
129-
your Coder database if you're not careful. The approximate writes per
130-
second can be calculated using the formula:
126+
Agent metadata can generate a significant write load and overwhelm your Coder
127+
database if you're not careful. The approximate writes per second can be
128+
calculated using the formula:
131129

132130
```text
133131
(metadata_count * num_running_agents * 2) / metadata_avg_interval
@@ -141,6 +139,5 @@ For example, let's say you have
141139

142140
You can expect `(10 * 6 * 2) / 4`, or 30 writes per second.
143141

144-
One of the writes is to the `UNLOGGED` `workspace_agent_metadata`
145-
table and the other to the `NOTIFY` query that enables live stats
146-
streaming in the UI.
142+
One of the writes is to the `UNLOGGED` `workspace_agent_metadata` table and the
143+
other to the `NOTIFY` query that enables live stats streaming in the UI.

docs/templates/authentication.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,31 +9,31 @@
99

1010
The Coder server's
1111
[provisioner](https://registry.terraform.io/providers/coder/coder/latest/docs/data-sources/provisioner)
12-
process needs to authenticate with other provider APIs to provision
13-
workspaces. There are two approaches to do this:
12+
process needs to authenticate with other provider APIs to provision workspaces.
13+
There are two approaches to do this:
1414

1515
- Pass credentials to the provisioner as parameters.
16-
- Preferred: Execute the Coder server in an environment that is
17-
authenticated with the provider.
16+
- Preferred: Execute the Coder server in an environment that is authenticated
17+
with the provider.
1818

1919
We encourage the latter approach where supported:
2020

2121
- Simplifies the template.
22-
- Keeps provider credentials out of Coder's database, making it
23-
a less valuable target for attackers.
24-
- Compatible with agent-based authentication schemes, which handle
25-
credential rotation or ensure the credentials are not written to disk.
22+
- Keeps provider credentials out of Coder's database, making it a less valuable
23+
target for attackers.
24+
- Compatible with agent-based authentication schemes, which handle credential
25+
rotation or ensure the credentials are not written to disk.
2626

27-
Generally, you can set up an environment to provide credentials to
28-
Coder in these ways:
27+
Generally, you can set up an environment to provide credentials to Coder in
28+
these ways:
2929

30-
- A well-known location on disk. For example, `~/.aws/credentials` for
31-
AWS on POSIX systems.
30+
- A well-known location on disk. For example, `~/.aws/credentials` for AWS on
31+
POSIX systems.
3232
- Environment variables.
3333

34-
It is usually sufficient to authenticate using the CLI or SDK for the
35-
provider before running Coder, but check the Terraform provider's
36-
documentation for details.
34+
It is usually sufficient to authenticate using the CLI or SDK for the provider
35+
before running Coder, but check the Terraform provider's documentation for
36+
details.
3737

3838
These platforms have Terraform providers that support authenticated
3939
environments:
@@ -43,6 +43,6 @@ environments:
4343
- [Microsoft Azure](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs)
4444
- [Kubernetes](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs)
4545

46-
Other providers might also support authenticated environments. Check
47-
the [documentation of the Terraform
48-
provider](https://registry.terraform.io/browse/providers) for details.
46+
Other providers might also support authenticated environments. Check the
47+
[documentation of the Terraform provider](https://registry.terraform.io/browse/providers)
48+
for details.

docs/templates/best-practices.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Template best practices
22

3-
We recommend a few ways to manage workspace resources, authentication,
4-
and versioning.
3+
We recommend a few ways to manage workspace resources, authentication, and
4+
versioning.
55

66
<children>
77
</children>

docs/templates/change-management.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
# Template Change Management
22

3-
We recommend source-controlling your templates as you would other
4-
code. You can [install Coder](../install/) in CI/CD pipelines to push new
5-
template versions.
3+
We recommend source-controlling your templates as you would other code. You can
4+
[install Coder](../install/) in CI/CD pipelines to push new template versions.
65

76
```console
87
# Install the Coder CLI
@@ -27,7 +26,7 @@ coder templates push --yes $CODER_TEMPLATE_NAME \
2726
--name=$CODER_TEMPLATE_VERSION # Version name is optional
2827
```
2928

30-
To cap token lifetime on creation, [configure Coder server to set a
31-
shorter max token lifetime](../cli/server.md#--max-token-lifetime).
29+
To cap token lifetime on creation,
30+
[configure Coder server to set a shorter max token lifetime](../cli/server.md#--max-token-lifetime).
3231
For an example, see how we push our development image and template
3332
[with GitHub actions](https://github.com/coder/coder/blob/main/.github/workflows/dogfood.yaml).

docs/templates/creating.md

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,61 @@
11
# Working with templates
22

3-
You create and edit Coder templates as [Terraform](./concepts.md)
4-
configuration files (`.tf`) and any supporting files, like a README or
5-
configuration files for other services.
3+
You create and edit Coder templates as [Terraform](./concepts.md) configuration
4+
files (`.tf`) and any supporting files, like a README or configuration files for
5+
other services.
66

77
## Who creates templates?
88

9-
The [Template Admin](../admin/users.md) role (and above) can create
10-
templates. End users, like developers, create workspaces from them.
9+
The [Template Admin](../admin/users.md) role (and above) can create templates.
10+
End users, like developers, create workspaces from them.
1111

12-
Templates can also be [managed with git](./change-management.md),
13-
allowing any developer to propose changes to a template.
12+
Templates can also be [managed with git](./change-management.md), allowing any
13+
developer to propose changes to a template.
1414

1515
You can give different users and groups access to templates with
1616
[role-based access control](../admin/rbac.md).
1717

1818
## Starter templates
1919

2020
We provide starter templates for common cloud providers, like AWS, and
21-
orchestrators, like Kubernetes. From there, you can modify them to use
22-
your own images, VPC, cloud credentials, and so on. Coder supports all
23-
Terraform resources and properties, so fear not if your favorite cloud
24-
provider isn't here!
21+
orchestrators, like Kubernetes. From there, you can modify them to use your own
22+
images, VPC, cloud credentials, and so on. Coder supports all Terraform
23+
resources and properties, so fear not if your favorite cloud provider isn't
24+
here!
2525

2626
![Starter templates](../images/templates/starter-templates.png)
2727

2828
If you prefer to use Coder on the [command line](../cli.md), use
2929
`coder templates init`.
3030

31-
> Coder starter templates are also available on our [GitHub
32-
> repo](https://github.com/coder/coder/tree/main/examples/templates).
31+
> Coder starter templates are also available on our
32+
> [GitHub repo](https://github.com/coder/coder/tree/main/examples/templates).
3333
3434
## Community Templates
3535

36-
As well as Coder's starter templates, you can see a list of community
37-
templates by our users
36+
As well as Coder's starter templates, you can see a list of community templates
37+
by our users
3838
[here](https://github.com/coder/coder/blob/main/examples/templates/community-templates.md).
3939

4040
## Editing templates
4141

42-
Our starter templates are meant to be modified for your use cases. You
43-
can edit any template's files directly in the Coder dashboard.
42+
Our starter templates are meant to be modified for your use cases. You can edit
43+
any template's files directly in the Coder dashboard.
4444

4545
![Editing a template](../images/templates/choosing-edit-template.gif)
4646

47-
If you'd prefer to use the CLI, use `coder templates pull`, edit the
48-
template files, then `coder templates push`.
47+
If you'd prefer to use the CLI, use `coder templates pull`, edit the template
48+
files, then `coder templates push`.
4949

50-
> Even if you are a Terraform expert, we suggest reading our [guided
51-
> tour](./tour.md).
50+
> Even if you are a Terraform expert, we suggest reading our
51+
> [guided tour](./tour.md).
5252
5353
## Updating templates
5454

55-
Coder tracks a template's versions, keeping all developer workspaces
56-
up-to-date. When you publish a new version, developers are notified to
57-
get the latest infrastructure, software, or security patches. Learn
58-
more about [change management](./change-management.md).
55+
Coder tracks a template's versions, keeping all developer workspaces up-to-date.
56+
When you publish a new version, developers are notified to get the latest
57+
infrastructure, software, or security patches. Learn more about
58+
[change management](./change-management.md).
5959

6060
![Updating a template](../images/templates/update.png)
6161

docs/templates/customizing.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Customizing templates
22

3-
You can give developers more information and control over their
4-
workspaces:
3+
You can give developers more information and control over their workspaces:
54

65
<children>
76
</children>

docs/templates/devcontainers.md

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,32 @@
11
# Devcontainers (alpha)
22

3-
[Devcontainers](https://containers.dev) are an open source
4-
specification for defining development environments.
3+
[Devcontainers](https://containers.dev) are an open source specification for
4+
defining development environments.
55

6-
[envbuilder](https://github.com/coder/envbuilder) is an open source
7-
project by Coder that runs devcontainers via Coder templates and your
8-
underlying infrastructure. It can run on Docker or Kubernetes.
6+
[envbuilder](https://github.com/coder/envbuilder) is an open source project by
7+
Coder that runs devcontainers via Coder templates and your underlying
8+
infrastructure. It can run on Docker or Kubernetes.
99

10-
There are several benefits to adding a devcontainer-compatible
11-
template to Coder:
10+
There are several benefits to adding a devcontainer-compatible template to
11+
Coder:
1212

13-
- Drop-in migration from Codespaces (or any existing repositories that
14-
use devcontainers)
15-
- Easier to start projects from Coder. Just create a new workspace
16-
then pick a starter devcontainer.
17-
- Developer teams can "bring their own image." No need for platform
18-
teams to manage complex images, registries, and CI pipelines.
13+
- Drop-in migration from Codespaces (or any existing repositories that use
14+
devcontainers)
15+
- Easier to start projects from Coder. Just create a new workspace then pick a
16+
starter devcontainer.
17+
- Developer teams can "bring their own image." No need for platform teams to
18+
manage complex images, registries, and CI pipelines.
1919

2020
## How it works
2121

22-
A Coder admin adds a devcontainer-compatible template to Coder
23-
(envbuilder). Then developers enter their repository URL as a
24-
[parameter](./parameters.md) when they create their
25-
workspace. [envbuilder](https://github.com/coder/envbuilder) clones
26-
the repo and builds a container from the `devcontainer.json` specified
27-
in the repo.
22+
A Coder admin adds a devcontainer-compatible template to Coder (envbuilder).
23+
Then developers enter their repository URL as a [parameter](./parameters.md)
24+
when they create their workspace.
25+
[envbuilder](https://github.com/coder/envbuilder) clones the repo and builds a
26+
container from the `devcontainer.json` specified in the repo.
2827

29-
Developers can edit the `devcontainer.json` in their workspace to
30-
rebuild to iterate on their development environments.
28+
Developers can edit the `devcontainer.json` in their workspace to rebuild to
29+
iterate on their development environments.
3130

3231
## Example templates
3332

@@ -41,19 +40,19 @@ Your template can prompt the user for a repo URL with
4140

4241
## Authentication
4342

44-
You may need to authenticate to your container registry, such as
45-
Artifactory, or git provider such as GitLab, to use envbuilder. See
46-
the [envbuilder documentation](https://github.com/coder/envbuilder/)
47-
for more information.
43+
You may need to authenticate to your container registry, such as Artifactory, or
44+
git provider such as GitLab, to use envbuilder. See the
45+
[envbuilder documentation](https://github.com/coder/envbuilder/) for more
46+
information.
4847

4948
## Caching
5049

5150
To improve build times, devcontainers can be cached. Refer to the
52-
[envbuilder documentation](https://github.com/coder/envbuilder/) for
53-
more information.
51+
[envbuilder documentation](https://github.com/coder/envbuilder/) for more
52+
information.
5453

5554
## Other features & known issues
5655

57-
Envbuilder is still under active development. Refer to the [envbuilder
58-
GitHub repo](https://github.com/coder/envbuilder/) for more
56+
Envbuilder is still under active development. Refer to the
57+
[envbuilder GitHub repo](https://github.com/coder/envbuilder/) for more
5958
information and to submit feature requests.

0 commit comments

Comments
 (0)