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

Update reproducible comparing tests on linux (not docker image) #3687

Closed
4 of 5 tasks
sophia-guo opened this issue Mar 5, 2024 · 20 comments · Fixed by #3739
Closed
4 of 5 tasks

Update reproducible comparing tests on linux (not docker image) #3687

sophia-guo opened this issue Mar 5, 2024 · 20 comments · Fixed by #3739
Assignees
Labels
jenkins Issues that enhance or fix our jenkins server testing Issues that enhance or fix our test suites x-linux Issues that affect or relate to the x64/x32 LINUX OS

Comments

@sophia-guo
Copy link
Contributor

sophia-guo commented Mar 5, 2024

Part of #3683

@sophia-guo sophia-guo self-assigned this Mar 5, 2024
@github-actions github-actions bot added the x-linux Issues that affect or relate to the x64/x32 LINUX OS label Mar 5, 2024
@sophia-guo
Copy link
Contributor Author

Trying in adopitum jenkins with some necessary updates.
On test-ibmcloud-rhel7-x64-1 https://ci.adoptium.net/view/Test_system/job/Test_openjdk21_hs_dev.system_x86-64_linux/21/console

15:19:17  TESTING:
15:19:18  Loaded plugins: product-id, search-disabled-repos, subscription-manager
15:19:18  You need to be root to perform this command.

That is in linux_repro_build_compare.sh if it's rhel that some extra tools are needed to install https://github.com/adoptium/temurin-build/blob/master/tooling/reproducible/linux_repro_build_compare.sh#L27-L37. However jenkins doesn't have the permission.

@sophia-guo
Copy link
Contributor Author

For non-rhel for now jq is need to install, which also has the permission issue. Can we ask the infra to install jq, which is also required for windows. @andrew-m-leonard @sxa

@sophia-guo
Copy link
Contributor Author

SCM_REF build issue #3710

@sophia-guo
Copy link
Contributor Author

sophia-guo commented Mar 22, 2024

Upstream build is triggered by personal temrurin-build ( could be the old repo openjdk-build) branch and sha, which will cause build failed -

   {
      "name" : "Temurin Build Ref",
      "value" : "https://github.com/andrew-m-leonard/openjdk-build/commit/532e5d1f4c39c121b42303c8f29d69e007ce96fe"
    },
15:32:44  Cloning into 'temurin-build'...
15:32:45  error: pathspec '"532e5d1f4c39c121b42303c8f29d69e007ce96fe\n532e5d1f4c39c121b42303c8f29d69e007ce96fe\n532e5d1f4c39c121b42303c8f29d69e007ce96fe\n532e5d1f4c39c121b42303c8f29d69e007ce96fe\n532e5d1f4c39c121b42303c8f29d69e007ce96fe"' did not match any file(s) known to git.

@andrew-m-leonard should personal branch be supported?

@sophia-guo
Copy link
Contributor Author

@sophia-guo
Copy link
Contributor Author

sophia-guo commented Mar 25, 2024

#3687 (comment)

This happened if Temurin Build Ref is referred develper's personal repo.

However I've tried the release version with main repo got the similar issue. - Using release jdk22 linux-x64 https://ci.adoptium.net/job/build-scripts/job/release-openjdk22-pipeline/5/artifact/target/linux/x64/temurin/OpenJDK22U-sbom_x64_linux_hotspot_22_36.json/*view*/ I got similar error

16:36:01  error: pathspec '"e95140bf52915bda6c5ff271538789ed9a55162b\ne95140bf52915bda6c5ff271538789ed9a55162b\ne95140bf52915bda6c5ff271538789ed9a55162b\ne95140bf52915bda6c5ff271538789ed9a55162b\ne95140bf52915bda6c5ff271538789ed9a55162b"' did not match any file(s) known to git.
16:36:02  reproducibleCompare

https://ci.adoptium.net/view/Test_grinder/job/Grinder/9302/consoleFull

@sophia-guo
Copy link
Contributor Author

e95140b is the commit of branch https://github.com/adoptium/temurin-build/commits/v2024.03.01 , which is not in the master. Hence can't be found. Suppose reproducible comparing should support the release? @andrew-m-leonard

@andrew-m-leonard
Copy link
Contributor

e95140b is the commit of branch https://github.com/adoptium/temurin-build/commits/v2024.03.01 , which is not in the master. Hence can't be found. Suppose reproducible comparing should support the release? @andrew-m-leonard

Should it matter where the commitSHA is from ?

@sophia-guo
Copy link
Contributor Author

sophia-guo commented Mar 26, 2024

Shouldn't be. But, according to the test the sha can't be found.
https://ci.adoptium.net/view/Test_grinder/job/Grinder/9302/consoleFull

@andrew-m-leonard
Copy link
Contributor

I suspect this needs changing to not assume a git "branch" ? https://github.com/sophia-guo/openjdk-build/blob/33e187ebdab191756b3f6584ef3a24862e529d4c/test/system/reproducibleCompare/build.xml#L61
probably needs to clone, then do a checkout by SHA

@sophia-guo
Copy link
Contributor Author

The build.xml only pre stages all shell scripts. https://github.com/sophia-guo/openjdk-build/blob/33e187ebdab191756b3f6584ef3a24862e529d4c/test/system/reproducibleCompare/build.xml#L61.
The reproducible build params are coming from sbom.json file.

The issue can be easily reproduced with master branch by following command

