DevContainer build environment

I’ve made a minor addition to a fork of the MarlinBuilder repo to add support for developing inside of a container. In short, this allows you to create consistent dev and build environments independent of your host computer. Rather than polluting your computer with local installations of dependencies that might be inconsistent from developer to developer, this is guaranteed to provide a complete, repeatable, and dependable environment every time.

A made a Walkthrough Video to showcase what it’s about. I wanted to get feedback before I send a pull request.

John

2 Likes

I keep the dependencies isolated by using virtualenv. Docker works well too, but all the dependencies are python libraries.

As long as you have an environment that can run bash and python, you can use virtualenv to keep the other dependencies local. I thought there was a description in the docs for this. From memory:

  • virvualenv -p python3 .venv
  • souce .venv/bin/activate
  • pip install -r requirements.txt
1 Like

The github actions also run the development inside a container. I found (but haven’t tried) act which promises to run github actions locally.

The build.sh is very nice though. Thanks for sharing.

1 Like

That looks slick as all heck. I need to see if I can figure it out.

The point of developing this way is consistency everywhere without needing anything (well, except docker and vscode) installed on your local computer. virtualenv goes a long way, and if we’re doing a dependency count it might be a wash. But with devcontainers, regardless of your local environment, the dev environment is identical everywhere.

The underlying tech parallels the CI/CD process you’re doing on github. Except that VSCode is able to instantiate that environment and attach to it so you can interact with it in a development role instead of it being a headless scripted process.

1 Like

I use docker for my development (I am a SWE) but I don’t use vscode. So it would add a dep for me (and not a small one). But I also don’t work in windows. So I have no idea what kinds of problems windows users have with MarlinBuilder.

And I test with the actual Gihub PR system (yikes). I am still trying to learn the travis/ci stuff and not mess up the actions Heffe has set up for me.