Skip to content

Commit

Permalink
Add docs VS Code remote containers (#541)
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-to authored Jun 25, 2024
1 parent f4e1427 commit c7aefdc
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 0 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/remote-container/server-start.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
64 changes: 64 additions & 0 deletions docs/internal/vs_code_remote_container.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# VS Code Remote Container

> Git credentials need to be setup in order to commit changes inside the remote
container using VS Code.

VS Code Remote Containers is a quick way to get started with internal Mesop
development if you have [VS Code](https://code.visualstudio.com/) and
[Docker Desktop](https://www.docker.com/products/docker-desktop/) installed.

This approach will create a fully configured workspace, saving you time from
debugging installation issues and allowing you to start development right away.

## Pre-requistes: Install VS Code and Docker

In order to use VS Code remote containers, you will need VS Code installed. You will
also need Docker Desktop (which will install Docker Engine and Docker Compose) to run
the remote containers.

- [VS Code](https://code.visualstudio.com/)
- [Docker Desktop](https://www.docker.com/products/docker-desktop/)

## Fork and Clone the Mesop repository

> It is not recommended to develop locally and on remote containers using the same
folder since this may cause unexpected conflicts. Instead you should clone the
repository in a separate directory.

You can follow the instructions here on [how to fork and clone a Github repository](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo).

## Open folder in container

> It is not recommended to develop locally and on remote containers using the same
folder since this may cause conflicts with Bazel. Instead you should clone the
repository in a separate directory.

Open VS Code, press `Cmd/Ctrl + Shift + P`, and select the `Dev Containers: Open Folder in Container...`
option. This will create a new workspace inside a remote container.

![VS Code open folder in container](../assets/remote-container/open-folder-container.png)

## Wait for postCreateCommand to run

The workspace will not be usable until the `postCreateCommand` has completed.

![Post Create Command](../assets/remote-container/post-create-command.png)

## Run Mesop for development

Once the `postCreateCommand` has finished, you can now start Mesop in the terminal.

```
./scripts/cli.sh
```

You will see some warning messages, but it is OK to ignore them.

You should see this message once the Mesop server is ready.

![Server started](../assets/remote-container/server-start.png)

## View Mesop demos

Once `./scripts/cli.sh` has started the Mesop dev server, you can view the demos at
http://localhost:32123.
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ nav:
- Development:
- Main: internal/development.md
- Github Codespaces: internal/codespaces.md
- VS Code Remote Container: internal/vs_code_remote_container.md
- Architecture: internal/architecture.md
- Goals: goals.md
- New component: internal/new_component.md
Expand Down

0 comments on commit c7aefdc

Please sign in to comment.