Add install step for developers #1492
Merged
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.
The developer experience is currently rather poor for developers using our Docker environment. Without custom patches, the only way to test new code changes is to rebuild the image and start a new container.
Given that we now have separate production and development configurations, I thought it might be helpful to upstream an installation patch I have been using locally for some time. The source code directory is mounted as a read-only volume in
/cdash_src, and thecdash_installalias runs a script which copies new code changes into the/cdashdirectory. This is particularly useful when paired with a separate terminal session runningnpm run watch-poll, which automatically compiles all of our static assets with mix whenever new changes are made.The alternative to this approach is to to simply mount
/cdashas a shared volume. The downside of mounting a shared volume to/cdashis that the volume must either be read-only, with all compilation occurring on the host side, and thus requiring the developer to havenpmandphp/composerinstalled, or to have a read-write volume with the potential for code running in the container to inadvertently overwrite the source code on the host. After accidentally writing files in the midst of my local source code several times, I found that mounting a read-only volume to/cdash_srcand then copying the code to/cdashwas the most effective way to develop CDash.I've personally found that the changes in this PR vastly improve my productivity as a CDash developer but I'm interested in any comments other developers may have regarding this matter.