-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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?
Conversation
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.
Hin @schelv
first many thanks for bring this in, I think there are many people out there using WSL2 + VScode + Dev-Container 👍
I've some comments left
|
||
**Prerequisites** | ||
|
||
- [Docker](https://docs.docker.com/get-docker/) |
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.
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
|
Co-authored-by: Michael <35783820+mib1185@users.noreply.github.com>
feedback from @mib1885
More feedback
link to instructions that help with verifying the WSL mode.
Thank you for the feedback! |
WalkthroughWalkthroughThe changes enhance the setup guide for a Home Assistant development environment by detailing how to use a devcontainer within a WSL (Windows Subsystem for Linux) distribution like Ubuntu. The updated documentation includes prerequisites, configuration steps for Docker and WSL, and instructions for integrating Visual Studio Code for seamless Home Assistant frontend development. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant WSL
participant Docker
participant VSCode
participant HomeAssistantRepo
User->>WSL: Set up WSL in Ubuntu
User->>Docker: Enable Docker-WSL integration
User->>HomeAssistantRepo: Fork repository
HomeAssistantRepo->>WSL: Clone forked repository
WSL->>VSCode: Open in WSL terminal
VSCode->>WSL: Reopen project in devcontainer
User->>VSCode: Run setup tasks and check for errors
VSCode->>HomeAssistantRepo: Fetch and display logs
User->>Browser: Access Home Assistant setup screen
Browser->>HomeAssistantRepo: Confirm successful setup
Recent review detailsConfiguration used: CodeRabbit UI Files selected for processing (1)
Additional context usedPath-based instructions (1)
LanguageTool
Additional comments not posted (2)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
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 as PR comments)
Additionally, you can add CodeRabbit Configration 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.
Actionable comments posted: 2
Outside diff range comments (2)
docs/development_environment.mdx (2)
Line range hint
116-116
: Standardize terminology for network adapters.The term 'adaptor' should be standardized to 'adapter' throughout the document to maintain consistency and avoid confusion.
- find the `inet` address of the `eth0` adaptor + find the `inet` address of the `eth0` adapterTools
LanguageTool
[misspelling] ~62-~62: Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Context: ...ant.io/integrations/debugpy/). ### Use devcontainer from Windows Subsystem for Linux (WSL) ...
[misspelling] ~64-~64: Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Context: ... Linux (WSL) It is possible to start a devcontainer from a Windows Subsystem for Linux (WSL...
[misspelling] ~66-~66: Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Context: ...buntu and [mount its directory into the devcontainer](https://developers.home-assistant.io/d...
[misspelling] ~71-~71: If the term is a proper noun, use initial capitals. (EN_SPECIFIC_CASE)
Context: ...https://docs.docker.com/get-docker/) - Visual Studio code - WSL ...
[misspelling] ~76-~76: Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Context: ...ur WSL distro, and clone your fork withgit clone <url from your fork>
. 4. Use the command `c...
[uncategorized] ~77-~77: Consider adding a hyphen. (TOP_LEFT_CORNER)
Context: ...re/to open Visual Studio Code. In the bottom left corner you will see
WSL: <name of the ...
[uncategorized] ~77-~77: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ... Visual Studio Code. In the bottom left corner you will see `WSL: <name of the distrib...
[uncategorized] ~78-~78: Consider adding a hyphen. (TOP_LEFT_CORNER)
Context: ...he "Reopen in Container" message in the bottom right corner or press the f1 key and select `...
[uncategorized] ~78-~78: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ...ontainer. After Visual Studio Code has reopened you should see
Dev Container: Home Ass...
[uncategorized] ~78-~78: Consider adding a hyphen. (TOP_LEFT_CORNER)
Context: ...v Container: Home Assistant Dev` in the bottom left corner. 6. You can verify that your dev...
[misspelling] ~80-~80: Only proper nouns start with an uppercase character (there are exceptions for headlines). (EN_UPPER_CASE_NGRAM)
Context: ...palette in Visual Studio Code -Shift
+Command
+P
(Mac) /Ctrl
+Shift
+P
(Windows...
[misspelling] ~87-~87: Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Context: ... instructions if you do not want to use devcontainers._ It is also possible to set up a more...
Line range hint
132-132
: Correct the verb form for 'set up'.The phrase 'setup your local copy' should use the verb form 'set up'.
- Once forked, setup your local copy of the source using the commands: + Once forked, set up your local copy of the source using the commands:Tools
LanguageTool
[misspelling] ~62-~62: Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Context: ...ant.io/integrations/debugpy/). ### Use devcontainer from Windows Subsystem for Linux (WSL) ...
[misspelling] ~64-~64: Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Context: ... Linux (WSL) It is possible to start a devcontainer from a Windows Subsystem for Linux (WSL...
[misspelling] ~66-~66: Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Context: ...buntu and [mount its directory into the devcontainer](https://developers.home-assistant.io/d...
[misspelling] ~71-~71: If the term is a proper noun, use initial capitals. (EN_SPECIFIC_CASE)
Context: ...https://docs.docker.com/get-docker/) - Visual Studio code - WSL ...
[misspelling] ~76-~76: Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Context: ...ur WSL distro, and clone your fork withgit clone <url from your fork>
. 4. Use the command `c...
[uncategorized] ~77-~77: Consider adding a hyphen. (TOP_LEFT_CORNER)
Context: ...re/to open Visual Studio Code. In the bottom left corner you will see
WSL: <name of the ...
[uncategorized] ~77-~77: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ... Visual Studio Code. In the bottom left corner you will see `WSL: <name of the distrib...
[uncategorized] ~78-~78: Consider adding a hyphen. (TOP_LEFT_CORNER)
Context: ...he "Reopen in Container" message in the bottom right corner or press the f1 key and select `...
[uncategorized] ~78-~78: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ...ontainer. After Visual Studio Code has reopened you should see
Dev Container: Home Ass...
[uncategorized] ~78-~78: Consider adding a hyphen. (TOP_LEFT_CORNER)
Context: ...v Container: Home Assistant Dev` in the bottom left corner. 6. You can verify that your dev...
[misspelling] ~80-~80: Only proper nouns start with an uppercase character (there are exceptions for headlines). (EN_UPPER_CASE_NGRAM)
Context: ...palette in Visual Studio Code -Shift
+Command
+P
(Mac) /Ctrl
+Shift
+P
(Windows...
[misspelling] ~87-~87: Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Context: ... instructions if you do not want to use devcontainers._ It is also possible to set up a more...
|
||
**Prerequisites** | ||
|
||
- [Docker](https://docs.docker.com/get-docker/) |
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.
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.
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 comment
The 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
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
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. | |
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**. |
Tools
LanguageTool
[uncategorized] ~78-~78: Consider adding a hyphen. (TOP_LEFT_CORNER)
Context: ...he "Reopen in Container" message in the bottom right corner or press the f1 key and select `...
[uncategorized] ~78-~78: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ...ontainer. After Visual Studio Code has reopened you should see
Dev Container: Home Ass...
[uncategorized] ~78-~78: Consider adding a hyphen. (TOP_LEFT_CORNER)
Context: ...v Container: Home Assistant Dev` in the bottom left corner. 6. You can verify that your dev...
Proposed change
Add instructions for using devcontainer from WSL.
This worked a lot better on my machine.
Type of change
Additional information
Summary by CodeRabbit