Skip to content

Conversation

@lostluck
Copy link
Contributor

@lostluck lostluck commented Aug 16, 2021

Without this change a redundant /build/ appears on the copy path, leading to the rule doing nothing.

Before, after clearing sdks/java/container/build and sdks/java/container/java8/build.

> Task :sdks:java:container:java8:copyJavaThirdPartyLicenses NO-SOURCE
file or directory '/home/rebo/git/src/github.com/apache/beam/sdks/java/container/build/build/target/third_party_licenses', not found
Skipping task ':sdks:java:container:java8:copyJavaThirdPartyLicenses' as it has no source files and no previous output files.
:sdks:java:container:java8:copyJavaThirdPartyLicenses (Thread[Execution worker for ':',5,main]) completed. Took 0.0 secs.
:sdks:java:container:java8:dockerPrepare (Thread[Execution worker for ':',5,main]) started.

The job then fails to build the Dockerfile.

Step 13/18 : ADD target/third_party_licenses /opt/apache/beam/third_party_licenses/
ADD failed: stat /var/lib/docker/tmp/docker-builder213254890/target/third_party_licenses: no such file or directory

However, a subsequent run succeeds but still produces the same error:

> Task :sdks:java:container:java8:copyJavaThirdPartyLicenses NO-SOURCE
file or directory '/home/rebo/git/src/github.com/apache/beam/sdks/java/container/build/build/target/third_party_licenses', not found
Skipping task ':sdks:java:container:java8:copyJavaThirdPartyLicenses' as it has no source files and no previous output files.
:sdks:java:container:java8:copyJavaThirdPartyLicenses (Thread[Execution worker for ':' Thread 3,5,main]) completed. Took 0.0 secs.
:sdks:java:container:java8:copyLicenses (Thread[Execution worker for ':' Thread 3,5,main]) started.

It's not clear why the 2nd run succeeds at all, or how the license files are making it the second time around, however, this PR resolves the issue immeadiately.

After the fix in this PR, the rule produces the following

> Task :sdks:java:container:java8:copyJavaThirdPartyLicenses
Caching disabled for task ':sdks:java:container:java8:copyJavaThirdPartyLicenses' because:
  Caching has not been enabled for the task
Task ':sdks:java:container:java8:copyJavaThirdPartyLicenses' is not up-to-date because:
  No history is available.
Watching 12568 directories to track changes
Watching 12859 directories to track changes
:sdks:java:container:java8:copyJavaThirdPartyLicenses (Thread[Execution worker for ':' Thread 3,5,main]) completed. Took 0.341 secs.
:sdks:java:container:java8:copyDockerfileDependencies (Thread[Execution worker for ':' Thread 3,5,main]) started.

and the Dockerfile succeeds on the first try.


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Choose reviewer(s) and mention them in a comment (R: @username).
  • Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

ValidatesRunner compliance status (on master branch)

Lang ULR Dataflow Flink Samza Spark Twister2
Go --- Build Status Build Status Build Status Build Status ---
Java Build Status Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Python --- Build Status
Build Status
Build Status
Build Status
Build Status
Build Status Build Status ---
XLang Build Status Build Status Build Status Build Status Build Status ---

Examples testing status on various runners

Lang ULR Dataflow Flink Samza Spark Twister2
Go --- --- --- --- --- --- ---
Java --- Build Status
Build Status
Build Status
--- --- --- --- ---
Python --- --- --- --- --- --- ---
XLang --- --- --- --- --- --- ---

Post-Commit SDK/Transform Integration Tests Status (on master branch)

Go Java Python
Build Status Build Status Build Status
Build Status
Build Status

Pre-Commit Tests Status (on master branch)

--- Java Python Go Website Whitespace Typescript
Non-portable Build Status
Build Status
Build Status
Build Status
Build Status
Build Status Build Status Build Status Build Status
Portable --- Build Status Build Status --- --- ---

See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests

See CI.md for more information about GitHub Actions CI.

@youngoli
Copy link
Contributor

This PR is fixing an issue that occurs when building a container with a clean docker cache. So if you follow these steps you can probably replicate it:

  1. Delete sdks/java/container/build and sdks/java/container/java8/build. (You might have to avoid some read-only directories, just delete everything else)
  2. Run ./gradlew -Pdocker-pull-licenses :sdks:java:container:java8:docker. It should fail with a complaint about a missing third_party_license directory.
  3. Run the same command again. It should work this time.

The specific error that it fails with is:

Step 13/18 : ADD target/third_party_licenses /opt/apache/beam/third_party_licenses/
[...]
ADD failed: stat /var/lib/docker/tmp/docker-builder099525146/target/third_party_licenses: no such file or directory

I can confirm that making this change fixes the issue on my machine at least.

@lostluck lostluck changed the title redundant build Remove redundant build from copy path. Aug 16, 2021
@lostluck
Copy link
Contributor Author

Run Go Flink ValidatesRunner

@lostluck lostluck changed the title Remove redundant build from copy path. [BEAM-12763] Remove redundant build from copy path. Aug 16, 2021
@lostluck
Copy link
Contributor Author

Run Java_Examples_Dataflow PreCommit

@lostluck lostluck changed the title [BEAM-12763] Remove redundant build from copy path. [BEAM-12763] Remove redundant build from copy path in copyJavaThirdPartyLicenses rule Aug 16, 2021
@lostluck
Copy link
Contributor Author

R: @youngoli
cc: @emilymye

@youngoli youngoli merged commit ecb8cbb into apache:master Aug 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants