Skip to content

updated lifecycle page #901

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 2 commits into from
Mar 16, 2022
Merged
Changes from all commits
Commits
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
42 changes: 32 additions & 10 deletions workspaces/lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,16 @@ title: "Lifecycle"
description: "Learn about the workspace lifecycle."
---

Workspaces are designed to sustain scheduled shutdowns and rebuilds. An
workspace lifecycle resilient to stops and starts means you can save dollars on
cloud compute and justify more powerful dev machines :).
A Coder workspace is designed to shutdown (triggered by either scheduled
workspace inactivity or manually by users and administrators) and be rebuilt.

The persistent volume claim (or `/home/<username>`) mounted to the workspace
ensures that the workspaces retain cloned code repositories and other
personalization settings.

You can manage a Coder workspace's lifecycle at the organization-level to auto
shutdown after a defined period of inactivity or when administrators want to
force workspace rebuilds.

## Rebuilds

Expand All @@ -19,6 +26,13 @@ even if the underlying [image](../images/index.md) or its dependencies change.
**Note:** `username` is defined in the image. See
[Docker's image documentation](https://docs.docker.com/engine/reference/builder/#user)

## Auto-start

Users can configure a workspace
[auto-start](https://coder.com/docs/coder/latest/workspaces/autostart) time,
which sets the time when Coder will rebuild and start their workspaces. Users
typically set this time to coincide with the start of their working day.

## Auto-off

Organizations can set an
Expand All @@ -38,11 +52,19 @@ available and running on an underlying host, the following steps are taken:
a Git provider, your SSH key pair is injected during this step as well,
allowing it to perform authenticated `git` operations.

1. **Execution of `/coder/configure`**: Execution of this script allows
[images](../images/index.md) to perform startup operations consistent across
all of the workspaces that use the image. If you need your image to include
modifications to `/home`, include the instructions in this script.
1. **Execution of `/coder/configure`**: Execution of this script, which is
included in the workspace image, allows [images](../images/index.md) to
perform startup operations that are consistent across all of the workspaces
that use the image. If you need your image to include modifications to
`/home/<user>`, include the instructions in this script.

In other words, the configure script is _not_ run as the root user but as the
`/home/<user>`, so configurations are stored in `/home/<user>`. You may also
run commands with `sudo`, but these changes will not persist in
`/home/<user>`.

1. **Execution of ~/personalize`**: Execution of this script allows you to
customize your personal development workspace on each rebuild. Read more on
personalization [here](./personalization.md).
1. **Execution of `~/personalize`**: Execution of this script allows you to
customize your personal development workspace on each rebuild. Coder injects
the personalize script into the workspace and includes cloning logic if a
user has specified a dotfiles repo. Read more on personalization
[here](./personalization.md).