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

Draft/wsl2 firmware development #1

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

JPHutchins
Copy link
Collaborator

Draft PR showing what our PR article submission to Memfault / Interrupt would look like. I'd really appreciate proof reading and review, I know there's still lots to clean up. Lightweight promoting Intercreate but I don't know if it's too blatant or too subtle.

Have a hard time switching between fact and opinion sometimes.

@davedesro
Copy link
Member

@JPHutchins this is awesome!! 👍 👍 👍 . Thank you for taking the initiative!

Is there a way to view the rendered post?

@JPHutchins
Copy link
Collaborator Author

JPHutchins commented Jul 29, 2024 via email

@JPHutchins
Copy link
Collaborator Author

JPHutchins commented Jul 31, 2024

I cloned it to windows to test the docker setup. It didn't go to well since it also seems to have grabbed the wrong Ruby:

  • Install Docker Desktop
  • (restart computer)
  • move to repo
  • change .sh scripts to LF from CRLF if git converted them
  • docker build -t memfault/interrupt .
  • docker run --rm -i -t --publish=4000:4000 --volume ${PWD}:/memfault/interrupt memfault/interrupt

You'll get this error

Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead.
Configuration file: /memfault/interrupt/_config.yml
            Source: /memfault/interrupt
       Destination: /memfault/interrupt/_site
 Incremental build: disabled. Enable with --incremental
      Generating...
              Lunr: Search index generation disabled. Enable by setting 'GENERATE_SEARCH_INDEX=true' environment variable.
  Liquid Exception: undefined method `tainted?' for {"name"=>"François Baldassari", "email"=>"[email protected]", "web"=>"https://twitter.com/baldassarifr", "image"=>"/img/author/francois.jpg", "blurb"=>"has worked on the embedded software teams at Sun, Pebble, and Oculus. He is currently the CEO of <a href='https://memfault.com'>Memfault</a>.", "twitter"=>"baldassarifr", "linkedin"=>"https://www.linkedin.com/in/francois-baldassari", "github"=>"franc0is"}:Hash in /memfault/interrupt/_layouts/post.html
bundler: failed to load command: jekyll (/usr/local/bundle/bin/jekyll)
/usr/local/bundle/gems/liquid-4.0.3/lib/liquid/variable.rb:124:in `taint_check': undefined method `tainted?' for {"name"=>"François Baldassari", "email"=>"[email protected]", "web"=>"https://twitter.com/baldassarifr", "image"=>"/img/author/francois.jpg", "blurb"=>"has worked on the embedded software teams at Sun, Pebble, and Oculus. He is currently the CEO of <a href='https://memfault.com'>Memfault</a>.", "twitter"=>"baldassarifr", "linkedin"=>"https://www.linkedin.com/in/francois-baldassari", "github"=>"franc0is"}:Hash (NoMethodError)

      return unless obj.tainted?
                       ^^^^^^^^^
        from /usr/local/bundle/gems/liquid-4.0.3/lib/liquid/variable.rb:89:in `render'
        from /usr/local/bundle/gems/liquid-4.0.3/lib/liquid/tags/assign.rb:26:in `render'
        from /usr/local/bundle/gems/liquid-4.0.3/lib/liquid/block_body.rb:103:in `render_node_to_output'
        from /usr/local/bundle/gems/liquid-4.0.3/lib/liquid/block_body.rb:91:in `render'
        from /usr/local/bundle/gems/liquid-4.0.3/lib/liquid/template.rb:208:in `block in render'
        from /usr/local/bundle/gems/liquid-4.0.3/lib/liquid/template.rb:242:in `with_profiling'
        from /usr/local/bundle/gems/liquid-4.0.3/lib/liquid/template.rb:207:in `render'
        from /usr/local/bundle/gems/liquid-4.0.3/lib/liquid/template.rb:220:in `render!'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/liquid_renderer/file.rb:39:in `block (3 levels) in render!'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/liquid_renderer/file.rb:59:in `measure_counts'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/liquid_renderer/file.rb:38:in `block (2 levels) in render!'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/liquid_renderer/file.rb:63:in `measure_bytes'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/liquid_renderer/file.rb:37:in `block in render!'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/liquid_renderer/file.rb:70:in `measure_time'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/liquid_renderer/file.rb:36:in `render!'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/renderer.rb:131:in `render_liquid'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/renderer.rb:194:in `render_layout'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/renderer.rb:163:in `place_in_layouts'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/renderer.rb:93:in `render_document'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/renderer.rb:63:in `run'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/site.rb:547:in `render_regenerated'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/site.rb:532:in `block (2 levels) in render_docs'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/site.rb:531:in `each'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/site.rb:531:in `block in render_docs'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/site.rb:530:in `each_value'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/site.rb:530:in `render_docs'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/site.rb:210:in `render'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/site.rb:80:in `process'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/command.rb:28:in `process_site'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/commands/build.rb:65:in `build'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/commands/build.rb:36:in `process'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/command.rb:91:in `block in process_with_graceful_fail'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/command.rb:91:in `each'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/command.rb:91:in `process_with_graceful_fail'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/commands/serve.rb:86:in `block (2 levels) in init_with_program'
        from /usr/local/bundle/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `block in execute'
        from /usr/local/bundle/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `each'
        from /usr/local/bundle/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `execute'
        from /usr/local/bundle/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:in `go'
        from /usr/local/bundle/gems/mercenary-0.4.0/lib/mercenary.rb:21:in `program'
        from /usr/local/bundle/gems/jekyll-4.2.1/exe/jekyll:15:in `<top (required)>'
        from /usr/local/bundle/bin/jekyll:25:in `load'
        from /usr/local/bundle/bin/jekyll:25:in `<top (required)>'
        from /usr/local/bundle/gems/bundler-2.2.29/lib/bundler/cli/exec.rb:58:in `load'
        from /usr/local/bundle/gems/bundler-2.2.29/lib/bundler/cli/exec.rb:58:in `kernel_load'
        from /usr/local/bundle/gems/bundler-2.2.29/lib/bundler/cli/exec.rb:23:in `run'
        from /usr/local/bundle/gems/bundler-2.2.29/lib/bundler/cli.rb:478:in `exec'
        from /usr/local/bundle/gems/bundler-2.2.29/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
        from /usr/local/bundle/gems/bundler-2.2.29/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
        from /usr/local/bundle/gems/bundler-2.2.29/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
        from /usr/local/bundle/gems/bundler-2.2.29/lib/bundler/cli.rb:31:in `dispatch'
        from /usr/local/bundle/gems/bundler-2.2.29/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
        from /usr/local/bundle/gems/bundler-2.2.29/lib/bundler/cli.rb:25:in `start'
        from /usr/local/bundle/gems/bundler-2.2.29/exe/bundle:49:in `block in <top (required)>'
        from /usr/local/bundle/gems/bundler-2.2.29/lib/bundler/friendly_errors.rb:128:in `with_friendly_errors'
        from /usr/local/bundle/gems/bundler-2.2.29/exe/bundle:37:in `<top (required)>'
        from /usr/local/bundle/bin/bundle:25:in `load'
        from /usr/local/bundle/bin/bundle:25:in `<main>'

And if you look at the docker pull it's getting Ruby 3.2.4 when it should get 2.7.7:

[+] Building 107.8s (15/15) FINISHED                                       docker:desktop-linux
 => [internal] load build definition from Dockerfile                                       0.1s
 => => transferring dockerfile: 628B                                                       0.0s
 => [internal] load metadata for docker.io/library/ruby:3.2.4-slim-bookworm                0.7s
 => [internal] load .dockerignore                                                          0.0s
 => => transferring context: 69B                                                           0.0s
 => [internal] load build context                                                          0.0s
 => => transferring context: 3.75kB                                                        0.0s
 => [ 1/10] FROM docker.io/library/ruby:3.2.4-slim-bookworm@sha256:3e345863daec6349230144  6.7s
 => => resolve docker.io/library/ruby:3.2.4-slim-bookworm@sha256:3e345863daec634923014406  0.0s
 => => sha256:7526da93d78473609a676a4f1b148622b04a66655d5d5dcde73131e87189755 198B / 198B  0.4s
 => => sha256:3e345863daec63492301440639ee6ad5554ad2edf20c6de4eb1c8b1d0 10.37kB / 10.37kB  1.0s
 => => sha256:0e49f5b8168417226e5dbc87192112a588d01bd17f61d05a48d3d374c35 1.93kB / 1.93kB  0.0s
 => => sha256:804e41e863d411b9eed8c33cd7ba7beeeb329b2b458c88dbbb59a0a35d2 6.12kB / 6.12kB  0.0s
 => => sha256:efc2b5ad9eec05befa54239d53feeae3569ccbef689aa5e5dbfc25da6 29.13MB / 29.13MB  1.8s
 => => sha256:d9fd855e250d7faf017ca29a4c4b900b068955e8580d7e0f09ebbd828 13.86MB / 13.86MB  1.3s
 => => sha256:f980dadaf440a6eb06273fcde041791fc3e2b7c14b4e80656c6a11ae4 34.83MB / 34.83MB  2.3s
 => => sha256:82e7b59acad3e910da5a2c2258d5a421434cf5a54f468db00913609e096d550 143B / 143B  1.5s
 => => extracting sha256:efc2b5ad9eec05befa54239d53feeae3569ccbef689aa5e5dbfc25da6c4df559  1.9s
 => => extracting sha256:d9fd855e250d7faf017ca29a4c4b900b068955e8580d7e0f09ebbd828791e08b  1.2s
 => => extracting sha256:7526da93d78473609a676a4f1b148622b04a66655d5d5dcde73131e871897558  0.0s
 => => extracting sha256:f980dadaf440a6eb06273fcde041791fc3e2b7c14b4e80656c6a11ae4b0f6f44  1.3s
 => => extracting sha256:82e7b59acad3e910da5a2c2258d5a421434cf5a54f468db00913609e096d5505  0.0s
 => [ 2/10] RUN apt-get update && apt-get install -y --no-install-recommends     build-e  21.2s
 => [ 3/10] WORKDIR /memfault/interrupt                                                    0.0s
 => [ 4/10] COPY Gemfile .                                                                 0.0s
 => [ 5/10] COPY Gemfile.lock .                                                            0.0s
 => [ 6/10] RUN bundle config force_ruby_platform true                                     0.4s
 => [ 7/10] RUN bundle install                                                            71.1s
 => [ 8/10] COPY requirements.txt .                                                        0.0s
 => [ 9/10] RUN python3 -m venv /venv && . /venv/bin/activate &&     python3 -m pip insta  5.5s
 => [10/10] COPY entrypoint.sh ./entrypoint.sh                                             0.1s
 => exporting to image                                                                     1.8s
 => => exporting layers                                                                    1.7s
 => => writing image sha256:96d9a6abd4ebb0902c12a6661ad5dfab1fdb96db711fcc709c76639250c32  0.0s
 => => naming to docker.io/memfault/interrupt                                              0.0s

View build details: docker-desktop://dashboard/build/desktop-linux/desktop-linux/o1t53rkpd96wzxxclheirz6wv

IDK

@JPHutchins
Copy link
Collaborator Author

I got it working by changing the top of the Dockerfile:

FROM ruby:2.7.7-slim

So, I will recommend the docker approach.

@JPHutchins
Copy link
Collaborator Author

Adding the --incremental flag speeds things up a bit

docker run --rm -i -t --publish=4000:4000 --volume ${PWD}:/memfault/interrupt memfault/interrupt --incremental

@davedesro
Copy link
Member

@JPHutchins is it possible to save the HTML and assets and send it in zip via slack or GDrive?

@JPHutchins
Copy link
Collaborator Author

@JPHutchins is it possible to save the HTML and assets and send it in zip via slack or GDrive?

I think this worked, attached here:
WSL2 for Firmware Development _ Interrupt_files.zip

This was created with Chrome "save as". Unzip it and open the "WSL2 for Firmware Development _ Interrupt.html" file.

@davedesro
Copy link
Member

@JPHutchins this is great! Can you put the "intercreate" string to a hyperlink to https://www.intercreate.io ? Also, you should do the same for "Framework 16" :)

Maybe could add a few more too.. .like "Zephyr" and "VMWare Workstation" and even "WSL2"

More hyperlinks should provide more hits to the article, right?

Copy link

@robhelvestine robhelvestine left a comment

Choose a reason for hiding this comment

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

I have a few minor comments. In general, I love it. Is there a way you can have your author name and possibly link to your Github somewhere in there?

_drafts/wsl2-firmware-development.md Outdated Show resolved Hide resolved

The performance differences between WSL2 and bare metal
Linux are [small](https://www.phoronix.com/review/windows11-wsl2-zen4/5),
[will continue shrinking](https://www.phoronix.com/news/Microsoft-WSL2-Linux-6.6-Kernel)

Choose a reason for hiding this comment

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

there is a space here in between "shrinking" and the ","


A benchmark shouldn't take too long, yet it should be long enough that it
smooths over some run-to-run issues you might see—_what are
Windows Defender and Windows Update up to during the run🔍?_. A build-only twister

Choose a reason for hiding this comment

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

LOL

_drafts/wsl2-firmware-development.md Outdated Show resolved Hide resolved
_drafts/wsl2-firmware-development.md Outdated Show resolved Hide resolved
_drafts/wsl2-firmware-development.md Outdated Show resolved Hide resolved
@davedesro
Copy link
Member

@JPHutchins @robhelvestine a thought. The article is long enough to be split up into 2 or 3 articles

  • WSL2
  • Framework 16
  • Tutorial

Not sure if that's an option.. just thinking about it 'cause people's attention span to online articles are too short.. also could maybe help with SEO by referring articles?

@robhelvestine
Copy link

@JPHutchins @robhelvestine a thought. The article is long enough to be split up into 2 or 3 articles

  • WSL2
  • Framework 16
  • Tutorial

Not sure if that's an option.. just thinking about it 'cause people's attention span to online articles are too short.. also could maybe help with SEO by referring articles?

Yea not a bad idea. I would say split into two articles: 1 pre-tutorial, and 1 tutorial

@JPHutchins
Copy link
Collaborator Author

Yea not a bad idea. I would say split into two articles: 1 pre-tutorial, and 1 tutorial

I like this idea and I think it makes it more likely to get approved by the editors.

Leaves me tempted to flesh out the article with VMWare benchmarks, but man, it would require

  1. download VMWare
  2. Install linux
  3. setup the environment
  4. run the benchmarks
  5. record results and add to article

Optimistically like 2 hours of work.

Similarly, tempted to benchmark my partner's M3 MacBook...

@davedesro
Copy link
Member

davedesro commented Aug 2, 2024 via email

_drafts/wsl2-firmware-development.md Outdated Show resolved Hide resolved
_drafts/wsl2-firmware-development.md Outdated Show resolved Hide resolved
_drafts/wsl2-firmware-development.md Outdated Show resolved Hide resolved
_drafts/wsl2-firmware-development.md Outdated Show resolved Hide resolved
_drafts/wsl2-firmware-development.md Outdated Show resolved Hide resolved
@swoisz
Copy link

swoisz commented Aug 2, 2024

Yea not a bad idea. I would say split into two articles: 1 pre-tutorial, and 1 tutorial

I like this idea and I think it makes it more likely to get approved by the editors.

Leaves me tempted to flesh out the article with VMWare benchmarks, but man, it would require

  1. download VMWare
  2. Install linux
  3. setup the environment
  4. run the benchmarks
  5. record results and add to article

Optimistically like 2 hours of work.

Similarly, tempted to benchmark my partner's M3 MacBook...

I could run something on a M2 MacBook if needed

@JPHutchins
Copy link
Collaborator Author

I could run something on a M2 MacBook if needed

It would be great! Hopefully it's clear enough how it was done from the Fixture section.

@JPHutchins
Copy link
Collaborator Author

@davedesro Thanks for the review! Updates are pushed and I've attached new previews.

previews.zip

@JPHutchins
Copy link
Collaborator Author

Real PR here: memfault#515

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants