Skip to content

Slice up the development environment setup#437

Closed
mcrosson wants to merge 7 commits intozmkfirmware:mainfrom
mcrosson:docs-setupcleanup
Closed

Slice up the development environment setup#437
mcrosson wants to merge 7 commits intozmkfirmware:mainfrom
mcrosson:docs-setupcleanup

Conversation

@mcrosson
Copy link
Copy Markdown
Contributor

  • Give a brief overview of docker+vscode vs native os
  • Dedicated page for docker+vscode setup
  • Dedicated page for native os setup
  • Dedicated page for setting up zmk sources for development

@innovaker innovaker added documentation Improvements or additions to documentation enhancement New feature or request labels Nov 28, 2020
@mcrosson
Copy link
Copy Markdown
Contributor Author

Updated and pushed new rev based on feedback

Copy link
Copy Markdown
Collaborator

@joelspadin joelspadin left a comment

Choose a reason for hiding this comment

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

See also the unresolved comments from my earlier review, but this revision does seem easier to follow.

@mcrosson
Copy link
Copy Markdown
Contributor Author

mcrosson commented Dec 2, 2020

Updated and pushed per feedback.

Will squash as last step before merge

@innovaker
Copy link
Copy Markdown
Contributor

@mcrosson, I think this PR needs a health check?

@mcrosson
Copy link
Copy Markdown
Contributor Author

@mcrosson, I think this PR needs a health check?

Health check?

@innovaker innovaker requested a review from Nicell January 5, 2021 20:26
@okke-formsma
Copy link
Copy Markdown
Collaborator

@mcrosson Would you mind rebasing again? I'd like to merge some of these old docs PRs.

@mcrosson
Copy link
Copy Markdown
Contributor Author

@mcrosson Would you mind rebasing again? I'd like to merge some of these old docs PRs.

I can but I'd prefer the others be merged ahead of this as this update will likely cause a ton of other conflits with other doc updates.

Would that work?

@okke-formsma
Copy link
Copy Markdown
Collaborator

Sure. Is there a way to keep track of what PR are blocking other PRs in github?

@mcrosson
Copy link
Copy Markdown
Contributor Author

Sure. Is there a way to keep track of what PR are blocking other PRs in github?

I'm not sure offhand. There is a box towards that says "Linked issues" but i can't make changes

If nothing else we can reference the others from this one and just keep tabs on things for a bit

@mcrosson
Copy link
Copy Markdown
Contributor Author

mcrosson commented Mar 1, 2021

bump?

anyone willing to review this if i fixup the conflicts

we are getting more folks interested in windows + vscode + docker and i think this set of updates will be helpful for folks

@idan
Copy link
Copy Markdown
Contributor

idan commented Mar 1, 2021

@mcrosson I'm happy to!

Copy link
Copy Markdown
Contributor

@idan idan left a comment

Choose a reason for hiding this comment

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

This looks fantastic! I did a scan for language and offered some suggested improvements, going to check this PR out and see how the docs look like built

---

:::danger
The Docker environment will **NOT** run on arm CPUs like the Raspberry Pi. You must use the native environment if using an arm CPU.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Probably worth calling out apple silicon here as well

Suggested change
The Docker environment will **NOT** run on arm CPUs like the Raspberry Pi. You must use the native environment if using an arm CPU.
The Docker environment will **NOT** run on arm CPUs like the Raspberry Pi or Apple Silicon. You must use the native environment if using an arm CPU.

:::

:::note Windows Users
Please note the zmk builds can run slower with Docker on Windows if you don't use the WSL2 filesystem to store files. Build times can take 3-5 minutes on slower hardware without using the WSL2 filesystem. If you run into performance problems you can checkout the zmk sources inside a WSL2 environment and use `code .` inside the WSL2 environment to open the sources. This can make builds run as fast as 20s.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If the path of least resistance is installing Docker for Windows and letting that work the WSL2 magic behind the scenes, maybe we ought to recommend the happiest path upfront. Can also link to a section at the end that talks about the finer points of WSL and IO perf.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think we can leave this note but move it after the setup steps.

@innovaker was the one driving this add initially and I don't think it detracts from the rest of the information on the page.


## Environment Setup

There are two ways to setup the zmk development environment: Docker+VS Code (Docker in the rest of the documentation) and using the operating system directly (native in the rest of the documentation). The Docker approach is a self-contained development environment while the native approach will setup your local operating system for development. The Docker approach is great for getting going quickly while the native approach is a bit faster but more difficult to setup initially.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
There are two ways to setup the zmk development environment: Docker+VS Code (Docker in the rest of the documentation) and using the operating system directly (native in the rest of the documentation). The Docker approach is a self-contained development environment while the native approach will setup your local operating system for development. The Docker approach is great for getting going quickly while the native approach is a bit faster but more difficult to setup initially.
There are two ways to setup the zmk development environment: Docker+VS Code (`Docker` in the rest of the documentation) and using the operating system directly (`native` in the rest of the documentation). The Docker approach is a self-contained development environment while the native approach will setup your local operating system for development. The Docker approach is great for getting going quickly while the native approach is a bit faster but more difficult to setup initially.

Please see the [Docker](/docs/development/setup/docker-vscode) instructions or [native](/docs/development/setup/native) instructions to continue setup.

:::danger
The Docker environment will **NOT** run on arm CPUs like the Raspberry Pi. You must use the native environment if using an arm CPU.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
The Docker environment will **NOT** run on arm CPUs like the Raspberry Pi. You must use the native environment if using an arm CPU.
The Docker environment will **NOT** run on arm CPUs like the Raspberry Pi or Apple Silicon. You must use the native environment if using an arm CPU.

sudo apt update
```

These commands should be run in a terminal such as Bash (Linux/macOS/Docker), PowerShell, or Command Prompt (Windows).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
These commands should be run in a terminal such as Bash (Linux/macOS/Docker), PowerShell, or Command Prompt (Windows).
These commands should be run in a terminal such as Bash (Linux/MacOS/Docker), PowerShell, or Command Prompt (Windows).

![VS Code Dev Container Configuration Alert](../../assets/dev-setup/vscode_devcontainer.png)

Click `Reopen in Container` in order to reopen the VS Code with the running container.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

image

Also cmd-shift-p and invoking Remote: Show Remote Menu displays the remotes menu

image

KemoNine added 5 commits March 2, 2021 19:06
- Give a brief overview of docker+vscode vs native os
- Dedicated page for docker+vscode setup
- Dedicated page for native os setup
- Dedicated page for setting up zmk sources for development
…ns. Expand some notes and caution boxes so some pitfalls and ways to improve performance are more clear to users
@mcrosson
Copy link
Copy Markdown
Contributor Author

mcrosson commented Mar 2, 2021

@idan TY for the suggestions, i've added them except for the last item with the screen shots. I'm not sure what you were suggesting in that last item and left it off. Would you be willing to provide some additional clarity?

@mcrosson
Copy link
Copy Markdown
Contributor Author

mcrosson commented Mar 4, 2021

bump? i'd like to get this in before some of the other churn for the docs pops up...

@idan
Copy link
Copy Markdown
Contributor

idan commented Mar 5, 2021

Apologies — yeah the screenshots were just referencing the two ways of getting at it, didn't mean them for inclusion.

@mcrosson If you're okay with the content, I'd say :shipit: and we can always add screenshots there later

@mcrosson
Copy link
Copy Markdown
Contributor Author

mcrosson commented Mar 6, 2021

Apologies — yeah the screenshots were just referencing the two ways of getting at it, didn't mean them for inclusion.

@mcrosson If you're okay with the content, I'd say :shipit: and we can always add screenshots there later

i'm 100% good with content but i can't merge. That's gotta be @okke-formsma / @petejohanson / @innovaker / @Nicell

Copy link
Copy Markdown
Member

@Nicell Nicell left a comment

Choose a reason for hiding this comment

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

A few more suggestions, but I'd like to get this in soon. Doesn't need to be perfect. I think we need to consider if anywhere links to the old "Basic Setup" URL. We could probably set up a Netlify redirect for that.


## Environment Setup

There are two ways to setup the zmk development environment: Docker+VS Code (`Docker` in the rest of the documentation) and using the operating system directly (`native` in the rest of the documentation). The Docker approach is a self-contained development environment while the native approach will setup your local operating system for development. The Docker approach is great for getting going quickly while the native approach is a bit faster but more difficult to setup initially.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
There are two ways to setup the zmk development environment: Docker+VS Code (`Docker` in the rest of the documentation) and using the operating system directly (`native` in the rest of the documentation). The Docker approach is a self-contained development environment while the native approach will setup your local operating system for development. The Docker approach is great for getting going quickly while the native approach is a bit faster but more difficult to setup initially.
There are two ways to setup the ZMK development environment: Docker+VS Code (`Docker` in the rest of the documentation) and using the operating system directly (`native` in the rest of the documentation). The Docker approach is a self-contained development environment while the native approach will setup your local operating system for development. The Docker approach is great for getting going quickly while the native approach is a bit faster but more difficult to setup initially.

Comment on lines +12 to +13
:::danger
The Docker environment will **NOT** run on arm CPUs like the Raspberry Pi or Apple Silicon. You must use the native environment if using an arm CPU.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
:::danger
The Docker environment will **NOT** run on arm CPUs like the Raspberry Pi or Apple Silicon. You must use the native environment if using an arm CPU.
:::caution
The Docker environment will **NOT** run on ARM CPUs like the Raspberry Pi or Apple Silicon. You must use the native environment if using an ARM CPU.

The Docker environment will **NOT** run on arm CPUs like the Raspberry Pi or Apple Silicon. You must use the native environment if using an arm CPU.
:::

This setup leverages the same [image which is used by the GitHub action](https://github.com/zmkfirmware/zephyr-west-action) for local development. Beyond the benefits of [dev/prod parity](https://12factor.net/dev-prod-parity), this approach is also the easiest to set up. No toolchain or dependencies are necessary when using Docker; the container image you'll be using already has the toolchain installed and set up to use.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This action is deprecated now. Our actions now just use this docker image as the base image, so I think this first sentence isn't necessary or could be reworded to something like This setup leverages the same [Docker image used when building ZMK on GitHub](https://github.com/zmkfirmware/zmk-docker/). Also not quite sure how the dev/prod parity stuff fits into this discussion.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's there to be clear that the container used for local dev is the same as used by the github build system.

Basically a signal that if you want to be guaranteed what you do locally (dev) is the same as on the upstream build stuff (prod) you should be using the docker container for builds.

This should stand IMO for folks (like me) who want to use the same environment locally as is used by the build system to ensure there aren't surprises.

3. Install the [Remote - Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)

:::note Windows Users
Please note the zmk builds can run slower with Docker on Windows if you don't use the WSL2 filesystem to store files. Build times can take 3-5 minutes on slower hardware without using the WSL2 filesystem. If you run into performance problems you can checkout the zmk sources inside a WSL2 environment and use `code .` inside the WSL2 environment to open the sources. This can make builds run as fast as 20s.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
Please note the zmk builds can run slower with Docker on Windows if you don't use the WSL2 filesystem to store files. Build times can take 3-5 minutes on slower hardware without using the WSL2 filesystem. If you run into performance problems you can checkout the zmk sources inside a WSL2 environment and use `code .` inside the WSL2 environment to open the sources. This can make builds run as fast as 20s.
Please note the ZMK builds run slower (up to 3-5 minutes on slower hardware) with Docker on Windows if you don't use the WSL2 filesystem to store files. If you run into performance problems you can checkout the ZMK sources inside a WSL2 environment and run `code .` to open the sources. This can make builds run at near-native speed.

@mcrosson
Copy link
Copy Markdown
Contributor Author

mcrosson commented Mar 6, 2021

@Nicell incorporated your suggestions, i think this should be good to go?

@mcrosson mcrosson requested a review from Nicell March 6, 2021 20:48
@mcrosson
Copy link
Copy Markdown
Contributor Author

bump @petejohanson / @Nicell

@Nicell
Copy link
Copy Markdown
Member

Nicell commented Mar 10, 2021

@mcrosson I'm good with these changes, but I still want to make sure we don't have any broken URLs. Could we add a redirect from development/setup to development/setup/getting-started? Netlify uses a _redirects file for this, or maybe @petejohanson has a suggestion since he has dashboard access.

@mcrosson
Copy link
Copy Markdown
Contributor Author

@mcrosson I'm good with these changes, but I still want to make sure we don't have any broken URLs. Could we add a redirect from development/setup to development/setup/getting-started? Netlify uses a _redirects file for this, or maybe @petejohanson has a suggestion since he has dashboard access.

I don't see a redirects file in the sources...

@petejohanson probably has to be involved at this point

@Nicell
Copy link
Copy Markdown
Member

Nicell commented Mar 10, 2021

I don't see a redirects file in the sources...

You can add a _redirects file to the /docs/static/ folder. See here: https://docs.netlify.com/routing/redirects/#rule-processing-order

@mcrosson
Copy link
Copy Markdown
Contributor Author

Added the _redirects file based on the docs ; i hope its right 🤞

@mcrosson mcrosson closed this Mar 10, 2021
@mcrosson mcrosson reopened this Mar 10, 2021
@mcrosson
Copy link
Copy Markdown
Contributor Author

bump @petejohanson

@nmunnich
Copy link
Copy Markdown
Contributor

nmunnich commented Jun 2, 2024

This pull request can now be closed as it was subsumed by #2272 which is now merged.

@caksoylar caksoylar closed this Jun 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants