Skip to content
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

Windows docker build ensure cleanWorkspace cleans build tmp workspace #1167

Merged
merged 9 commits into from
Dec 18, 2024

Conversation

andrew-m-leonard
Copy link
Contributor

@andrew-m-leonard andrew-m-leonard commented Dec 17, 2024

For Windows which builds within a tmp workspace, ensure when CLEAN_WORKSPACE is specified it is honoured.

Also, changed pr-tester default setting to cleanWorkspace prior to tester builds, which should now ensure windows host cleans workspace before container build

Some test builds:

@andrew-m-leonard andrew-m-leonard self-assigned this Dec 17, 2024
Copy link

Thank you for creating a pull request!

Please check out the information below if you have not made a pull request here before (or if you need a reminder how things work).

Code Quality and Contributing Guidelines

If you have not done so already, please familiarise yourself with our Contributing Guidelines and Code Of Conduct, even if you have contributed before.

Tests

Github actions will run a set of jobs against your PR that will lint and unit test your changes. Keep an eye out for the results from these on the latest commit you submitted. For more information, please see our testing documentation.

In order to run the advanced pipeline tests (executing a set of mock pipelines), it requires an admin to post run tests on this PR.
If you are not an admin, please ask for one's attention in #infrastructure on Slack or ping one here.
To run full set of tests, use "run tests"; a subset of tests on specific jdk version, use "run tests quick 11,21"

@andrew-m-leonard
Copy link
Contributor Author

run tests

Copy link
Member

@sxa sxa left a comment

Choose a reason for hiding this comment

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

LGTM. This looks to do the correct thing when the workspace directory is owned by the user in the container's host system due to a problematic earlier run. Noting that for this to be effective CLEAN_WORKSPACE needs to be set to true so perhaps we should also consider changing that to be the default in the PR tester.

pipelines/build/common/openjdk_build_pipeline.groovy Outdated Show resolved Hide resolved
@eclipse-temurin-bot
Copy link
Collaborator

 PR TESTER RESULT 

❎ Some pipelines failed or the job was aborted! ❎
See the pipeline-build-check below for more information...

@andrew-m-leonard andrew-m-leonard requested a review from sxa December 18, 2024 09:27
@github-actions github-actions bot added aarch windows x64 Issues that affect or relate to the x64/x32 LINUX OS labels Dec 18, 2024
Copy link
Member

@sxa sxa left a comment

Choose a reason for hiding this comment

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

If I'm reading updates to this PR correctly it's masking some errors and just printing a warning now instead, so potentially continuing even if things aren't being cleaned up, therefore there seems to be a risk of running the builds with out of date things in the workspace.
I feel we should be aborting if such a condition occurs generally - is there a reason to mask the cleanup failure?

Also bear in mind that in the block around rm -rf that is a command that cannot return a failure error code, so I don't believe the catch block can be triggered.

pipelines/build/common/openjdk_build_pipeline.groovy Outdated Show resolved Hide resolved
pipelines/build/common/openjdk_build_pipeline.groovy Outdated Show resolved Hide resolved
pipelines/build/common/openjdk_build_pipeline.groovy Outdated Show resolved Hide resolved
@andrew-m-leonard
Copy link
Contributor Author

If I'm reading updates to this PR correctly it's masking some errors and just printing a warning now instead, so potentially continuing even if things aren't being cleaned up, therefore there seems to be a risk of running the builds with out of date things in the workspace. I feel we should be aborting if such a condition occurs generally - is there a reason to mask the cleanup failure?

Also bear in mind that in the block around rm -rf that is a command that cannot return a failure error code, so I don't believe the catch block can be triggered.

@sxa Note this is "post-build" cleanup if cleanWorkspaceAfter=true, which I believe will always fail for docker as the ci-jenkins-pipelines|temurin-build repo checkout is done by host, also note the hidden file cleanup was already within a catch clause

Note the outer catch can be for a Jenkins context.timeout

@andrew-m-leonard
Copy link
Contributor Author

run tests

@sxa
Copy link
Member

sxa commented Dec 18, 2024

Also bear in mind that in the block around rm -rf that is a command that cannot return a failure error code

Hmm apparently it does specifically in the Permission denied case. I retract that comment.

@sxa
Copy link
Member

sxa commented Dec 18, 2024

this is "post-build" cleanup if cleanWorkspaceAfter=true, which I believe will always fail for docker

Fair point. I'm now not so convinced it should have the ERROR: prefix now, but I'll leave it to you :-)

@andrew-m-leonard
Copy link
Contributor Author

I'm now not so convinced it should have the ERROR: prefix now, but I'll leave it to you :-)

yeah good point, i'll change to WARNING

Copy link
Contributor

@adamfarley adamfarley left a comment

Choose a reason for hiding this comment

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

LGTM

@andrew-m-leonard
Copy link
Contributor Author

run tests

@karianna karianna merged commit 5bb8310 into adoptium:master Dec 18, 2024
27 of 28 checks passed
@eclipse-temurin-bot
Copy link
Collaborator

 PR TESTER RESULT 

✅ All pipelines passed! ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aarch docker jenkins-pipeline testing windows x64 Issues that affect or relate to the x64/x32 LINUX OS
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants