-
Notifications
You must be signed in to change notification settings - Fork 954
docs: update dev container docs for GA #18907
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
base: main
Are you sure you want to change the base?
Conversation
@@ -49,7 +49,7 @@ Coder's backend is built using a collection of robust, modern Go libraries and i | |||
|
|||
The Coder backend is organized into multiple packages and directories, each with a specific purpose. Here's a high-level overview of the most important ones: | |||
|
|||
* [agent](https://github.com/coder/coder/tree/main/agent): core logic of a workspace agent, supports DevContainers, remote SSH, startup/shutdown script execution. Protobuf definitions for DRPC communication with `coderd` are kept in [proto](https://github.com/coder/coder/tree/main/agent/proto). | |||
* [agent](https://github.com/coder/coder/tree/main/agent): core logic of a workspace agent, supports dev containers, remote SSH, startup/shutdown script execution. Protobuf definitions for DRPC communication with `coderd` are kept in [proto](https://github.com/coder/coder/tree/main/agent/proto). | |||
* [cli](https://github.com/coder/coder/tree/main/cli): CLI interface for `coder` command built on [coder/serpent](https://github.com/coder/serpent). Input controls are defined in [cliui](https://github.com/coder/coder/tree/docs-backend-contrib-guide/cli/cliui), and [testdata](https://github.com/coder/coder/tree/docs-backend-contrib-guide/cli/testdata) contains golden files for common CLI calls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [linkspector] reported by reviewdog 🐶
Cannot reach https://github.com/coder/coder/tree/docs-backend-contrib-guide/cli/cliui Status: 404
@@ -49,7 +49,7 @@ | |||
|
|||
The Coder backend is organized into multiple packages and directories, each with a specific purpose. Here's a high-level overview of the most important ones: | |||
|
|||
* [agent](https://github.com/coder/coder/tree/main/agent): core logic of a workspace agent, supports DevContainers, remote SSH, startup/shutdown script execution. Protobuf definitions for DRPC communication with `coderd` are kept in [proto](https://github.com/coder/coder/tree/main/agent/proto). | |||
* [agent](https://github.com/coder/coder/tree/main/agent): core logic of a workspace agent, supports dev containers, remote SSH, startup/shutdown script execution. Protobuf definitions for DRPC communication with `coderd` are kept in [proto](https://github.com/coder/coder/tree/main/agent/proto). | |||
* [cli](https://github.com/coder/coder/tree/main/cli): CLI interface for `coder` command built on [coder/serpent](https://github.com/coder/serpent). Input controls are defined in [cliui](https://github.com/coder/coder/tree/docs-backend-contrib-guide/cli/cliui), and [testdata](https://github.com/coder/coder/tree/docs-backend-contrib-guide/cli/testdata) contains golden files for common CLI calls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [linkspector] reported by reviewdog 🐶
Cannot reach https://github.com/coder/coder/tree/docs-backend-contrib-guide/cli/testdata Status: 404
- SSH access requires using the `--container` flag | ||
- Some devcontainer features may not work as expected | ||
```shell | ||
ssh <agent>.<workspace>.me.coder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't get it working with coder ssh
, but it worked like this
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing Touches🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
more changes incoming + matching up more comments from the old PR
|
||
Run independent dev containers in the same workspace so each component appears as its own agent. | ||
|
||
In this example, there are two: repositories called `frontend` and `backend`: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added repositories called
to show that the the directories come from the project name per https://github.com/coder/coder/pull/18582/files#r2194698875
source = "registry.coder.com/modules/git-clone/coder" | ||
agent_id = coder_agent.main.id | ||
url = "https://github.com/example/repository.git" | ||
base_dir = "" # defaults to $HOME |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the module defaults to $HOME
but I want to be able to show that people can change that too if they need
re @mafredri in https://github.com/coder/coder/pull/18582/files#r2194700957
resource "coder_devcontainer" "backend" { | ||
count = data.coder_workspace.me.start_count | ||
agent_id = coder_agent.main.id | ||
workspace_folder = module.git-clone-backend[0].repo_dir |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the docs now default to assuming the git-clone
module
} | ||
``` | ||
|
||
Each dev container appears as a separate agent, so developers can connect to each separately. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reworded from component
data "coder_parameter" "autostart_frontend" { | ||
type = "bool" | ||
name = "Autostart frontend container" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from @mafredri 's suggestion to avoid enable
in the name
## Install the Dev Containers CLI | ||
|
||
Use the | ||
[devcontainers-cli](https://registry.coder.com/modules/devcontainers-cli) module | ||
to ensure the `@devcontainers/cli` is installed in your workspace: | ||
to install `devcontainers/cli` in your workspace: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm torn about this one
it could be @devcontainers/cli
but that doesn't match the text they're going to enter
|
||
- The `devcontainers-cli` module requires npm. | ||
|
||
- You can use an image that already includes npm, such as `codercom/enterprise-node:ubuntu`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can recommend this image, but I think we should mention it includes both Docker and npm. If the user is trying to solve the Docker pre-requisite and then be recommended to switch to a base that "only" targets npm, that may be confusing.
in my testing, the Docker prereq had to be solved separately from npm, so even if this image has Docker, I still had to set up sysbox first, even when I tried with privileged = true
|
||
The `repo_dir` output from the git-clone module provides the path to the cloned repository. | ||
|
||
### If you're not using the git-clone module |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
The `blocking` behavior ensures Docker is fully started before the workspace is considered ready, which is critical for dev containers to function correctly. | ||
|
||
## Define the Dev Container Resource |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to review the order of the sections here - the heading is about defining the resource, but it starts with git-clone
# Clone each repo | ||
module "git-clone-frontend" { | ||
count = data.coder_workspace.me.start_count | ||
source = "dev.registry.coder.com/modules/git-clone/coder" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
incoming commit removes the dev.
WIP
update dev container docs for GA
followup to #18582
To do
docs/user-guides/devcontainers/working-with-dev-containers.md
docs/user-guides/devcontainers/index.md
repo_dir
)