docker run -v "$(TEST_RESROOT):/home/jenkins/test" -w "/home/jenkins/test" --name reproducibleCompare centos:7 /bin/bash /home/jenkins/test/linux_repro_build_compare.sh  /home/jenkins/jdkbinary/OpenJDK22U-sbom_x64_linux_hotspot_22_36.json /home/jenkins/jdkbinary/OpenJDK22U-jdk_x64_linux_hotspot_22_36.tar.gz

export $(TEST_RESROOT) to local temurin-build/tooling/reproducible. Download the jdkfile and sbom file to same directory. Update linux_repro_build_compare.sh to support local files.

@andrew-m-leonard
Copy link
Contributor

andrew-m-leonard commented Mar 27, 2024

The reproducible build params are coming from sbom.json file.

yeah, I am wondering if the SCM_REF for these examples in the SBOM should be empty ?
and in which case the git checkout should then checkout by openjdk_commit

@sophia-guo
Copy link
Contributor Author

sophia-guo commented Mar 27, 2024

The files are release files
https://ci.adoptium.net/job/build-scripts/job/release-openjdk22-pipeline/5/artifact/target/linux/x64/temurin/OpenJDK22U-jdk_x64_linux_hotspot_22_36.tar.gz

https://ci.adoptium.net/job/build-scripts/job/release-openjdk22-pipeline/5/artifact/target/linux/x64/temurin/OpenJDK22U-sbom_x64_linux_hotspot_22_36.json

        {
          "name" : "SCM Ref",
          "value" : "jdk-22+36_adopt"
        },
        {
          "name" : "OpenJDK Source Commit",
          "value" : "https://github.com/adoptium/jdk22/commit/1aa79b171e3f8b58852a01e08d82230565a01989"
        },
        {
          "name" : "Temurin Build Ref",
          "value" : "https://github.com/adoptium/temurin-build/commit/e95140bf52915bda6c5ff271538789ed9a55162b"

With linux it should be easily reproduced by

linux_repo_build_compare.sh https://ci.adoptium.net/job/build-scripts/job/release-openjdk22-pipeline/5/artifact/target/linux/x64/temurin/OpenJDK22U-sbom_x64_linux_hotspot_22_36.json https://ci.adoptium.net/job/build-scripts/job/release-openjdk22-pipeline/5/artifact/target/linux/x64/temurin/OpenJDK22U-jdk_x64_linux_hotspot_22_36.tar.gz 

@andrew-m-leonard
Copy link
Contributor

@sophia-guo The jq command needs fixing, the git checkout command it is running is:

(cd temurin-build && git checkout e95140bf52915bda6c5ff271538789ed9a55162b e95140bf52915bda6c5ff271538789ed9a55162b e95140bf52915bda6c5ff271538789ed9a55162b e95140bf52915bda6c5ff271538789ed9a55162b e95140bf52915bda6c5ff271538789ed9a55162b)

because jq is returning:

andrew@andrew:~/temurin-build/tooling/reproducible$ jq -r '.components[] | .properties[] | select (.name == "Temurin Build Ref") | .value' "OpenJDK22U-sbom_x64_linux_hotspot_22_36.json" | awk -F/ '{print $NF}'
e95140bf52915bda6c5ff271538789ed9a55162b
e95140bf52915bda6c5ff271538789ed9a55162b
e95140bf52915bda6c5ff271538789ed9a55162b
e95140bf52915bda6c5ff271538789ed9a55162b
e95140bf52915bda6c5ff271538789ed9a55162b

@sophia-guo
Copy link
Contributor Author

#3687 (comment)

I see. Seems SBOM file content changed. For this specific sbomfile there are 4 components ( jdk, jre, static-lib, debug). All properties of those 4 components are duplicate except filename itself.

@github-actions github-actions bot added jenkins Issues that enhance or fix our jenkins server testing Issues that enhance or fix our test suites labels Mar 28, 2024
@sophia-guo
Copy link
Contributor Author

The diff for reproducing release jdk22 is as following

diff -r jdk-22+36/release compare.1/jdk-22+36/release
11,13d10
< BUILD_SOURCE="git:e95140bf52915bda6c5ff271538789ed9a55162b"
< BUILD_SOURCE_REPO="https://github.com/adoptium/temurin-build.git"
< SOURCE_REPO="https://github.com/adoptium/jdk22.git"

That is for reproducing one the release file doesn't have those information, which is minor but not sure if it is expected. @andrew-m-leonard

@andrew-m-leonard
Copy link
Contributor

The diff for reproducing release jdk22 is as following

diff -r jdk-22+36/release compare.1/jdk-22+36/release
11,13d10
< BUILD_SOURCE="git:e95140bf52915bda6c5ff271538789ed9a55162b"
< BUILD_SOURCE_REPO="https://github.com/adoptium/temurin-build.git"
< SOURCE_REPO="https://github.com/adoptium/jdk22.git"

That is for reproducing one the release file doesn't have those information, which is minor but not sure if it is expected. @andrew-m-leonard

I thought that should be clean'd by this

sed -i '/^BUILD_SOURCE=.*$/d' "${DIR}/release"

@sophia-guo
Copy link
Contributor Author

Linux_repro_build_compare.sh doesn't use the repro_common.sh

@andrew-m-leonard
Copy link
Contributor

Linux_repro_build_compare.sh doesn't use the repro_common.sh

Ah yes, so we should re-use that clean method to make these compare if possible?

@sophia-guo
Copy link
Contributor Author

We can do in separate issue or pr later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jenkins Issues that enhance or fix our jenkins server testing Issues that enhance or fix our test suites x-linux Issues that affect or relate to the x64/x32 LINUX OS
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants