Skip to content

Commit 33b168c

Browse files
authored
POD-894: Add PUML diagrams to docs (loft-sh#1311)
* POD-894: Add PUML diagrams to docs * PR comments
1 parent dce74c4 commit 33b168c

31 files changed

+3050
-1942
lines changed

docs/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"deploy": "docusaurus deploy"
1010
},
1111
"dependencies": {
12-
"@docusaurus/core": "^3.2.1",
13-
"@docusaurus/preset-classic": "^3.2.1",
12+
"@docusaurus/core": "^3.5.2",
13+
"@docusaurus/preset-classic": "^3.5.2",
1414
"classnames": "^2.2.6",
1515
"docusaurus": "^1.14.7",
1616
"docusaurus-gtm-plugin": "^0.0.2",
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
title: How DevPod Builds Workspaces
3+
sidebar_label: Building workspaces
4+
---
5+
6+
Devpod provides the ability to build workspaces by taking a devcontainer.json and a git repository to compile an OCI compliant image with everything you need to develop
7+
against using local tools.
8+
9+
<figure>
10+
<img src="/docs/media/c4_build.png" alt="DevPod Architecture" />
11+
<figcaption>DevPod - Container Diagram</figcaption>
12+
</figure>
13+
14+
It does this by parsing the devcontainer.json, extracting the "features" and appending them as build stages to the base Dockerfile. The container is then built, depending on the driver
15+
this could be docker, buildkit or kaniko and deployed with the configuration defined by your context. Optionally once the container is built, it can be pushed to a registry to cache for
16+
other developers or in case you rebuild your workspace later. See #tutorials/reduce-build-times.
17+
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
title: How it works using kubernetes
3+
sidebar_label: Deploying kubernetes
4+
---
5+
6+
DevPod works the same with kubernetes as with Machines, the key difference is the secure tunnel is set up using the kubernetes control plane (e.g. kubectl ...) so an agent is not necessary
7+
to be run on the kubernetes node. Instead devpod-provider-kubernetes simply wraps the appropriate `kubectl` commands to start and connect a workspace using a devcontainer.
8+
9+
<figure>
10+
<img src="/docs/media/c4_k8s.png" alt="DevPod Architecture" />
11+
<figcaption>DevPod - Container Diagram Kubernetes</figcaption>
12+
</figure>
13+
14+
DevPod often has to build workspaces even when an "image" is specified in .devcontainer.json. This is because the devcontainer can contain "features" the cause the Dockerfile to be extended.
15+
When this happens, or simply when "build" is used in .devcontainer.json, DevPod deploys an init container to the workspace that uses kaniko to first build your image (see #tutorials/reduce-build-times
16+
for more details on kaniko) then executes the container's entrypoint in the pod's main container. While building, if REGISTRY_CACHE has been specified in the context options, kaniko will download
17+
existing build layers from the registry to reduce the overall build time.
18+
19+
<figure>
20+
<img src="/docs/media/c4_build_k8s.png" alt="DevPod Architecture 2" />
21+
<figcaption>DevPod - Component Diagram Kubernetes Build Process</figcaption>
22+
</figure>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
title: How it works using VMs
3+
sidebar_label: Deploying machines
4+
---
5+
6+
Machines to DevPod are the infrastructure that ultimately run your devcontainer. Some providers such as gcloud, aws, digitalocean are "machine" providers since
7+
they first setup a VM to deploy you container to.
8+
9+
When DevPod starts a workspace, such as `devpod up`, DevPod uses the provider selected and starts your devcontainer. If using a machine provider, DevPod will check if it should create a VM first.
10+
If so it uses your local environments credentials and the associated CLI tool, such as `aws` or `az` to create the infrastructure. Once started DevPod connects to the VM using the provider's specified tunnel, below
11+
are some examples of providers and there secure tunnels.
12+
13+
14+
- AWS: Instance connect
15+
- GCloud:
16+
- Azure:
17+
18+
The dedvpod agent starts a SSH server using the STDIO of the secure tunnel in order for you local DevPod CLI/UI to forward ports over the SSH connection. Once this is done DevPod starts your local
19+
IDE and connects it to the devcontainer via SSH.
20+
21+
<figure>
22+
<img src="/docs/media/c4_machines.png" alt="DevPod Architecture" />
23+
<figcaption>DevPod - Component Diagram</figcaption>
24+
</figure>
25+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
title: How DevPod Deploys Workspaces
3+
sidebar_label: Deploying workspaces
4+
---
5+
6+
Devpod deploys workspaces using the "up" command, when executed DevPod builds a devcontainer, if not already available, then uses the provider to deploy the devcontainer to a workspace. Below is a sequence diagram
7+
of the main stages of the "up" command.
8+
9+
<figure>
10+
<img src="/docs/media/up_sequence.png" alt="DevPod Up Sequence" />
11+
<figcaption>DevPod up - Sequence Diagram</figcaption>
12+
</figure>
13+
14+
First DevPod checks if we need to create/start a machine to deploy the devcontainer to. Next we pull the source code and .devcontainer.json source from git or a local file and use this with the local environment
15+
to build the workspace. Building is done by the agent since we need access to build tools such as buildkit or kaniko, i.e. `devpod workspace build`. The workspace now contains everything needed,
16+
so DevPod sets up a SSH connection to the DevPod agent running alongside the container's control plane.
17+
18+
The agent recieves "devpod agent workspace up" with the workspace spec serialised as workspace-info and uses the control plane (kube api server for k8s, docker daemon for anything else) to start the devcontainer.
19+
Once started DevPod deploys a daemon to monitor activity, optionally sets up any platform access for pro users then optionally retrieves credentials from the local environment before launching the IDE. Once the
20+
IDE has started the deployment process has complete, DevPod's agent daemon will continue to monitor the pod, if deployed, to put the machine or container to sleep when not in use.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
title: How it works
3+
sidebar_label: Overview
4+
---
5+
6+
Devpod provides the ability to provision workspaces on any infrastructure. It does so by wrapping your conventional CLI tools such as kubectl, docker, gcloud etc to deploy your development environment
7+
and set up everything required to run the dev container. While creating the workspace DevPod deploys an agent to the machine running the container as well as to the container itself to provide useful
8+
functions such as port forwarding, credential forwarding and log streaming. Doing so it provides a control plane across your development environment.
9+
10+
Devpod uses a client-agent architecture, where the client deploys it's own agent to host various servers, such as a grpc server or SSH server.
11+
In this regard the system is not unlike a browser server architecture where the front end is deployed and executed on a remote host. There are several improvements this brings to our specific context:
12+
- There can be no conflict of versions between client and server, since you install only one version of the client
13+
- There is no infrastructure to manage for users
14+
15+
To simplify debugging, DevPod connects your local shell with the agent's STDIO so you can see what's happening locally and in the container at all times.
16+
17+
Below is a high level overview of how DevPod uses your local environment, a source repo and a devcontainer to deploy your workspace to the cloud.
18+
19+
<figure>
20+
<img src="/docs/media/c4_workspaces.png" alt="DevPod Architecture" />
21+
<figcaption>DevPod - Component Diagram</figcaption>
22+
</figure>
23+
24+
Devpod establishes a connection to the workspace using a vendor specific API. This vendor specific communication channel is referred to as the "tunnel". When you run a `devpod up` command, DevPod selects a
25+
provider based on your context and starts your devcontainer. If using a machine provider, DevPod will check if it should create a VM first. Once the devcontainer
26+
is running DevPod deploys an agent to the container. The way in which DevPod communicates with the workspace depends on the provider, this is known as the "tunnel". For AWS this could be instance connect, kubernetes uses
27+
the kubernetes control plane (kubectl), this connection is secured based on this tunnel. The DevPod agent starts a SSH server using the STDIO of the secure tunnel in order for you local DevPod CLI/UI to forward
28+
ports over the SSH connection. Once this is done DevPod starts your local IDE and connects it to the devcontainer via SSH.
29+
30+
If you developer environment requires any port forwarding, then your IDE or an SSH connection must be running. That's because devpod needs the SSH server running on the agent to perform the forwarding,
31+
which is deployed when starting the IDE or SSH session.

docs/pages/licenses/devpod.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ Some packages may only be included on certain architectures or operating systems
5757
- [github.com/cenkalti/backoff/v4](https://pkg.go.dev/github.com/cenkalti/backoff/v4) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/cenkalti/backoff/v4/LICENSE))
5858
- [github.com/cespare/xxhash/v2](https://pkg.go.dev/github.com/cespare/xxhash/v2) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/cespare/xxhash/v2/LICENSE.txt))
5959
- [github.com/chrismellard/docker-credential-acr-env/pkg](https://pkg.go.dev/github.com/chrismellard/docker-credential-acr-env/pkg) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/chrismellard/docker-credential-acr-env/LICENSE))
60-
- [github.com/compose-spec/compose-go/v2](https://pkg.go.dev/github.com/compose-spec/compose-go/v2) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/compose-spec/compose-go/v2/LICENSE))
61-
- [github.com/compose-spec/compose-go/v2/dotenv](https://pkg.go.dev/github.com/compose-spec/compose-go/v2/dotenv) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/compose-spec/compose-go/v2/dotenv/LICENSE))
60+
- [github.com/compose-spec/compose-go](https://pkg.go.dev/github.com/compose-spec/compose-go) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/compose-spec/compose-go/LICENSE))
61+
- [github.com/compose-spec/compose-go/dotenv](https://pkg.go.dev/github.com/compose-spec/compose-go/dotenv) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/compose-spec/compose-go/dotenv/LICENSE))
6262
- [github.com/containerd/console](https://pkg.go.dev/github.com/containerd/console) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/containerd/console/LICENSE))
6363
- [github.com/containerd/containerd](https://pkg.go.dev/github.com/containerd/containerd) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/containerd/containerd/LICENSE))
6464
- [github.com/containerd/continuity](https://pkg.go.dev/github.com/containerd/continuity) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/containerd/continuity/LICENSE))
@@ -88,7 +88,6 @@ Some packages may only be included on certain architectures or operating systems
8888
- [github.com/go-openapi/jsonpointer](https://pkg.go.dev/github.com/go-openapi/jsonpointer) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/go-openapi/jsonpointer/LICENSE))
8989
- [github.com/go-openapi/jsonreference](https://pkg.go.dev/github.com/go-openapi/jsonreference) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/go-openapi/jsonreference/LICENSE))
9090
- [github.com/go-openapi/swag](https://pkg.go.dev/github.com/go-openapi/swag) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/go-openapi/swag/LICENSE))
91-
- [github.com/go-viper/mapstructure/v2](https://pkg.go.dev/github.com/go-viper/mapstructure/v2) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/go-viper/mapstructure/v2/LICENSE))
9291
- [github.com/gofrs/flock](https://pkg.go.dev/github.com/gofrs/flock) ([BSD-3-Clause](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/gofrs/flock/LICENSE))
9392
- [github.com/gogo/googleapis/google/rpc](https://pkg.go.dev/github.com/gogo/googleapis/google/rpc) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/gogo/googleapis/LICENSE))
9493
- [github.com/gogo/protobuf](https://pkg.go.dev/github.com/gogo/protobuf) ([BSD-3-Clause](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/gogo/protobuf/LICENSE))
@@ -133,6 +132,7 @@ Some packages may only be included on certain architectures or operating systems
133132
- [github.com/mgutz/ansi](https://pkg.go.dev/github.com/mgutz/ansi) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/mgutz/ansi/LICENSE))
134133
- [github.com/mitchellh/go-homedir](https://pkg.go.dev/github.com/mitchellh/go-homedir) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/mitchellh/go-homedir/LICENSE))
135134
- [github.com/mitchellh/go-wordwrap](https://pkg.go.dev/github.com/mitchellh/go-wordwrap) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/mitchellh/go-wordwrap/LICENSE.md))
135+
- [github.com/mitchellh/mapstructure](https://pkg.go.dev/github.com/mitchellh/mapstructure) ([MIT](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/mitchellh/mapstructure/LICENSE))
136136
- [github.com/moby/buildkit](https://pkg.go.dev/github.com/moby/buildkit) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/moby/buildkit/LICENSE))
137137
- [github.com/moby/patternmatcher](https://pkg.go.dev/github.com/moby/patternmatcher) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/moby/patternmatcher/LICENSE))
138138
- [github.com/moby/spdystream](https://pkg.go.dev/github.com/moby/spdystream) ([Apache-2.0](https://github.com/loft-sh/devpod/blob/HEAD/vendor/github.com/moby/spdystream/LICENSE))
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: IDE Troubleshooting
3+
sidebar_label: IDE Troubleshooting
4+
---
5+
6+
This purpose of this page is to outline any known issues with using devpod on unsupported IDEs using the SSH provider
7+
8+
### NeoVim
9+
10+
Some issues such as setting $TERM have been noticed on NeoVim, a solution has been documented [here](https://github.com/loft-sh/devpod/issues/1187)
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
title: Linux Troubleshooting
3+
sidebar_label: Linux Troubleshooting
4+
---
5+
6+
This purpose of this page is to outline any known issues with using devpod on Linux and provide known workarounds / fixes.
7+
8+
### Using FISH shell
9+
10+
Custom configurations in config.fish file run every time a fish -c command is called, so this processes somewhat get on the way of devpod agent workspace up.
11+
12+
The solution is to move the customizations inside the if status is-interactive case.
13+
14+
From this
15+
16+
```
17+
if status is-interactive
18+
# Commands to run in interactive sessions can go here
19+
end
20+
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
21+
22+
# customizations
23+
```
24+
25+
to this
26+
27+
```
28+
if status is-interactive
29+
# Commands to run in interactive sessions can go here
30+
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
31+
32+
# customizations
33+
end
34+
```
35+
36+
### Using SELinux
37+
38+
If you are running SELinux and try to start a workspace with a mounted volume, you may recieve a "Permission Denied" even if the ownership of the files are correct. To resolve
39+
append `:Z` to your volume definitions, like so
40+
41+
```
42+
{
43+
// some fields
44+
45+
"workspaceMount": "",
46+
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
47+
"runArgs": [
48+
// other args
49+
"--volume=${localWorkspaceFolder}:/workspaces/${localWorkspaceFolderBasename}:Z"
50+
]
51+
}
52+
```

docs/pages/quickstart/browser.mdx

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
title: Quickstart VS Code Browser
3+
sidebar_label: VS Code Browser
4+
---
5+
6+
import AddProvider from '../fragments/add-provider.mdx'
7+
8+
## Quickstart with VS Code Browser
9+
10+
Make sure you have installed [DevPod](./install.mdx) on your system.
11+
12+
### Add a Provider
13+
14+
<AddProvider />
15+
16+
### Start a Workspace with VS Code Browser
17+
18+
Navigate to 'Workspaces' > '+ Create'. Enter your project url or choose one of the quickstart examples.
19+
20+
<figure>
21+
<img src="/docs/media/create-workspace-repo.png" alt="DevPod Flow" />
22+
<figcaption>Create Workspace</figcaption>
23+
</figure>
24+
25+
Make sure to select 'VS Code Browser' under 'Default IDE'
26+
27+
<figure>
28+
<img src="/docs/media/create-workspace-vscode-browser.png" alt="DevPod Flow" />
29+
<figcaption>Select IDE</figcaption>
30+
</figure>
31+
32+
Then press 'Create Workspace'.
33+
34+
<figure>
35+
<img src="/docs/media/create-workspace-final-vscode-browser.png" alt="DevPod Flow" />
36+
<figcaption>Create Workspace</figcaption>
37+
</figure>
38+
39+
A new window appears showing DevPod starting the workspace. After the workspace was created, VS Code should open automatically connected to the DevContainer.
40+
41+
<figure>
42+
<img src="/docs/media/create-workspace-vscode-browser-2.png" alt="DevPod Flow" />
43+
<figcaption>VS Code opens automatically in the browser</figcaption>
44+
</figure>
45+

0 commit comments

Comments
 (0)