-
Notifications
You must be signed in to change notification settings - Fork 11
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
Feature/adds development container #32
Feature/adds development container #32
Conversation
It seems there's an issue with trying to switch the variant to buster. When you do so, the spin install script fails for a missing version of glibc (See output below). Looks to be related to fermyon/spin#168 and fermyon/bartholomew#150 as well, not necessarily an issue with the python sdk or the devcontainer, other than maybe don't use buster. Confirmed same error when using spin versions 0.9.0 thru canary, which can be changed by passing into the command below as a build arg reproducible by building the devcontainer manually:
|
9b15d58
to
040fb6f
Compare
Does installing the build dependencies, like described here: https://developer.fermyon.com/spin/install#building-spin-from-source help? |
I hadn't tried it, but I suspect it probably would since it should link against the correct glibc. Wasn't sure of the best way to go on it. Since it's being used for development, my initial thought was to just duplicate the environment that the main spin repo is build in, to keep things the same. Though, it wouldn't be linked, so there's just a much a chance of getting out of sync, so maybe building from scratch based on the selected variant and spin version. 🤔 easy enough to try out either way, I'll see if I can knock that out in the next day or so |
040fb6f
to
5a3b352
Compare
ade4c50
to
b26d827
Compare
hmm...I thought I had responded to the previous question already but apparently I did not...Long story short, switching to building spin from source didn't fix the issue, I started running into the same glibc error messages from the wasi sdk as well. After taking another look at my original goal for building a devcontainer, to get a dev environment with dependencies up and running quickly and reproducibly, I've decided to limit the devcontainer install/build to just the prerequisite installed dependencies listed in the README to get a user right up to the point where they can run the build scripts (build-python.sh and make), following the instructions in the README, rather than automating the full build during container startup. I think this will work better with future changes that require changes to the build system, cpython versions etc. |
6cc2b85
to
dbb4278
Compare
Alright, I think I have it in a good place. Tested it on Ubuntu, Ubuntu in WSL , and on Github Codespaces by pulling the repo from scratch, building the devcontainer in vscode and then following the instructions in the readme to build the plugin, then test it with the example hello world app. I made an update to the readme about needing to do a git submodule update before trying to run the build-python.sh. |
README.md
Outdated
### Instructions | ||
|
||
First, build CPython for wasm32-wasi. | ||
First, perform a git submodule update to update the cpython submodule |
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.
Could this and the CPython build be part of the container creation?
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.
We could actually do a couple of things here. I flipped back and forth a couple of times on it previously. It all comes down to the usual workflow...if there is rarely a need to rebuild cpython or make changes to the branch etc, then it probably makes sense to move it into the dockerfile and take advantage of image caching...the build is already long enough to be a "walk away for a bit" build the first time, so I'm not adverse to just including the python compile as well.
Ultimately I made the decision to leave it this way after looking at how the development steps are listed in the README...ie: install these dependencies (stuff I put in dockerfile) and then steps begin with "run this script" which I left up to the user.
I'll defer to you guys at Fermyon though as far as which way would be a better developer experience given the normal workflow and tasks that are often performed?
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.
As discussed on discord, I switch the devcontainer to use an artifact compiled version of wasi cpython, so running these commands is no longer necessary when using it. Added notes to the affected steps in the README.
ae224b8
to
baf43e8
Compare
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.
LGTM
Thanks @jasonwashburn. One last thing is to to make sure your commits are signed before we can merge them. |
Signed-off-by: Jason Washburn <[email protected]>
Signed-off-by: Jason Washburn <[email protected]>
Signed-off-by: Jason Washburn <[email protected]>
Signed-off-by: Jason Washburn <[email protected]>
Signed-off-by: Jason Washburn <[email protected]>
Signed-off-by: Jason Washburn <[email protected]>
Signed-off-by: Jason Washburn <[email protected]>
Signed-off-by: Jason Washburn <[email protected]>
Signed-off-by: Jason Washburn <[email protected]>
Signed-off-by: Jason Washburn <[email protected]>
Signed-off-by: Jason Washburn <[email protected]>
Signed-off-by: Jason Washburn <[email protected]>
Signed-off-by: Jason Washburn <[email protected]>
Signed-off-by: Jason Washburn <[email protected]>
baf43e8
to
f6dab68
Compare
I'm sure you guys are busy, just checking back to make sure there's not something additional you'd like to me to do with this? |
Sorry about that @jasonwashburn, I'm not sure what happened there! I've merged it now - thanks for putting this together! |
This PR adds config and scripts for a devcontainer running on the rust/bullseye variant. The WASI-SDK and Spin versions used at build time, can be modified by changing args passed to Dockerfile in devcontainer.json.
Compilation of cPython and spin-python-sdk are performed in a post creation command script since they rely on the repository being available (not the case during build time when using on GitHub codespaces)
I've tested it successfully as is on both GitHub Codespaces, and on an x86 linux host, but it could probably use a little more testing in other configs, ie: on windows, or maybe with different versions of wasi-sdk / spin version, though I don't know the currently compatibility story there, so maybe not relevant.
Known issues:
Opening up draft PR to facilitate discussion and collect feedback on experience, or thoughts on improvements to the config, extensions, included python tooling etc.