Skip to content

feat: initial docs pages #1107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 34 commits into from
Apr 26, 2022
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
eba2d48
docs structure and edits to getting started
bpmct Apr 22, 2022
1283422
draft for about page
bpmct Apr 22, 2022
8cb6a88
skeleton for concepts page
bpmct Apr 22, 2022
4c1b767
attempt at explaining templates
bpmct Apr 24, 2022
d5f5116
left-align tables
bpmct Apr 24, 2022
de9f3af
add best practices and variables
bpmct Apr 24, 2022
892122c
update structrure
bpmct Apr 25, 2022
c526982
update structure
bpmct Apr 25, 2022
68da32e
templates are shared
bpmct Apr 25, 2022
808767e
workspaces docs
bpmct Apr 25, 2022
c8f1e25
remove coming soon
bpmct Apr 25, 2022
a803f8a
fix typos
bpmct Apr 25, 2022
1bb34bd
docs structure and edits to getting started
bpmct Apr 22, 2022
97f03e0
draft for about page
bpmct Apr 22, 2022
0485c6c
skeleton for concepts page
bpmct Apr 22, 2022
0e1bc57
attempt at explaining templates
bpmct Apr 24, 2022
57d4d0f
left-align tables
bpmct Apr 24, 2022
fc48d53
add best practices and variables
bpmct Apr 24, 2022
361decc
update structrure
bpmct Apr 25, 2022
950ee85
update structure
bpmct Apr 25, 2022
afac7ee
templates are shared
bpmct Apr 25, 2022
e67dabb
workspaces docs
bpmct Apr 25, 2022
325c46c
remove coming soon
bpmct Apr 25, 2022
e37e4a4
fix typos
bpmct Apr 25, 2022
c010530
Merge branch 'bpmct/docs' of https://github.com/coder/coder into bpmc…
Apr 25, 2022
3bf7d4f
fix typos
bpmct Apr 25, 2022
ebcb866
Update docs/about.md
bpmct Apr 26, 2022
9c18282
remove line breaks between bullets
bpmct Apr 26, 2022
3e4318a
rename variables to parameters
bpmct Apr 26, 2022
8c93ae2
reduce limits
bpmct Apr 26, 2022
75af45b
merge
bpmct Apr 26, 2022
2ef477d
chore: edit text
Apr 26, 2022
c875319
Merge branch 'bpmct/docs' of https://github.com/coder/coder into bpmc…
Apr 26, 2022
81435b5
revert some changes, fix footnotes
bpmct Apr 26, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 27 additions & 7 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ Provision remote development environments with Terraform.
- Start writing code with a single command
- Use one of many [examples](./examples) to get started

## Getting Started
## Installing Coder

