-
Notifications
You must be signed in to change notification settings - Fork 203
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
Copy build log and artifacts to a permanent location after failures #4601
base: develop
Are you sure you want to change the base?
Conversation
b306ccd
to
092fcd0
Compare
I am not sure what is the best way to select the build directory so that I can move it to a more permanent location. That is at the moment I am recreating the location of the build path and then copy the directory to the destination path:
|
50d99c3
to
86fe081
Compare
@gkaf89 The For, for example, for So, I think you could create a subdirectory in the permanent storage location that uses the name of the easyconfig file (to keep it simple), and copy the contents of |
Yeah, the thing to copy should be |
1274a2b
to
b1a9da8
Compare
@gkaf89 If you need any help with this, do let us know! |
b1a9da8
to
6bc53e6
Compare
@boegel The commit is ready. I won't have enough time to familiarize myself with the test framework for the The commit can be tested by modifying the configuration options of some easyconfig that uses the system toolchain to cause a failure. For instance I added the option
in |
@gkaf89 There's a problem with the tests, looks like |
The failure is caused because the target location for permanent storage is the same as the source location. The steps I am following to resolve the issue:
|
b34ff11
to
5cfdfd1
Compare
@boegel Some edge cases where uncovered by the tests. The latest commit resolves the issue. I leave it up you if you prefer to move it to version 5. I am not familiar enough with the tests to test the PR extensively. |
@gkaf89 As briefly discussed during the conf call today, it would be good if you could add a test (or enhance an existing one, like Do let us know if you need any help with that! |
…failures The files can be build in some selected build path (--buildpath), and the logs of successful compilation are then concentrated to some other location for permanent storage (--logfile-format). Logs of failed builds remain in the build path location so that they can be inspected. However, this setup is problematic when building software in HPC jobs. Quite often in HPC systems the build path is set to some fast storage local to the node, like NVME raid mounted on `/tmp` or `/dev/shm` (as suggested in the documentation: https://docs.easybuild.io/configuration/#buildpath). The node storage is often wiped out after the end of a job, so the log files and the artifacts are no longer available after the termination of the job. This commit adds an option (--errorlogpath)to accumulate errors in some more permanent location, so that the can be easily inspected after a failed build.
Create tests for: - the `errorlogpath` option.
- There does not seem to be a field storing the path to the builddir of an easyblock relative to the base build path. In this refactored version the relative builddir is extracted from the full path and the base build path using the `os.path.relpath` function. - During the copying of the files, the operation may fail, for instance due to the lack of space in the target location or insufficient rights. Report the copying of the artifacts after the copy operations.
The function moves logs and artifacts of failed build in a special location for permanent storage.
The base builddir path is used to construct the builddir by - pre-pending the asboloute build path, and - adding a numerical suffix to ensure uniqueness.
The log messages mention both the temporary log file created in the build directory, and the path where the file is copied for permanent storage. This commits makes a distinction between the two path in the log messages.
- In testing multiple failures can occur in quick succession resulting in the same time stamp, and as a result in the same base error log path. Extent the path stamp with an increasing number (naive O(n^2) algorithm used at the moment, should be sufficient). - In case the user provides the same error log path as the build directory log path, add a check to prevent copying the files to prevent errors in the copying functions.
5cfdfd1
to
7f3e2c9
Compare
7f3e2c9
to
e7437a1
Compare
e7437a1
to
65f0294
Compare
The files can be build in some selected build path (--buildpath), and the logs of successful compilation are then concentrated to some other location for permanent storage (--logfile-format). Logs of failed builds remain in the build path location so that they can be inspected.
However, this setup is problematic when building software in HPC jobs. Quite often in HPC systems the build path is set to some fast storage local to the node, like NVME raid mounted on
/tmp
or/dev/shm
(as suggested in the documentation: https://docs.easybuild.io/configuration/#buildpath). The node storage is often wiped out after the end of a job, so the log files and the artifacts are no longer available after the termination of the job.This commit adds an option to accumulate errors in some more permanent location, so they can be easily inspected after a failed build.