-
Notifications
You must be signed in to change notification settings - Fork 2
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
move environment initialization into separate script #95
Conversation
- copy it into image at a specific root location - source it in /etc/skel/.profile so it appears in default denv use - source it in /etc/entry.sh so it is still used in ldmx use
using shellcheck 0.8.0 with shellcheck -S style -s sh env-init.sh
external was only ever filled by ONNX runtime being downloaded by the CMake infrastructure. Since it was moved into the container image (v4.0), the external subdirectory of an install will only exist if the user specifically edits the cmake to use the older ONNX version. In this case, they will now need to also update their local copy of .profile to include that directory in LD_LIBRARY_PATH (if using denv) or edit the cmake to install ONNX in one of the paths already included.
The tests fail due to the
This can be fixed by editing
before source the
|
Reset
Since the libraries are the same between the old and new images, I don't need to re-compile. I just waited until after the "merge" check was done so that the tag on DockerHub points to the new set of image layers. Resume Testing
|
Edit the ldmx-sw/Dockerfile to use the diff --git a/Dockerfile b/Dockerfile
index a20e8973..1e47622a 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -3,7 +3,7 @@
# for the development image, look at the LDMX-Software/docker repo
###############################################################################
-FROM ldmx/dev:4.2.1
+FROM ldmx/dev:94-copy-env-to-skel
# install ldmx-sw into the container at /usr/local
COPY . /code I have podman on this particular computer so I'm going to test build the production image with that.1
Test run with
Test run with
Footnotes
|
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.
Alright, it appears like this update is not breaking the current setup and enables a smoother use of denv
. I am now passing on review to other parties who may be interested.
Whether you are testing denv
or ldmx
, make sure to switch to using the development image built with this branch: ldmx/dev:94-copy-env-to-skel
.
denv init ldmx/dev:94-copy-env-to-skel
# OR if denv init has already been done
denv config image ldmx/dev:94-copy-env-to-skel
# or if using ldmx
ldmx use dev 94-copy-env-to-skel
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.
The code changes look perfectly fine to me and I think I understand what the use-case is but maybe you could write down why this change makes denv easier to use?
There are two things this does that makes
|
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.
Looks good to me as well! Thanks!
Check List
Testing
Moving the env init into its own script opens the door to having both an entrypoint (used by the
ldmx
bash functions inldmx-sw/scripts/ldmx-env.sh
) and an updated.profile
(copied bydenv
into the working directory for the user). The entrypoint is tested by the CI, so I will focus on making sure the updated.profile
is useful when running the image withdenv
.Set Up
Just in case anyone in the future is reproducing this, I should emphasize that we need
to start from an empty denv.
denv
does not copy the skeleton files if they alreadyexist. In addition, in order to save time in start-up,
denv
creates an empty filesignalling to the entrypoint that it does not need to even check for skeleton files.
In short, I just started from an emtpy envrionment to avoid this.
Testing
Inside of the directory I want to be
LDMX_BASE
(on my computers I use~/code/ldmx
)This downloads the image if it isn't already downloaded.
Download the ldmx-sw source code.
Configure the build
Compile and install
Run the tests
Build production image
Make sure local build of production image can run a config