-
Notifications
You must be signed in to change notification settings - Fork 27
Devcontainer improvements #1137
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
Open
hacki11
wants to merge
24
commits into
ioBroker:master
Choose a base branch
from
hacki11:devcontainer-improvements
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- include adapter name in the devcontainer name to be able to distinguish between different opened vscode instances - use forwardPorts to make it accessible in the vscode tab "ports" - use portsAttributes to give the port a name - update the position of settings and extensions due to schema update - put the postcreate commands into a separate script - allow to extend the post create script with custom script to i.e. configure the adapter with a test configuration automatically - make the iobroker (non-root) user the default user to not get permission problems because files created or modified (also .git/ files) will be owned by root and working outside the devcontainer is a problem then postcreate.sh - create and stop a new instance of the adapter in questions to avoid the manual task - execute a custom script (postcreate_ext.sh) if the user provided one, so this file can stay as is docker-compose.yml - remove obsolete version attribute - remove persisting the iobroker data to a volume - this will defeat the purpose of "rebuild container" because the volume still stays the same. This causes side effects. A dev container is build and created once, and recreated from scrach if needed. All configuration which is needed for a test must be done in the post create extension script. That way the devcontainer is robust and is always created correctly. - use non-default ports for the main redis instance, to be able to call integration tests which also start a redis instance on default ports. - remove the static port mapping to 8082 as it prevents to be able to open devcontainers of two different adapters at the same time. instead rely on the feature of vscode to dynamically assign a available host port.
change postcreate from chaining commands to set -e simplify custom script execution avoid the need for execution permissions
call npm install on post create
- move node_modules to / so also non-root is able to use this global node_modules dir - add node wrapper due capability/non-root/debug issue in nodejs which is a open bug - rewrite the entrypoint to be able to forward the log into the devcontainer log boot.sh - use boot.sh to tee the log of the entrypoint into a log file which can be tail'd in the poststart/postcreate node-wrapper.sh - add a node wrapper to support non-root debugging even with cap_net_raw capability devcontainer.json - upper case B in ioBroker - add a poststart script to also show the boot log when the container was created already postcreate.sh - add some echos - add wait for script to avoid race conditions - find adapter name automatically poststart.sh - show boot.log also during container start wait_for_iobroker.sh - make sure we don't run into a race condition with the entrypoint which runs in the background
- fix path to custom postcreate
update style flavor fix typos
- fix indendation
Some adapters already using this configuration successfully: https://github.com/hacki11/ioBroker.valloxmv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Checklist:
npm run build
npm test
.github/create_templates.ts
)docs/updates
explaining what the user needs to do when manually updating an existing projectCHANGELOG.md
(referencing the migration description and this PR or the issue you fixed)Description:
Dev Container Improvements
This pull request brings the improvements and relevant changes to the Dev Container setup for ioBroker adapter development, focusing on robustness, reliability and usability. Key updates include:
More:
Dev Container Improvements
Allow newer versions of
admin
How to test:
Select
Reopen in Container
in VS Code.This PR also includes #1135