Skip to content

Add devcontainer config #54

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

Merged
merged 14 commits into from
Nov 18, 2024
Merged

Add devcontainer config #54

merged 14 commits into from
Nov 18, 2024

Conversation

dblnz
Copy link
Contributor

@dblnz dblnz commented Nov 12, 2024

The following dev container configuration can be found in the .devcontainer directory.
It contains:

  • devcontainer.json a configuration file for the Dev container that puts everything toghether
  • Dockerfile config for a base container image that is pre-built by using the .github/workflows/CreateDevcontainerImage.yml action that is automatically triggered when a change is detected for Dockerfile or the workflow configuration.
  • setup.sh script that changes the ownership for the /dev/kvm device inside the container so it can be accessible by the user

@dblnz dblnz changed the title Change the link to GHCR image Add devcontainer config Nov 12, 2024
@dblnz dblnz added good first issue Good for newcomers github-actions and removed good first issue Good for newcomers labels Nov 12, 2024
@dblnz dblnz requested a review from simongdavies November 12, 2024 13:57
The following dev container configuration can be found in the .devcontainer directory.
It contains:
- devcontainer.json a configuration file for the Dev container that puts everything toghether
- create_env.sh script that is run on the host machine and creates a .devcontainer/.env file that contains the necessary group info for the container image build phase
- Dockerfile.base config for a base container image that is pre-built by using the .github/workflows/CreateDevcontainerImage.yml action that is automatically triggered when a change is detected for Dockerfile.base or the workflow configuration.
- Dockerfile config that uses the pre-build image as a base image, creates a group with the same GID of the device being passed to the docker container and adds the user to that group

Note: The reason why the environment file generation is needed is because in order to access the device (/dev/kvm) inside the container, the user needs to belong to the correct group, so the group is created at image build time.

Signed-off-by: Doru Blânzeanu <dblnz@pm.me>
Signed-off-by: Doru Blânzeanu <dblnz@pm.me>
- This avoids creating a new group in a new container image
- Also there is no need for the environment file to be dynamically generated

Signed-off-by: Doru Blânzeanu <dblnz@pm.me>
@dblnz dblnz force-pushed the add-dev-container branch from 6714763 to 3beb33a Compare November 13, 2024 10:28
Signed-off-by: Doru Blânzeanu <dblnz@pm.me>
Signed-off-by: Doru Blânzeanu <dblnz@pm.me>
Signed-off-by: Doru Blânzeanu <dblnz@pm.me>
Signed-off-by: Doru Blânzeanu <dblnz@pm.me>
Signed-off-by: Doru Blânzeanu <dblnz@pm.me>
simongdavies
simongdavies previously approved these changes Nov 13, 2024
Copy link
Contributor

@simongdavies simongdavies left a comment

Choose a reason for hiding this comment

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

One small issue, this is great, thanks @dblnz

Signed-off-by: Doru Blânzeanu <dblnz@pm.me>
Signed-off-by: Doru Blânzeanu <dblnz@pm.me>
simongdavies
simongdavies previously approved these changes Nov 14, 2024
Signed-off-by: Doru Blânzeanu <dblnz@pm.me>
@dblnz dblnz merged commit dcbddc3 into hyperlight-dev:main Nov 18, 2024
23 checks passed
@dblnz dblnz deleted the add-dev-container branch March 4, 2025 12:17
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.

3 participants