adoptium / ci-jenkins-pipelines

jenkins pipeline build scripts
Apache License 2.0
19 stars 70 forks source link

WIP: Trial using `context.bat` instead of `context.sh` on Windows in docker #1103

Open sxa opened 3 weeks ago

sxa commented 3 weeks ago

This is very much a 'work-in-progress' / feasibility study with the intention of diagnosing the problem described in https://github.com/adoptium/infrastructure/issues/3714. The PR is not ready for review (since it's mostly debug information and experiments) but I'm creating it in the spirit of openness to go alongside the issue :-)

I have attempted to put comments against all of the context.sh operations which are performed inside the containers during a docker build to identify which ones are causing problems.

I have converted some of them to context.bat based on some of the trial runs (Noting that this cannot be a final solution as-is as it won't work on non-Windows systems unless an if windows block is used to switch between them).

The four-digit numbers in the battable lines are the line number in the openjdk_build_pipeline.groovy and the windbld numbers are the job runs of windbld which showed the problem, so are instances where we have definitely hit an issue with those.

github-actions[bot] commented 3 weeks ago

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"

sxa commented 3 weeks ago

run tests

sxa commented 3 weeks ago

@andrew-m-leonard FYI

This is really horrible, but it's to resolve issues with using context.sh in a docker container. I've trapped the situations that are occurring more often - I may need to do more but it's been fairly reliable since I got this far.

LMK what you think of this (Mostly the if windows && docker use context.bat else context.sh bits) - I'd love to hear other suggestions - would it work as a wrapper function for example?

The other changes in this WIP are pretty much just debug or downloading a workspace tarball to avoid me re-running the build each time to see how well it's working (about 7 minutes vs over 2 hours) so you can ignore those bits - obviously they won't be there if this gets to a stage where we're comfortable taking it out of draft.

sxa commented 3 weeks ago

run tests

eclipse-temurin-bot commented 3 weeks ago

 PR TESTER RESULT 

✅ All pipelines passed! ✅

sxa commented 3 weeks ago

Noting that while this branch is still being used for testing, it will likely get merged into a second PR to cover the refactoring described in https://github.com/adoptium/infrastructure/issues/3709#issuecomment-2333827072