-
-
Notifications
You must be signed in to change notification settings - Fork 964
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
base: master
Are you sure you want to change the base?
Changes from all commits
ccd82a1
65633e6
9c4fd06
9208e46
ecbf3c6
f2e0c6b
883d723
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -59,6 +59,29 @@ 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 Windows Subsystem for Linux (WSL) | ||||||
|
||||||
It is possible to start a devcontainer from a Windows Subsystem for Linux (WSL) distribution (e.g. Ubuntu). | ||||||
This allows you to [work on the home assistant frontend](https://developers.home-assistant.io/docs/frontend/development). | ||||||
You can do this by forking the frontend project inside Ubuntu and [mount its directory into the devcontainer](https://developers.home-assistant.io/docs/frontend/development#configuring-home-assistant). | ||||||
|
||||||
**Prerequisites** | ||||||
|
||||||
- [Docker](https://docs.docker.com/get-docker/) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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](#developing-on-windows) section below for further instructions and tips. | ||||||
|
||||||
1. Follow the [instructions in the Docker documentation](https://docs.docker.com/desktop/wsl/#enabling-docker-support-in-wsl-2-distros) to ensure your WSL distribution is running in WSL 2 mode and enable Docker-WSL integration. | ||||||
2. Go to [Home Assistant core repository](https://github.com/home-assistant/core) and click "fork". | ||||||
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. Reopen the project in a development container. In Visual Studio Code, either use the "Reopen in Container" message in the bottom right corner or press the f1 key and select `Dev Containers: Reopen in Container`. After Visual Studio Code has reopened you should see `Dev Container: Home Assistant Dev` in the bottom left corner. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Clarify UI navigation instructions. The instructions for reopening the project in a development container could be clearer. Specifically, the description of UI elements could benefit from the use of bold text to highlight buttons and labels, improving readability and user guidance. - In Visual Studio Code, either use the "Reopen in Container" message in the bottom right corner or press the f1 key and select `Dev Containers: Reopen in Container`.
+ In Visual Studio Code, either use the **Reopen in Container** message in the **bottom-right corner** or press the **F1** key and select **Dev Containers: Reopen in Container**. Committable suggestion
Suggested change
ToolsLanguageTool
|
||||||
6. You can verify that your dev container is set up properly by the following: | ||||||
* Open the command palette in Visual Studio Code - `Shift`+`Command`+`P`(Mac) / `Ctrl`+`Shift`+`P` (Windows/Linux). | ||||||
* Select `Tasks: Run Task` -> `Run Home Assistant Core` | ||||||
* A terminal should open and begin outputting activity. Check for errors and wait for the output to stop/slow down. | ||||||
* Navigate a web browser to `http://localhost:8123`, and you should see the Home Assistant setup screen. | ||||||
|
||||||
## Manual Environment | ||||||
|
||||||
_You only need these instructions if you do not want to use devcontainers._ | ||||||
|
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.
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)
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 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.