Skip to content
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

Add instructions for using devcontainer from WSL #1949

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
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
18 changes: 18 additions & 0 deletions docs/development_environment.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,24 @@ If the Dev Container was set up correctly - it supports debugging by default, ou

It is also possible to debug a remote Home Assistance instance (e.g., production instance) by following the procedure described [here](https://www.home-assistant.io/integrations/debugpy/).

### Use devcontainer from WSL
schelv marked this conversation as resolved.
Show resolved Hide resolved

With WSL, you won't run into as many path issues because of the '/' and '\' differences between Linux and Windows.
This is handy when working on frontend code and using `script/develop`, since it's using stuff that works best on Linux.
schelv marked this conversation as resolved.
Show resolved Hide resolved

**Prerequisites**

- [Docker](https://docs.docker.com/get-docker/)
Copy link
Contributor

Choose a reason for hiding this comment

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

since WSL2 supports systemd now, we should point the user both options for docker - Docker Desktop and Docker-Engine (i prefer the installing the docker engine over docker desktop, since docker desktop comes with some unneeded overhead)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't consider that option yet.
So far "Docker" in these instructions has meant "Docker desktop installed on windows".

I'm not sure if mentioning docker-engine here is helpful for most people.
There is already a lot of information and I'm afraid adding more options makes it even more overwhelming.

Copy link
Contributor

Choose a reason for hiding this comment

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

Consider mentioning Docker Engine as an alternative to Docker Desktop.

Given that Docker Engine might be preferred by some users due to its lower overhead compared to Docker Desktop, consider mentioning it as an alternative, especially now that WSL2 supports systemd. This could provide users with more flexibility in choosing their setup.

- [Visual Studio code](https://code.visualstudio.com/)
- WSL + A WSL Distribution of your choice (Note: The instructions will be based on Ubuntu). Refer to the "Developing on Windows" section below for further instructions and tips.
schelv marked this conversation as resolved.
Show resolved Hide resolved

1. Enable integration with your WSL distro, This can be done in Docker Desktop under Settings > Resources > WSL integration.
2. Step 1. of "Getting started".
schelv marked this conversation as resolved.
Show resolved Hide resolved
3. Open the terminal of your WSL distro, and clone your fork with `git clone <url from your fork>`.
4. Use the command `code core/` to open Visual Studio Code. In the bottom left corner you will see `WSL: <name of the distribution you are using>`.
5. In Visual Studio Code press the f1 key and select `Dev Containers: Reopen in Container`. Visual Studio Code will reopen and in the bottom left corner you will see `Dev Container: Home Assistant Dev`.
schelv marked this conversation as resolved.
Show resolved Hide resolved
6. Step 6. of "Getting started".

## Manual Environment

_You only need these instructions if you do not want to use devcontainers._
Expand Down