Skip to content

Clean up temp directory#23316

Open
AswathySK wants to merge 2 commits intoeclipse-openj9:masterfrom
AswathySK:temp_clean
Open

Clean up temp directory#23316
AswathySK wants to merge 2 commits intoeclipse-openj9:masterfrom
AswathySK:temp_clean

Conversation

@AswathySK
Copy link
Contributor

The current cleanup script only removes temporary files from the /tmp directory, which is insufficient for Windows machines running Jenkins agents. Some Windows machines are getting disconnected due to low disk space. Upon investigation, it was found that C:\temp (or the directory specified by the TEMP environment variable) accumulates around 75GB of data, causing disk space exhaustion.

To resolve this, the cleanup script needs to be enhanced to include commands for clearing files from C:\temp or the machine’s designated TEMP directory. This will help prevent disconnections and ensure consistent performance of Jenkins agents by freeing up disk space
#https://github.ibm.com/runtimes/infrastructure/issues/10482

Signed-off-by: Aswathy S Kumar <aswathyskumar144@gmail.com>
// test resources
cleanDirsStr += " ${buildWorkspace}/../../"
cleanDirsStr += cleanDirs.join(" ${buildWorkspace}/../../")
cleanDirsStr += " /cygdrive/c/temp/${cleanDirs.join(' /cygdrive/c/temp/')}"
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should use the relevant environment variable(s) (e.g. TEMP mentioned in the description) instead of hard-coding that path.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@keithc-ca I have made the correction. Can I go ahead and squash the commits?

Signed-off-by: Aswathy S Kumar <aswathyskumar144@gmail.com>
// test resources
cleanDirsStr += " ${buildWorkspace}/../../"
cleanDirsStr += cleanDirs.join(" ${buildWorkspace}/../../")
cleanDirsStr += " ${tempDir}/${cleanDirs.join(" ${tempDir}/")}"
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't expect tempDir is accessible here; it should be defined here.
Variable references should use ${}.
Double-quotes don't nest (on line 169).
I suggest we need to supply a default for TEMP:

                                        def tempDir = "${env.TEMP}" ?: "/cygdrive/c/temp"
                                        // convert to unix path
                                        tempDir = sh(script: "cygpath -u '${tempDir}'", returnStdout: true).trim()
                                        cleanDirsStr += " ${tempDir}/${cleanDirs.join(' ${tempDir}/')}"

@keithc-ca
Copy link
Contributor

Please rebase to avoid implicit merges (e.g. with #23311).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants