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

Add devcontainer and Github Codespaces setup #43

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

Conversation

cleverer
Copy link
Contributor

@cleverer cleverer commented Mar 25, 2023

Just works ;) (If you don't know how, check the docs)

After merging it would make sense to set up prebuilds: https://docs.github.com/en/codespaces/prebuilding-your-codespaces/configuring-prebuilds

I'd recommend to run weekly rebuilds I guess.

Prebuilds run on Github Actions which is free for public repositories, so no additional costs. Only storage for the prebuilt images is not enough with 15GB…

@cleverer cleverer force-pushed the devcontainer branch 10 times, most recently from fa08dcb to c1a61f3 Compare March 25, 2023 19:00
@cleverer cleverer changed the title WIP: add devcontainer add devcontainer Mar 26, 2023
@cleverer cleverer marked this pull request as ready for review March 26, 2023 15:36
BacLuc and others added 5 commits March 8, 2024 23:37
# Conflicts:
#	.gitignore
#	docker/rails.dockerfile
Else you need to accept the public key of github.com,
which needs interaction.
Merge hitobito/development into cleverer/devcontainer
@cleverer cleverer changed the title add devcontainer Add devcontainer and Github Codespaces setup Mar 11, 2024
@cleverer
Copy link
Contributor Author

cleverer commented Mar 11, 2024

This PR has been reworked and optimized. Thanks to @BacLuc, @petter1 and all the others for their inputs and help!

New since the last time:

  • Docker containers now wait for each other using docker healthchecks. This makes the waitfortcp in the entrypoints obsolete.
  • Github SSH Host keys are preregistered in the docker container, simplifying pulling via ssh.
  • Replace mysql with corresponding mariadb. (Yay arm-based machines 🎉 )
  • Don't mount the whole home directory outside the container. That leads to a lot of confusing behaviour…
  • Don't mount the X11 socket by default, as it causes issues on multiple platforms (arch, macos on Apple Silicon…)
  • Allow to access docker from within the dev container

Currently not working:

  • If you run the Github Codespace in the Browser and access hitobito, CORS is not set up correctly.
  • Debugging inside the container requires a merge of fix(Gemfile): pin json gem below 2.7.0 hitobito#2478
  • The prebuilt images currently seem a bit finicky. If in doubt do a full rebuild as described in docs/Devcontainer.md and grab a coffee ;)

TODOs for Puzzle

  • After merging this, it would be wonderful if pre-builds would be setup, for that truly instant first time setup.
  • It would be lovely if a .github Repository could be created on the hitobito org. There you could add links like this:
    • https://github.com/codespaces/new?ref=devcontainer&repo=277813823&machine=basicLinux32gb&geo=EuropeWest&devcontainer_path=.devcontainer%2Fgeneric%2Fdevcontainer.json
    • This allows people to directly launch a codespace.
    • You can list all possible variants, just change the devcontainer_path param accordingly.
  • Update the list of variants/setups aka update .devcontainerconfigs.

If you have questions about how it "just works", check the docs/Devcontainer.md and docs/DevcontainerInDepth.md ;)

@carlobeltrame I think I'm through with reworking, feel free to review and request more docs! Also: Feel free to squash when merging, there's a lot of trial and error here… ^^

@cleverer
Copy link
Contributor Author

Update for all interested in this: I talked to Puzzle/hitobito, they unfortunately don't have capacity to look at this at the moment. I'll investigate if we can fork this under https://github.com/scout-ch

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.

None yet

2 participants