Install [the latest release](https://github.com/coder/coder/releases).
Install [the latest release](https://github.com/coder/coder/releases) on a system with
at least 2 CPU cores and 2 GB RAM.

To tinker, start with dev-mode (all data is in-memory, and is destroyed on exit):

Expand All @@ -27,33 +28,35 @@ $ CODER_PG_CONNECTION_URL="postgres://<username>@<host>/<database>?password=<pas
coder server
```

To run as a system service, install with `.deb` or `.rpm`:
To run as a system service, install with `.deb` (Debian, Ubuntu) or `.rpm` (Fedora, CentOS, RHEL, SUSE):

```bash
# Edit the configuration!
$ sudo vim /etc/coder.d/coder.env
$ sudo service coder restart
```

Reference `coder start --help` for a complete list of flags and environment variables.

### Your First Workspace

In a new terminal, create a new project (eg. Develop in Linux on Google Cloud):
In a new terminal, create a new template (eg. Develop in Linux on Google Cloud):

```
$ coder templates init
$ coder templates create
```

Create a new workspace and SSH in:
Create a new workspace and connect via SSH:

```
$ coder workspaces create my-first-workspace
$ coder ssh my-first-workspace
```

### Working with Projects
### Modifying Templates

You can edit the Terraform from a sample project:
You can edit the Terraform from a sample template:

```sh
$ coder templates init
Expand All @@ -62,6 +65,23 @@ $ vim main.tf
$ coder templates update gcp-linux
```

## Documentation

- [About Coder](./about.md#about-coder)
- [Why remote development](about.md#why-remote-development)
- [Why Coder](about.md#why-coder)
- [What Coder is not](about.md#what-coder-is-not)
- [Templates](./templates.md)
- [Manage templates](./templates.md#manage-templates)
- [Persistent and ephemeral resources](./templates.md#persistent-and-ephemeral-resources)
- [Variables](./templates.md#variables)
- [Workspaces](./workspaces.md)
- [Create workspaces](./workspaces.md#create-workspaces)
- [Connect with SSH](./workspaces.md#connect-with-ssh)
- [Editors and IDEs](./workspaces.md#editors-and-ides)
- [Workspace lifecycle](./workspaces.md#workspace-lifecycle)
- [Updating workspaces](./workspaces.md#updating-workspaces)

## Contributing

Read the [contributing docs](./CONTRIBUTING.md).
Expand Down
52 changes: 52 additions & 0 deletions docs/about.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# About Coder
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


Coder is an open source platform for creating and managing developer workspaces on your preferred clouds and servers.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there should be a screenshot to break up the text-heavy stuff

By building on top of common development interfaces (SSH) and infrastructure tools (Terraform), Coder aims to make the process of **provisioning** and **accessing** remote workspaces approachable for organizations of various sizes and stages of cloud-native maturity.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love this sentence 👏🏼


> ⚠️ Coder v2 is in alpha and not ready for production use. You may be interested in [Coder v1](https://coder.com/docs) or [code-server](https://github.com/cdr/code-server).

## Why remote development

Migrating from local developer machines to remote servers is an increasingly common solution for developers[^1] and organizations[^2] alike. Remote development has a number of benefits:

- Speed: Server-grade compute speeds up operations in software development such as IDE loads, compiles, builds, and running large workloads (monolyth or microservice applications).

- Environment management: Onboarding & troubleshooting development environments is automated using tools such as Terraform, nix, Docker, devcontainers, etc.

- Security: Source code and other data can be centralized on private servers or cloud, instead of local developer machines.

- Compatibility: Remote workspaces share infrastructure configuration with other developer, staging, and production environments, reducing configuration drift.

- Accessibility: Devices such as light notebooks, Chromebooks, and iPads connect to remote workspaces via browser-based IDEs or remote IDE extensions.

## Why Coder?

The added layer of infrastructure control is a key differentiator from Coder v1 and other remote IDE platforms. This gives admins the ability to:

- support ARM, Windows, Linux, and MacOS workspaces
- modify pod/container spec: add disks, manage network policy, environment variables
- use VM/dedicated workspaces: develop with Kernel features, container knowledge not required
- enable persistent workspaces: just like a local machine, but faster and in the cloud

Coder includes [production-ready templates](../examples) for use on Kubernetes, AWS EC2, Google Cloud, Azure, and more.

## What Coder is not

- Coder is an infrastructure as code (IaC) platform. Terraform is the first IaC *provisioner* in Coder. As a result, Coder admins can define any Terraform resources can as Coder workspaces.

- Coder is not a DevOps/CI platform. Coder workspaces can follow best practices for cloud workloads, but Coder is not responsible for how you define or deploy the software you write.

- Coder is not an online IDE. Instead, Coder has strong support for common editors such as VS Code, vim, and JetBrains, over HTTPS or SSH.

- Coder is not a collaboration platform. You can continue using git and IDE extensions for pull requests, code reviews, and pair programming.

- Coder is not SaaS/fully-managed. Install Coder on your cloud (AWS, GCP, Azure) or datacenter.

---

Next: [Templates](./templates.md)

[^1]: alexellis.io: [The Internet is my computer](https://blog.alexellis.io/the-internet-is-my-computer/)

[^2]: slack.engineering: [Development environments at Slack](https://slack.engineering/development-environments-at-slack)
47 changes: 47 additions & 0 deletions docs/templates.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Templates

Coder admins manage *templates* to define the infrastructure behind workspaces. A Coder deployment can have multiple templates for different workloads, such as "frontend development," "windows development," etc.

Templates are shared and updates can be rolled out, or users can manually update their workspaces.

## Manage templates

Coder provides production-ready template [examples](../examples/), but they can be modified with Terraform.

```sh
# start from an example
coder templates init

# optional: modify the template
vim <template-name>/main.tf

# add the template to Coder deployment
coder templates <create/update> <template-name>
```

If you are commonly editing templates, we recommend source-controlling template code using GitOps/CI pipelines to make changes.

## Persistent and ephemeral resources

Coder supports ephemeral and persistent resources in workspaces. Ephemeral resources are be destroyed when a workspace is not in use (stopped). persistent resources remain. See how this works for an example "frontend" template:

| Resource | Type |
| :--------------------------- | :--------- |
| google_compute_disk.home_dir | persistent |
| kubernetes_pod.dev | ephemeral |
| └─ nodejs (linux, amd64) | |
| api_token.backend | ephemeral |

When a workspace is deleted, all related resources are destroyed.

## Variables

Templates often contain *variables*. In Coder, there are two types of variables.

**Admin variables** are set when a template is being created/updated. These are often cloud secrets, such as a ServiceAccount token. These are annotated with `sensitive = true` in the template code.

**User variables** are set when a user creates a workspace. They are unique to each workspace, often personalization settings such as preferred region or workspace image.

---

Next: [Workspaces](./workspaces.md)
59 changes: 59 additions & 0 deletions docs/workspaces.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Workspaces

Workspaces contain the dependencies, IDEs, and configuration information needed for software development.

## Create workspaces

Each Coder user has their own workspaces, created from a shared [template](./templates.md).

```sh
# create a workspace from template, specify any variables
coder workspaces create <workspace-name>

# show the resources behind the workspace, and how to connect
coder workspaces show <workspace-name>
```

## Connect with SSH

Once Coder workspaces are added to your SSH hosts, you can connect from any IDE with remote development support.

```sh
coder config-ssh

ssh coder.<workspace-name>
```

## Editors and IDEs

The following desktop IDEs have been tested with Coder. Any IDE with SSH support should work!

- VS Code (with [Remote - SSH](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh) extension)
- JetBrains (with [Gateway](https://www.jetbrains.com/help/idea/remote-development-a.html#launch_gateway) installed)
- IntelliJ IDEA
- CLion
- GoLand
- PyCharm
- Rider
- RubyMine
- WebStorm

## Workspace lifecycle

Workspaces in Coder are started and stopped, often based on activity or when a [template update](./templates.md#manage-templates) is available.

While the exact behavior depends on the template, resources are often destroyed and re-created when a workspace is restarted. For more details, see [persistent and ephemeral resources](./templates.md#persistent-and-ephemeral-resources).

> ⚠️ To avoid data loss, reference your template documentation to see where to store files, install software, etc. Default templates are documented in [../examples](../examples/).
>
> You can use `coder workspace show <workspace-name>` to see which resources are persistent vs ephemeral.

When a workspace is deleted, all of the workspace's resources are deleted.

## Updating workspaces

Use the following command to update a workspace to the latest version of a template. The workspace will be stopped and started.

```sh
coder workspaces update <workspace-name>
```