You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2020/08/29 03:15:41 UTC

[GitHub] [beam] y1chi opened a new pull request #12727: Add option to prebuild python sdk container

y1chi opened a new pull request #12727:
URL: https://github.com/apache/beam/pull/12727


   **Please** add a meaningful description for your change here
   
   ------------------------
   
   Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
   
    - [ ] [**Choose reviewer(s)**](https://beam.apache.org/contribute/#make-your-change) 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](https://www.apache.org/licenses/icla.pdf).
   
   See the [Contributor Guide](https://beam.apache.org/contribute) for more tips on [how to make review process smoother](https://beam.apache.org/contribute/#make-reviewers-job-easier).
   
   Post-Commit Tests Status (on master branch)
   ------------------------------------------------------------------------------------------------
   
   Lang | SDK | Dataflow | Flink | Samza | Spark | Twister2
   --- | --- | --- | --- | --- | --- | ---
   Go | [![Build Status](https://ci-beam.apache.org/job/beam_PostCommit_Go/lastCompletedBuild/badge/icon)](https://ci-beam.apache.org/job/beam_PostCommit_Go/lastCompletedBuild/) | --- | [![Build Status](https://ci-beam.apache.org/job/beam_PostCommit_Go_VR_Flink/lastCompletedBuild/badge/icon)](https://ci-beam.apache.org/job/beam_PostCommit_Go_VR_Flink/lastCompletedBuild/) | --- | [![Build Status](https://ci-beam.apache.org/job/beam_PostCommit_Go_VR_Spark/lastCompletedBuild/badge/icon)](https://ci-beam.apache.org/job/beam_PostCommit_Go_VR_Spark/lastCompletedBuild/) | ---
   Java | [![Build Status](https://ci-beam.apache.org/job/beam_PostCommit_Java/lastCompletedBuild/badge/icon)](https://ci-beam.apache.org/job/beam_PostCommit_Java/lastCompletedBuild/) | [![Build Status](https://ci-beam.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Dataflow/lastCompletedBuild/badge/icon)](https://ci-beam.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Dataflow/lastCompletedBuild/)<br>[![Build Status](https://ci-beam.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Dataflow_Java11/lastCompletedBuild/badge/icon)](https://ci-beam.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Dataflow_Java11/lastCompletedBuild/) | [![Build Status](https://ci-beam.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Flink/lastCompletedBuild/badge/icon)](https://ci-beam.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Flink/lastCompletedBuild/)<br>[![Build Status](https://ci-beam.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Flink_Java11/lastCompletedBuild/badge/i
 con)](https://ci-beam.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Flink_Java11/lastCompletedBuild/)<br>[![Build Status](https://ci-beam.apache.org/job/beam_PostCommit_Java_PVR_Flink_Batch/lastCompletedBuild/badge/icon)](https://ci-beam.apache.org/job/beam_PostCommit_Java_PVR_Flink_Batch/lastCompletedBuild/)<br>[![Build Status](https://ci-beam.apache.org/job/beam_PostCommit_Java_PVR_Flink_Streaming/lastCompletedBuild/badge/icon)](https://ci-beam.apache.org/job/beam_PostCommit_Java_PVR_Flink_Streaming/lastCompletedBuild/) | [![Build Status](https://ci-beam.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Samza/lastCompletedBuild/badge/icon)](https://ci-beam.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Samza/lastCompletedBuild/) | [![Build Status](https://ci-beam.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Spark/lastCompletedBuild/badge/icon)](https://ci-beam.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Spark/lastCompletedBuild/)<br>[![Build Status](htt
 ps://ci-beam.apache.org/job/beam_PostCommit_Java_PVR_Spark_Batch/lastCompletedBuild/badge/icon)](https://ci-beam.apache.org/job/beam_PostCommit_Java_PVR_Spark_Batch/lastCompletedBuild/)<br>[![Build Status](https://ci-beam.apache.org/job/beam_PostCommit_Java_ValidatesRunner_SparkStructuredStreaming/lastCompletedBuild/badge/icon)](https://ci-beam.apache.org/job/beam_PostCommit_Java_ValidatesRunner_SparkStructuredStreaming/lastCompletedBuild/) | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Twister2/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Twister2/lastCompletedBuild/)
   Python | [![Build Status](https://ci-beam.apache.org/job/beam_PostCommit_Python2/lastCompletedBuild/badge/icon)](https://ci-beam.apache.org/job/beam_PostCommit_Python2/lastCompletedBuild/)<br>[![Build Status](https://ci-beam.apache.org/job/beam_PostCommit_Python35/lastCompletedBuild/badge/icon)](https://ci-beam.apache.org/job/beam_PostCommit_Python35/lastCompletedBuild/)<br>[![Build Status](https://ci-beam.apache.org/job/beam_PostCommit_Python36/lastCompletedBuild/badge/icon)](https://ci-beam.apache.org/job/beam_PostCommit_Python36/lastCompletedBuild/)<br>[![Build Status](https://ci-beam.apache.org/job/beam_PostCommit_Python37/lastCompletedBuild/badge/icon)](https://ci-beam.apache.org/job/beam_PostCommit_Python37/lastCompletedBuild/)<br>[![Build Status](https://ci-beam.apache.org/job/beam_PostCommit_Python38/lastCompletedBuild/badge/icon)](https://ci-beam.apache.org/job/beam_PostCommit_Python38/lastCompletedBuild/) | [![Build Status](https://ci-beam.apache.org/job/beam_PostCommit_
 Py_VR_Dataflow/lastCompletedBuild/badge/icon)](https://ci-beam.apache.org/job/beam_PostCommit_Py_VR_Dataflow/lastCompletedBuild/)<br>[![Build Status](https://ci-beam.apache.org/job/beam_PostCommit_Py_VR_Dataflow_V2/lastCompletedBuild/badge/icon)](https://ci-beam.apache.org/job/beam_PostCommit_Py_VR_Dataflow_V2/lastCompletedBuild/)<br>[![Build Status](https://ci-beam.apache.org/job/beam_PostCommit_Py_ValCont/lastCompletedBuild/badge/icon)](https://ci-beam.apache.org/job/beam_PostCommit_Py_ValCont/lastCompletedBuild/) | [![Build Status](https://ci-beam.apache.org/job/beam_PreCommit_Python2_PVR_Flink_Cron/lastCompletedBuild/badge/icon)](https://ci-beam.apache.org/job/beam_PreCommit_Python2_PVR_Flink_Cron/lastCompletedBuild/)<br>[![Build Status](https://ci-beam.apache.org/job/beam_PostCommit_Python35_VR_Flink/lastCompletedBuild/badge/icon)](https://ci-beam.apache.org/job/beam_PostCommit_Python35_VR_Flink/lastCompletedBuild/) | --- | [![Build Status](https://ci-beam.apache.org/job/beam_P
 ostCommit_Python_VR_Spark/lastCompletedBuild/badge/icon)](https://ci-beam.apache.org/job/beam_PostCommit_Python_VR_Spark/lastCompletedBuild/) | ---
   XLang | [![Build Status](https://ci-beam.apache.org/job/beam_PostCommit_XVR_Direct/lastCompletedBuild/badge/icon)](https://ci-beam.apache.org/job/beam_PostCommit_XVR_Direct/lastCompletedBuild/) | --- | [![Build Status](https://ci-beam.apache.org/job/beam_PostCommit_XVR_Flink/lastCompletedBuild/badge/icon)](https://ci-beam.apache.org/job/beam_PostCommit_XVR_Flink/lastCompletedBuild/) | --- | [![Build Status](https://ci-beam.apache.org/job/beam_PostCommit_XVR_Spark/lastCompletedBuild/badge/icon)](https://ci-beam.apache.org/job/beam_PostCommit_XVR_Spark/lastCompletedBuild/) | ---
   
   Pre-Commit Tests Status (on master branch)
   ------------------------------------------------------------------------------------------------
   
   --- |Java | Python | Go | Website | Whitespace
   --- | --- | --- | --- | --- | ---
   Non-portable | [![Build Status](https://ci-beam.apache.org/job/beam_PreCommit_Java_Cron/lastCompletedBuild/badge/icon)](https://ci-beam.apache.org/job/beam_PreCommit_Java_Cron/lastCompletedBuild/) | [![Build Status](https://ci-beam.apache.org/job/beam_PreCommit_Python_Cron/lastCompletedBuild/badge/icon)](https://ci-beam.apache.org/job/beam_PreCommit_Python_Cron/lastCompletedBuild/)<br>[![Build Status](https://ci-beam.apache.org/job/beam_PreCommit_PythonLint_Cron/lastCompletedBuild/badge/icon)](https://ci-beam.apache.org/job/beam_PreCommit_PythonLint_Cron/lastCompletedBuild/)<br>[![Build Status](https://ci-beam.apache.org/job/beam_PreCommit_PythonDocker_Cron/badge/icon)](https://ci-beam.apache.org/job/beam_PreCommit_PythonDocker_Cron/lastCompletedBuild/) <br>[![Build Status](https://ci-beam.apache.org/job/beam_PreCommit_PythonDocs_Cron/badge/icon)](https://ci-beam.apache.org/job/beam_PreCommit_PythonDocs_Cron/lastCompletedBuild/) | [![Build Status](https://ci-beam.apache.org/job/be
 am_PreCommit_Go_Cron/lastCompletedBuild/badge/icon)](https://ci-beam.apache.org/job/beam_PreCommit_Go_Cron/lastCompletedBuild/) | [![Build Status](https://ci-beam.apache.org/job/beam_PreCommit_Website_Cron/lastCompletedBuild/badge/icon)](https://ci-beam.apache.org/job/beam_PreCommit_Website_Cron/lastCompletedBuild/) | [![Build Status](https://ci-beam.apache.org/job/beam_PreCommit_Whitespace_Cron/lastCompletedBuild/badge/icon)](https://ci-beam.apache.org/job/beam_PreCommit_Whitespace_Cron/lastCompletedBuild/)
   Portable | --- | [![Build Status](https://ci-beam.apache.org/job/beam_PreCommit_Portable_Python_Cron/lastCompletedBuild/badge/icon)](https://ci-beam.apache.org/job/beam_PreCommit_Portable_Python_Cron/lastCompletedBuild/) | --- | --- | ---
   
   See [.test-infra/jenkins/README](https://github.com/apache/beam/blob/master/.test-infra/jenkins/README.md) for trigger phrase, status and link of all Jenkins jobs.
   
   
   GitHub Actions Tests Status (on master branch)
   ------------------------------------------------------------------------------------------------
   ![Build python source distribution and wheels](https://github.com/apache/beam/workflows/Build%20python%20source%20distribution%20and%20wheels/badge.svg)
   ![Python tests](https://github.com/apache/beam/workflows/Python%20tests/badge.svg)
   ![Java tests](https://github.com/apache/beam/workflows/Java%20Tests/badge.svg)
   
   See [CI.md](https://github.com/apache/beam/blob/master/CI.md) for more information about GitHub Actions CI.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] robertwb commented on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
robertwb commented on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-685188645


   I think the general idea can be done in such a way that is useful to all runners (though for Dataflow we might use CloudBuild while defaulting to using a local docker (if available) otherwise). I agree a bit more design would be good. 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: Add option to prebuild python sdk container

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/a99c6826a067f49ebb60e625c8652900c7d0e810?el=desc) will **increase** coverage by `5.88%`.
   > The diff coverage is `33.80%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   + Coverage   34.32%   40.21%   +5.88%     
   ==========================================
     Files         694      455     -239     
     Lines       82226    53738   -28488     
     Branches     9294        0    -9294     
   ==========================================
   - Hits        28225    21610    -6615     
   + Misses      53578    32128   -21450     
   + Partials      423        0     -423     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `20.20% <28.57%> (ø)` | |
   | [...che\_beam/runners/dataflow/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `34.37% <34.37%> (ø)` | |
   | [io/avroio.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vYXZyb2lvLnB5) | | |
   | [transforms/cy\_combiners.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dHJhbnNmb3Jtcy9jeV9jb21iaW5lcnMucHk=) | | |
   | [ml/gcp/visionml\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-bWwvZ2NwL3Zpc2lvbm1sX3Rlc3QucHk=) | | |
   | [utils/retry\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dXRpbHMvcmV0cnlfdGVzdC5weQ==) | | |
   | [io/filebasedsink\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vZmlsZWJhc2Vkc2lua190ZXN0LnB5) | | |
   | [runners/dataflow/dataflow\_metrics.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9kYXRhZmxvdy9kYXRhZmxvd19tZXRyaWNzLnB5) | | |
   | [examples/cookbook/multiple\_output\_pardo.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZXhhbXBsZXMvY29va2Jvb2svbXVsdGlwbGVfb3V0cHV0X3BhcmRvLnB5) | | |
   | [ml/gcp/cloud\_dlp.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-bWwvZ2NwL2Nsb3VkX2RscC5weQ==) | | |
   | ... and [1141 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [a99c682...2c4505c](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: Add option to prebuild python sdk container

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/a99c6826a067f49ebb60e625c8652900c7d0e810?el=desc) will **increase** coverage by `5.88%`.
   > The diff coverage is `33.80%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   + Coverage   34.32%   40.21%   +5.88%     
   ==========================================
     Files         694      455     -239     
     Lines       82226    53738   -28488     
     Branches     9294        0    -9294     
   ==========================================
   - Hits        28225    21610    -6615     
   + Misses      53578    32128   -21450     
   + Partials      423        0     -423     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `20.20% <28.57%> (ø)` | |
   | [...che\_beam/runners/dataflow/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `34.37% <34.37%> (ø)` | |
   | [...ners/portability/flink\_uber\_jar\_job\_server\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9wb3J0YWJpbGl0eS9mbGlua191YmVyX2phcl9qb2Jfc2VydmVyX3Rlc3QucHk=) | | |
   | [runners/worker/worker\_status\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy93b3JrZXIvd29ya2VyX3N0YXR1c190ZXN0LnB5) | | |
   | [io/aws/clients/s3/messages.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vYXdzL2NsaWVudHMvczMvbWVzc2FnZXMucHk=) | | |
   | [io/localfilesystem.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vbG9jYWxmaWxlc3lzdGVtLnB5) | | |
   | [examples/wordcount\_minimal\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZXhhbXBsZXMvd29yZGNvdW50X21pbmltYWxfdGVzdC5weQ==) | | |
   | [transforms/combiners\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dHJhbnNmb3Jtcy9jb21iaW5lcnNfdGVzdC5weQ==) | | |
   | [transforms/external\_test\_py3.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dHJhbnNmb3Jtcy9leHRlcm5hbF90ZXN0X3B5My5weQ==) | | |
   | [...es/snippets/transforms/elementwise/flatmap\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZXhhbXBsZXMvc25pcHBldHMvdHJhbnNmb3Jtcy9lbGVtZW50d2lzZS9mbGF0bWFwX3Rlc3QucHk=) | | |
   | ... and [1141 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [a99c682...2c4505c](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] robertwb commented on a change in pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
robertwb commented on a change in pull request #12727:
URL: https://github.com/apache/beam/pull/12727#discussion_r492283727



##########
File path: sdks/python/apache_beam/runners/portability/stager.py
##########
@@ -119,6 +119,7 @@ def create_job_resources(options,  # type: PipelineOptions
                            temp_dir,  # type: str
                            build_setup_args=None,  # type: Optional[List[str]]
                            populate_requirements_cache=None,  # type: Optional[str]
+                           skip_boot_dependencies=False, # type: Optional[bool]

Review comment:
       It seems the pickled main session should get staged like everything else. The java jars belong to the java environment, and should get staged in the java container image, not here. (But again, maybe this is a Dataflow issue, and will be taken care of when that is cleaned up.)




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: Add option to prebuild python sdk container

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/a99c6826a067f49ebb60e625c8652900c7d0e810?el=desc) will **increase** coverage by `5.88%`.
   > The diff coverage is `33.80%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   + Coverage   34.32%   40.21%   +5.88%     
   ==========================================
     Files         694      455     -239     
     Lines       82226    53738   -28488     
     Branches     9294        0    -9294     
   ==========================================
   - Hits        28225    21610    -6615     
   + Misses      53578    32128   -21450     
   + Partials      423        0     -423     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `20.20% <28.57%> (ø)` | |
   | [...che\_beam/runners/dataflow/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `34.37% <34.37%> (ø)` | |
   | [runners/worker/statesampler\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy93b3JrZXIvc3RhdGVzYW1wbGVyX3Rlc3QucHk=) | | |
   | [typehints/decorators\_test\_py3.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dHlwZWhpbnRzL2RlY29yYXRvcnNfdGVzdF9weTMucHk=) | | |
   | [examples/snippets/transforms/elementwise/kvswap.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZXhhbXBsZXMvc25pcHBldHMvdHJhbnNmb3Jtcy9lbGVtZW50d2lzZS9rdnN3YXAucHk=) | | |
   | [runners/dataflow/native\_io/iobase\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9kYXRhZmxvdy9uYXRpdmVfaW8vaW9iYXNlX3Rlc3QucHk=) | | |
   | [io/gcp/experimental/spannerio.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vZ2NwL2V4cGVyaW1lbnRhbC9zcGFubmVyaW8ucHk=) | | |
   | [typehints/trivial\_inference.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dHlwZWhpbnRzL3RyaXZpYWxfaW5mZXJlbmNlLnB5) | | |
   | [io/gcp/gcsfilesystem.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vZ2NwL2djc2ZpbGVzeXN0ZW0ucHk=) | | |
   | [io/gcp/pubsub\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vZ2NwL3B1YnN1Yl90ZXN0LnB5) | | |
   | ... and [1141 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [a99c682...2c4505c](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/5ef04e945fb1a3948d665af5d6b7f13b86487616?el=desc) will **decrease** coverage by `0.16%`.
   > The diff coverage is `52.66%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   - Coverage   82.36%   82.20%   -0.17%     
   ==========================================
     Files         451      455       +4     
     Lines       53753    54284     +531     
   ==========================================
   + Hits        44273    44623     +350     
   - Misses       9480     9661     +181     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `72.60% <0.00%> (ø)` | |
   | [...eam/testing/benchmarks/nexmark/nexmark\_launcher.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19sYXVuY2hlci5weQ==) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_perf.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19wZXJmLnB5) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_util.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya191dGlsLnB5) | `0.00% <0.00%> (ø)` | |
   | [...\_beam/runners/portability/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9wb3J0YWJpbGl0eS9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `31.16% <31.16%> (ø)` | |
   | [...on/apache\_beam/runners/dataflow/dataflow\_runner.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9kYXRhZmxvd19ydW5uZXIucHk=) | `77.06% <66.66%> (-0.12%)` | :arrow_down: |
   | [sdks/python/apache\_beam/transforms/environments.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdHJhbnNmb3Jtcy9lbnZpcm9ubWVudHMucHk=) | `83.49% <66.66%> (-0.33%)` | :arrow_down: |
   | [...dks/python/apache\_beam/options/pipeline\_options.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vb3B0aW9ucy9waXBlbGluZV9vcHRpb25zLnB5) | `95.02% <72.72%> (+0.04%)` | :arrow_up: |
   | [sdks/python/apache\_beam/io/gcp/bigquery.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vaW8vZ2NwL2JpZ3F1ZXJ5LnB5) | `79.78% <90.90%> (+<0.01%)` | :arrow_up: |
   | [sdks/python/apache\_beam/utils/histogram.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdXRpbHMvaGlzdG9ncmFtLnB5) | `94.28% <94.28%> (ø)` | |
   | ... and [75 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [68e7f2e...b59a1ba](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: Add option to prebuild python sdk container

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/a99c6826a067f49ebb60e625c8652900c7d0e810?el=desc) will **increase** coverage by `5.88%`.
   > The diff coverage is `33.80%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   + Coverage   34.32%   40.21%   +5.88%     
   ==========================================
     Files         694      455     -239     
     Lines       82226    53738   -28488     
     Branches     9294        0    -9294     
   ==========================================
   - Hits        28225    21610    -6615     
   + Misses      53578    32128   -21450     
   + Partials      423        0     -423     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `20.20% <28.57%> (ø)` | |
   | [...che\_beam/runners/dataflow/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `34.37% <34.37%> (ø)` | |
   | [ml/gcp/videointelligenceml\_test\_it.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-bWwvZ2NwL3ZpZGVvaW50ZWxsaWdlbmNlbWxfdGVzdF9pdC5weQ==) | | |
   | [testing/test\_stream.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dGVzdGluZy90ZXN0X3N0cmVhbS5weQ==) | | |
   | [transforms/environments\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dHJhbnNmb3Jtcy9lbnZpcm9ubWVudHNfdGVzdC5weQ==) | | |
   | [transforms/util\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dHJhbnNmb3Jtcy91dGlsX3Rlc3QucHk=) | | |
   | [io/gcp/datastore/v1new/query\_splitter\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vZ2NwL2RhdGFzdG9yZS92MW5ldy9xdWVyeV9zcGxpdHRlcl90ZXN0LnB5) | | |
   | [runners/interactive/options/capture\_limiters.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9pbnRlcmFjdGl2ZS9vcHRpb25zL2NhcHR1cmVfbGltaXRlcnMucHk=) | | |
   | [internal/util.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW50ZXJuYWwvdXRpbC5weQ==) | | |
   | [examples/complete/game/leader\_board\_it\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZXhhbXBsZXMvY29tcGxldGUvZ2FtZS9sZWFkZXJfYm9hcmRfaXRfdGVzdC5weQ==) | | |
   | ... and [1141 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [a99c682...2c4505c](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] commented on pull request #12727: Add option to prebuild python sdk container

Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/a99c6826a067f49ebb60e625c8652900c7d0e810?el=desc) will **increase** coverage by `5.88%`.
   > The diff coverage is `33.80%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   + Coverage   34.32%   40.21%   +5.88%     
   ==========================================
     Files         694      455     -239     
     Lines       82226    53738   -28488     
     Branches     9294        0    -9294     
   ==========================================
   - Hits        28225    21610    -6615     
   + Misses      53578    32128   -21450     
   + Partials      423        0     -423     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `20.20% <28.57%> (ø)` | |
   | [...che\_beam/runners/dataflow/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `34.37% <34.37%> (ø)` | |
   | [runners/portability/spark\_runner.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9wb3J0YWJpbGl0eS9zcGFya19ydW5uZXIucHk=) | | |
   | [runners/portability/local\_job\_service\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9wb3J0YWJpbGl0eS9sb2NhbF9qb2Jfc2VydmljZV90ZXN0LnB5) | | |
   | [examples/complete/game/game\_stats.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZXhhbXBsZXMvY29tcGxldGUvZ2FtZS9nYW1lX3N0YXRzLnB5) | | |
   | [internal/util\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW50ZXJuYWwvdXRpbF90ZXN0LnB5) | | |
   | [runners/pipeline\_context.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9waXBlbGluZV9jb250ZXh0LnB5) | | |
   | [io/gcp/bigquery\_read\_perf\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vZ2NwL2JpZ3F1ZXJ5X3JlYWRfcGVyZl90ZXN0LnB5) | | |
   | [version.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dmVyc2lvbi5weQ==) | | |
   | [metrics/metric.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-bWV0cmljcy9tZXRyaWMucHk=) | | |
   | ... and [1141 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [a99c682...ba76a3f](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] aaltay commented on a change in pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
aaltay commented on a change in pull request #12727:
URL: https://github.com/apache/beam/pull/12727#discussion_r491168283



##########
File path: sdks/python/apache_beam/runners/dataflow/dataflow_runner.py
##########
@@ -473,10 +474,19 @@ def run_pipeline(self, pipeline, options):
 
     use_fnapi = apiclient._use_fnapi(options)
     from apache_beam.transforms import environments
-    self._default_environment = (
-        environments.DockerEnvironment.from_container_image(
-            apiclient.get_container_image_from_options(options),
-            artifacts=environments.python_sdk_dependencies(options)))
+    if options.view_as(DebugOptions).lookup_experiment(
+        'prebuild_sdk_container'):

Review comment:
       Should this be a top level option similar to `docker_registry_push_url` or vice versa? It probably make sense to make either both options an experiment, or both as top level options.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/5ef04e945fb1a3948d665af5d6b7f13b86487616?el=desc) will **decrease** coverage by `0.20%`.
   > The diff coverage is `52.86%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   - Coverage   82.36%   82.16%   -0.21%     
   ==========================================
     Files         451      452       +1     
     Lines       53753    54036     +283     
   ==========================================
   + Hits        44273    44398     +125     
   - Misses       9480     9638     +158     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `72.60% <0.00%> (ø)` | |
   | [...eam/testing/benchmarks/nexmark/nexmark\_launcher.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19sYXVuY2hlci5weQ==) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_perf.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19wZXJmLnB5) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_util.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya191dGlsLnB5) | `0.00% <0.00%> (ø)` | |
   | [...\_beam/runners/portability/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9wb3J0YWJpbGl0eS9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `32.23% <32.23%> (ø)` | |
   | [...on/apache\_beam/runners/dataflow/dataflow\_runner.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9kYXRhZmxvd19ydW5uZXIucHk=) | `77.03% <60.00%> (-0.15%)` | :arrow_down: |
   | [...dks/python/apache\_beam/options/pipeline\_options.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vb3B0aW9ucy9waXBlbGluZV9vcHRpb25zLnB5) | `95.00% <66.66%> (+0.01%)` | :arrow_up: |
   | [sdks/python/apache\_beam/transforms/environments.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdHJhbnNmb3Jtcy9lbnZpcm9ubWVudHMucHk=) | `83.49% <66.66%> (-0.33%)` | :arrow_down: |
   | [...beam/runners/interactive/background\_caching\_job.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9iYWNrZ3JvdW5kX2NhY2hpbmdfam9iLnB5) | `94.78% <90.90%> (ø)` | |
   | [sdks/python/apache\_beam/utils/histogram.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdXRpbHMvaGlzdG9ncmFtLnB5) | `94.28% <94.28%> (ø)` | |
   | ... and [67 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [68e7f2e...81f9a9e](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/5ef04e945fb1a3948d665af5d6b7f13b86487616?el=desc) will **decrease** coverage by `0.19%`.
   > The diff coverage is `54.59%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   - Coverage   82.36%   82.16%   -0.20%     
   ==========================================
     Files         451      453       +2     
     Lines       53753    54009     +256     
   ==========================================
   + Hits        44273    44377     +104     
   - Misses       9480     9632     +152     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...eam/testing/benchmarks/nexmark/nexmark\_launcher.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19sYXVuY2hlci5weQ==) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_perf.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19wZXJmLnB5) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_util.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya191dGlsLnB5) | `0.00% <0.00%> (ø)` | |
   | [...s/dataflow/internal/sdk\_container\_cloud\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9zZGtfY29udGFpbmVyX2Nsb3VkX2J1aWxkZXIucHk=) | `34.14% <34.14%> (ø)` | |
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `72.02% <42.85%> (-0.58%)` | :arrow_down: |
   | [...\_beam/runners/portability/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9wb3J0YWJpbGl0eS9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `42.85% <42.85%> (ø)` | |
   | [...dks/python/apache\_beam/options/pipeline\_options.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vb3B0aW9ucy9waXBlbGluZV9vcHRpb25zLnB5) | `95.01% <70.00%> (+0.02%)` | :arrow_up: |
   | [...beam/runners/interactive/background\_caching\_job.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9iYWNrZ3JvdW5kX2NhY2hpbmdfam9iLnB5) | `94.78% <90.90%> (ø)` | |
   | [sdks/python/apache\_beam/utils/histogram.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdXRpbHMvaGlzdG9ncmFtLnB5) | `94.28% <94.28%> (ø)` | |
   | [...ache\_beam/runners/interactive/recording\_manager.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9yZWNvcmRpbmdfbWFuYWdlci5weQ==) | `98.05% <95.74%> (+5.19%)` | :arrow_up: |
   | ... and [62 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [68e7f2e...d4cecb7](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] tvalentyn commented on a change in pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
tvalentyn commented on a change in pull request #12727:
URL: https://github.com/apache/beam/pull/12727#discussion_r492430139



##########
File path: sdks/python/apache_beam/runners/dataflow/dataflow_runner.py
##########
@@ -473,10 +473,16 @@ def run_pipeline(self, pipeline, options):
 
     use_fnapi = apiclient._use_fnapi(options)
     from apache_beam.transforms import environments
-    self._default_environment = (
-        environments.DockerEnvironment.from_container_image(
-            apiclient.get_container_image_from_options(options),
-            artifacts=environments.python_sdk_dependencies(options)))
+    if options.view_as(SetupOptions).prebuild_sdk_container_engine:

Review comment:
       I don't fully follow why we need this branch - could you add a comment?

##########
File path: sdks/python/apache_beam/runners/portability/sdk_container_builder.py
##########
@@ -0,0 +1,274 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+"""SdkContainerBuilder builds the portable SDK container with dependencies.
+
+It copies the right boot dependencies, namely: apache beam sdk, python packages
+from requirements.txt, python packages from extra_packages.txt, workflow
+tarball, into the latest public python sdk container image, and run the
+dependencies installation in advance with the boot program in setup only mode
+to build the new image.
+"""
+
+from __future__ import absolute_import
+
+import json
+import logging
+import os
+import shutil
+import subprocess
+import sys
+import tarfile
+import tempfile
+import time
+import uuid
+
+from google.protobuf.duration_pb2 import Duration
+from google.protobuf.json_format import MessageToJson
+
+from apache_beam.internal.gcp.auth import get_service_credentials
+from apache_beam.internal.http_client import get_new_http
+from apache_beam.io.gcp.internal.clients import storage
+from apache_beam.options.pipeline_options import GoogleCloudOptions
+from apache_beam.options.pipeline_options import PipelineOptions  # pylint: disable=unused-import
+from apache_beam.options.pipeline_options import SetupOptions
+from apache_beam.portability import common_urns
+from apache_beam.portability.api import beam_runner_api_pb2
+from apache_beam.runners.portability.stager import Stager
+
+ARTIFACTS_CONTAINER_DIR = '/opt/apache/beam/artifacts'
+ARTIFACTS_MANIFEST_FILE = 'artifacts_info.json'
+SDK_CONTAINER_ENTRYPOINT = '/opt/apache/beam/boot'
+DOCKERFILE_TEMPLATE = (
+    """FROM apache/beam_python{major}.{minor}_sdk:latest
+RUN mkdir -p {workdir}
+COPY ./* {workdir}/
+RUN {entrypoint} --setup_only --artifacts {workdir}/{manifest_file}
+""")
+
+SOURCE_FOLDER = 'source'
+_LOGGER = logging.getLogger(__name__)
+
+
+class SdkContainerBuilder(object):
+  def __init__(self, options):
+    self._options = options
+    self._temp_src_dir = tempfile.mkdtemp()
+    self._docker_registry_push_url = self._options.view_as(
+        SetupOptions).docker_registry_push_url
+
+  def build(self):

Review comment:
       The terminology is a bit confusing here.
   
   - Container ID is typically an ID of a running container (see output of `docker ps -a`).
   - We tend to confuse container _images_ and containers (running/stopped instances of an image).
   - Image Tag is the last part of the image name after colon (`/repo/name:tag`), see https://docs.docker.com/engine/reference/commandline/tag/.
   
   Please use the variable names  consistently with Docker terminology.  
   

##########
File path: sdks/python/apache_beam/options/pipeline_options.py
##########
@@ -1003,6 +1003,13 @@ def _add_argparse_args(cls, parser):
             'environment. Choose the docker build engine of local docker '
             'environment or google cloud build by passing the option '
             'local_docker or cloud_build.'))
+    parser.add_argument(
+        '--prebuild_sdk_container_base_image',
+        default=None,
+        help=(
+            'The base image to use when pre-building the sdk container image '
+            'with dependencies, if not specified, the latest public '

Review comment:
       I think for released SDKs, we should use the version that corresponds to the SDK version (`apache_beam.version.__version__`) 

##########
File path: sdks/python/apache_beam/runners/portability/sdk_container_builder.py
##########
@@ -0,0 +1,279 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+"""SdkContainerBuilder builds the portable SDK container with dependencies.
+
+It copies the right boot dependencies, namely: apache beam sdk, python packages
+from requirements.txt, python packages from extra_packages.txt, workflow
+tarball, into the latest public python sdk container image, and run the
+dependencies installation in advance with the boot program in setup only mode
+to build the new image.
+"""
+
+from __future__ import absolute_import
+
+import json
+import logging
+import os
+import shutil
+import subprocess
+import sys
+import tarfile
+import tempfile
+import time
+import uuid
+
+from google.protobuf.duration_pb2 import Duration
+from google.protobuf.json_format import MessageToJson
+
+from apache_beam.internal.gcp.auth import get_service_credentials
+from apache_beam.internal.http_client import get_new_http
+from apache_beam.io.gcp.internal.clients import storage
+from apache_beam.options.pipeline_options import GoogleCloudOptions
+from apache_beam.options.pipeline_options import PipelineOptions  # pylint: disable=unused-import
+from apache_beam.options.pipeline_options import SetupOptions
+from apache_beam.portability import common_urns
+from apache_beam.portability.api import beam_runner_api_pb2
+from apache_beam.runners.portability.stager import Stager
+
+ARTIFACTS_CONTAINER_DIR = '/opt/apache/beam/artifacts'
+ARTIFACTS_MANIFEST_FILE = 'artifacts_info.json'
+SDK_CONTAINER_ENTRYPOINT = '/opt/apache/beam/boot'
+DOCKERFILE_TEMPLATE = (
+    """FROM {base_image}
+RUN mkdir -p {workdir}
+COPY ./* {workdir}/
+RUN {entrypoint} --setup_only --artifacts {workdir}/{manifest_file}
+""")
+
+SOURCE_FOLDER = 'source'
+_LOGGER = logging.getLogger(__name__)
+
+
+class SdkContainerBuilder(object):
+  def __init__(self, options):
+    self._options = options
+    self._docker_registry_push_url = self._options.view_as(
+        SetupOptions).docker_registry_push_url
+    self._base_image = (
+        self._options.view_as(SetupOptions).prebuild_sdk_container_base_image or
+        'apache/beam_python%s.%s_sdk:latest' %
+        (sys.version_info[0], sys.version_info[1]))
+    self._temp_src_dir = None
+
+  def build(self):
+    container_id = str(uuid.uuid4())
+    container_tag = os.path.join(
+        self._docker_registry_push_url or '',
+        'beam_python_prebuilt_sdk:%s' % container_id)
+    with tempfile.TemporaryDirectory() as temp_folder:
+      self._temp_src_dir = temp_folder
+      self.prepare_dependencies()
+      self.invoke_docker_build_and_push(container_id, container_tag)
+
+    return container_tag
+
+  def prepare_dependencies(self):
+    with tempfile.TemporaryDirectory() as tmp:
+      resources = Stager.create_job_resources(self._options, tmp)
+      # make a copy of the staged artifacts into the temp source folder.
+      for path, name in resources:
+        shutil.copyfile(path, os.path.join(self._temp_src_dir, name))
+      with open(os.path.join(self._temp_src_dir, 'Dockerfile'), 'w') as file:
+        file.write(
+            DOCKERFILE_TEMPLATE.format(
+                base_image=self._base_image,
+                workdir=ARTIFACTS_CONTAINER_DIR,
+                manifest_file=ARTIFACTS_MANIFEST_FILE,
+                entrypoint=SDK_CONTAINER_ENTRYPOINT))
+      self.generate_artifacts_manifests_json_file(resources, self._temp_src_dir)
+
+  def invoke_docker_build_and_push(self, container_id, container_tag):
+    raise NotImplementedError
+
+  @staticmethod
+  def generate_artifacts_manifests_json_file(resources, temp_dir):
+    infos = []
+    for _, name in resources:
+      info = beam_runner_api_pb2.ArtifactInformation(
+          type_urn=common_urns.StandardArtifacts.Types.FILE.urn,
+          type_payload=beam_runner_api_pb2.ArtifactFilePayload(
+              path=name).SerializeToString(),
+      )
+      infos.append(json.dumps(MessageToJson(info)))
+    with open(os.path.join(temp_dir, ARTIFACTS_MANIFEST_FILE), 'w') as file:
+      file.write('[\n' + ',\n'.join(infos) + '\n]')
+
+  @classmethod
+  def build_container_image(cls, pipeline_options):
+    # type: (PipelineOptions) -> str
+    setup_options = pipeline_options.view_as(SetupOptions)
+    container_build_engine = setup_options.prebuild_sdk_container_engine
+    if container_build_engine:
+      if container_build_engine == 'local_docker':
+        builder = _SdkContainerLocalBuilder(
+            pipeline_options)  # type: SdkContainerBuilder
+      elif container_build_engine == 'cloud_build':
+        builder = _SdkContainerCloudBuilder(pipeline_options)
+      else:
+        raise ValueError(
+            'Only (--prebuild_sdk_container_engine local_docker) and '
+            '(--prebuild_sdk_container_engine cloud_build) are supported')
+    else:
+      raise ValueError('No --prebuild_sdk_container_engine option specified.')
+    return builder.build()
+
+
+class _SdkContainerLocalBuilder(SdkContainerBuilder):
+  """SdkContainerLocalBuilder builds the sdk container image with local
+  docker."""
+  def invoke_docker_build_and_push(self, container_id, container_tag):
+    try:
+      _LOGGER.info("Building sdk container, this may take a few minutes...")
+      now = time.time()
+      subprocess.run(['docker', 'build', '.', '-t', container_tag],
+                     capture_output=True,
+                     check=True,
+                     cwd=self._temp_src_dir)
+    except subprocess.CalledProcessError as err:
+      raise RuntimeError(
+          'Failed to build sdk container with local docker, '
+          'stderr:\n %s.' % err.stderr)
+    else:
+      _LOGGER.info(
+          "Successfully built %s in %.2f seconds" %
+          (container_tag, time.time() - now))
+
+    if self._docker_registry_push_url:
+      _LOGGER.info("Pushing prebuilt sdk container...")
+      try:
+        subprocess.run(['docker', 'push', container_tag],
+                       capture_output=True,
+                       check=True)
+      except subprocess.CalledProcessError as err:
+        raise RuntimeError(
+            'Failed to push prebuilt sdk container %s, stderr: \n%s' %
+            (container_tag, err.stderr))
+      _LOGGER.info(
+          "Successfully pushed %s in %.2f seconds" %
+          (container_tag, time.time() - now))
+    else:
+      _LOGGER.info(
+          "no --docker_registry_push_url option is specified in pipeline "
+          "options, specify it if the new image is intended to be "
+          "pushed to a registry.")
+
+
+class _SdkContainerCloudBuilder(SdkContainerBuilder):
+  """SdkContainerLocalBuilder builds the sdk container image with google cloud
+  build."""
+  def __init__(self, options):
+    super().__init__(options)
+    self._google_cloud_options = options.view_as(GoogleCloudOptions)
+    if self._google_cloud_options.no_auth:
+      credentials = None
+    else:
+      credentials = get_service_credentials()
+    self._storage_client = storage.StorageV1(
+        url='https://www.googleapis.com/storage/v1',
+        credentials=credentials,
+        get_credentials=(not self._google_cloud_options.no_auth),
+        http=get_new_http(),
+        response_encoding='utf8')
+    if not self._docker_registry_push_url:
+      self._docker_registry_push_url = (
+          'gcr.io/%s' % self._google_cloud_options.project)
+
+  def invoke_docker_build_and_push(self, container_id, container_tag):
+    project_id = self._google_cloud_options.project
+    temp_location = self._google_cloud_options.temp_location
+    # google cloud build service expects all the build source file to be
+    # compressed into a tarball.
+    tarball_path = os.path.join(self._temp_src_dir, '%s.tgz' % SOURCE_FOLDER)
+    self._make_tarfile(tarball_path, self._temp_src_dir)
+    _LOGGER.info(
+        "Compressed source files for building sdk container at %s" %
+        tarball_path)
+
+    gcs_location = os.path.join(
+        temp_location, '%s-%s.tgz' % (SOURCE_FOLDER, container_id))
+    self._upload_to_gcs(tarball_path, gcs_location)
+
+    from google.cloud.devtools import cloudbuild_v1
+    client = cloudbuild_v1.CloudBuildClient()
+    build = cloudbuild_v1.Build()
+    build.steps = []
+    step = cloudbuild_v1.BuildStep()
+    step.name = 'gcr.io/cloud-builders/docker'
+    step.args = ['build', '-t', container_tag, '.']
+    step.dir = SOURCE_FOLDER
+
+    build.steps.append(step)
+    build.images = [container_tag]
+
+    source = cloudbuild_v1.Source()
+    source.storage_source = cloudbuild_v1.StorageSource()
+    gcs_bucket, gcs_object = self._get_gcs_bucket_and_name(gcs_location)
+    source.storage_source.bucket = os.path.join(gcs_bucket)
+    source.storage_source.object = gcs_object
+    build.source = source
+    # TODO(zyichi): make timeout configurable
+    build.timeout = Duration().FromSeconds(seconds=1800)
+
+    now = time.time()
+    _LOGGER.info('Building sdk container, this may take a few minutes...')
+    operation = client.create_build(project_id=project_id, build=build)
+    # if build fails exception will be raised and stops the job submission.

Review comment:
       Can we consider retrying some small number of times? Can be done earlier in the call stack for both engines.

##########
File path: sdks/python/apache_beam/options/pipeline_options.py
##########
@@ -994,6 +994,21 @@ def _add_argparse_args(cls, parser):
             'staged in the staging area (--staging_location option) and the '
             'workers will install them in same order they were specified on '
             'the command line.'))
+    parser.add_argument(
+        '--prebuild_sdk_container_engine',
+        choices=['local_docker', 'cloud_build'],
+        help=(
+            'Pre-builds the sdk worker container image with boot dependencies '

Review comment:
       Wording suggestion: `Prebuild sdk worker container image before job submission. If enabled, SDK invokes the  boot sequence in SDK worker containers to install all pipeline dependencies in the container, and uses the prebuilt image in the pipeline environment. This may speed up pipeline execution. To enable, select  the Docker build engine: local_docker using locally-installed Docker or cloud_build for using  Google Cloud Build.`

##########
File path: sdks/python/apache_beam/examples/wordcount_it_test.py
##########
@@ -56,6 +57,17 @@ def test_wordcount_it(self):
   def test_wordcount_fnapi_it(self):
     self._run_wordcount_it(wordcount.run, experiment='beam_fn_api')
 
+  @attr('ValidatesContainer')
+  def test_wordcount_it_with_prebuilt_sdk_container(self):
+    if sys.version_info[0] < 3:

Review comment:
       We no longer run Py2 tests.

##########
File path: sdks/python/apache_beam/runners/portability/sdk_container_builder.py
##########
@@ -0,0 +1,279 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+"""SdkContainerBuilder builds the portable SDK container with dependencies.
+
+It copies the right boot dependencies, namely: apache beam sdk, python packages
+from requirements.txt, python packages from extra_packages.txt, workflow
+tarball, into the latest public python sdk container image, and run the
+dependencies installation in advance with the boot program in setup only mode
+to build the new image.
+"""
+
+from __future__ import absolute_import
+
+import json
+import logging
+import os
+import shutil
+import subprocess
+import sys
+import tarfile
+import tempfile
+import time
+import uuid
+
+from google.protobuf.duration_pb2 import Duration
+from google.protobuf.json_format import MessageToJson
+
+from apache_beam.internal.gcp.auth import get_service_credentials
+from apache_beam.internal.http_client import get_new_http
+from apache_beam.io.gcp.internal.clients import storage
+from apache_beam.options.pipeline_options import GoogleCloudOptions
+from apache_beam.options.pipeline_options import PipelineOptions  # pylint: disable=unused-import
+from apache_beam.options.pipeline_options import SetupOptions
+from apache_beam.portability import common_urns
+from apache_beam.portability.api import beam_runner_api_pb2
+from apache_beam.runners.portability.stager import Stager
+
+ARTIFACTS_CONTAINER_DIR = '/opt/apache/beam/artifacts'
+ARTIFACTS_MANIFEST_FILE = 'artifacts_info.json'
+SDK_CONTAINER_ENTRYPOINT = '/opt/apache/beam/boot'
+DOCKERFILE_TEMPLATE = (
+    """FROM {base_image}
+RUN mkdir -p {workdir}
+COPY ./* {workdir}/
+RUN {entrypoint} --setup_only --artifacts {workdir}/{manifest_file}
+""")
+
+SOURCE_FOLDER = 'source'
+_LOGGER = logging.getLogger(__name__)
+
+
+class SdkContainerBuilder(object):
+  def __init__(self, options):
+    self._options = options
+    self._docker_registry_push_url = self._options.view_as(
+        SetupOptions).docker_registry_push_url
+    self._base_image = (
+        self._options.view_as(SetupOptions).prebuild_sdk_container_base_image or
+        'apache/beam_python%s.%s_sdk:latest' %
+        (sys.version_info[0], sys.version_info[1]))
+    self._temp_src_dir = None
+
+  def build(self):
+    container_id = str(uuid.uuid4())
+    container_tag = os.path.join(
+        self._docker_registry_push_url or '',
+        'beam_python_prebuilt_sdk:%s' % container_id)
+    with tempfile.TemporaryDirectory() as temp_folder:
+      self._temp_src_dir = temp_folder
+      self.prepare_dependencies()
+      self.invoke_docker_build_and_push(container_id, container_tag)
+
+    return container_tag
+
+  def prepare_dependencies(self):
+    with tempfile.TemporaryDirectory() as tmp:
+      resources = Stager.create_job_resources(self._options, tmp)
+      # make a copy of the staged artifacts into the temp source folder.
+      for path, name in resources:
+        shutil.copyfile(path, os.path.join(self._temp_src_dir, name))
+      with open(os.path.join(self._temp_src_dir, 'Dockerfile'), 'w') as file:
+        file.write(
+            DOCKERFILE_TEMPLATE.format(
+                base_image=self._base_image,
+                workdir=ARTIFACTS_CONTAINER_DIR,
+                manifest_file=ARTIFACTS_MANIFEST_FILE,
+                entrypoint=SDK_CONTAINER_ENTRYPOINT))
+      self.generate_artifacts_manifests_json_file(resources, self._temp_src_dir)
+
+  def invoke_docker_build_and_push(self, container_id, container_tag):
+    raise NotImplementedError
+
+  @staticmethod
+  def generate_artifacts_manifests_json_file(resources, temp_dir):
+    infos = []
+    for _, name in resources:
+      info = beam_runner_api_pb2.ArtifactInformation(
+          type_urn=common_urns.StandardArtifacts.Types.FILE.urn,
+          type_payload=beam_runner_api_pb2.ArtifactFilePayload(
+              path=name).SerializeToString(),
+      )
+      infos.append(json.dumps(MessageToJson(info)))
+    with open(os.path.join(temp_dir, ARTIFACTS_MANIFEST_FILE), 'w') as file:
+      file.write('[\n' + ',\n'.join(infos) + '\n]')
+
+  @classmethod
+  def build_container_image(cls, pipeline_options):
+    # type: (PipelineOptions) -> str

Review comment:
       nit: You can use typehints too now that we use Py3 only.

##########
File path: sdks/python/apache_beam/transforms/environments.py
##########
@@ -252,6 +254,13 @@ def from_runner_api_parameter(payload, capabilities, artifacts, context):
   @classmethod
   def from_options(cls, options):
     # type: (PipelineOptions) -> DockerEnvironment
+    if options.view_as(SetupOptions).prebuild_sdk_container_engine:
+      prebuilt_container_image = SdkContainerBuilder.build_container_image(
+          options)
+      return cls.from_container_image(
+          container_image=prebuilt_container_image,
+          artifacts=python_sdk_dependencies(
+              options, skip_boot_dependencies=True))

Review comment:
       Does `python_sdk_dependencies()` need `skip_boot_dependencies argument` given that it accepts `options` ?

##########
File path: sdks/python/apache_beam/runners/portability/stager.py
##########
@@ -136,6 +137,8 @@ def create_job_resources(options,  # type: PipelineOptions
             only for testing.
           populate_requirements_cache: Callable for populating the requirements
             cache. Used only for testing.
+          skip_boot_dependencies: Skip apache beam sdk, requirements, extra
+            packages, workflow tarball installs by sdk boot program.

Review comment:
       This seems confusing since stager and boot program in SDK containers are different entities.
   
   How about `skip_prestaged_dependencies: Skip staging dependencies that can be added into SDK containers during prebuilding`.

##########
File path: sdks/python/apache_beam/runners/portability/sdk_container_builder.py
##########
@@ -69,6 +69,10 @@ def __init__(self, options):
     self._options = options
     self._docker_registry_push_url = self._options.view_as(
         SetupOptions).docker_registry_push_url
+    self._base_image = (
+        self._options.view_as(SetupOptions).prebuild_sdk_container_base_image or

Review comment:
       I think for released SDKs, we should use the version that corresponds to the SDK version (`apache_beam.version.__version__`)
   
   

##########
File path: sdks/python/container/boot.go
##########
@@ -203,15 +223,9 @@ func setupAcceptableWheelSpecs() error {
 }
 
 // installSetupPackages installs Beam SDK and user dependencies.
-func installSetupPackages(mds []*jobpb.ArtifactMetadata, workDir string) error {
+func installSetupPackages(files []string, workDir string) error {

Review comment:
       Let's move evaluation of correct wheel files (a call to `setupAcceptableWheelSpecs`) inside this method now that we call `installSetupPackages` in two places.

##########
File path: sdks/python/container/boot.go
##########
@@ -30,18 +32,21 @@ import (
 	"time"
 
 	"github.com/apache/beam/sdks/go/pkg/beam/artifact"
-	jobpb "github.com/apache/beam/sdks/go/pkg/beam/model/jobmanagement_v1"
 	pipepb "github.com/apache/beam/sdks/go/pkg/beam/model/pipeline_v1"
 	"github.com/apache/beam/sdks/go/pkg/beam/provision"
 	"github.com/apache/beam/sdks/go/pkg/beam/util/execx"
 	"github.com/apache/beam/sdks/go/pkg/beam/util/grpcx"
+	"github.com/golang/protobuf/jsonpb"
 	"github.com/golang/protobuf/proto"
 	"github.com/nightlyone/lockfile"
 )
 
 var (
 	acceptableWhlSpecs []string
 
+	setupOnly = flag.Bool("setup_only", false, "Execute boot program in setup only mode (optional).")

Review comment:
       Please add explanation of setup_only mode here for people who will be reading boot.go and are not familiar with this change.

##########
File path: sdks/python/apache_beam/runners/portability/stager.py
##########
@@ -119,6 +119,7 @@ def create_job_resources(options,  # type: PipelineOptions
                            temp_dir,  # type: str
                            build_setup_args=None,  # type: Optional[List[str]]
                            populate_requirements_cache=None,  # type: Optional[str]
+                           skip_boot_dependencies=False, # type: Optional[bool]

Review comment:
       You could consider having one 
   ```
   if not skip_boot_dependencies:
     ...
   ```
   and add a comment/TODO to explain why other dependencies currently cannot be included in this if.

##########
File path: sdks/python/apache_beam/options/pipeline_options.py
##########
@@ -994,6 +994,21 @@ def _add_argparse_args(cls, parser):
             'staged in the staging area (--staging_location option) and the '
             'workers will install them in same order they were specified on '
             'the command line.'))
+    parser.add_argument(
+        '--prebuild_sdk_container_engine',
+        choices=['local_docker', 'cloud_build'],
+        help=(
+            'Pre-builds the sdk worker container image with boot dependencies '

Review comment:
       or: `...for using  Google Cloud Build (requires a GCP project with Cloud Build API enabled).`




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] robertwb commented on a change in pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
robertwb commented on a change in pull request #12727:
URL: https://github.com/apache/beam/pull/12727#discussion_r492504554



##########
File path: sdks/python/apache_beam/runners/portability/sdk_container_builder.py
##########
@@ -0,0 +1,274 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+"""SdkContainerBuilder builds the portable SDK container with dependencies.
+
+It copies the right boot dependencies, namely: apache beam sdk, python packages
+from requirements.txt, python packages from extra_packages.txt, workflow
+tarball, into the latest public python sdk container image, and run the
+dependencies installation in advance with the boot program in setup only mode
+to build the new image.
+"""
+
+from __future__ import absolute_import
+
+import json
+import logging
+import os
+import shutil
+import subprocess
+import sys
+import tarfile
+import tempfile
+import time
+import uuid
+
+from google.protobuf.duration_pb2 import Duration
+from google.protobuf.json_format import MessageToJson
+
+from apache_beam.internal.gcp.auth import get_service_credentials
+from apache_beam.internal.http_client import get_new_http
+from apache_beam.io.gcp.internal.clients import storage
+from apache_beam.options.pipeline_options import GoogleCloudOptions
+from apache_beam.options.pipeline_options import PipelineOptions  # pylint: disable=unused-import
+from apache_beam.options.pipeline_options import SetupOptions
+from apache_beam.portability import common_urns
+from apache_beam.portability.api import beam_runner_api_pb2
+from apache_beam.runners.portability.stager import Stager
+
+ARTIFACTS_CONTAINER_DIR = '/opt/apache/beam/artifacts'
+ARTIFACTS_MANIFEST_FILE = 'artifacts_info.json'
+SDK_CONTAINER_ENTRYPOINT = '/opt/apache/beam/boot'
+DOCKERFILE_TEMPLATE = (
+    """FROM apache/beam_python{major}.{minor}_sdk:latest
+RUN mkdir -p {workdir}
+COPY ./* {workdir}/
+RUN {entrypoint} --setup_only --artifacts {workdir}/{manifest_file}
+""")
+
+SOURCE_FOLDER = 'source'
+_LOGGER = logging.getLogger(__name__)
+
+
+class SdkContainerBuilder(object):
+  def __init__(self, options):
+    self._options = options
+    self._temp_src_dir = tempfile.mkdtemp()
+    self._docker_registry_push_url = self._options.view_as(
+        SetupOptions).docker_registry_push_url
+
+  def build(self):
+    container_id = str(uuid.uuid4())
+    container_tag = os.path.join(
+        self._docker_registry_push_url or '',
+        'beam_python_prebuilt_sdk:%s' % container_id)
+    self.prepare_dependencies()
+    self.invoke_docker_build_and_push(container_id, container_tag)
+
+    return container_tag
+
+  def prepare_dependencies(self):
+    tmp = tempfile.mkdtemp()

Review comment:
       Similarly, remove when you're done with it. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/a99c6826a067f49ebb60e625c8652900c7d0e810?el=desc) will **increase** coverage by `5.88%`.
   > The diff coverage is `33.80%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   + Coverage   34.32%   40.21%   +5.88%     
   ==========================================
     Files         694      455     -239     
     Lines       82226    53738   -28488     
     Branches     9294        0    -9294     
   ==========================================
   - Hits        28225    21610    -6615     
   + Misses      53578    32128   -21450     
   + Partials      423        0     -423     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `20.20% <28.57%> (ø)` | |
   | [...che\_beam/runners/dataflow/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `34.37% <34.37%> (ø)` | |
   | [runners/worker/worker\_status\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy93b3JrZXIvd29ya2VyX3N0YXR1c190ZXN0LnB5) | | |
   | [examples/cookbook/bigquery\_side\_input\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZXhhbXBsZXMvY29va2Jvb2svYmlncXVlcnlfc2lkZV9pbnB1dF90ZXN0LnB5) | | |
   | [examples/wordcount\_minimal.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZXhhbXBsZXMvd29yZGNvdW50X21pbmltYWwucHk=) | | |
   | [examples/streaming\_wordcount.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZXhhbXBsZXMvc3RyZWFtaW5nX3dvcmRjb3VudC5weQ==) | | |
   | [utils/annotations\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dXRpbHMvYW5ub3RhdGlvbnNfdGVzdC5weQ==) | | |
   | [dataframe/expressions\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZGF0YWZyYW1lL2V4cHJlc3Npb25zX3Rlc3QucHk=) | | |
   | [pvalue\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cHZhbHVlX3Rlc3QucHk=) | | |
   | [.../internal/clients/dataflow/dataflow\_v1b3\_client.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9jbGllbnRzL2RhdGFmbG93L2RhdGFmbG93X3YxYjNfY2xpZW50LnB5) | | |
   | ... and [1141 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [a99c682...e68ad06](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] robertwb commented on a change in pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
robertwb commented on a change in pull request #12727:
URL: https://github.com/apache/beam/pull/12727#discussion_r492422441



##########
File path: sdks/python/apache_beam/runners/portability/stager.py
##########
@@ -119,6 +119,7 @@ def create_job_resources(options,  # type: PipelineOptions
                            temp_dir,  # type: str
                            build_setup_args=None,  # type: Optional[List[str]]
                            populate_requirements_cache=None,  # type: Optional[str]
+                           skip_boot_dependencies=False, # type: Optional[bool]

Review comment:
       Hmm... what we need to do is fix Dataflow to not be so weird. But probably not in this PR. 

##########
File path: sdks/python/apache_beam/runners/portability/sdk_container_builder.py
##########
@@ -0,0 +1,274 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+"""SdkContainerBuilder builds the portable SDK container with dependencies.
+
+It copies the right boot dependencies, namely: apache beam sdk, python packages
+from requirements.txt, python packages from extra_packages.txt, workflow
+tarball, into the latest public python sdk container image, and run the
+dependencies installation in advance with the boot program in setup only mode
+to build the new image.
+"""
+
+from __future__ import absolute_import
+
+import json
+import logging
+import os
+import shutil
+import subprocess
+import sys
+import tarfile
+import tempfile
+import time
+import uuid
+
+from google.protobuf.duration_pb2 import Duration
+from google.protobuf.json_format import MessageToJson
+
+from apache_beam.internal.gcp.auth import get_service_credentials
+from apache_beam.internal.http_client import get_new_http
+from apache_beam.io.gcp.internal.clients import storage
+from apache_beam.options.pipeline_options import GoogleCloudOptions
+from apache_beam.options.pipeline_options import PipelineOptions  # pylint: disable=unused-import
+from apache_beam.options.pipeline_options import SetupOptions
+from apache_beam.portability import common_urns
+from apache_beam.portability.api import beam_runner_api_pb2
+from apache_beam.runners.portability.stager import Stager
+
+ARTIFACTS_CONTAINER_DIR = '/opt/apache/beam/artifacts'
+ARTIFACTS_MANIFEST_FILE = 'artifacts_info.json'
+SDK_CONTAINER_ENTRYPOINT = '/opt/apache/beam/boot'
+DOCKERFILE_TEMPLATE = (
+    """FROM apache/beam_python{major}.{minor}_sdk:latest
+RUN mkdir -p {workdir}
+COPY ./* {workdir}/
+RUN {entrypoint} --setup_only --artifacts {workdir}/{manifest_file}
+""")
+
+SOURCE_FOLDER = 'source'
+_LOGGER = logging.getLogger(__name__)
+
+
+class SdkContainerBuilder(object):
+  def __init__(self, options):
+    self._options = options
+    self._temp_src_dir = tempfile.mkdtemp()

Review comment:
       Make sure to remove this directory when you're done with it.

##########
File path: sdks/python/apache_beam/runners/portability/sdk_container_builder.py
##########
@@ -0,0 +1,274 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+"""SdkContainerBuilder builds the portable SDK container with dependencies.
+
+It copies the right boot dependencies, namely: apache beam sdk, python packages
+from requirements.txt, python packages from extra_packages.txt, workflow
+tarball, into the latest public python sdk container image, and run the
+dependencies installation in advance with the boot program in setup only mode
+to build the new image.
+"""
+
+from __future__ import absolute_import
+
+import json
+import logging
+import os
+import shutil
+import subprocess
+import sys
+import tarfile
+import tempfile
+import time
+import uuid
+
+from google.protobuf.duration_pb2 import Duration
+from google.protobuf.json_format import MessageToJson
+
+from apache_beam.internal.gcp.auth import get_service_credentials
+from apache_beam.internal.http_client import get_new_http
+from apache_beam.io.gcp.internal.clients import storage
+from apache_beam.options.pipeline_options import GoogleCloudOptions
+from apache_beam.options.pipeline_options import PipelineOptions  # pylint: disable=unused-import
+from apache_beam.options.pipeline_options import SetupOptions
+from apache_beam.portability import common_urns
+from apache_beam.portability.api import beam_runner_api_pb2
+from apache_beam.runners.portability.stager import Stager
+
+ARTIFACTS_CONTAINER_DIR = '/opt/apache/beam/artifacts'
+ARTIFACTS_MANIFEST_FILE = 'artifacts_info.json'
+SDK_CONTAINER_ENTRYPOINT = '/opt/apache/beam/boot'
+DOCKERFILE_TEMPLATE = (
+    """FROM apache/beam_python{major}.{minor}_sdk:latest
+RUN mkdir -p {workdir}
+COPY ./* {workdir}/
+RUN {entrypoint} --setup_only --artifacts {workdir}/{manifest_file}
+""")
+
+SOURCE_FOLDER = 'source'
+_LOGGER = logging.getLogger(__name__)
+
+
+class SdkContainerBuilder(object):
+  def __init__(self, options):
+    self._options = options
+    self._temp_src_dir = tempfile.mkdtemp()
+    self._docker_registry_push_url = self._options.view_as(
+        SetupOptions).docker_registry_push_url
+
+  def build(self):
+    container_id = str(uuid.uuid4())
+    container_tag = os.path.join(
+        self._docker_registry_push_url or '',
+        'beam_python_prebuilt_sdk:%s' % container_id)
+    self.prepare_dependencies()
+    self.invoke_docker_build_and_push(container_id, container_tag)
+
+    return container_tag
+
+  def prepare_dependencies(self):
+    tmp = tempfile.mkdtemp()

Review comment:
       Similarly, remove when you're done with it. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] y1chi commented on a change in pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
y1chi commented on a change in pull request #12727:
URL: https://github.com/apache/beam/pull/12727#discussion_r493760627



##########
File path: sdks/python/apache_beam/runners/portability/sdk_container_builder.py
##########
@@ -0,0 +1,279 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+"""SdkContainerBuilder builds the portable SDK container with dependencies.
+
+It copies the right boot dependencies, namely: apache beam sdk, python packages
+from requirements.txt, python packages from extra_packages.txt, workflow
+tarball, into the latest public python sdk container image, and run the
+dependencies installation in advance with the boot program in setup only mode
+to build the new image.
+"""
+
+from __future__ import absolute_import
+
+import json
+import logging
+import os
+import shutil
+import subprocess
+import sys
+import tarfile
+import tempfile
+import time
+import uuid
+
+from google.protobuf.duration_pb2 import Duration
+from google.protobuf.json_format import MessageToJson
+
+from apache_beam.internal.gcp.auth import get_service_credentials
+from apache_beam.internal.http_client import get_new_http
+from apache_beam.io.gcp.internal.clients import storage
+from apache_beam.options.pipeline_options import GoogleCloudOptions
+from apache_beam.options.pipeline_options import PipelineOptions  # pylint: disable=unused-import
+from apache_beam.options.pipeline_options import SetupOptions
+from apache_beam.portability import common_urns
+from apache_beam.portability.api import beam_runner_api_pb2
+from apache_beam.runners.portability.stager import Stager
+
+ARTIFACTS_CONTAINER_DIR = '/opt/apache/beam/artifacts'
+ARTIFACTS_MANIFEST_FILE = 'artifacts_info.json'
+SDK_CONTAINER_ENTRYPOINT = '/opt/apache/beam/boot'
+DOCKERFILE_TEMPLATE = (
+    """FROM {base_image}
+RUN mkdir -p {workdir}
+COPY ./* {workdir}/
+RUN {entrypoint} --setup_only --artifacts {workdir}/{manifest_file}
+""")
+
+SOURCE_FOLDER = 'source'
+_LOGGER = logging.getLogger(__name__)
+
+
+class SdkContainerBuilder(object):
+  def __init__(self, options):
+    self._options = options
+    self._docker_registry_push_url = self._options.view_as(
+        SetupOptions).docker_registry_push_url
+    self._base_image = (
+        self._options.view_as(SetupOptions).prebuild_sdk_container_base_image or
+        'apache/beam_python%s.%s_sdk:latest' %
+        (sys.version_info[0], sys.version_info[1]))
+    self._temp_src_dir = None
+
+  def build(self):
+    container_id = str(uuid.uuid4())
+    container_tag = os.path.join(
+        self._docker_registry_push_url or '',
+        'beam_python_prebuilt_sdk:%s' % container_id)
+    with tempfile.TemporaryDirectory() as temp_folder:
+      self._temp_src_dir = temp_folder
+      self.prepare_dependencies()
+      self.invoke_docker_build_and_push(container_id, container_tag)
+
+    return container_tag
+
+  def prepare_dependencies(self):
+    with tempfile.TemporaryDirectory() as tmp:
+      resources = Stager.create_job_resources(self._options, tmp)
+      # make a copy of the staged artifacts into the temp source folder.
+      for path, name in resources:
+        shutil.copyfile(path, os.path.join(self._temp_src_dir, name))
+      with open(os.path.join(self._temp_src_dir, 'Dockerfile'), 'w') as file:
+        file.write(
+            DOCKERFILE_TEMPLATE.format(
+                base_image=self._base_image,
+                workdir=ARTIFACTS_CONTAINER_DIR,
+                manifest_file=ARTIFACTS_MANIFEST_FILE,
+                entrypoint=SDK_CONTAINER_ENTRYPOINT))
+      self.generate_artifacts_manifests_json_file(resources, self._temp_src_dir)
+
+  def invoke_docker_build_and_push(self, container_id, container_tag):
+    raise NotImplementedError
+
+  @staticmethod
+  def generate_artifacts_manifests_json_file(resources, temp_dir):
+    infos = []
+    for _, name in resources:
+      info = beam_runner_api_pb2.ArtifactInformation(
+          type_urn=common_urns.StandardArtifacts.Types.FILE.urn,
+          type_payload=beam_runner_api_pb2.ArtifactFilePayload(
+              path=name).SerializeToString(),
+      )
+      infos.append(json.dumps(MessageToJson(info)))
+    with open(os.path.join(temp_dir, ARTIFACTS_MANIFEST_FILE), 'w') as file:
+      file.write('[\n' + ',\n'.join(infos) + '\n]')
+
+  @classmethod
+  def build_container_image(cls, pipeline_options):
+    # type: (PipelineOptions) -> str
+    setup_options = pipeline_options.view_as(SetupOptions)
+    container_build_engine = setup_options.prebuild_sdk_container_engine
+    if container_build_engine:
+      if container_build_engine == 'local_docker':
+        builder = _SdkContainerLocalBuilder(
+            pipeline_options)  # type: SdkContainerBuilder
+      elif container_build_engine == 'cloud_build':
+        builder = _SdkContainerCloudBuilder(pipeline_options)
+      else:
+        raise ValueError(
+            'Only (--prebuild_sdk_container_engine local_docker) and '
+            '(--prebuild_sdk_container_engine cloud_build) are supported')
+    else:
+      raise ValueError('No --prebuild_sdk_container_engine option specified.')
+    return builder.build()
+
+
+class _SdkContainerLocalBuilder(SdkContainerBuilder):
+  """SdkContainerLocalBuilder builds the sdk container image with local
+  docker."""
+  def invoke_docker_build_and_push(self, container_id, container_tag):
+    try:
+      _LOGGER.info("Building sdk container, this may take a few minutes...")
+      now = time.time()
+      subprocess.run(['docker', 'build', '.', '-t', container_tag],
+                     capture_output=True,
+                     check=True,
+                     cwd=self._temp_src_dir)
+    except subprocess.CalledProcessError as err:
+      raise RuntimeError(
+          'Failed to build sdk container with local docker, '
+          'stderr:\n %s.' % err.stderr)
+    else:
+      _LOGGER.info(
+          "Successfully built %s in %.2f seconds" %
+          (container_tag, time.time() - now))
+
+    if self._docker_registry_push_url:
+      _LOGGER.info("Pushing prebuilt sdk container...")
+      try:
+        subprocess.run(['docker', 'push', container_tag],
+                       capture_output=True,
+                       check=True)
+      except subprocess.CalledProcessError as err:
+        raise RuntimeError(
+            'Failed to push prebuilt sdk container %s, stderr: \n%s' %
+            (container_tag, err.stderr))
+      _LOGGER.info(
+          "Successfully pushed %s in %.2f seconds" %
+          (container_tag, time.time() - now))
+    else:
+      _LOGGER.info(
+          "no --docker_registry_push_url option is specified in pipeline "
+          "options, specify it if the new image is intended to be "
+          "pushed to a registry.")
+
+
+class _SdkContainerCloudBuilder(SdkContainerBuilder):
+  """SdkContainerLocalBuilder builds the sdk container image with google cloud
+  build."""
+  def __init__(self, options):
+    super().__init__(options)
+    self._google_cloud_options = options.view_as(GoogleCloudOptions)
+    if self._google_cloud_options.no_auth:
+      credentials = None
+    else:
+      credentials = get_service_credentials()
+    self._storage_client = storage.StorageV1(
+        url='https://www.googleapis.com/storage/v1',
+        credentials=credentials,
+        get_credentials=(not self._google_cloud_options.no_auth),
+        http=get_new_http(),
+        response_encoding='utf8')
+    if not self._docker_registry_push_url:
+      self._docker_registry_push_url = (
+          'gcr.io/%s' % self._google_cloud_options.project)
+
+  def invoke_docker_build_and_push(self, container_id, container_tag):
+    project_id = self._google_cloud_options.project
+    temp_location = self._google_cloud_options.temp_location
+    # google cloud build service expects all the build source file to be
+    # compressed into a tarball.
+    tarball_path = os.path.join(self._temp_src_dir, '%s.tgz' % SOURCE_FOLDER)
+    self._make_tarfile(tarball_path, self._temp_src_dir)
+    _LOGGER.info(
+        "Compressed source files for building sdk container at %s" %
+        tarball_path)
+
+    gcs_location = os.path.join(
+        temp_location, '%s-%s.tgz' % (SOURCE_FOLDER, container_id))
+    self._upload_to_gcs(tarball_path, gcs_location)
+
+    from google.cloud.devtools import cloudbuild_v1
+    client = cloudbuild_v1.CloudBuildClient()
+    build = cloudbuild_v1.Build()
+    build.steps = []
+    step = cloudbuild_v1.BuildStep()
+    step.name = 'gcr.io/cloud-builders/docker'
+    step.args = ['build', '-t', container_tag, '.']
+    step.dir = SOURCE_FOLDER
+
+    build.steps.append(step)
+    build.images = [container_tag]
+
+    source = cloudbuild_v1.Source()
+    source.storage_source = cloudbuild_v1.StorageSource()
+    gcs_bucket, gcs_object = self._get_gcs_bucket_and_name(gcs_location)
+    source.storage_source.bucket = os.path.join(gcs_bucket)
+    source.storage_source.object = gcs_object
+    build.source = source
+    # TODO(zyichi): make timeout configurable
+    build.timeout = Duration().FromSeconds(seconds=1800)
+
+    now = time.time()
+    _LOGGER.info('Building sdk container, this may take a few minutes...')
+    operation = client.create_build(project_id=project_id, build=build)
+    # if build fails exception will be raised and stops the job submission.

Review comment:
       sounds good.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] robinyqiu commented on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
robinyqiu commented on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-698035756


   codecov/patch is failing (what is this?) If this need to be fixed should we move it to 2.26.0?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: Add option to prebuild python sdk container

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/a99c6826a067f49ebb60e625c8652900c7d0e810?el=desc) will **increase** coverage by `5.88%`.
   > The diff coverage is `33.80%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   + Coverage   34.32%   40.21%   +5.88%     
   ==========================================
     Files         694      455     -239     
     Lines       82226    53738   -28488     
     Branches     9294        0    -9294     
   ==========================================
   - Hits        28225    21610    -6615     
   + Misses      53578    32128   -21450     
   + Partials      423        0     -423     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `20.20% <28.57%> (ø)` | |
   | [...che\_beam/runners/dataflow/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `34.37% <34.37%> (ø)` | |
   | [examples/flink/flink\_streaming\_impulse.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZXhhbXBsZXMvZmxpbmsvZmxpbmtfc3RyZWFtaW5nX2ltcHVsc2UucHk=) | | |
   | [io/hadoopfilesystem.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vaGFkb29wZmlsZXN5c3RlbS5weQ==) | | |
   | [dataframe/convert\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZGF0YWZyYW1lL2NvbnZlcnRfdGVzdC5weQ==) | | |
   | [io/aws/\_\_init\_\_.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vYXdzL19faW5pdF9fLnB5) | | |
   | [tools/map\_fn\_microbenchmark.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dG9vbHMvbWFwX2ZuX21pY3JvYmVuY2htYXJrLnB5) | | |
   | [io/gcp/bigquery\_io\_read\_it\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vZ2NwL2JpZ3F1ZXJ5X2lvX3JlYWRfaXRfdGVzdC5weQ==) | | |
   | [testing/benchmarks/nexmark/models/auction\_bid.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbW9kZWxzL2F1Y3Rpb25fYmlkLnB5) | | |
   | [io/gcp/tests/bigquery\_matcher.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vZ2NwL3Rlc3RzL2JpZ3F1ZXJ5X21hdGNoZXIucHk=) | | |
   | ... and [1141 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [a99c682...20c8398](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/5ef04e945fb1a3948d665af5d6b7f13b86487616?el=desc) will **decrease** coverage by `0.18%`.
   > The diff coverage is `52.77%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   - Coverage   82.36%   82.18%   -0.19%     
   ==========================================
     Files         451      453       +2     
     Lines       53753    54177     +424     
   ==========================================
   + Hits        44273    44524     +251     
   - Misses       9480     9653     +173     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `72.60% <0.00%> (ø)` | |
   | [...eam/testing/benchmarks/nexmark/nexmark\_launcher.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19sYXVuY2hlci5weQ==) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_perf.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19wZXJmLnB5) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_util.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya191dGlsLnB5) | `0.00% <0.00%> (ø)` | |
   | [...\_beam/runners/portability/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9wb3J0YWJpbGl0eS9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `31.78% <31.78%> (ø)` | |
   | [...on/apache\_beam/runners/dataflow/dataflow\_runner.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9kYXRhZmxvd19ydW5uZXIucHk=) | `77.00% <50.00%> (-0.18%)` | :arrow_down: |
   | [sdks/python/apache\_beam/transforms/environments.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdHJhbnNmb3Jtcy9lbnZpcm9ubWVudHMucHk=) | `83.49% <66.66%> (-0.33%)` | :arrow_down: |
   | [...dks/python/apache\_beam/options/pipeline\_options.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vb3B0aW9ucy9waXBlbGluZV9vcHRpb25zLnB5) | `95.01% <70.00%> (+0.02%)` | :arrow_up: |
   | [...beam/runners/interactive/background\_caching\_job.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9iYWNrZ3JvdW5kX2NhY2hpbmdfam9iLnB5) | `94.78% <90.90%> (ø)` | |
   | [sdks/python/apache\_beam/utils/histogram.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdXRpbHMvaGlzdG9ncmFtLnB5) | `94.28% <94.28%> (ø)` | |
   | ... and [70 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [68e7f2e...4f63252](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] y1chi commented on a change in pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
y1chi commented on a change in pull request #12727:
URL: https://github.com/apache/beam/pull/12727#discussion_r491178572



##########
File path: sdks/python/apache_beam/runners/dataflow/dataflow_runner.py
##########
@@ -473,10 +474,19 @@ def run_pipeline(self, pipeline, options):
 
     use_fnapi = apiclient._use_fnapi(options)
     from apache_beam.transforms import environments
-    self._default_environment = (
-        environments.DockerEnvironment.from_container_image(
-            apiclient.get_container_image_from_options(options),
-            artifacts=environments.python_sdk_dependencies(options)))
+    if options.view_as(DebugOptions).lookup_experiment(
+        'prebuild_sdk_container'):

Review comment:
       make sense, moved to experiment.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] tvalentyn commented on a change in pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
tvalentyn commented on a change in pull request #12727:
URL: https://github.com/apache/beam/pull/12727#discussion_r493134703



##########
File path: sdks/python/apache_beam/options/pipeline_options.py
##########
@@ -1003,6 +1003,13 @@ def _add_argparse_args(cls, parser):
             'environment. Choose the docker build engine of local docker '
             'environment or google cloud build by passing the option '
             'local_docker or cloud_build.'))
+    parser.add_argument(
+        '--prebuild_sdk_container_base_image',
+        default=None,
+        help=(
+            'The base image to use when pre-building the sdk container image '
+            'with dependencies, if not specified, the latest public '

Review comment:
       It may be incompatible when breaking changes happen. We could require that for dev sdks users must provide an image (could be 'nightly' if/when we build those, or built from Dockerfile). 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: Add option to prebuild python sdk container

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/a99c6826a067f49ebb60e625c8652900c7d0e810?el=desc) will **increase** coverage by `5.88%`.
   > The diff coverage is `33.80%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   + Coverage   34.32%   40.21%   +5.88%     
   ==========================================
     Files         694      455     -239     
     Lines       82226    53738   -28488     
     Branches     9294        0    -9294     
   ==========================================
   - Hits        28225    21610    -6615     
   + Misses      53578    32128   -21450     
   + Partials      423        0     -423     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `20.20% <28.57%> (ø)` | |
   | [...che\_beam/runners/dataflow/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `34.37% <34.37%> (ø)` | |
   | [testing/metric\_result\_matchers\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dGVzdGluZy9tZXRyaWNfcmVzdWx0X21hdGNoZXJzX3Rlc3QucHk=) | | |
   | [coders/observable.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-Y29kZXJzL29ic2VydmFibGUucHk=) | | |
   | [coders/coders\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-Y29kZXJzL2NvZGVyc190ZXN0LnB5) | | |
   | [.../interactive/display/interactive\_pipeline\_graph.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9pbnRlcmFjdGl2ZS9kaXNwbGF5L2ludGVyYWN0aXZlX3BpcGVsaW5lX2dyYXBoLnB5) | | |
   | [io/gcp/bigquery\_write\_it\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vZ2NwL2JpZ3F1ZXJ5X3dyaXRlX2l0X3Rlc3QucHk=) | | |
   | [io/gcp/experimental/spannerio\_write\_it\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vZ2NwL2V4cGVyaW1lbnRhbC9zcGFubmVyaW9fd3JpdGVfaXRfdGVzdC5weQ==) | | |
   | [internal/http\_client.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW50ZXJuYWwvaHR0cF9jbGllbnQucHk=) | | |
   | [...teractive/testing/integration/notebook\_executor.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9pbnRlcmFjdGl2ZS90ZXN0aW5nL2ludGVncmF0aW9uL25vdGVib29rX2V4ZWN1dG9yLnB5) | | |
   | ... and [1141 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [a99c682...20c8398](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] tvalentyn merged pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
tvalentyn merged pull request #12727:
URL: https://github.com/apache/beam/pull/12727


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] y1chi commented on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
y1chi commented on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-697023719


   @aaltay @ananvay test added, PTAL.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/5ef04e945fb1a3948d665af5d6b7f13b86487616?el=desc) will **decrease** coverage by `0.19%`.
   > The diff coverage is `54.59%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   - Coverage   82.36%   82.16%   -0.20%     
   ==========================================
     Files         451      453       +2     
     Lines       53753    54009     +256     
   ==========================================
   + Hits        44273    44377     +104     
   - Misses       9480     9632     +152     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...eam/testing/benchmarks/nexmark/nexmark\_launcher.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19sYXVuY2hlci5weQ==) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_perf.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19wZXJmLnB5) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_util.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya191dGlsLnB5) | `0.00% <0.00%> (ø)` | |
   | [...s/dataflow/internal/sdk\_container\_cloud\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9zZGtfY29udGFpbmVyX2Nsb3VkX2J1aWxkZXIucHk=) | `34.14% <34.14%> (ø)` | |
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `72.02% <42.85%> (-0.58%)` | :arrow_down: |
   | [...\_beam/runners/portability/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9wb3J0YWJpbGl0eS9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `42.85% <42.85%> (ø)` | |
   | [...dks/python/apache\_beam/options/pipeline\_options.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vb3B0aW9ucy9waXBlbGluZV9vcHRpb25zLnB5) | `95.01% <70.00%> (+0.02%)` | :arrow_up: |
   | [...beam/runners/interactive/background\_caching\_job.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9iYWNrZ3JvdW5kX2NhY2hpbmdfam9iLnB5) | `94.78% <90.90%> (ø)` | |
   | [sdks/python/apache\_beam/utils/histogram.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdXRpbHMvaGlzdG9ncmFtLnB5) | `94.28% <94.28%> (ø)` | |
   | [...ache\_beam/runners/interactive/recording\_manager.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9yZWNvcmRpbmdfbWFuYWdlci5weQ==) | `98.05% <95.74%> (+5.19%)` | :arrow_up: |
   | ... and [62 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [68e7f2e...81f9a9e](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] y1chi commented on a change in pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
y1chi commented on a change in pull request #12727:
URL: https://github.com/apache/beam/pull/12727#discussion_r492290645



##########
File path: sdks/python/apache_beam/runners/portability/stager.py
##########
@@ -119,6 +119,7 @@ def create_job_resources(options,  # type: PipelineOptions
                            temp_dir,  # type: str
                            build_setup_args=None,  # type: Optional[List[str]]
                            populate_requirements_cache=None,  # type: Optional[str]
+                           skip_boot_dependencies=False, # type: Optional[bool]

Review comment:
       Sounds good to me. The pickled main session is expected to be stored in semi persistent directory and I believe that is re-mounted at container launch time right now. Should we add another flag to boot.go to specify a separate path for prestaged picked main session directory?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/5ef04e945fb1a3948d665af5d6b7f13b86487616?el=desc) will **decrease** coverage by `0.16%`.
   > The diff coverage is `52.76%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   - Coverage   82.36%   82.20%   -0.17%     
   ==========================================
     Files         451      454       +3     
     Lines       53753    54215     +462     
   ==========================================
   + Hits        44273    44566     +293     
   - Misses       9480     9649     +169     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `72.60% <0.00%> (ø)` | |
   | [...eam/testing/benchmarks/nexmark/nexmark\_launcher.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19sYXVuY2hlci5weQ==) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_perf.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19wZXJmLnB5) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_util.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya191dGlsLnB5) | `0.00% <0.00%> (ø)` | |
   | [...\_beam/runners/portability/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9wb3J0YWJpbGl0eS9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `31.78% <31.78%> (ø)` | |
   | [...ks/python/apache\_beam/runners/worker/sdk\_worker.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy93b3JrZXIvc2RrX3dvcmtlci5weQ==) | `88.63% <50.00%> (-0.54%)` | :arrow_down: |
   | [...on/apache\_beam/runners/dataflow/dataflow\_runner.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9kYXRhZmxvd19ydW5uZXIucHk=) | `77.06% <66.66%> (-0.12%)` | :arrow_down: |
   | [sdks/python/apache\_beam/transforms/environments.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdHJhbnNmb3Jtcy9lbnZpcm9ubWVudHMucHk=) | `83.49% <66.66%> (-0.33%)` | :arrow_down: |
   | [...dks/python/apache\_beam/options/pipeline\_options.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vb3B0aW9ucy9waXBlbGluZV9vcHRpb25zLnB5) | `95.01% <70.00%> (+0.02%)` | :arrow_up: |
   | [...beam/runners/interactive/background\_caching\_job.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9iYWNrZ3JvdW5kX2NhY2hpbmdfam9iLnB5) | `94.78% <90.90%> (ø)` | |
   | ... and [73 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [68e7f2e...8a1ceaa](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] y1chi commented on a change in pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
y1chi commented on a change in pull request #12727:
URL: https://github.com/apache/beam/pull/12727#discussion_r492220801



##########
File path: sdks/python/apache_beam/transforms/environments.py
##########
@@ -252,6 +254,14 @@ def from_runner_api_parameter(payload, capabilities, artifacts, context):
   @classmethod
   def from_options(cls, options):
     # type: (PipelineOptions) -> DockerEnvironment
+    if options.view_as(DebugOptions).lookup_experiment(
+        'prebuild_sdk_container'):
+      prebuilt_container_image = SdkContainerBuilder.build_container_imge(

Review comment:
       Changed to invoking from_options in dataflow runner.

##########
File path: sdks/python/apache_beam/runners/portability/sdk_container_builder.py
##########
@@ -0,0 +1,275 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+"""SdkContainerBuilder builds the portable SDK container with dependencies.
+
+It copies the right boot dependencies, namely: apache beam sdk, python packages
+from requirements.txt, python packages from extra_packages.txt, workflow
+tarball, into the latest public python sdk container image, and run the
+dependencies installation in advance with the boot program in setup only mode
+to build the new image.
+"""
+
+from __future__ import absolute_import
+
+import json
+import logging
+import os
+import shutil
+import subprocess
+import sys
+import tarfile
+import tempfile
+import time
+import uuid
+
+from google.protobuf.duration_pb2 import Duration
+from google.protobuf.json_format import MessageToJson
+
+from apache_beam.internal.gcp.auth import get_service_credentials
+from apache_beam.internal.http_client import get_new_http
+from apache_beam.io.gcp.internal.clients import storage
+from apache_beam.options.pipeline_options import DebugOptions
+from apache_beam.options.pipeline_options import GoogleCloudOptions
+from apache_beam.options.pipeline_options import PipelineOptions  # pylint: disable=unused-import
+from apache_beam.portability import common_urns
+from apache_beam.portability.api import beam_runner_api_pb2
+from apache_beam.runners.portability.stager import Stager
+
+ARTIFACTS_CONTAINER_DIR = '/opt/apache/beam/artifacts'
+ARTIFACTS_MANIFEST_FILE = 'artifacts_info.json'
+SDK_CONTAINER_ENTRYPOINT = '/opt/apache/beam/boot'
+DOCKERFILE_TEMPLATE = (
+    """FROM apache/beam_python{major}.{minor}_sdk:latest
+RUN mkdir -p {workdir}
+COPY ./* {workdir}/
+RUN {entrypoint} --setup_only --artifacts {workdir}/{manifest_file}
+""")
+
+SOURCE_FOLDER = 'source'
+_LOGGER = logging.getLogger(__name__)
+
+
+class SdkContainerBuilder(object):
+  def __init__(self, options):
+    self._options = options
+    self._temp_src_dir = tempfile.mkdtemp()
+    self._docker_registry_push_url = self._options.view_as(
+        DebugOptions).lookup_experiment('docker_registry_push_url')
+
+  def build(self):
+    container_id = str(uuid.uuid4())
+    container_tag = os.path.join(
+        self._docker_registry_push_url or '',
+        'beam_python_prebuilt_sdk:%s' % container_id)
+    self.prepare_dependencies()
+    self.invoke_docker_build_and_push(container_id, container_tag)
+
+    return container_tag
+
+  def prepare_dependencies(self):
+    tmp = tempfile.mkdtemp()
+    resources = Stager.create_job_resources(self._options, tmp)
+    # make a copy of the staged artifacts into the temp source folder.
+    for path, name in resources:
+      shutil.copyfile(path, os.path.join(self._temp_src_dir, name))
+    with open(os.path.join(self._temp_src_dir, 'Dockerfile'), 'w') as file:
+      file.write(
+          DOCKERFILE_TEMPLATE.format(
+              major=sys.version_info[0],
+              minor=sys.version_info[1],
+              workdir=ARTIFACTS_CONTAINER_DIR,
+              manifest_file=ARTIFACTS_MANIFEST_FILE,
+              entrypoint=SDK_CONTAINER_ENTRYPOINT))
+    self.generate_artifacts_manifests_json_file(resources, self._temp_src_dir)
+
+  def invoke_docker_build_and_push(self, container_id, container_tag):
+    raise NotImplementedError
+
+  @staticmethod
+  def generate_artifacts_manifests_json_file(resources, temp_dir):
+    infos = []
+    for _, name in resources:
+      info = beam_runner_api_pb2.ArtifactInformation(
+          type_urn=common_urns.StandardArtifacts.Types.FILE.urn,
+          type_payload=beam_runner_api_pb2.ArtifactFilePayload(
+              path=name).SerializeToString(),
+      )
+      infos.append(json.dumps(MessageToJson(info)))
+    with open(os.path.join(temp_dir, ARTIFACTS_MANIFEST_FILE), 'w') as file:
+      file.write('[\n' + ',\n'.join(infos) + '\n]')
+
+  @classmethod
+  def build_container_imge(cls, pipeline_options):

Review comment:
       done.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] y1chi commented on a change in pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
y1chi commented on a change in pull request #12727:
URL: https://github.com/apache/beam/pull/12727#discussion_r493104239



##########
File path: sdks/python/apache_beam/runners/portability/sdk_container_builder.py
##########
@@ -0,0 +1,279 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+"""SdkContainerBuilder builds the portable SDK container with dependencies.
+
+It copies the right boot dependencies, namely: apache beam sdk, python packages
+from requirements.txt, python packages from extra_packages.txt, workflow
+tarball, into the latest public python sdk container image, and run the
+dependencies installation in advance with the boot program in setup only mode
+to build the new image.
+"""
+
+from __future__ import absolute_import
+
+import json
+import logging
+import os
+import shutil
+import subprocess
+import sys
+import tarfile
+import tempfile
+import time
+import uuid
+
+from google.protobuf.duration_pb2 import Duration
+from google.protobuf.json_format import MessageToJson
+
+from apache_beam.internal.gcp.auth import get_service_credentials
+from apache_beam.internal.http_client import get_new_http
+from apache_beam.io.gcp.internal.clients import storage
+from apache_beam.options.pipeline_options import GoogleCloudOptions
+from apache_beam.options.pipeline_options import PipelineOptions  # pylint: disable=unused-import
+from apache_beam.options.pipeline_options import SetupOptions
+from apache_beam.portability import common_urns
+from apache_beam.portability.api import beam_runner_api_pb2
+from apache_beam.runners.portability.stager import Stager
+
+ARTIFACTS_CONTAINER_DIR = '/opt/apache/beam/artifacts'
+ARTIFACTS_MANIFEST_FILE = 'artifacts_info.json'
+SDK_CONTAINER_ENTRYPOINT = '/opt/apache/beam/boot'
+DOCKERFILE_TEMPLATE = (
+    """FROM {base_image}
+RUN mkdir -p {workdir}
+COPY ./* {workdir}/
+RUN {entrypoint} --setup_only --artifacts {workdir}/{manifest_file}
+""")
+
+SOURCE_FOLDER = 'source'
+_LOGGER = logging.getLogger(__name__)
+
+
+class SdkContainerBuilder(object):
+  def __init__(self, options):
+    self._options = options
+    self._docker_registry_push_url = self._options.view_as(
+        SetupOptions).docker_registry_push_url
+    self._base_image = (
+        self._options.view_as(SetupOptions).prebuild_sdk_container_base_image or
+        'apache/beam_python%s.%s_sdk:latest' %
+        (sys.version_info[0], sys.version_info[1]))
+    self._temp_src_dir = None
+
+  def build(self):
+    container_id = str(uuid.uuid4())
+    container_tag = os.path.join(
+        self._docker_registry_push_url or '',
+        'beam_python_prebuilt_sdk:%s' % container_id)
+    with tempfile.TemporaryDirectory() as temp_folder:
+      self._temp_src_dir = temp_folder
+      self.prepare_dependencies()
+      self.invoke_docker_build_and_push(container_id, container_tag)
+
+    return container_tag
+
+  def prepare_dependencies(self):
+    with tempfile.TemporaryDirectory() as tmp:
+      resources = Stager.create_job_resources(self._options, tmp)
+      # make a copy of the staged artifacts into the temp source folder.
+      for path, name in resources:
+        shutil.copyfile(path, os.path.join(self._temp_src_dir, name))
+      with open(os.path.join(self._temp_src_dir, 'Dockerfile'), 'w') as file:
+        file.write(
+            DOCKERFILE_TEMPLATE.format(
+                base_image=self._base_image,
+                workdir=ARTIFACTS_CONTAINER_DIR,
+                manifest_file=ARTIFACTS_MANIFEST_FILE,
+                entrypoint=SDK_CONTAINER_ENTRYPOINT))
+      self.generate_artifacts_manifests_json_file(resources, self._temp_src_dir)
+
+  def invoke_docker_build_and_push(self, container_id, container_tag):
+    raise NotImplementedError
+
+  @staticmethod
+  def generate_artifacts_manifests_json_file(resources, temp_dir):
+    infos = []
+    for _, name in resources:
+      info = beam_runner_api_pb2.ArtifactInformation(
+          type_urn=common_urns.StandardArtifacts.Types.FILE.urn,
+          type_payload=beam_runner_api_pb2.ArtifactFilePayload(
+              path=name).SerializeToString(),
+      )
+      infos.append(json.dumps(MessageToJson(info)))
+    with open(os.path.join(temp_dir, ARTIFACTS_MANIFEST_FILE), 'w') as file:
+      file.write('[\n' + ',\n'.join(infos) + '\n]')
+
+  @classmethod
+  def build_container_image(cls, pipeline_options):
+    # type: (PipelineOptions) -> str

Review comment:
       done.

##########
File path: sdks/python/apache_beam/examples/wordcount_it_test.py
##########
@@ -56,6 +57,17 @@ def test_wordcount_it(self):
   def test_wordcount_fnapi_it(self):
     self._run_wordcount_it(wordcount.run, experiment='beam_fn_api')
 
+  @attr('ValidatesContainer')
+  def test_wordcount_it_with_prebuilt_sdk_container(self):
+    if sys.version_info[0] < 3:

Review comment:
       done.

##########
File path: sdks/python/apache_beam/runners/portability/sdk_container_builder.py
##########
@@ -0,0 +1,274 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+"""SdkContainerBuilder builds the portable SDK container with dependencies.
+
+It copies the right boot dependencies, namely: apache beam sdk, python packages
+from requirements.txt, python packages from extra_packages.txt, workflow
+tarball, into the latest public python sdk container image, and run the
+dependencies installation in advance with the boot program in setup only mode
+to build the new image.
+"""
+
+from __future__ import absolute_import
+
+import json
+import logging
+import os
+import shutil
+import subprocess
+import sys
+import tarfile
+import tempfile
+import time
+import uuid
+
+from google.protobuf.duration_pb2 import Duration
+from google.protobuf.json_format import MessageToJson
+
+from apache_beam.internal.gcp.auth import get_service_credentials
+from apache_beam.internal.http_client import get_new_http
+from apache_beam.io.gcp.internal.clients import storage
+from apache_beam.options.pipeline_options import GoogleCloudOptions
+from apache_beam.options.pipeline_options import PipelineOptions  # pylint: disable=unused-import
+from apache_beam.options.pipeline_options import SetupOptions
+from apache_beam.portability import common_urns
+from apache_beam.portability.api import beam_runner_api_pb2
+from apache_beam.runners.portability.stager import Stager
+
+ARTIFACTS_CONTAINER_DIR = '/opt/apache/beam/artifacts'
+ARTIFACTS_MANIFEST_FILE = 'artifacts_info.json'
+SDK_CONTAINER_ENTRYPOINT = '/opt/apache/beam/boot'
+DOCKERFILE_TEMPLATE = (
+    """FROM apache/beam_python{major}.{minor}_sdk:latest
+RUN mkdir -p {workdir}
+COPY ./* {workdir}/
+RUN {entrypoint} --setup_only --artifacts {workdir}/{manifest_file}
+""")
+
+SOURCE_FOLDER = 'source'
+_LOGGER = logging.getLogger(__name__)
+
+
+class SdkContainerBuilder(object):
+  def __init__(self, options):
+    self._options = options
+    self._temp_src_dir = tempfile.mkdtemp()
+    self._docker_registry_push_url = self._options.view_as(
+        SetupOptions).docker_registry_push_url
+
+  def build(self):

Review comment:
       done.

##########
File path: sdks/python/apache_beam/runners/dataflow/dataflow_runner.py
##########
@@ -473,10 +473,16 @@ def run_pipeline(self, pipeline, options):
 
     use_fnapi = apiclient._use_fnapi(options)
     from apache_beam.transforms import environments
-    self._default_environment = (
-        environments.DockerEnvironment.from_container_image(
-            apiclient.get_container_image_from_options(options),
-            artifacts=environments.python_sdk_dependencies(options)))
+    if options.view_as(SetupOptions).prebuild_sdk_container_engine:

Review comment:
       done.

##########
File path: sdks/python/apache_beam/options/pipeline_options.py
##########
@@ -994,6 +994,21 @@ def _add_argparse_args(cls, parser):
             'staged in the staging area (--staging_location option) and the '
             'workers will install them in same order they were specified on '
             'the command line.'))
+    parser.add_argument(
+        '--prebuild_sdk_container_engine',
+        choices=['local_docker', 'cloud_build'],
+        help=(
+            'Pre-builds the sdk worker container image with boot dependencies '

Review comment:
       done.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: Add option to prebuild python sdk container

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/a99c6826a067f49ebb60e625c8652900c7d0e810?el=desc) will **increase** coverage by `5.88%`.
   > The diff coverage is `33.80%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   + Coverage   34.32%   40.21%   +5.88%     
   ==========================================
     Files         694      455     -239     
     Lines       82226    53738   -28488     
     Branches     9294        0    -9294     
   ==========================================
   - Hits        28225    21610    -6615     
   + Misses      53578    32128   -21450     
   + Partials      423        0     -423     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `20.20% <28.57%> (ø)` | |
   | [...che\_beam/runners/dataflow/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `34.37% <34.37%> (ø)` | |
   | [examples/flink/flink\_streaming\_impulse.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZXhhbXBsZXMvZmxpbmsvZmxpbmtfc3RyZWFtaW5nX2ltcHVsc2UucHk=) | | |
   | [io/hadoopfilesystem.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vaGFkb29wZmlsZXN5c3RlbS5weQ==) | | |
   | [dataframe/convert\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZGF0YWZyYW1lL2NvbnZlcnRfdGVzdC5weQ==) | | |
   | [io/aws/\_\_init\_\_.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vYXdzL19faW5pdF9fLnB5) | | |
   | [tools/map\_fn\_microbenchmark.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dG9vbHMvbWFwX2ZuX21pY3JvYmVuY2htYXJrLnB5) | | |
   | [io/gcp/bigquery\_io\_read\_it\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vZ2NwL2JpZ3F1ZXJ5X2lvX3JlYWRfaXRfdGVzdC5weQ==) | | |
   | [testing/benchmarks/nexmark/models/auction\_bid.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbW9kZWxzL2F1Y3Rpb25fYmlkLnB5) | | |
   | [io/gcp/tests/bigquery\_matcher.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vZ2NwL3Rlc3RzL2JpZ3F1ZXJ5X21hdGNoZXIucHk=) | | |
   | ... and [1141 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [a99c682...e747445](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: Add option to prebuild python sdk container

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/a99c6826a067f49ebb60e625c8652900c7d0e810?el=desc) will **increase** coverage by `5.88%`.
   > The diff coverage is `33.80%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   + Coverage   34.32%   40.21%   +5.88%     
   ==========================================
     Files         694      455     -239     
     Lines       82226    53738   -28488     
     Branches     9294        0    -9294     
   ==========================================
   - Hits        28225    21610    -6615     
   + Misses      53578    32128   -21450     
   + Partials      423        0     -423     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `20.20% <28.57%> (ø)` | |
   | [...che\_beam/runners/dataflow/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `34.37% <34.37%> (ø)` | |
   | [io/avroio.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vYXZyb2lvLnB5) | | |
   | [transforms/cy\_combiners.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dHJhbnNmb3Jtcy9jeV9jb21iaW5lcnMucHk=) | | |
   | [ml/gcp/visionml\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-bWwvZ2NwL3Zpc2lvbm1sX3Rlc3QucHk=) | | |
   | [utils/retry\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dXRpbHMvcmV0cnlfdGVzdC5weQ==) | | |
   | [io/filebasedsink\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vZmlsZWJhc2Vkc2lua190ZXN0LnB5) | | |
   | [runners/dataflow/dataflow\_metrics.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9kYXRhZmxvdy9kYXRhZmxvd19tZXRyaWNzLnB5) | | |
   | [examples/cookbook/multiple\_output\_pardo.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZXhhbXBsZXMvY29va2Jvb2svbXVsdGlwbGVfb3V0cHV0X3BhcmRvLnB5) | | |
   | [ml/gcp/cloud\_dlp.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-bWwvZ2NwL2Nsb3VkX2RscC5weQ==) | | |
   | ... and [1141 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [a99c682...e747445](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/5ef04e945fb1a3948d665af5d6b7f13b86487616?el=desc) will **decrease** coverage by `0.19%`.
   > The diff coverage is `54.59%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   - Coverage   82.36%   82.16%   -0.20%     
   ==========================================
     Files         451      453       +2     
     Lines       53753    54009     +256     
   ==========================================
   + Hits        44273    44378     +105     
   - Misses       9480     9631     +151     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...eam/testing/benchmarks/nexmark/nexmark\_launcher.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19sYXVuY2hlci5weQ==) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_perf.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19wZXJmLnB5) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_util.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya191dGlsLnB5) | `0.00% <0.00%> (ø)` | |
   | [...s/dataflow/internal/sdk\_container\_cloud\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9zZGtfY29udGFpbmVyX2Nsb3VkX2J1aWxkZXIucHk=) | `34.14% <34.14%> (ø)` | |
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `72.02% <42.85%> (-0.58%)` | :arrow_down: |
   | [...\_beam/runners/portability/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9wb3J0YWJpbGl0eS9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `42.85% <42.85%> (ø)` | |
   | [...dks/python/apache\_beam/options/pipeline\_options.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vb3B0aW9ucy9waXBlbGluZV9vcHRpb25zLnB5) | `95.01% <70.00%> (+0.02%)` | :arrow_up: |
   | [...beam/runners/interactive/background\_caching\_job.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9iYWNrZ3JvdW5kX2NhY2hpbmdfam9iLnB5) | `94.78% <90.90%> (ø)` | |
   | [sdks/python/apache\_beam/utils/histogram.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdXRpbHMvaGlzdG9ncmFtLnB5) | `94.28% <94.28%> (ø)` | |
   | [...ache\_beam/runners/interactive/recording\_manager.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9yZWNvcmRpbmdfbWFuYWdlci5weQ==) | `98.05% <95.74%> (+5.19%)` | :arrow_up: |
   | ... and [61 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [68e7f2e...3e6cb8e](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/5ef04e945fb1a3948d665af5d6b7f13b86487616?el=desc) will **decrease** coverage by `0.20%`.
   > The diff coverage is `52.86%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   - Coverage   82.36%   82.16%   -0.21%     
   ==========================================
     Files         451      452       +1     
     Lines       53753    54036     +283     
   ==========================================
   + Hits        44273    44397     +124     
   - Misses       9480     9639     +159     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `72.60% <0.00%> (ø)` | |
   | [...eam/testing/benchmarks/nexmark/nexmark\_launcher.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19sYXVuY2hlci5weQ==) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_perf.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19wZXJmLnB5) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_util.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya191dGlsLnB5) | `0.00% <0.00%> (ø)` | |
   | [...\_beam/runners/portability/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9wb3J0YWJpbGl0eS9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `32.23% <32.23%> (ø)` | |
   | [...on/apache\_beam/runners/dataflow/dataflow\_runner.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9kYXRhZmxvd19ydW5uZXIucHk=) | `77.03% <60.00%> (-0.15%)` | :arrow_down: |
   | [...dks/python/apache\_beam/options/pipeline\_options.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vb3B0aW9ucy9waXBlbGluZV9vcHRpb25zLnB5) | `95.00% <66.66%> (+0.01%)` | :arrow_up: |
   | [sdks/python/apache\_beam/transforms/environments.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdHJhbnNmb3Jtcy9lbnZpcm9ubWVudHMucHk=) | `83.49% <66.66%> (-0.33%)` | :arrow_down: |
   | [...beam/runners/interactive/background\_caching\_job.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9iYWNrZ3JvdW5kX2NhY2hpbmdfam9iLnB5) | `94.78% <90.90%> (ø)` | |
   | [sdks/python/apache\_beam/utils/histogram.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdXRpbHMvaGlzdG9ncmFtLnB5) | `94.28% <94.28%> (ø)` | |
   | ... and [66 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [68e7f2e...984c4e7](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: Add option to prebuild python sdk container

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/a99c6826a067f49ebb60e625c8652900c7d0e810?el=desc) will **increase** coverage by `5.88%`.
   > The diff coverage is `33.80%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   + Coverage   34.32%   40.21%   +5.88%     
   ==========================================
     Files         694      455     -239     
     Lines       82226    53738   -28488     
     Branches     9294        0    -9294     
   ==========================================
   - Hits        28225    21610    -6615     
   + Misses      53578    32128   -21450     
   + Partials      423        0     -423     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `20.20% <28.57%> (ø)` | |
   | [...che\_beam/runners/dataflow/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `34.37% <34.37%> (ø)` | |
   | [io/aws/s3io\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vYXdzL3MzaW9fdGVzdC5weQ==) | | |
   | [ml/gcp/cloud\_dlp\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-bWwvZ2NwL2Nsb3VkX2RscF90ZXN0LnB5) | | |
   | [io/gcp/experimental/\_\_init\_\_.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vZ2NwL2V4cGVyaW1lbnRhbC9fX2luaXRfXy5weQ==) | | |
   | [examples/cookbook/filters\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZXhhbXBsZXMvY29va2Jvb2svZmlsdGVyc190ZXN0LnB5) | | |
   | [...s/snippets/transforms/elementwise/tostring\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZXhhbXBsZXMvc25pcHBldHMvdHJhbnNmb3Jtcy9lbGVtZW50d2lzZS90b3N0cmluZ190ZXN0LnB5) | | |
   | [...snippets/transforms/aggregation/groupbykey\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZXhhbXBsZXMvc25pcHBldHMvdHJhbnNmb3Jtcy9hZ2dyZWdhdGlvbi9ncm91cGJ5a2V5X3Rlc3QucHk=) | | |
   | [version.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dmVyc2lvbi5weQ==) | | |
   | [examples/cookbook/\_\_init\_\_.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZXhhbXBsZXMvY29va2Jvb2svX19pbml0X18ucHk=) | | |
   | ... and [1141 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [a99c682...2c4505c](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] aaltay commented on a change in pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
aaltay commented on a change in pull request #12727:
URL: https://github.com/apache/beam/pull/12727#discussion_r492448750



##########
File path: sdks/python/setup.py
##########
@@ -215,6 +215,8 @@ def get_version():
     'google-cloud-language>=1.3.0,<2',
     'google-cloud-videointelligence>=1.8.0,<2',
     'google-cloud-vision>=0.38.0,<2',
+    # GCP packages required by fast container startup functionality.

Review comment:
       nit: "required by prebuild sdk container functionality". That is what you are calling it in options.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: Add option to prebuild python sdk container

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/a99c6826a067f49ebb60e625c8652900c7d0e810?el=desc) will **increase** coverage by `5.88%`.
   > The diff coverage is `33.80%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   + Coverage   34.32%   40.21%   +5.88%     
   ==========================================
     Files         694      455     -239     
     Lines       82226    53738   -28488     
     Branches     9294        0    -9294     
   ==========================================
   - Hits        28225    21610    -6615     
   + Misses      53578    32128   -21450     
   + Partials      423        0     -423     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `20.20% <28.57%> (ø)` | |
   | [...che\_beam/runners/dataflow/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `34.37% <34.37%> (ø)` | |
   | [...ers/dataflow/dataflow\_exercise\_metrics\_pipeline.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9kYXRhZmxvdy9kYXRhZmxvd19leGVyY2lzZV9tZXRyaWNzX3BpcGVsaW5lLnB5) | | |
   | [testing/test\_stream\_service.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dGVzdGluZy90ZXN0X3N0cmVhbV9zZXJ2aWNlLnB5) | | |
   | [io/aws/s3io.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vYXdzL3MzaW8ucHk=) | | |
   | [tools/sideinput\_microbenchmark.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dG9vbHMvc2lkZWlucHV0X21pY3JvYmVuY2htYXJrLnB5) | | |
   | [io/fileio.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vZmlsZWlvLnB5) | | |
   | [dataframe/schemas.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZGF0YWZyYW1lL3NjaGVtYXMucHk=) | | |
   | [typehints/schemas.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dHlwZWhpbnRzL3NjaGVtYXMucHk=) | | |
   | [io/gcp/bigquery\_avro\_tools\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vZ2NwL2JpZ3F1ZXJ5X2F2cm9fdG9vbHNfdGVzdC5weQ==) | | |
   | ... and [1141 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [a99c682...030594c](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/5ef04e945fb1a3948d665af5d6b7f13b86487616?el=desc) will **decrease** coverage by `0.18%`.
   > The diff coverage is `52.77%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   - Coverage   82.36%   82.18%   -0.19%     
   ==========================================
     Files         451      453       +2     
     Lines       53753    54177     +424     
   ==========================================
   + Hits        44273    44524     +251     
   - Misses       9480     9653     +173     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `72.60% <0.00%> (ø)` | |
   | [...eam/testing/benchmarks/nexmark/nexmark\_launcher.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19sYXVuY2hlci5weQ==) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_perf.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19wZXJmLnB5) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_util.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya191dGlsLnB5) | `0.00% <0.00%> (ø)` | |
   | [...\_beam/runners/portability/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9wb3J0YWJpbGl0eS9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `31.78% <31.78%> (ø)` | |
   | [...on/apache\_beam/runners/dataflow/dataflow\_runner.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9kYXRhZmxvd19ydW5uZXIucHk=) | `77.00% <50.00%> (-0.18%)` | :arrow_down: |
   | [sdks/python/apache\_beam/transforms/environments.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdHJhbnNmb3Jtcy9lbnZpcm9ubWVudHMucHk=) | `83.49% <66.66%> (-0.33%)` | :arrow_down: |
   | [...dks/python/apache\_beam/options/pipeline\_options.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vb3B0aW9ucy9waXBlbGluZV9vcHRpb25zLnB5) | `95.01% <70.00%> (+0.02%)` | :arrow_up: |
   | [...beam/runners/interactive/background\_caching\_job.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9iYWNrZ3JvdW5kX2NhY2hpbmdfam9iLnB5) | `94.78% <90.90%> (ø)` | |
   | [sdks/python/apache\_beam/utils/histogram.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdXRpbHMvaGlzdG9ncmFtLnB5) | `94.28% <94.28%> (ø)` | |
   | ... and [70 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [68e7f2e...8a1ceaa](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: Add option to prebuild python sdk container

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/a99c6826a067f49ebb60e625c8652900c7d0e810?el=desc) will **increase** coverage by `5.88%`.
   > The diff coverage is `33.80%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   + Coverage   34.32%   40.21%   +5.88%     
   ==========================================
     Files         694      455     -239     
     Lines       82226    53738   -28488     
     Branches     9294        0    -9294     
   ==========================================
   - Hits        28225    21610    -6615     
   + Misses      53578    32128   -21450     
   + Partials      423        0     -423     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `20.20% <28.57%> (ø)` | |
   | [...che\_beam/runners/dataflow/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `34.37% <34.37%> (ø)` | |
   | [transforms/stats.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dHJhbnNmb3Jtcy9zdGF0cy5weQ==) | | |
   | [runners/interactive/interactive\_beam.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9pbnRlcmFjdGl2ZS9pbnRlcmFjdGl2ZV9iZWFtLnB5) | | |
   | [runners/interactive/options/capture\_limiters.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9pbnRlcmFjdGl2ZS9vcHRpb25zL2NhcHR1cmVfbGltaXRlcnMucHk=) | | |
   | [examples/cookbook/coders\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZXhhbXBsZXMvY29va2Jvb2svY29kZXJzX3Rlc3QucHk=) | | |
   | [ml/gcp/videointelligenceml\_test\_it.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-bWwvZ2NwL3ZpZGVvaW50ZWxsaWdlbmNlbWxfdGVzdF9pdC5weQ==) | | |
   | [runners/dataflow/internal/names.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9uYW1lcy5weQ==) | | |
   | [utils/interactive\_utils.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dXRpbHMvaW50ZXJhY3RpdmVfdXRpbHMucHk=) | | |
   | [runners/direct/sdf\_direct\_runner.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9kaXJlY3Qvc2RmX2RpcmVjdF9ydW5uZXIucHk=) | | |
   | ... and [1141 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [a99c682...103b2ca](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/5ef04e945fb1a3948d665af5d6b7f13b86487616?el=desc) will **decrease** coverage by `0.18%`.
   > The diff coverage is `52.68%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   - Coverage   82.36%   82.17%   -0.19%     
   ==========================================
     Files         451      452       +1     
     Lines       53753    54034     +281     
   ==========================================
   + Hits        44273    44402     +129     
   - Misses       9480     9632     +152     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `72.60% <0.00%> (ø)` | |
   | [...eam/testing/benchmarks/nexmark/nexmark\_launcher.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19sYXVuY2hlci5weQ==) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_perf.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19wZXJmLnB5) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_util.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya191dGlsLnB5) | `0.00% <0.00%> (ø)` | |
   | [...\_beam/runners/portability/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9wb3J0YWJpbGl0eS9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `31.78% <31.78%> (ø)` | |
   | [...on/apache\_beam/runners/dataflow/dataflow\_runner.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9kYXRhZmxvd19ydW5uZXIucHk=) | `77.03% <60.00%> (-0.15%)` | :arrow_down: |
   | [...dks/python/apache\_beam/options/pipeline\_options.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vb3B0aW9ucy9waXBlbGluZV9vcHRpb25zLnB5) | `94.98% <62.50%> (ø)` | |
   | [sdks/python/apache\_beam/transforms/environments.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdHJhbnNmb3Jtcy9lbnZpcm9ubWVudHMucHk=) | `83.49% <66.66%> (-0.33%)` | :arrow_down: |
   | [...beam/runners/interactive/background\_caching\_job.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9iYWNrZ3JvdW5kX2NhY2hpbmdfam9iLnB5) | `94.78% <90.90%> (ø)` | |
   | [sdks/python/apache\_beam/utils/histogram.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdXRpbHMvaGlzdG9ncmFtLnB5) | `94.28% <94.28%> (ø)` | |
   | ... and [68 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [68e7f2e...e26ecaf](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/5ef04e945fb1a3948d665af5d6b7f13b86487616?el=desc) will **decrease** coverage by `0.18%`.
   > The diff coverage is `52.77%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   - Coverage   82.36%   82.18%   -0.19%     
   ==========================================
     Files         451      453       +2     
     Lines       53753    54177     +424     
   ==========================================
   + Hits        44273    44524     +251     
   - Misses       9480     9653     +173     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `72.60% <0.00%> (ø)` | |
   | [...eam/testing/benchmarks/nexmark/nexmark\_launcher.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19sYXVuY2hlci5weQ==) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_perf.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19wZXJmLnB5) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_util.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya191dGlsLnB5) | `0.00% <0.00%> (ø)` | |
   | [...\_beam/runners/portability/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9wb3J0YWJpbGl0eS9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `31.78% <31.78%> (ø)` | |
   | [...on/apache\_beam/runners/dataflow/dataflow\_runner.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9kYXRhZmxvd19ydW5uZXIucHk=) | `77.00% <50.00%> (-0.18%)` | :arrow_down: |
   | [sdks/python/apache\_beam/transforms/environments.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdHJhbnNmb3Jtcy9lbnZpcm9ubWVudHMucHk=) | `83.49% <66.66%> (-0.33%)` | :arrow_down: |
   | [...dks/python/apache\_beam/options/pipeline\_options.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vb3B0aW9ucy9waXBlbGluZV9vcHRpb25zLnB5) | `95.01% <70.00%> (+0.02%)` | :arrow_up: |
   | [...beam/runners/interactive/background\_caching\_job.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9iYWNrZ3JvdW5kX2NhY2hpbmdfam9iLnB5) | `94.78% <90.90%> (ø)` | |
   | [sdks/python/apache\_beam/utils/histogram.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdXRpbHMvaGlzdG9ncmFtLnB5) | `94.28% <94.28%> (ø)` | |
   | ... and [70 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [68e7f2e...4f63252](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] robertwb commented on a change in pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
robertwb commented on a change in pull request #12727:
URL: https://github.com/apache/beam/pull/12727#discussion_r492191803



##########
File path: sdks/python/apache_beam/runners/dataflow/dataflow_runner.py
##########
@@ -473,10 +474,19 @@ def run_pipeline(self, pipeline, options):
 
     use_fnapi = apiclient._use_fnapi(options)
     from apache_beam.transforms import environments
-    self._default_environment = (
-        environments.DockerEnvironment.from_container_image(
-            apiclient.get_container_image_from_options(options),
-            artifacts=environments.python_sdk_dependencies(options)))
+    if options.view_as(DebugOptions).lookup_experiment(
+        'prebuild_sdk_container'):

Review comment:
       +1 to being consistent. I would lean towards both being top-level options. 

##########
File path: sdks/python/apache_beam/runners/portability/stager.py
##########
@@ -119,6 +119,7 @@ def create_job_resources(options,  # type: PipelineOptions
                            temp_dir,  # type: str
                            build_setup_args=None,  # type: Optional[List[str]]
                            populate_requirements_cache=None,  # type: Optional[str]
+                           skip_boot_dependencies=False, # type: Optional[bool]

Review comment:
       Why are "boot" dependencies handled any differently than non-"boot" dependencies? 

##########
File path: sdks/python/apache_beam/runners/portability/sdk_container_builder.py
##########
@@ -0,0 +1,275 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+"""SdkContainerBuilder builds the portable SDK container with dependencies.
+
+It copies the right boot dependencies, namely: apache beam sdk, python packages
+from requirements.txt, python packages from extra_packages.txt, workflow
+tarball, into the latest public python sdk container image, and run the
+dependencies installation in advance with the boot program in setup only mode
+to build the new image.
+"""
+
+from __future__ import absolute_import
+
+import json
+import logging
+import os
+import shutil
+import subprocess
+import sys
+import tarfile
+import tempfile
+import time
+import uuid
+
+from google.protobuf.duration_pb2 import Duration
+from google.protobuf.json_format import MessageToJson
+
+from apache_beam.internal.gcp.auth import get_service_credentials
+from apache_beam.internal.http_client import get_new_http
+from apache_beam.io.gcp.internal.clients import storage
+from apache_beam.options.pipeline_options import DebugOptions
+from apache_beam.options.pipeline_options import GoogleCloudOptions
+from apache_beam.options.pipeline_options import PipelineOptions  # pylint: disable=unused-import
+from apache_beam.portability import common_urns
+from apache_beam.portability.api import beam_runner_api_pb2
+from apache_beam.runners.portability.stager import Stager
+
+ARTIFACTS_CONTAINER_DIR = '/opt/apache/beam/artifacts'
+ARTIFACTS_MANIFEST_FILE = 'artifacts_info.json'
+SDK_CONTAINER_ENTRYPOINT = '/opt/apache/beam/boot'
+DOCKERFILE_TEMPLATE = (
+    """FROM apache/beam_python{major}.{minor}_sdk:latest
+RUN mkdir -p {workdir}
+COPY ./* {workdir}/
+RUN {entrypoint} --setup_only --artifacts {workdir}/{manifest_file}
+""")
+
+SOURCE_FOLDER = 'source'
+_LOGGER = logging.getLogger(__name__)
+
+
+class SdkContainerBuilder(object):
+  def __init__(self, options):
+    self._options = options
+    self._temp_src_dir = tempfile.mkdtemp()
+    self._docker_registry_push_url = self._options.view_as(
+        DebugOptions).lookup_experiment('docker_registry_push_url')
+
+  def build(self):
+    container_id = str(uuid.uuid4())
+    container_tag = os.path.join(
+        self._docker_registry_push_url or '',
+        'beam_python_prebuilt_sdk:%s' % container_id)
+    self.prepare_dependencies()
+    self.invoke_docker_build_and_push(container_id, container_tag)
+
+    return container_tag
+
+  def prepare_dependencies(self):
+    tmp = tempfile.mkdtemp()
+    resources = Stager.create_job_resources(self._options, tmp)
+    # make a copy of the staged artifacts into the temp source folder.
+    for path, name in resources:
+      shutil.copyfile(path, os.path.join(self._temp_src_dir, name))
+    with open(os.path.join(self._temp_src_dir, 'Dockerfile'), 'w') as file:
+      file.write(
+          DOCKERFILE_TEMPLATE.format(
+              major=sys.version_info[0],
+              minor=sys.version_info[1],
+              workdir=ARTIFACTS_CONTAINER_DIR,
+              manifest_file=ARTIFACTS_MANIFEST_FILE,
+              entrypoint=SDK_CONTAINER_ENTRYPOINT))
+    self.generate_artifacts_manifests_json_file(resources, self._temp_src_dir)
+
+  def invoke_docker_build_and_push(self, container_id, container_tag):
+    raise NotImplementedError
+
+  @staticmethod
+  def generate_artifacts_manifests_json_file(resources, temp_dir):
+    infos = []
+    for _, name in resources:
+      info = beam_runner_api_pb2.ArtifactInformation(
+          type_urn=common_urns.StandardArtifacts.Types.FILE.urn,
+          type_payload=beam_runner_api_pb2.ArtifactFilePayload(
+              path=name).SerializeToString(),
+      )
+      infos.append(json.dumps(MessageToJson(info)))
+    with open(os.path.join(temp_dir, ARTIFACTS_MANIFEST_FILE), 'w') as file:
+      file.write('[\n' + ',\n'.join(infos) + '\n]')
+
+  @classmethod
+  def build_container_imge(cls, pipeline_options):

Review comment:
       spelling

##########
File path: sdks/python/apache_beam/transforms/environments.py
##########
@@ -252,6 +254,14 @@ def from_runner_api_parameter(payload, capabilities, artifacts, context):
   @classmethod
   def from_options(cls, options):
     # type: (PipelineOptions) -> DockerEnvironment
+    if options.view_as(DebugOptions).lookup_experiment(
+        'prebuild_sdk_container'):
+      prebuilt_container_image = SdkContainerBuilder.build_container_imge(

Review comment:
       I see this being called both here and in dataflow_runner.py. Are we invoking it twice on Dataflow?

##########
File path: sdks/python/apache_beam/runners/portability/stager.py
##########
@@ -151,7 +151,8 @@ def create_job_resources(options,  # type: PipelineOptions
     setup_options = options.view_as(SetupOptions)
 
     # Stage a requirements file if present.
-    if setup_options.requirements_file is not None:
+    if (setup_options.requirements_file is not None and

Review comment:
       It may require some refactoring, but I think the over-all result would be cleaner. (Maybe this is also messy due to a partial transition in how Dataflow handles artifacts compared to every other runner...) 
   
   However, if you prefer to keep it like this that's OK. 

##########
File path: sdks/python/apache_beam/runners/portability/stager.py
##########
@@ -119,6 +119,7 @@ def create_job_resources(options,  # type: PipelineOptions
                            temp_dir,  # type: str
                            build_setup_args=None,  # type: Optional[List[str]]
                            populate_requirements_cache=None,  # type: Optional[str]
+                           skip_boot_dependencies=False, # type: Optional[bool]

Review comment:
       It seems the pickled main session should get staged like everything else. The java jars belong to the java environment, and should get staged in the java container image, not here. (But again, maybe this is a Dataflow issue, and will be taken care of when that is cleaned up.)

##########
File path: sdks/python/apache_beam/runners/portability/stager.py
##########
@@ -119,6 +119,7 @@ def create_job_resources(options,  # type: PipelineOptions
                            temp_dir,  # type: str
                            build_setup_args=None,  # type: Optional[List[str]]
                            populate_requirements_cache=None,  # type: Optional[str]
+                           skip_boot_dependencies=False, # type: Optional[bool]

Review comment:
       Hmm... what we need to do is fix Dataflow to not be so weird. But probably not in this PR. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: Add option to prebuild python sdk container

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/a99c6826a067f49ebb60e625c8652900c7d0e810?el=desc) will **increase** coverage by `5.88%`.
   > The diff coverage is `33.80%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   + Coverage   34.32%   40.21%   +5.88%     
   ==========================================
     Files         694      455     -239     
     Lines       82226    53738   -28488     
     Branches     9294        0    -9294     
   ==========================================
   - Hits        28225    21610    -6615     
   + Misses      53578    32128   -21450     
   + Partials      423        0     -423     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `20.20% <28.57%> (ø)` | |
   | [...che\_beam/runners/dataflow/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `34.37% <34.37%> (ø)` | |
   | [runners/worker/statesampler\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy93b3JrZXIvc3RhdGVzYW1wbGVyX3Rlc3QucHk=) | | |
   | [typehints/decorators\_test\_py3.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dHlwZWhpbnRzL2RlY29yYXRvcnNfdGVzdF9weTMucHk=) | | |
   | [examples/snippets/transforms/elementwise/kvswap.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZXhhbXBsZXMvc25pcHBldHMvdHJhbnNmb3Jtcy9lbGVtZW50d2lzZS9rdnN3YXAucHk=) | | |
   | [runners/dataflow/native\_io/iobase\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9kYXRhZmxvdy9uYXRpdmVfaW8vaW9iYXNlX3Rlc3QucHk=) | | |
   | [io/gcp/experimental/spannerio.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vZ2NwL2V4cGVyaW1lbnRhbC9zcGFubmVyaW8ucHk=) | | |
   | [typehints/trivial\_inference.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dHlwZWhpbnRzL3RyaXZpYWxfaW5mZXJlbmNlLnB5) | | |
   | [io/gcp/gcsfilesystem.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vZ2NwL2djc2ZpbGVzeXN0ZW0ucHk=) | | |
   | [io/gcp/pubsub\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vZ2NwL3B1YnN1Yl90ZXN0LnB5) | | |
   | ... and [1141 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [a99c682...c13d108](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/a99c6826a067f49ebb60e625c8652900c7d0e810?el=desc) will **increase** coverage by `5.88%`.
   > The diff coverage is `33.80%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   + Coverage   34.32%   40.21%   +5.88%     
   ==========================================
     Files         694      455     -239     
     Lines       82226    53738   -28488     
     Branches     9294        0    -9294     
   ==========================================
   - Hits        28225    21610    -6615     
   + Misses      53578    32128   -21450     
   + Partials      423        0     -423     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `20.20% <28.57%> (ø)` | |
   | [...che\_beam/runners/dataflow/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `34.37% <34.37%> (ø)` | |
   | [io/gcp/bigquery\_file\_loads.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vZ2NwL2JpZ3F1ZXJ5X2ZpbGVfbG9hZHMucHk=) | | |
   | [utils/shared\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dXRpbHMvc2hhcmVkX3Rlc3QucHk=) | | |
   | [runners/interactive/testing/test\_cache\_manager.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9pbnRlcmFjdGl2ZS90ZXN0aW5nL3Rlc3RfY2FjaGVfbWFuYWdlci5weQ==) | | |
   | [io/sources\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vc291cmNlc190ZXN0LnB5) | | |
   | [...unners/portability/fn\_api\_runner/fn\_runner\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9wb3J0YWJpbGl0eS9mbl9hcGlfcnVubmVyL2ZuX3J1bm5lcl90ZXN0LnB5) | | |
   | [runners/interactive/options/capture\_limiters.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9pbnRlcmFjdGl2ZS9vcHRpb25zL2NhcHR1cmVfbGltaXRlcnMucHk=) | | |
   | [runners/job/manager.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9qb2IvbWFuYWdlci5weQ==) | | |
   | [examples/complete/juliaset/juliaset/juliaset.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZXhhbXBsZXMvY29tcGxldGUvanVsaWFzZXQvanVsaWFzZXQvanVsaWFzZXQucHk=) | | |
   | ... and [1141 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [a99c682...be5e21e](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] y1chi commented on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
y1chi commented on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-698025433


   @aaltay @tvalentyn PTAL and help merge if this LG.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] aaltay commented on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
aaltay commented on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-685129814


   Could we have a design discussion about this first? This looks very Dataflow specific. I do not believe we had enough chance to discuss this. And it is also overlapping with work @emilymye and @tysonjh working on.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/5ef04e945fb1a3948d665af5d6b7f13b86487616?el=desc) will **decrease** coverage by `0.19%`.
   > The diff coverage is `52.86%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   - Coverage   82.36%   82.16%   -0.20%     
   ==========================================
     Files         451      452       +1     
     Lines       53753    54036     +283     
   ==========================================
   + Hits        44273    44400     +127     
   - Misses       9480     9636     +156     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `72.60% <0.00%> (ø)` | |
   | [...eam/testing/benchmarks/nexmark/nexmark\_launcher.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19sYXVuY2hlci5weQ==) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_perf.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19wZXJmLnB5) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_util.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya191dGlsLnB5) | `0.00% <0.00%> (ø)` | |
   | [...\_beam/runners/portability/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9wb3J0YWJpbGl0eS9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `32.23% <32.23%> (ø)` | |
   | [...on/apache\_beam/runners/dataflow/dataflow\_runner.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9kYXRhZmxvd19ydW5uZXIucHk=) | `77.03% <60.00%> (-0.15%)` | :arrow_down: |
   | [...dks/python/apache\_beam/options/pipeline\_options.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vb3B0aW9ucy9waXBlbGluZV9vcHRpb25zLnB5) | `95.00% <66.66%> (+0.01%)` | :arrow_up: |
   | [sdks/python/apache\_beam/transforms/environments.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdHJhbnNmb3Jtcy9lbnZpcm9ubWVudHMucHk=) | `83.49% <66.66%> (-0.33%)` | :arrow_down: |
   | [...beam/runners/interactive/background\_caching\_job.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9iYWNrZ3JvdW5kX2NhY2hpbmdfam9iLnB5) | `94.78% <90.90%> (ø)` | |
   | [sdks/python/apache\_beam/utils/histogram.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdXRpbHMvaGlzdG9ncmFtLnB5) | `94.28% <94.28%> (ø)` | |
   | ... and [66 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [68e7f2e...984c4e7](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: Add option to prebuild python sdk container

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/a99c6826a067f49ebb60e625c8652900c7d0e810?el=desc) will **increase** coverage by `5.88%`.
   > The diff coverage is `33.80%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   + Coverage   34.32%   40.21%   +5.88%     
   ==========================================
     Files         694      455     -239     
     Lines       82226    53738   -28488     
     Branches     9294        0    -9294     
   ==========================================
   - Hits        28225    21610    -6615     
   + Misses      53578    32128   -21450     
   + Partials      423        0     -423     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `20.20% <28.57%> (ø)` | |
   | [...che\_beam/runners/dataflow/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `34.37% <34.37%> (ø)` | |
   | [testing/metric\_result\_matchers\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dGVzdGluZy9tZXRyaWNfcmVzdWx0X21hdGNoZXJzX3Rlc3QucHk=) | | |
   | [transforms/external\_java.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dHJhbnNmb3Jtcy9leHRlcm5hbF9qYXZhLnB5) | | |
   | [io/avroio\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vYXZyb2lvX3Rlc3QucHk=) | | |
   | [io/restriction\_trackers\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vcmVzdHJpY3Rpb25fdHJhY2tlcnNfdGVzdC5weQ==) | | |
   | [examples/complete/\_\_init\_\_.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZXhhbXBsZXMvY29tcGxldGUvX19pbml0X18ucHk=) | | |
   | [runners/worker/opcounters.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy93b3JrZXIvb3Bjb3VudGVycy5weQ==) | | |
   | [testing/util.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dGVzdGluZy91dGlsLnB5) | | |
   | [transforms/create\_source.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dHJhbnNmb3Jtcy9jcmVhdGVfc291cmNlLnB5) | | |
   | ... and [1141 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [a99c682...030594c](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: Add option to prebuild python sdk container

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/a99c6826a067f49ebb60e625c8652900c7d0e810?el=desc) will **increase** coverage by `5.88%`.
   > The diff coverage is `33.80%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   + Coverage   34.32%   40.21%   +5.88%     
   ==========================================
     Files         694      455     -239     
     Lines       82226    53738   -28488     
     Branches     9294        0    -9294     
   ==========================================
   - Hits        28225    21610    -6615     
   + Misses      53578    32128   -21450     
   + Partials      423        0     -423     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `20.20% <28.57%> (ø)` | |
   | [...che\_beam/runners/dataflow/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `34.37% <34.37%> (ø)` | |
   | [utils/annotations\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dXRpbHMvYW5ub3RhdGlvbnNfdGVzdC5weQ==) | | |
   | [examples/snippets/transforms/elementwise/kvswap.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZXhhbXBsZXMvc25pcHBldHMvdHJhbnNmb3Jtcy9lbGVtZW50d2lzZS9rdnN3YXAucHk=) | | |
   | [examples/complete/game/game\_stats.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZXhhbXBsZXMvY29tcGxldGUvZ2FtZS9nYW1lX3N0YXRzLnB5) | | |
   | [runners/portability/artifact\_service.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9wb3J0YWJpbGl0eS9hcnRpZmFjdF9zZXJ2aWNlLnB5) | | |
   | [runners/worker/statesampler.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy93b3JrZXIvc3RhdGVzYW1wbGVyLnB5) | | |
   | [io/localfilesystem.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vbG9jYWxmaWxlc3lzdGVtLnB5) | | |
   | [runners/portability/fn\_api\_runner/translations.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9wb3J0YWJpbGl0eS9mbl9hcGlfcnVubmVyL3RyYW5zbGF0aW9ucy5weQ==) | | |
   | [examples/snippets/transforms/elementwise/filter.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZXhhbXBsZXMvc25pcHBldHMvdHJhbnNmb3Jtcy9lbGVtZW50d2lzZS9maWx0ZXIucHk=) | | |
   | ... and [1141 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [a99c682...eb39d12](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] tvalentyn commented on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
tvalentyn commented on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-698036314


   I don't have additional comments at this time so I am fine to merge and iterate.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] y1chi commented on a change in pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
y1chi commented on a change in pull request #12727:
URL: https://github.com/apache/beam/pull/12727#discussion_r493104158



##########
File path: sdks/python/apache_beam/runners/portability/stager.py
##########
@@ -136,6 +137,8 @@ def create_job_resources(options,  # type: PipelineOptions
             only for testing.
           populate_requirements_cache: Callable for populating the requirements
             cache. Used only for testing.
+          skip_boot_dependencies: Skip apache beam sdk, requirements, extra
+            packages, workflow tarball installs by sdk boot program.

Review comment:
       sounds much better, thanks.

##########
File path: sdks/python/apache_beam/transforms/environments.py
##########
@@ -252,6 +254,13 @@ def from_runner_api_parameter(payload, capabilities, artifacts, context):
   @classmethod
   def from_options(cls, options):
     # type: (PipelineOptions) -> DockerEnvironment
+    if options.view_as(SetupOptions).prebuild_sdk_container_engine:
+      prebuilt_container_image = SdkContainerBuilder.build_container_image(
+          options)
+      return cls.from_container_image(
+          container_image=prebuilt_container_image,
+          artifacts=python_sdk_dependencies(
+              options, skip_boot_dependencies=True))

Review comment:
       I think we still need it for python_sdk_dependencies to produce two sets(complete set or the reduced set) of artifacts

##########
File path: sdks/python/container/boot.go
##########
@@ -203,15 +223,9 @@ func setupAcceptableWheelSpecs() error {
 }
 
 // installSetupPackages installs Beam SDK and user dependencies.
-func installSetupPackages(mds []*jobpb.ArtifactMetadata, workDir string) error {
+func installSetupPackages(files []string, workDir string) error {

Review comment:
       done.

##########
File path: sdks/python/container/boot.go
##########
@@ -30,18 +32,21 @@ import (
 	"time"
 
 	"github.com/apache/beam/sdks/go/pkg/beam/artifact"
-	jobpb "github.com/apache/beam/sdks/go/pkg/beam/model/jobmanagement_v1"
 	pipepb "github.com/apache/beam/sdks/go/pkg/beam/model/pipeline_v1"
 	"github.com/apache/beam/sdks/go/pkg/beam/provision"
 	"github.com/apache/beam/sdks/go/pkg/beam/util/execx"
 	"github.com/apache/beam/sdks/go/pkg/beam/util/grpcx"
+	"github.com/golang/protobuf/jsonpb"
 	"github.com/golang/protobuf/proto"
 	"github.com/nightlyone/lockfile"
 )
 
 var (
 	acceptableWhlSpecs []string
 
+	setupOnly = flag.Bool("setup_only", false, "Execute boot program in setup only mode (optional).")

Review comment:
       done.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] y1chi commented on a change in pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
y1chi commented on a change in pull request #12727:
URL: https://github.com/apache/beam/pull/12727#discussion_r493106053



##########
File path: sdks/python/apache_beam/options/pipeline_options.py
##########
@@ -1003,6 +1003,13 @@ def _add_argparse_args(cls, parser):
             'environment. Choose the docker build engine of local docker '
             'environment or google cloud build by passing the option '
             'local_docker or cloud_build.'))
+    parser.add_argument(
+        '--prebuild_sdk_container_base_image',
+        default=None,
+        help=(
+            'The base image to use when pre-building the sdk container image '
+            'with dependencies, if not specified, the latest public '

Review comment:
       For a dev sdk version, can we use the last released version? 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] y1chi commented on a change in pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
y1chi commented on a change in pull request #12727:
URL: https://github.com/apache/beam/pull/12727#discussion_r491077972



##########
File path: sdks/python/container/boot.go
##########
@@ -283,3 +306,51 @@ func multiProcessExactlyOnce(actionFunc func(), completeFileName string) {
 	os.OpenFile(installCompleteFile, os.O_RDONLY|os.O_CREATE, 0666)
 
 }
+
+func processArtifactsInSetupOnlyMode() error {
+	if *artifacts == "" {
+		log.Fatal("No --artifacts provided along with --setup_only flag.")
+	}
+	workDir := filepath.Dir(*artifacts)
+	metadata, err := ioutil.ReadFile(*artifacts)
+	if err != nil {
+		log.Fatalf("Unable to open artifacts metadata file %v with error %v", *artifacts, err)
+	}
+	var infoJsons []string
+	if err := json.Unmarshal(metadata, &infoJsons); err != nil {
+		log.Fatalf("Unable to parse metadata, error: %v", err)
+	}
+
+	files := make([]string, len(infoJsons))
+	for i, info := range infoJsons {
+		var artifactInformation pipepb.ArtifactInformation
+		if err := jsonpb.UnmarshalString(info, &artifactInformation); err != nil {
+			log.Fatalf("Unable to unmarshal artifact information from json string %v", info)
+		}
+
+		// For now we only expect artifacts in file type. The condition should be revisited if the assumption is not valid any more.
+		if artifactInformation.GetTypeUrn() != standardArtifactFileTypeUrn {
+			log.Fatalf("Expect file artifact type in setup only mode, found %v.", artifactInformation.GetTypeUrn())
+		}
+		filePayload := &pipepb.ArtifactFilePayload{}
+		if err := proto.Unmarshal(artifactInformation.GetTypePayload(), filePayload); err != nil {
+			log.Fatal("Unable to unmarshal artifact information type payload.")
+		}
+		if dir := filepath.Dir(filePayload.GetPath()); dir != workDir {
+			log.Fatalf("Artifact %v not stored in the same work directory %v of metadata file", filePayload.GetPath(), workDir)

Review comment:
       removed it. the installation script has an implicit requirements that all the artifacts are in same workdir. we can guarantee it while copying the artifacts.

##########
File path: sdks/python/apache_beam/runners/portability/sdk_container_builder.py
##########
@@ -0,0 +1,138 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+"""SdkContainerBuilder builds the portable SDK container with dependencies.
+
+It copies the right boot dependencies, namely: apache beam sdk, python packages
+from requirements.txt, python packages from extra_packages.txt, workflow
+tarball, into the latest public python sdk container image, and run the
+dependencies installation in advance with the boot program in setup only mode
+to build the new image.
+"""
+
+from __future__ import absolute_import
+
+import json
+import logging
+import os
+import shutil
+import subprocess
+import sys
+import tempfile
+import time
+import uuid
+
+from google.protobuf.json_format import MessageToJson
+
+from apache_beam.options.pipeline_options import SetupOptions
+from apache_beam.portability import common_urns
+from apache_beam.portability.api import beam_runner_api_pb2
+from apache_beam.runners.portability.stager import Stager
+
+ARTIFACTS_CONTAINER_DIR = '/opt/apache/beam/artifacts'
+ARTIFACTS_MANIFEST_FILE = 'artifacts_info.json'
+DOCKERFILE_TEMPLATE = (
+    """FROM apache/beam_python{major}.{minor}_sdk:latest
+RUN mkdir -p {workdir}
+COPY ./* {workdir}/
+RUN /opt/apache/beam/boot --setup_only --artifacts {workdir}/{manifest_file}

Review comment:
       done.

##########
File path: sdks/python/container/boot.go
##########
@@ -61,11 +66,22 @@ const (
 	sdkSrcFile        = "dataflow_python_sdk.tar"
 	extraPackagesFile = "extra_packages.txt"
 	workerPoolIdEnv   = "BEAM_PYTHON_WORKER_POOL_ID"
+
+	// Setup result for the setup only mode.
+	setupResultFile             = "/opt/apache/beam/setup_result.json"

Review comment:
       done.

##########
File path: sdks/python/container/boot.go
##########
@@ -203,13 +225,14 @@ func setupAcceptableWheelSpecs() error {
 }
 
 // installSetupPackages installs Beam SDK and user dependencies.
-func installSetupPackages(mds []*jobpb.ArtifactMetadata, workDir string) error {
+func installSetupPackages(files []string, workDir string) error {
 	log.Printf("Installing setup packages ...")
 
-	files := make([]string, len(mds))
-	for i, v := range mds {
-		log.Printf("Found artifact: %s", v.Name)
-		files[i] = v.Name
+	// Check if setupResultFile exists, if so we can skip the dependency installation since

Review comment:
       done.

##########
File path: sdks/python/apache_beam/runners/portability/stager.py
##########
@@ -151,7 +151,8 @@ def create_job_resources(options,  # type: PipelineOptions
     setup_options = options.view_as(SetupOptions)
 
     # Stage a requirements file if present.
-    if setup_options.requirements_file is not None:
+    if (setup_options.requirements_file is not None and

Review comment:
       the artifact infos are generated from the result of stager create_resources, so it is easiest to reduce it in the stager, also this means we don't re-create or re-download unnecessary resources.

##########
File path: sdks/python/apache_beam/runners/portability/sdk_container_builder.py
##########
@@ -0,0 +1,138 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+"""SdkContainerBuilder builds the portable SDK container with dependencies.
+
+It copies the right boot dependencies, namely: apache beam sdk, python packages
+from requirements.txt, python packages from extra_packages.txt, workflow
+tarball, into the latest public python sdk container image, and run the
+dependencies installation in advance with the boot program in setup only mode
+to build the new image.
+"""
+
+from __future__ import absolute_import
+
+import json
+import logging
+import os
+import shutil
+import subprocess
+import sys
+import tempfile
+import time
+import uuid
+
+from google.protobuf.json_format import MessageToJson
+
+from apache_beam.options.pipeline_options import SetupOptions
+from apache_beam.portability import common_urns
+from apache_beam.portability.api import beam_runner_api_pb2
+from apache_beam.runners.portability.stager import Stager
+
+ARTIFACTS_CONTAINER_DIR = '/opt/apache/beam/artifacts'
+ARTIFACTS_MANIFEST_FILE = 'artifacts_info.json'
+DOCKERFILE_TEMPLATE = (
+    """FROM apache/beam_python{major}.{minor}_sdk:latest
+RUN mkdir -p {workdir}
+COPY ./* {workdir}/
+RUN /opt/apache/beam/boot --setup_only --artifacts {workdir}/{manifest_file}
+""")
+
+_LOGGER = logging.getLogger(__name__)
+
+
+class SdkContainerBuilder(object):

Review comment:
       done.

##########
File path: sdks/python/apache_beam/runners/dataflow/internal/apiclient.py
##########
@@ -1070,7 +1075,28 @@ def get_container_image_from_options(pipeline_options):
     Returns:
       str: Container image for remote execution.
   """
+  debug_options = pipeline_options.view_as(DebugOptions)
   worker_options = pipeline_options.view_as(WorkerOptions)
+  container_build_engine = debug_options.lookup_experiment(

Review comment:
       done.

##########
File path: sdks/python/apache_beam/runners/dataflow/internal/apiclient.py
##########
@@ -1070,7 +1075,28 @@ def get_container_image_from_options(pipeline_options):
     Returns:
       str: Container image for remote execution.
   """
+  debug_options = pipeline_options.view_as(DebugOptions)
   worker_options = pipeline_options.view_as(WorkerOptions)
+  container_build_engine = debug_options.lookup_experiment(
+      'prebuild_sdk_container')
+  if (debug_options.lookup_experiment('beam_fn_api') and

Review comment:
       done.

##########
File path: sdks/python/apache_beam/runners/dataflow/internal/apiclient.py
##########
@@ -51,13 +51,18 @@
 from apache_beam.io.gcp.internal.clients import storage
 from apache_beam.options.pipeline_options import DebugOptions
 from apache_beam.options.pipeline_options import GoogleCloudOptions
+from apache_beam.options.pipeline_options import SetupOptions
 from apache_beam.options.pipeline_options import StandardOptions
 from apache_beam.options.pipeline_options import WorkerOptions
 from apache_beam.portability import common_urns
 from apache_beam.portability.api import beam_runner_api_pb2
 from apache_beam.runners.dataflow.internal import names
 from apache_beam.runners.dataflow.internal.clients import dataflow
 from apache_beam.runners.dataflow.internal.names import PropertyNames
+from apache_beam.runners.dataflow.internal.sdk_container_cloud_builder import \

Review comment:
       done.

##########
File path: sdks/python/apache_beam/options/pipeline_options.py
##########
@@ -994,6 +994,23 @@ def _add_argparse_args(cls, parser):
             'staged in the staging area (--staging_location option) and the '
             'workers will install them in same order they were specified on '
             'the command line.'))
+    parser.add_argument(
+        '--docker_registry_url',
+        default=None,
+        help=(
+            'The default docker registry to for pushing additional docker '

Review comment:
       done.

##########
File path: sdks/python/apache_beam/options/pipeline_options.py
##########
@@ -994,6 +994,23 @@ def _add_argparse_args(cls, parser):
             'staged in the staging area (--staging_location option) and the '
             'workers will install them in same order they were specified on '
             'the command line.'))
+    parser.add_argument(
+        '--docker_registry_url',

Review comment:
       done.

##########
File path: sdks/python/apache_beam/options/pipeline_options.py
##########
@@ -994,6 +994,23 @@ def _add_argparse_args(cls, parser):
             'staged in the staging area (--staging_location option) and the '
             'workers will install them in same order they were specified on '
             'the command line.'))
+    parser.add_argument(
+        '--docker_registry_url',
+        default=None,
+        help=(
+            'The default docker registry to for pushing additional docker '
+            'images for the setup.'))
+    parser.add_argument(

Review comment:
       done.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: Add option to prebuild python sdk container

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/a99c6826a067f49ebb60e625c8652900c7d0e810?el=desc) will **increase** coverage by `5.88%`.
   > The diff coverage is `33.80%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   + Coverage   34.32%   40.21%   +5.88%     
   ==========================================
     Files         694      455     -239     
     Lines       82226    53738   -28488     
     Branches     9294        0    -9294     
   ==========================================
   - Hits        28225    21610    -6615     
   + Misses      53578    32128   -21450     
   + Partials      423        0     -423     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `20.20% <28.57%> (ø)` | |
   | [...che\_beam/runners/dataflow/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `34.37% <34.37%> (ø)` | |
   | [internal/gcp/json\_value\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW50ZXJuYWwvZ2NwL2pzb25fdmFsdWVfdGVzdC5weQ==) | | |
   | [io/gcp/tests/bigquery\_matcher\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vZ2NwL3Rlc3RzL2JpZ3F1ZXJ5X21hdGNoZXJfdGVzdC5weQ==) | | |
   | [transforms/py\_dataflow\_distribution\_counter.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dHJhbnNmb3Jtcy9weV9kYXRhZmxvd19kaXN0cmlidXRpb25fY291bnRlci5weQ==) | | |
   | [...ers/dataflow/dataflow\_exercise\_metrics\_pipeline.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9kYXRhZmxvdy9kYXRhZmxvd19leGVyY2lzZV9tZXRyaWNzX3BpcGVsaW5lLnB5) | | |
   | [io/aws/clients/s3/boto3\_client.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vYXdzL2NsaWVudHMvczMvYm90bzNfY2xpZW50LnB5) | | |
   | [runners/portability/expansion\_service\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9wb3J0YWJpbGl0eS9leHBhbnNpb25fc2VydmljZV90ZXN0LnB5) | | |
   | [io/external/gcp/\_\_init\_\_.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vZXh0ZXJuYWwvZ2NwL19faW5pdF9fLnB5) | | |
   | [io/gcp/bigquery\_write\_perf\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vZ2NwL2JpZ3F1ZXJ5X3dyaXRlX3BlcmZfdGVzdC5weQ==) | | |
   | ... and [1141 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [a99c682...eb39d12](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] y1chi commented on a change in pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
y1chi commented on a change in pull request #12727:
URL: https://github.com/apache/beam/pull/12727#discussion_r491077501



##########
File path: sdks/python/container/boot.go
##########
@@ -61,11 +66,22 @@ const (
 	sdkSrcFile        = "dataflow_python_sdk.tar"
 	extraPackagesFile = "extra_packages.txt"
 	workerPoolIdEnv   = "BEAM_PYTHON_WORKER_POOL_ID"
+
+	// Setup result for the setup only mode.
+	setupResultFile             = "/opt/apache/beam/setup_result.json"
+	standardArtifactFileTypeUrn = "beam:artifact:type:file:v1"

Review comment:
       I didn't find an already existing constant for this.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] aaltay commented on a change in pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
aaltay commented on a change in pull request #12727:
URL: https://github.com/apache/beam/pull/12727#discussion_r492448750



##########
File path: sdks/python/setup.py
##########
@@ -215,6 +215,8 @@ def get_version():
     'google-cloud-language>=1.3.0,<2',
     'google-cloud-videointelligence>=1.8.0,<2',
     'google-cloud-vision>=0.38.0,<2',
+    # GCP packages required by fast container startup functionality.

Review comment:
       nit: "required by prebuild sdk container functionality". That is what you are calling it in options.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] y1chi commented on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
y1chi commented on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-684128579


   R: @tvalentyn @robertwb @angoenka 
   CC: @ananvay 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/5ef04e945fb1a3948d665af5d6b7f13b86487616?el=desc) will **decrease** coverage by `0.16%`.
   > The diff coverage is `52.76%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   - Coverage   82.36%   82.20%   -0.17%     
   ==========================================
     Files         451      454       +3     
     Lines       53753    54215     +462     
   ==========================================
   + Hits        44273    44566     +293     
   - Misses       9480     9649     +169     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `72.60% <0.00%> (ø)` | |
   | [...eam/testing/benchmarks/nexmark/nexmark\_launcher.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19sYXVuY2hlci5weQ==) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_perf.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19wZXJmLnB5) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_util.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya191dGlsLnB5) | `0.00% <0.00%> (ø)` | |
   | [...\_beam/runners/portability/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9wb3J0YWJpbGl0eS9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `31.78% <31.78%> (ø)` | |
   | [...ks/python/apache\_beam/runners/worker/sdk\_worker.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy93b3JrZXIvc2RrX3dvcmtlci5weQ==) | `88.63% <50.00%> (-0.54%)` | :arrow_down: |
   | [...on/apache\_beam/runners/dataflow/dataflow\_runner.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9kYXRhZmxvd19ydW5uZXIucHk=) | `77.06% <66.66%> (-0.12%)` | :arrow_down: |
   | [sdks/python/apache\_beam/transforms/environments.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdHJhbnNmb3Jtcy9lbnZpcm9ubWVudHMucHk=) | `83.49% <66.66%> (-0.33%)` | :arrow_down: |
   | [...dks/python/apache\_beam/options/pipeline\_options.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vb3B0aW9ucy9waXBlbGluZV9vcHRpb25zLnB5) | `95.01% <70.00%> (+0.02%)` | :arrow_up: |
   | [...beam/runners/interactive/background\_caching\_job.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9iYWNrZ3JvdW5kX2NhY2hpbmdfam9iLnB5) | `94.78% <90.90%> (ø)` | |
   | ... and [73 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [68e7f2e...8a1ceaa](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/a99c6826a067f49ebb60e625c8652900c7d0e810?el=desc) will **increase** coverage by `3.54%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   + Coverage   34.32%   37.86%   +3.54%     
   ==========================================
     Files         694      420     -274     
     Lines       82226    50214   -32012     
     Branches     9294     6925    -2369     
   ==========================================
   - Hits        28225    19015    -9210     
   + Misses      53578    30808   -22770     
   + Partials      423      391      -32     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [runners/portability/stager.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9wb3J0YWJpbGl0eS9zdGFnZXIucHk=) | `31.74% <0.00%> (ø)` | |
   | [testing/metric\_result\_matchers\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dGVzdGluZy9tZXRyaWNfcmVzdWx0X21hdGNoZXJzX3Rlc3QucHk=) | | |
   | [runners/pipeline\_context\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9waXBlbGluZV9jb250ZXh0X3Rlc3QucHk=) | | |
   | [io/filesystem\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vZmlsZXN5c3RlbV90ZXN0LnB5) | | |
   | [internal/util\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW50ZXJuYWwvdXRpbF90ZXN0LnB5) | | |
   | [io/mongodbio\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vbW9uZ29kYmlvX3Rlc3QucHk=) | | |
   | [tools/microbenchmarks\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dG9vbHMvbWljcm9iZW5jaG1hcmtzX3Rlc3QucHk=) | | |
   | [transforms/environments\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dHJhbnNmb3Jtcy9lbnZpcm9ubWVudHNfdGVzdC5weQ==) | | |
   | [transforms/write\_ptransform\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dHJhbnNmb3Jtcy93cml0ZV9wdHJhbnNmb3JtX3Rlc3QucHk=) | | |
   | [io/gcp/datastore/v1new/datastoreio\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vZ2NwL2RhdGFzdG9yZS92MW5ldy9kYXRhc3RvcmVpb190ZXN0LnB5) | | |
   | ... and [271 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [a99c682...e7c0b16](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: Add option to prebuild python sdk container

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/a99c6826a067f49ebb60e625c8652900c7d0e810?el=desc) will **increase** coverage by `5.88%`.
   > The diff coverage is `33.80%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   + Coverage   34.32%   40.21%   +5.88%     
   ==========================================
     Files         694      455     -239     
     Lines       82226    53738   -28488     
     Branches     9294        0    -9294     
   ==========================================
   - Hits        28225    21610    -6615     
   + Misses      53578    32128   -21450     
   + Partials      423        0     -423     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `20.20% <28.57%> (ø)` | |
   | [...che\_beam/runners/dataflow/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `34.37% <34.37%> (ø)` | |
   | [ml/gcp/naturallanguageml\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-bWwvZ2NwL25hdHVyYWxsYW5ndWFnZW1sX3Rlc3QucHk=) | | |
   | [metrics/cells.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-bWV0cmljcy9jZWxscy5weQ==) | | |
   | [options/value\_provider.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-b3B0aW9ucy92YWx1ZV9wcm92aWRlci5weQ==) | | |
   | [portability/api/beam\_runner\_api\_pb2\_urns.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cG9ydGFiaWxpdHkvYXBpL2JlYW1fcnVubmVyX2FwaV9wYjJfdXJucy5weQ==) | | |
   | [transforms/display\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dHJhbnNmb3Jtcy9kaXNwbGF5X3Rlc3QucHk=) | | |
   | [examples/snippets/transforms/aggregation/mean.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZXhhbXBsZXMvc25pcHBldHMvdHJhbnNmb3Jtcy9hZ2dyZWdhdGlvbi9tZWFuLnB5) | | |
   | [error.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZXJyb3IucHk=) | | |
   | [io/filebasedsink.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vZmlsZWJhc2Vkc2luay5weQ==) | | |
   | ... and [1141 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [a99c682...eb39d12](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/5ef04e945fb1a3948d665af5d6b7f13b86487616?el=desc) will **decrease** coverage by `0.19%`.
   > The diff coverage is `54.59%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   - Coverage   82.36%   82.16%   -0.20%     
   ==========================================
     Files         451      453       +2     
     Lines       53753    54009     +256     
   ==========================================
   + Hits        44273    44378     +105     
   - Misses       9480     9631     +151     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...eam/testing/benchmarks/nexmark/nexmark\_launcher.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19sYXVuY2hlci5weQ==) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_perf.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19wZXJmLnB5) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_util.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya191dGlsLnB5) | `0.00% <0.00%> (ø)` | |
   | [...s/dataflow/internal/sdk\_container\_cloud\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9zZGtfY29udGFpbmVyX2Nsb3VkX2J1aWxkZXIucHk=) | `34.14% <34.14%> (ø)` | |
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `72.02% <42.85%> (-0.58%)` | :arrow_down: |
   | [...\_beam/runners/portability/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9wb3J0YWJpbGl0eS9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `42.85% <42.85%> (ø)` | |
   | [...dks/python/apache\_beam/options/pipeline\_options.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vb3B0aW9ucy9waXBlbGluZV9vcHRpb25zLnB5) | `95.01% <70.00%> (+0.02%)` | :arrow_up: |
   | [...beam/runners/interactive/background\_caching\_job.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9iYWNrZ3JvdW5kX2NhY2hpbmdfam9iLnB5) | `94.78% <90.90%> (ø)` | |
   | [sdks/python/apache\_beam/utils/histogram.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdXRpbHMvaGlzdG9ncmFtLnB5) | `94.28% <94.28%> (ø)` | |
   | [...ache\_beam/runners/interactive/recording\_manager.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9yZWNvcmRpbmdfbWFuYWdlci5weQ==) | `98.05% <95.74%> (+5.19%)` | :arrow_up: |
   | ... and [61 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [68e7f2e...3e6cb8e](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/5ef04e945fb1a3948d665af5d6b7f13b86487616?el=desc) will **decrease** coverage by `0.18%`.
   > The diff coverage is `52.68%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   - Coverage   82.36%   82.17%   -0.19%     
   ==========================================
     Files         451      452       +1     
     Lines       53753    54034     +281     
   ==========================================
   + Hits        44273    44402     +129     
   - Misses       9480     9632     +152     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `72.60% <0.00%> (ø)` | |
   | [...eam/testing/benchmarks/nexmark/nexmark\_launcher.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19sYXVuY2hlci5weQ==) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_perf.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19wZXJmLnB5) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_util.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya191dGlsLnB5) | `0.00% <0.00%> (ø)` | |
   | [...\_beam/runners/portability/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9wb3J0YWJpbGl0eS9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `31.78% <31.78%> (ø)` | |
   | [...on/apache\_beam/runners/dataflow/dataflow\_runner.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9kYXRhZmxvd19ydW5uZXIucHk=) | `77.03% <60.00%> (-0.15%)` | :arrow_down: |
   | [...dks/python/apache\_beam/options/pipeline\_options.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vb3B0aW9ucy9waXBlbGluZV9vcHRpb25zLnB5) | `94.98% <62.50%> (ø)` | |
   | [sdks/python/apache\_beam/transforms/environments.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdHJhbnNmb3Jtcy9lbnZpcm9ubWVudHMucHk=) | `83.49% <66.66%> (-0.33%)` | :arrow_down: |
   | [...beam/runners/interactive/background\_caching\_job.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9iYWNrZ3JvdW5kX2NhY2hpbmdfam9iLnB5) | `94.78% <90.90%> (ø)` | |
   | [sdks/python/apache\_beam/utils/histogram.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdXRpbHMvaGlzdG9ncmFtLnB5) | `94.28% <94.28%> (ø)` | |
   | ... and [68 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [68e7f2e...794808f](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: Add option to prebuild python sdk container

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/a99c6826a067f49ebb60e625c8652900c7d0e810?el=desc) will **increase** coverage by `5.88%`.
   > The diff coverage is `33.80%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   + Coverage   34.32%   40.21%   +5.88%     
   ==========================================
     Files         694      455     -239     
     Lines       82226    53738   -28488     
     Branches     9294        0    -9294     
   ==========================================
   - Hits        28225    21610    -6615     
   + Misses      53578    32128   -21450     
   + Partials      423        0     -423     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `20.20% <28.57%> (ø)` | |
   | [...che\_beam/runners/dataflow/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `34.37% <34.37%> (ø)` | |
   | [testing/metric\_result\_matchers\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dGVzdGluZy9tZXRyaWNfcmVzdWx0X21hdGNoZXJzX3Rlc3QucHk=) | | |
   | [transforms/external\_java.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dHJhbnNmb3Jtcy9leHRlcm5hbF9qYXZhLnB5) | | |
   | [io/avroio\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vYXZyb2lvX3Rlc3QucHk=) | | |
   | [io/restriction\_trackers\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vcmVzdHJpY3Rpb25fdHJhY2tlcnNfdGVzdC5weQ==) | | |
   | [examples/complete/\_\_init\_\_.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZXhhbXBsZXMvY29tcGxldGUvX19pbml0X18ucHk=) | | |
   | [runners/worker/opcounters.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy93b3JrZXIvb3Bjb3VudGVycy5weQ==) | | |
   | [testing/util.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dGVzdGluZy91dGlsLnB5) | | |
   | [transforms/create\_source.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dHJhbnNmb3Jtcy9jcmVhdGVfc291cmNlLnB5) | | |
   | ... and [1141 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [a99c682...e747445](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: Add option to prebuild python sdk container

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/a99c6826a067f49ebb60e625c8652900c7d0e810?el=desc) will **increase** coverage by `5.88%`.
   > The diff coverage is `33.80%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   + Coverage   34.32%   40.21%   +5.88%     
   ==========================================
     Files         694      455     -239     
     Lines       82226    53738   -28488     
     Branches     9294        0    -9294     
   ==========================================
   - Hits        28225    21610    -6615     
   + Misses      53578    32128   -21450     
   + Partials      423        0     -423     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `20.20% <28.57%> (ø)` | |
   | [...che\_beam/runners/dataflow/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `34.37% <34.37%> (ø)` | |
   | [runners/worker/statesampler\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy93b3JrZXIvc3RhdGVzYW1wbGVyX3Rlc3QucHk=) | | |
   | [typehints/decorators\_test\_py3.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dHlwZWhpbnRzL2RlY29yYXRvcnNfdGVzdF9weTMucHk=) | | |
   | [examples/snippets/transforms/elementwise/kvswap.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZXhhbXBsZXMvc25pcHBldHMvdHJhbnNmb3Jtcy9lbGVtZW50d2lzZS9rdnN3YXAucHk=) | | |
   | [runners/dataflow/native\_io/iobase\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9kYXRhZmxvdy9uYXRpdmVfaW8vaW9iYXNlX3Rlc3QucHk=) | | |
   | [io/gcp/experimental/spannerio.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vZ2NwL2V4cGVyaW1lbnRhbC9zcGFubmVyaW8ucHk=) | | |
   | [typehints/trivial\_inference.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dHlwZWhpbnRzL3RyaXZpYWxfaW5mZXJlbmNlLnB5) | | |
   | [io/gcp/gcsfilesystem.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vZ2NwL2djc2ZpbGVzeXN0ZW0ucHk=) | | |
   | [io/gcp/pubsub\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vZ2NwL3B1YnN1Yl90ZXN0LnB5) | | |
   | ... and [1141 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [a99c682...eb39d12](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: Add option to prebuild python sdk container

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/a99c6826a067f49ebb60e625c8652900c7d0e810?el=desc) will **increase** coverage by `5.88%`.
   > The diff coverage is `33.80%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   + Coverage   34.32%   40.21%   +5.88%     
   ==========================================
     Files         694      455     -239     
     Lines       82226    53738   -28488     
     Branches     9294        0    -9294     
   ==========================================
   - Hits        28225    21610    -6615     
   + Misses      53578    32128   -21450     
   + Partials      423        0     -423     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `20.20% <28.57%> (ø)` | |
   | [...che\_beam/runners/dataflow/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `34.37% <34.37%> (ø)` | |
   | [runners/worker/data\_plane.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy93b3JrZXIvZGF0YV9wbGFuZS5weQ==) | | |
   | [ml/gcp/visionml.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-bWwvZ2NwL3Zpc2lvbm1sLnB5) | | |
   | [...ners/portability/flink\_uber\_jar\_job\_server\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9wb3J0YWJpbGl0eS9mbGlua191YmVyX2phcl9qb2Jfc2VydmVyX3Rlc3QucHk=) | | |
   | [io/gcp/bigquery\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vZ2NwL2JpZ3F1ZXJ5X3Rlc3QucHk=) | | |
   | [testing/synthetic\_pipeline.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dGVzdGluZy9zeW50aGV0aWNfcGlwZWxpbmUucHk=) | | |
   | [testing/datatype\_inference\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dGVzdGluZy9kYXRhdHlwZV9pbmZlcmVuY2VfdGVzdC5weQ==) | | |
   | [internal/gcp/json\_value\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW50ZXJuYWwvZ2NwL2pzb25fdmFsdWVfdGVzdC5weQ==) | | |
   | [testing/benchmarks/chicago\_taxi/trainer/taxi.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dGVzdGluZy9iZW5jaG1hcmtzL2NoaWNhZ29fdGF4aS90cmFpbmVyL3RheGkucHk=) | | |
   | ... and [1141 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [a99c682...030594c](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] y1chi commented on a change in pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
y1chi commented on a change in pull request #12727:
URL: https://github.com/apache/beam/pull/12727#discussion_r493764637



##########
File path: sdks/python/apache_beam/options/pipeline_options.py
##########
@@ -1003,6 +1003,13 @@ def _add_argparse_args(cls, parser):
             'environment. Choose the docker build engine of local docker '
             'environment or google cloud build by passing the option '
             'local_docker or cloud_build.'))
+    parser.add_argument(
+        '--prebuild_sdk_container_base_image',
+        default=None,
+        help=(
+            'The base image to use when pre-building the sdk container image '
+            'with dependencies, if not specified, the latest public '

Review comment:
       I agree that we should use a nightly build and we can change to that if we build those. Some context is that we may need to use this feature in some runner v2 rolling upgrade test and building from dockerfile for the test seems not applicable.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/5ef04e945fb1a3948d665af5d6b7f13b86487616?el=desc) will **decrease** coverage by `0.19%`.
   > The diff coverage is `54.59%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   - Coverage   82.36%   82.16%   -0.20%     
   ==========================================
     Files         451      453       +2     
     Lines       53753    54009     +256     
   ==========================================
   + Hits        44273    44377     +104     
   - Misses       9480     9632     +152     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...eam/testing/benchmarks/nexmark/nexmark\_launcher.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19sYXVuY2hlci5weQ==) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_perf.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19wZXJmLnB5) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_util.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya191dGlsLnB5) | `0.00% <0.00%> (ø)` | |
   | [...s/dataflow/internal/sdk\_container\_cloud\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9zZGtfY29udGFpbmVyX2Nsb3VkX2J1aWxkZXIucHk=) | `34.14% <34.14%> (ø)` | |
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `72.02% <42.85%> (-0.58%)` | :arrow_down: |
   | [...\_beam/runners/portability/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9wb3J0YWJpbGl0eS9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `42.85% <42.85%> (ø)` | |
   | [...dks/python/apache\_beam/options/pipeline\_options.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vb3B0aW9ucy9waXBlbGluZV9vcHRpb25zLnB5) | `95.01% <70.00%> (+0.02%)` | :arrow_up: |
   | [...beam/runners/interactive/background\_caching\_job.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9iYWNrZ3JvdW5kX2NhY2hpbmdfam9iLnB5) | `94.78% <90.90%> (ø)` | |
   | [sdks/python/apache\_beam/utils/histogram.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdXRpbHMvaGlzdG9ncmFtLnB5) | `94.28% <94.28%> (ø)` | |
   | [...ache\_beam/runners/interactive/recording\_manager.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9yZWNvcmRpbmdfbWFuYWdlci5weQ==) | `98.05% <95.74%> (+5.19%)` | :arrow_up: |
   | ... and [62 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [68e7f2e...2998c30](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/a99c6826a067f49ebb60e625c8652900c7d0e810?el=desc) will **increase** coverage by `3.54%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   + Coverage   34.32%   37.86%   +3.54%     
   ==========================================
     Files         694      420     -274     
     Lines       82226    50214   -32012     
     Branches     9294     6925    -2369     
   ==========================================
   - Hits        28225    19015    -9210     
   + Misses      53578    30808   -22770     
   + Partials      423      391      -32     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [runners/portability/stager.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9wb3J0YWJpbGl0eS9zdGFnZXIucHk=) | `31.74% <0.00%> (ø)` | |
   | [runners/interactive/display/pipeline\_graph\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9pbnRlcmFjdGl2ZS9kaXNwbGF5L3BpcGVsaW5lX2dyYXBoX3Rlc3QucHk=) | | |
   | [...taflow\_exercise\_streaming\_metrics\_pipeline\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9kYXRhZmxvdy9kYXRhZmxvd19leGVyY2lzZV9zdHJlYW1pbmdfbWV0cmljc19waXBlbGluZV90ZXN0LnB5) | | |
   | [metrics/execution\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-bWV0cmljcy9leGVjdXRpb25fdGVzdC5weQ==) | | |
   | [internal/pickler\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW50ZXJuYWwvcGlja2xlcl90ZXN0LnB5) | | |
   | [io/gcp/gcsfilesystem\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vZ2NwL2djc2ZpbGVzeXN0ZW1fdGVzdC5weQ==) | | |
   | [io/gcp/tests/bigquery\_matcher\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vZ2NwL3Rlc3RzL2JpZ3F1ZXJ5X21hdGNoZXJfdGVzdC5weQ==) | | |
   | [io/filesystems\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vZmlsZXN5c3RlbXNfdGVzdC5weQ==) | | |
   | [runners/worker/sdk\_worker\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy93b3JrZXIvc2RrX3dvcmtlcl90ZXN0LnB5) | | |
   | [tools/coders\_microbenchmark.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dG9vbHMvY29kZXJzX21pY3JvYmVuY2htYXJrLnB5) | | |
   | ... and [271 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [a99c682...e7c0b16](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/5ef04e945fb1a3948d665af5d6b7f13b86487616?el=desc) will **decrease** coverage by `0.10%`.
   > The diff coverage is `55.18%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   - Coverage   82.36%   82.26%   -0.11%     
   ==========================================
     Files         451      455       +4     
     Lines       53753    54515     +762     
   ==========================================
   + Hits        44273    44846     +573     
   - Misses       9480     9669     +189     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `72.60% <0.00%> (ø)` | |
   | [...eam/testing/benchmarks/nexmark/nexmark\_launcher.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19sYXVuY2hlci5weQ==) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_perf.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19wZXJmLnB5) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_util.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya191dGlsLnB5) | `0.00% <0.00%> (ø)` | |
   | [...\_beam/runners/portability/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9wb3J0YWJpbGl0eS9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `31.21% <31.21%> (ø)` | |
   | [...on/apache\_beam/runners/dataflow/dataflow\_runner.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9kYXRhZmxvd19ydW5uZXIucHk=) | `77.06% <66.66%> (-0.12%)` | :arrow_down: |
   | [sdks/python/apache\_beam/transforms/environments.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdHJhbnNmb3Jtcy9lbnZpcm9ubWVudHMucHk=) | `83.54% <66.66%> (-0.28%)` | :arrow_down: |
   | [...s/python/apache\_beam/runners/portability/stager.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9wb3J0YWJpbGl0eS9zdGFnZXIucHk=) | `82.62% <89.18%> (+0.34%)` | :arrow_up: |
   | [sdks/python/apache\_beam/io/gcp/bigquery.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vaW8vZ2NwL2JpZ3F1ZXJ5LnB5) | `79.33% <90.90%> (-0.45%)` | :arrow_down: |
   | [...dks/python/apache\_beam/options/pipeline\_options.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vb3B0aW9ucy9waXBlbGluZV9vcHRpb25zLnB5) | `94.79% <92.85%> (-0.20%)` | :arrow_down: |
   | ... and [83 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [68e7f2e...b59a1ba](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/5ef04e945fb1a3948d665af5d6b7f13b86487616?el=desc) will **decrease** coverage by `0.19%`.
   > The diff coverage is `52.86%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   - Coverage   82.36%   82.16%   -0.20%     
   ==========================================
     Files         451      452       +1     
     Lines       53753    54036     +283     
   ==========================================
   + Hits        44273    44400     +127     
   - Misses       9480     9636     +156     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `72.60% <0.00%> (ø)` | |
   | [...eam/testing/benchmarks/nexmark/nexmark\_launcher.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19sYXVuY2hlci5weQ==) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_perf.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19wZXJmLnB5) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_util.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya191dGlsLnB5) | `0.00% <0.00%> (ø)` | |
   | [...\_beam/runners/portability/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9wb3J0YWJpbGl0eS9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `32.23% <32.23%> (ø)` | |
   | [...on/apache\_beam/runners/dataflow/dataflow\_runner.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9kYXRhZmxvd19ydW5uZXIucHk=) | `77.03% <60.00%> (-0.15%)` | :arrow_down: |
   | [...dks/python/apache\_beam/options/pipeline\_options.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vb3B0aW9ucy9waXBlbGluZV9vcHRpb25zLnB5) | `95.00% <66.66%> (+0.01%)` | :arrow_up: |
   | [sdks/python/apache\_beam/transforms/environments.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdHJhbnNmb3Jtcy9lbnZpcm9ubWVudHMucHk=) | `83.49% <66.66%> (-0.33%)` | :arrow_down: |
   | [...beam/runners/interactive/background\_caching\_job.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9iYWNrZ3JvdW5kX2NhY2hpbmdfam9iLnB5) | `94.78% <90.90%> (ø)` | |
   | [sdks/python/apache\_beam/utils/histogram.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdXRpbHMvaGlzdG9ncmFtLnB5) | `94.28% <94.28%> (ø)` | |
   | ... and [66 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [68e7f2e...794808f](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: Add option to prebuild python sdk container

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/a99c6826a067f49ebb60e625c8652900c7d0e810?el=desc) will **increase** coverage by `5.88%`.
   > The diff coverage is `33.80%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   + Coverage   34.32%   40.21%   +5.88%     
   ==========================================
     Files         694      455     -239     
     Lines       82226    53738   -28488     
     Branches     9294        0    -9294     
   ==========================================
   - Hits        28225    21610    -6615     
   + Misses      53578    32128   -21450     
   + Partials      423        0     -423     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `20.20% <28.57%> (ø)` | |
   | [...che\_beam/runners/dataflow/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `34.37% <34.37%> (ø)` | |
   | [transforms/sql\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dHJhbnNmb3Jtcy9zcWxfdGVzdC5weQ==) | | |
   | [io/mongodbio\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vbW9uZ29kYmlvX3Rlc3QucHk=) | | |
   | [coders/observable.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-Y29kZXJzL29ic2VydmFibGUucHk=) | | |
   | [...es/snippets/transforms/elementwise/flatmap\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZXhhbXBsZXMvc25pcHBldHMvdHJhbnNmb3Jtcy9lbGVtZW50d2lzZS9mbGF0bWFwX3Rlc3QucHk=) | | |
   | [examples/complete/juliaset/setup.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZXhhbXBsZXMvY29tcGxldGUvanVsaWFzZXQvc2V0dXAucHk=) | | |
   | [runners/direct/direct\_runner.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9kaXJlY3QvZGlyZWN0X3J1bm5lci5weQ==) | | |
   | [io/gcp/\_\_init\_\_.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vZ2NwL19faW5pdF9fLnB5) | | |
   | [examples/complete/distribopt.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZXhhbXBsZXMvY29tcGxldGUvZGlzdHJpYm9wdC5weQ==) | | |
   | ... and [1141 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [a99c682...20c8398](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/5ef04e945fb1a3948d665af5d6b7f13b86487616?el=desc) will **decrease** coverage by `0.18%`.
   > The diff coverage is `52.68%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   - Coverage   82.36%   82.17%   -0.19%     
   ==========================================
     Files         451      452       +1     
     Lines       53753    54034     +281     
   ==========================================
   + Hits        44273    44403     +130     
   - Misses       9480     9631     +151     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `72.60% <0.00%> (ø)` | |
   | [...eam/testing/benchmarks/nexmark/nexmark\_launcher.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19sYXVuY2hlci5weQ==) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_perf.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19wZXJmLnB5) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_util.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya191dGlsLnB5) | `0.00% <0.00%> (ø)` | |
   | [...\_beam/runners/portability/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9wb3J0YWJpbGl0eS9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `31.78% <31.78%> (ø)` | |
   | [...on/apache\_beam/runners/dataflow/dataflow\_runner.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9kYXRhZmxvd19ydW5uZXIucHk=) | `77.03% <60.00%> (-0.15%)` | :arrow_down: |
   | [...dks/python/apache\_beam/options/pipeline\_options.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vb3B0aW9ucy9waXBlbGluZV9vcHRpb25zLnB5) | `94.98% <62.50%> (ø)` | |
   | [sdks/python/apache\_beam/transforms/environments.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdHJhbnNmb3Jtcy9lbnZpcm9ubWVudHMucHk=) | `83.49% <66.66%> (-0.33%)` | :arrow_down: |
   | [...beam/runners/interactive/background\_caching\_job.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9iYWNrZ3JvdW5kX2NhY2hpbmdfam9iLnB5) | `94.78% <90.90%> (ø)` | |
   | [sdks/python/apache\_beam/utils/histogram.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdXRpbHMvaGlzdG9ncmFtLnB5) | `94.28% <94.28%> (ø)` | |
   | ... and [70 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [68e7f2e...e26ecaf](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: Add option to prebuild python sdk container

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] aaltay commented on a change in pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
aaltay commented on a change in pull request #12727:
URL: https://github.com/apache/beam/pull/12727#discussion_r491168283



##########
File path: sdks/python/apache_beam/runners/dataflow/dataflow_runner.py
##########
@@ -473,10 +474,19 @@ def run_pipeline(self, pipeline, options):
 
     use_fnapi = apiclient._use_fnapi(options)
     from apache_beam.transforms import environments
-    self._default_environment = (
-        environments.DockerEnvironment.from_container_image(
-            apiclient.get_container_image_from_options(options),
-            artifacts=environments.python_sdk_dependencies(options)))
+    if options.view_as(DebugOptions).lookup_experiment(
+        'prebuild_sdk_container'):

Review comment:
       Should this be a top level option similar to `docker_registry_push_url` or vice versa? It probably sense to make either both options an experiment, or both as top level options.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/5ef04e945fb1a3948d665af5d6b7f13b86487616?el=desc) will **decrease** coverage by `0.16%`.
   > The diff coverage is `52.66%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   - Coverage   82.36%   82.20%   -0.17%     
   ==========================================
     Files         451      455       +4     
     Lines       53753    54284     +531     
   ==========================================
   + Hits        44273    44623     +350     
   - Misses       9480     9661     +181     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `72.60% <0.00%> (ø)` | |
   | [...eam/testing/benchmarks/nexmark/nexmark\_launcher.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19sYXVuY2hlci5weQ==) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_perf.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19wZXJmLnB5) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_util.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya191dGlsLnB5) | `0.00% <0.00%> (ø)` | |
   | [...\_beam/runners/portability/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9wb3J0YWJpbGl0eS9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `31.16% <31.16%> (ø)` | |
   | [...on/apache\_beam/runners/dataflow/dataflow\_runner.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9kYXRhZmxvd19ydW5uZXIucHk=) | `77.06% <66.66%> (-0.12%)` | :arrow_down: |
   | [sdks/python/apache\_beam/transforms/environments.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdHJhbnNmb3Jtcy9lbnZpcm9ubWVudHMucHk=) | `83.49% <66.66%> (-0.33%)` | :arrow_down: |
   | [...dks/python/apache\_beam/options/pipeline\_options.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vb3B0aW9ucy9waXBlbGluZV9vcHRpb25zLnB5) | `95.02% <72.72%> (+0.04%)` | :arrow_up: |
   | [sdks/python/apache\_beam/io/gcp/bigquery.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vaW8vZ2NwL2JpZ3F1ZXJ5LnB5) | `79.78% <90.90%> (+<0.01%)` | :arrow_up: |
   | [sdks/python/apache\_beam/utils/histogram.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdXRpbHMvaGlzdG9ncmFtLnB5) | `94.28% <94.28%> (ø)` | |
   | ... and [75 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [68e7f2e...1fe2d8d](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: Add option to prebuild python sdk container

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/a99c6826a067f49ebb60e625c8652900c7d0e810?el=desc) will **increase** coverage by `5.88%`.
   > The diff coverage is `33.80%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   + Coverage   34.32%   40.21%   +5.88%     
   ==========================================
     Files         694      455     -239     
     Lines       82226    53738   -28488     
     Branches     9294        0    -9294     
   ==========================================
   - Hits        28225    21610    -6615     
   + Misses      53578    32128   -21450     
   + Partials      423        0     -423     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `20.20% <28.57%> (ø)` | |
   | [...che\_beam/runners/dataflow/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `34.37% <34.37%> (ø)` | |
   | [runners/runner\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9ydW5uZXJfdGVzdC5weQ==) | | |
   | [io/aws/clients/s3/messages.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vYXdzL2NsaWVudHMvczMvbWVzc2FnZXMucHk=) | | |
   | [typehints/trivial\_inference\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dHlwZWhpbnRzL3RyaXZpYWxfaW5mZXJlbmNlX3Rlc3QucHk=) | | |
   | [transforms/external.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dHJhbnNmb3Jtcy9leHRlcm5hbC5weQ==) | | |
   | [examples/avro\_bitcoin.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZXhhbXBsZXMvYXZyb19iaXRjb2luLnB5) | | |
   | [testing/load\_tests/load\_test\_metrics\_utils.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dGVzdGluZy9sb2FkX3Rlc3RzL2xvYWRfdGVzdF9tZXRyaWNzX3V0aWxzLnB5) | | |
   | [typehints/decorators\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dHlwZWhpbnRzL2RlY29yYXRvcnNfdGVzdC5weQ==) | | |
   | [examples/complete/autocomplete.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZXhhbXBsZXMvY29tcGxldGUvYXV0b2NvbXBsZXRlLnB5) | | |
   | ... and [1141 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [a99c682...030594c](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: Add option to prebuild python sdk container

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/a99c6826a067f49ebb60e625c8652900c7d0e810?el=desc) will **increase** coverage by `5.88%`.
   > The diff coverage is `33.80%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   + Coverage   34.32%   40.21%   +5.88%     
   ==========================================
     Files         694      455     -239     
     Lines       82226    53738   -28488     
     Branches     9294        0    -9294     
   ==========================================
   - Hits        28225    21610    -6615     
   + Misses      53578    32128   -21450     
   + Partials      423        0     -423     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `20.20% <28.57%> (ø)` | |
   | [...che\_beam/runners/dataflow/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `34.37% <34.37%> (ø)` | |
   | [internal/gcp/json\_value\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW50ZXJuYWwvZ2NwL2pzb25fdmFsdWVfdGVzdC5weQ==) | | |
   | [io/gcp/tests/bigquery\_matcher\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vZ2NwL3Rlc3RzL2JpZ3F1ZXJ5X21hdGNoZXJfdGVzdC5weQ==) | | |
   | [transforms/py\_dataflow\_distribution\_counter.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dHJhbnNmb3Jtcy9weV9kYXRhZmxvd19kaXN0cmlidXRpb25fY291bnRlci5weQ==) | | |
   | [...ers/dataflow/dataflow\_exercise\_metrics\_pipeline.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9kYXRhZmxvdy9kYXRhZmxvd19leGVyY2lzZV9tZXRyaWNzX3BpcGVsaW5lLnB5) | | |
   | [io/aws/clients/s3/boto3\_client.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vYXdzL2NsaWVudHMvczMvYm90bzNfY2xpZW50LnB5) | | |
   | [runners/portability/expansion\_service\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9wb3J0YWJpbGl0eS9leHBhbnNpb25fc2VydmljZV90ZXN0LnB5) | | |
   | [io/external/gcp/\_\_init\_\_.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vZXh0ZXJuYWwvZ2NwL19faW5pdF9fLnB5) | | |
   | [io/gcp/bigquery\_write\_perf\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vZ2NwL2JpZ3F1ZXJ5X3dyaXRlX3BlcmZfdGVzdC5weQ==) | | |
   | ... and [1141 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [a99c682...20c8398](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/5ef04e945fb1a3948d665af5d6b7f13b86487616?el=desc) will **decrease** coverage by `0.16%`.
   > The diff coverage is `52.66%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   - Coverage   82.36%   82.20%   -0.17%     
   ==========================================
     Files         451      455       +4     
     Lines       53753    54284     +531     
   ==========================================
   + Hits        44273    44623     +350     
   - Misses       9480     9661     +181     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `72.60% <0.00%> (ø)` | |
   | [...eam/testing/benchmarks/nexmark/nexmark\_launcher.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19sYXVuY2hlci5weQ==) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_perf.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19wZXJmLnB5) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_util.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya191dGlsLnB5) | `0.00% <0.00%> (ø)` | |
   | [...\_beam/runners/portability/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9wb3J0YWJpbGl0eS9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `31.16% <31.16%> (ø)` | |
   | [...on/apache\_beam/runners/dataflow/dataflow\_runner.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9kYXRhZmxvd19ydW5uZXIucHk=) | `77.06% <66.66%> (-0.12%)` | :arrow_down: |
   | [sdks/python/apache\_beam/transforms/environments.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdHJhbnNmb3Jtcy9lbnZpcm9ubWVudHMucHk=) | `83.49% <66.66%> (-0.33%)` | :arrow_down: |
   | [...dks/python/apache\_beam/options/pipeline\_options.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vb3B0aW9ucy9waXBlbGluZV9vcHRpb25zLnB5) | `95.02% <72.72%> (+0.04%)` | :arrow_up: |
   | [sdks/python/apache\_beam/io/gcp/bigquery.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vaW8vZ2NwL2JpZ3F1ZXJ5LnB5) | `79.78% <90.90%> (+<0.01%)` | :arrow_up: |
   | [sdks/python/apache\_beam/utils/histogram.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdXRpbHMvaGlzdG9ncmFtLnB5) | `94.28% <94.28%> (ø)` | |
   | ... and [75 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [68e7f2e...1fe2d8d](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/a99c6826a067f49ebb60e625c8652900c7d0e810?el=desc) will **increase** coverage by `5.88%`.
   > The diff coverage is `33.80%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   + Coverage   34.32%   40.21%   +5.88%     
   ==========================================
     Files         694      455     -239     
     Lines       82226    53738   -28488     
     Branches     9294        0    -9294     
   ==========================================
   - Hits        28225    21610    -6615     
   + Misses      53578    32128   -21450     
   + Partials      423        0     -423     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `20.20% <28.57%> (ø)` | |
   | [...che\_beam/runners/dataflow/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `34.37% <34.37%> (ø)` | |
   | [portability/api/beam\_job\_api\_pb2\_urns.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cG9ydGFiaWxpdHkvYXBpL2JlYW1fam9iX2FwaV9wYjJfdXJucy5weQ==) | | |
   | [runners/interactive/display/pipeline\_graph\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9pbnRlcmFjdGl2ZS9kaXNwbGF5L3BpcGVsaW5lX2dyYXBoX3Rlc3QucHk=) | | |
   | [...taflow\_exercise\_streaming\_metrics\_pipeline\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9kYXRhZmxvdy9kYXRhZmxvd19leGVyY2lzZV9zdHJlYW1pbmdfbWV0cmljc19waXBlbGluZV90ZXN0LnB5) | | |
   | [internal/pickler\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW50ZXJuYWwvcGlja2xlcl90ZXN0LnB5) | | |
   | [coders/observable.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-Y29kZXJzL29ic2VydmFibGUucHk=) | | |
   | [internal/gcp/auth.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW50ZXJuYWwvZ2NwL2F1dGgucHk=) | | |
   | [typehints/\_\_init\_\_.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dHlwZWhpbnRzL19faW5pdF9fLnB5) | | |
   | [io/filebasedsource.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vZmlsZWJhc2Vkc291cmNlLnB5) | | |
   | ... and [1141 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [a99c682...850b0b9](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/5ef04e945fb1a3948d665af5d6b7f13b86487616?el=desc) will **decrease** coverage by `0.19%`.
   > The diff coverage is `52.86%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   - Coverage   82.36%   82.16%   -0.20%     
   ==========================================
     Files         451      452       +1     
     Lines       53753    54036     +283     
   ==========================================
   + Hits        44273    44400     +127     
   - Misses       9480     9636     +156     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `72.60% <0.00%> (ø)` | |
   | [...eam/testing/benchmarks/nexmark/nexmark\_launcher.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19sYXVuY2hlci5weQ==) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_perf.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19wZXJmLnB5) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_util.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya191dGlsLnB5) | `0.00% <0.00%> (ø)` | |
   | [...\_beam/runners/portability/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9wb3J0YWJpbGl0eS9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `32.23% <32.23%> (ø)` | |
   | [...on/apache\_beam/runners/dataflow/dataflow\_runner.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9kYXRhZmxvd19ydW5uZXIucHk=) | `77.03% <60.00%> (-0.15%)` | :arrow_down: |
   | [...dks/python/apache\_beam/options/pipeline\_options.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vb3B0aW9ucy9waXBlbGluZV9vcHRpb25zLnB5) | `95.00% <66.66%> (+0.01%)` | :arrow_up: |
   | [sdks/python/apache\_beam/transforms/environments.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdHJhbnNmb3Jtcy9lbnZpcm9ubWVudHMucHk=) | `83.49% <66.66%> (-0.33%)` | :arrow_down: |
   | [...beam/runners/interactive/background\_caching\_job.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9iYWNrZ3JvdW5kX2NhY2hpbmdfam9iLnB5) | `94.78% <90.90%> (ø)` | |
   | [sdks/python/apache\_beam/utils/histogram.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdXRpbHMvaGlzdG9ncmFtLnB5) | `94.28% <94.28%> (ø)` | |
   | ... and [66 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [68e7f2e...984c4e7](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/a99c6826a067f49ebb60e625c8652900c7d0e810?el=desc) will **increase** coverage by `5.88%`.
   > The diff coverage is `33.80%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   + Coverage   34.32%   40.21%   +5.88%     
   ==========================================
     Files         694      455     -239     
     Lines       82226    53738   -28488     
     Branches     9294        0    -9294     
   ==========================================
   - Hits        28225    21610    -6615     
   + Misses      53578    32128   -21450     
   + Partials      423        0     -423     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `20.20% <28.57%> (ø)` | |
   | [...che\_beam/runners/dataflow/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `34.37% <34.37%> (ø)` | |
   | [typehints/schemas.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dHlwZWhpbnRzL3NjaGVtYXMucHk=) | | |
   | [utils/annotations\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dXRpbHMvYW5ub3RhdGlvbnNfdGVzdC5weQ==) | | |
   | [dataframe/expressions\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZGF0YWZyYW1lL2V4cHJlc3Npb25zX3Rlc3QucHk=) | | |
   | [examples/snippets/transforms/elementwise/keys.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZXhhbXBsZXMvc25pcHBldHMvdHJhbnNmb3Jtcy9lbGVtZW50d2lzZS9rZXlzLnB5) | | |
   | [typehints/opcodes.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dHlwZWhpbnRzL29wY29kZXMucHk=) | | |
   | [io/gcp/bigtableio.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vZ2NwL2JpZ3RhYmxlaW8ucHk=) | | |
   | [examples/snippets/snippets\_test\_py3.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZXhhbXBsZXMvc25pcHBldHMvc25pcHBldHNfdGVzdF9weTMucHk=) | | |
   | [transforms/userstate\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dHJhbnNmb3Jtcy91c2Vyc3RhdGVfdGVzdC5weQ==) | | |
   | ... and [1141 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [a99c682...e7c0b16](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/5ef04e945fb1a3948d665af5d6b7f13b86487616?el=desc) will **decrease** coverage by `0.19%`.
   > The diff coverage is `54.59%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   - Coverage   82.36%   82.16%   -0.20%     
   ==========================================
     Files         451      453       +2     
     Lines       53753    54009     +256     
   ==========================================
   + Hits        44273    44378     +105     
   - Misses       9480     9631     +151     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...eam/testing/benchmarks/nexmark/nexmark\_launcher.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19sYXVuY2hlci5weQ==) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_perf.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19wZXJmLnB5) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_util.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya191dGlsLnB5) | `0.00% <0.00%> (ø)` | |
   | [...s/dataflow/internal/sdk\_container\_cloud\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9zZGtfY29udGFpbmVyX2Nsb3VkX2J1aWxkZXIucHk=) | `34.14% <34.14%> (ø)` | |
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `72.02% <42.85%> (-0.58%)` | :arrow_down: |
   | [...\_beam/runners/portability/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9wb3J0YWJpbGl0eS9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `42.85% <42.85%> (ø)` | |
   | [...dks/python/apache\_beam/options/pipeline\_options.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vb3B0aW9ucy9waXBlbGluZV9vcHRpb25zLnB5) | `95.01% <70.00%> (+0.02%)` | :arrow_up: |
   | [...beam/runners/interactive/background\_caching\_job.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9iYWNrZ3JvdW5kX2NhY2hpbmdfam9iLnB5) | `94.78% <90.90%> (ø)` | |
   | [sdks/python/apache\_beam/utils/histogram.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdXRpbHMvaGlzdG9ncmFtLnB5) | `94.28% <94.28%> (ø)` | |
   | [...ache\_beam/runners/interactive/recording\_manager.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9yZWNvcmRpbmdfbWFuYWdlci5weQ==) | `98.05% <95.74%> (+5.19%)` | :arrow_up: |
   | ... and [61 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [68e7f2e...3e6cb8e](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: Add option to prebuild python sdk container

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/a99c6826a067f49ebb60e625c8652900c7d0e810?el=desc) will **increase** coverage by `5.88%`.
   > The diff coverage is `33.80%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   + Coverage   34.32%   40.21%   +5.88%     
   ==========================================
     Files         694      455     -239     
     Lines       82226    53738   -28488     
     Branches     9294        0    -9294     
   ==========================================
   - Hits        28225    21610    -6615     
   + Misses      53578    32128   -21450     
   + Partials      423        0     -423     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `20.20% <28.57%> (ø)` | |
   | [...che\_beam/runners/dataflow/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `34.37% <34.37%> (ø)` | |
   | [runners/worker/data\_plane.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy93b3JrZXIvZGF0YV9wbGFuZS5weQ==) | | |
   | [ml/gcp/visionml.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-bWwvZ2NwL3Zpc2lvbm1sLnB5) | | |
   | [...ners/portability/flink\_uber\_jar\_job\_server\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9wb3J0YWJpbGl0eS9mbGlua191YmVyX2phcl9qb2Jfc2VydmVyX3Rlc3QucHk=) | | |
   | [io/gcp/bigquery\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vZ2NwL2JpZ3F1ZXJ5X3Rlc3QucHk=) | | |
   | [testing/synthetic\_pipeline.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dGVzdGluZy9zeW50aGV0aWNfcGlwZWxpbmUucHk=) | | |
   | [testing/datatype\_inference\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dGVzdGluZy9kYXRhdHlwZV9pbmZlcmVuY2VfdGVzdC5weQ==) | | |
   | [internal/gcp/json\_value\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW50ZXJuYWwvZ2NwL2pzb25fdmFsdWVfdGVzdC5weQ==) | | |
   | [testing/benchmarks/chicago\_taxi/trainer/taxi.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dGVzdGluZy9iZW5jaG1hcmtzL2NoaWNhZ29fdGF4aS90cmFpbmVyL3RheGkucHk=) | | |
   | ... and [1141 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [a99c682...ba76a3f](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: Add option to prebuild python sdk container

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/a99c6826a067f49ebb60e625c8652900c7d0e810?el=desc) will **increase** coverage by `5.88%`.
   > The diff coverage is `33.80%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   + Coverage   34.32%   40.21%   +5.88%     
   ==========================================
     Files         694      455     -239     
     Lines       82226    53738   -28488     
     Branches     9294        0    -9294     
   ==========================================
   - Hits        28225    21610    -6615     
   + Misses      53578    32128   -21450     
   + Partials      423        0     -423     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `20.20% <28.57%> (ø)` | |
   | [...che\_beam/runners/dataflow/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `34.37% <34.37%> (ø)` | |
   | [testing/benchmarks/nexmark/nexmark\_launcher.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19sYXVuY2hlci5weQ==) | | |
   | [metrics/execution.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-bWV0cmljcy9leGVjdXRpb24ucHk=) | | |
   | [testing/benchmarks/\_\_init\_\_.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dGVzdGluZy9iZW5jaG1hcmtzL19faW5pdF9fLnB5) | | |
   | [runners/pipeline\_context.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9waXBlbGluZV9jb250ZXh0LnB5) | | |
   | [transforms/combiners\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dHJhbnNmb3Jtcy9jb21iaW5lcnNfdGVzdC5weQ==) | | |
   | [examples/complete/estimate\_pi.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZXhhbXBsZXMvY29tcGxldGUvZXN0aW1hdGVfcGkucHk=) | | |
   | [runners/dataflow/dataflow\_runner\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9kYXRhZmxvdy9kYXRhZmxvd19ydW5uZXJfdGVzdC5weQ==) | | |
   | [dataframe/convert\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZGF0YWZyYW1lL2NvbnZlcnRfdGVzdC5weQ==) | | |
   | ... and [1141 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [a99c682...e747445](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/5ef04e945fb1a3948d665af5d6b7f13b86487616?el=desc) will **decrease** coverage by `0.20%`.
   > The diff coverage is `52.86%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   - Coverage   82.36%   82.16%   -0.21%     
   ==========================================
     Files         451      452       +1     
     Lines       53753    54036     +283     
   ==========================================
   + Hits        44273    44398     +125     
   - Misses       9480     9638     +158     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `72.60% <0.00%> (ø)` | |
   | [...eam/testing/benchmarks/nexmark/nexmark\_launcher.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19sYXVuY2hlci5weQ==) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_perf.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19wZXJmLnB5) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_util.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya191dGlsLnB5) | `0.00% <0.00%> (ø)` | |
   | [...\_beam/runners/portability/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9wb3J0YWJpbGl0eS9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `32.23% <32.23%> (ø)` | |
   | [...on/apache\_beam/runners/dataflow/dataflow\_runner.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9kYXRhZmxvd19ydW5uZXIucHk=) | `77.03% <60.00%> (-0.15%)` | :arrow_down: |
   | [...dks/python/apache\_beam/options/pipeline\_options.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vb3B0aW9ucy9waXBlbGluZV9vcHRpb25zLnB5) | `95.00% <66.66%> (+0.01%)` | :arrow_up: |
   | [sdks/python/apache\_beam/transforms/environments.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdHJhbnNmb3Jtcy9lbnZpcm9ubWVudHMucHk=) | `83.49% <66.66%> (-0.33%)` | :arrow_down: |
   | [...beam/runners/interactive/background\_caching\_job.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9iYWNrZ3JvdW5kX2NhY2hpbmdfam9iLnB5) | `94.78% <90.90%> (ø)` | |
   | [sdks/python/apache\_beam/utils/histogram.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdXRpbHMvaGlzdG9ncmFtLnB5) | `94.28% <94.28%> (ø)` | |
   | ... and [67 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [68e7f2e...984c4e7](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] y1chi commented on a change in pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
y1chi commented on a change in pull request #12727:
URL: https://github.com/apache/beam/pull/12727#discussion_r493764967



##########
File path: sdks/python/apache_beam/transforms/environments.py
##########
@@ -252,6 +254,13 @@ def from_runner_api_parameter(payload, capabilities, artifacts, context):
   @classmethod
   def from_options(cls, options):
     # type: (PipelineOptions) -> DockerEnvironment
+    if options.view_as(SetupOptions).prebuild_sdk_container_engine:
+      prebuilt_container_image = SdkContainerBuilder.build_container_image(
+          options)
+      return cls.from_container_image(
+          container_image=prebuilt_container_image,
+          artifacts=python_sdk_dependencies(
+              options, skip_boot_dependencies=True))

Review comment:
       sounds good, applied the change.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: Add option to prebuild python sdk container

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/a99c6826a067f49ebb60e625c8652900c7d0e810?el=desc) will **increase** coverage by `5.88%`.
   > The diff coverage is `33.80%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   + Coverage   34.32%   40.21%   +5.88%     
   ==========================================
     Files         694      455     -239     
     Lines       82226    53738   -28488     
     Branches     9294        0    -9294     
   ==========================================
   - Hits        28225    21610    -6615     
   + Misses      53578    32128   -21450     
   + Partials      423        0     -423     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `20.20% <28.57%> (ø)` | |
   | [...che\_beam/runners/dataflow/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `34.37% <34.37%> (ø)` | |
   | [testing/util\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dGVzdGluZy91dGlsX3Rlc3QucHk=) | | |
   | [io/aws/clients/s3/fake\_client.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vYXdzL2NsaWVudHMvczMvZmFrZV9jbGllbnQucHk=) | | |
   | [examples/cookbook/datastore\_wordcount\_it\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZXhhbXBsZXMvY29va2Jvb2svZGF0YXN0b3JlX3dvcmRjb3VudF9pdF90ZXN0LnB5) | | |
   | [dataframe/frames\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZGF0YWZyYW1lL2ZyYW1lc190ZXN0LnB5) | | |
   | [runners/interactive/pipeline\_analyzer\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9pbnRlcmFjdGl2ZS9waXBlbGluZV9hbmFseXplcl90ZXN0LnB5) | | |
   | [io/gcp/pubsub\_integration\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vZ2NwL3B1YnN1Yl9pbnRlZ3JhdGlvbl90ZXN0LnB5) | | |
   | [...amples/snippets/transforms/aggregation/\_\_init\_\_.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZXhhbXBsZXMvc25pcHBldHMvdHJhbnNmb3Jtcy9hZ2dyZWdhdGlvbi9fX2luaXRfXy5weQ==) | | |
   | [examples/complete/top\_wikipedia\_sessions.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZXhhbXBsZXMvY29tcGxldGUvdG9wX3dpa2lwZWRpYV9zZXNzaW9ucy5weQ==) | | |
   | ... and [1141 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [a99c682...e747445](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] aaltay commented on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
aaltay commented on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-698027243


   @tvalentyn - I will defer to you. You provided the last round of feedback.
   
   (/cc: @robinyqiu - in case you would like to merge it today for the next release.)


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/5ef04e945fb1a3948d665af5d6b7f13b86487616?el=desc) will **decrease** coverage by `0.10%`.
   > The diff coverage is `55.18%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   - Coverage   82.36%   82.26%   -0.11%     
   ==========================================
     Files         451      455       +4     
     Lines       53753    54515     +762     
   ==========================================
   + Hits        44273    44846     +573     
   - Misses       9480     9669     +189     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `72.60% <0.00%> (ø)` | |
   | [...eam/testing/benchmarks/nexmark/nexmark\_launcher.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19sYXVuY2hlci5weQ==) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_perf.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19wZXJmLnB5) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_util.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya191dGlsLnB5) | `0.00% <0.00%> (ø)` | |
   | [...\_beam/runners/portability/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9wb3J0YWJpbGl0eS9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `31.21% <31.21%> (ø)` | |
   | [...on/apache\_beam/runners/dataflow/dataflow\_runner.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9kYXRhZmxvd19ydW5uZXIucHk=) | `77.06% <66.66%> (-0.12%)` | :arrow_down: |
   | [sdks/python/apache\_beam/transforms/environments.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdHJhbnNmb3Jtcy9lbnZpcm9ubWVudHMucHk=) | `83.54% <66.66%> (-0.28%)` | :arrow_down: |
   | [...s/python/apache\_beam/runners/portability/stager.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9wb3J0YWJpbGl0eS9zdGFnZXIucHk=) | `82.62% <89.18%> (+0.34%)` | :arrow_up: |
   | [sdks/python/apache\_beam/io/gcp/bigquery.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vaW8vZ2NwL2JpZ3F1ZXJ5LnB5) | `79.33% <90.90%> (-0.45%)` | :arrow_down: |
   | [...dks/python/apache\_beam/options/pipeline\_options.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vb3B0aW9ucy9waXBlbGluZV9vcHRpb25zLnB5) | `94.79% <92.85%> (-0.20%)` | :arrow_down: |
   | ... and [83 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [68e7f2e...b59a1ba](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] robertwb commented on a change in pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
robertwb commented on a change in pull request #12727:
URL: https://github.com/apache/beam/pull/12727#discussion_r492195972



##########
File path: sdks/python/apache_beam/runners/portability/stager.py
##########
@@ -119,6 +119,7 @@ def create_job_resources(options,  # type: PipelineOptions
                            temp_dir,  # type: str
                            build_setup_args=None,  # type: Optional[List[str]]
                            populate_requirements_cache=None,  # type: Optional[str]
+                           skip_boot_dependencies=False, # type: Optional[bool]

Review comment:
       Why are "boot" dependencies handled any differently than non-"boot" dependencies? 

##########
File path: sdks/python/apache_beam/runners/portability/sdk_container_builder.py
##########
@@ -0,0 +1,275 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+"""SdkContainerBuilder builds the portable SDK container with dependencies.
+
+It copies the right boot dependencies, namely: apache beam sdk, python packages
+from requirements.txt, python packages from extra_packages.txt, workflow
+tarball, into the latest public python sdk container image, and run the
+dependencies installation in advance with the boot program in setup only mode
+to build the new image.
+"""
+
+from __future__ import absolute_import
+
+import json
+import logging
+import os
+import shutil
+import subprocess
+import sys
+import tarfile
+import tempfile
+import time
+import uuid
+
+from google.protobuf.duration_pb2 import Duration
+from google.protobuf.json_format import MessageToJson
+
+from apache_beam.internal.gcp.auth import get_service_credentials
+from apache_beam.internal.http_client import get_new_http
+from apache_beam.io.gcp.internal.clients import storage
+from apache_beam.options.pipeline_options import DebugOptions
+from apache_beam.options.pipeline_options import GoogleCloudOptions
+from apache_beam.options.pipeline_options import PipelineOptions  # pylint: disable=unused-import
+from apache_beam.portability import common_urns
+from apache_beam.portability.api import beam_runner_api_pb2
+from apache_beam.runners.portability.stager import Stager
+
+ARTIFACTS_CONTAINER_DIR = '/opt/apache/beam/artifacts'
+ARTIFACTS_MANIFEST_FILE = 'artifacts_info.json'
+SDK_CONTAINER_ENTRYPOINT = '/opt/apache/beam/boot'
+DOCKERFILE_TEMPLATE = (
+    """FROM apache/beam_python{major}.{minor}_sdk:latest
+RUN mkdir -p {workdir}
+COPY ./* {workdir}/
+RUN {entrypoint} --setup_only --artifacts {workdir}/{manifest_file}
+""")
+
+SOURCE_FOLDER = 'source'
+_LOGGER = logging.getLogger(__name__)
+
+
+class SdkContainerBuilder(object):
+  def __init__(self, options):
+    self._options = options
+    self._temp_src_dir = tempfile.mkdtemp()
+    self._docker_registry_push_url = self._options.view_as(
+        DebugOptions).lookup_experiment('docker_registry_push_url')
+
+  def build(self):
+    container_id = str(uuid.uuid4())
+    container_tag = os.path.join(
+        self._docker_registry_push_url or '',
+        'beam_python_prebuilt_sdk:%s' % container_id)
+    self.prepare_dependencies()
+    self.invoke_docker_build_and_push(container_id, container_tag)
+
+    return container_tag
+
+  def prepare_dependencies(self):
+    tmp = tempfile.mkdtemp()
+    resources = Stager.create_job_resources(self._options, tmp)
+    # make a copy of the staged artifacts into the temp source folder.
+    for path, name in resources:
+      shutil.copyfile(path, os.path.join(self._temp_src_dir, name))
+    with open(os.path.join(self._temp_src_dir, 'Dockerfile'), 'w') as file:
+      file.write(
+          DOCKERFILE_TEMPLATE.format(
+              major=sys.version_info[0],
+              minor=sys.version_info[1],
+              workdir=ARTIFACTS_CONTAINER_DIR,
+              manifest_file=ARTIFACTS_MANIFEST_FILE,
+              entrypoint=SDK_CONTAINER_ENTRYPOINT))
+    self.generate_artifacts_manifests_json_file(resources, self._temp_src_dir)
+
+  def invoke_docker_build_and_push(self, container_id, container_tag):
+    raise NotImplementedError
+
+  @staticmethod
+  def generate_artifacts_manifests_json_file(resources, temp_dir):
+    infos = []
+    for _, name in resources:
+      info = beam_runner_api_pb2.ArtifactInformation(
+          type_urn=common_urns.StandardArtifacts.Types.FILE.urn,
+          type_payload=beam_runner_api_pb2.ArtifactFilePayload(
+              path=name).SerializeToString(),
+      )
+      infos.append(json.dumps(MessageToJson(info)))
+    with open(os.path.join(temp_dir, ARTIFACTS_MANIFEST_FILE), 'w') as file:
+      file.write('[\n' + ',\n'.join(infos) + '\n]')
+
+  @classmethod
+  def build_container_imge(cls, pipeline_options):

Review comment:
       spelling

##########
File path: sdks/python/apache_beam/transforms/environments.py
##########
@@ -252,6 +254,14 @@ def from_runner_api_parameter(payload, capabilities, artifacts, context):
   @classmethod
   def from_options(cls, options):
     # type: (PipelineOptions) -> DockerEnvironment
+    if options.view_as(DebugOptions).lookup_experiment(
+        'prebuild_sdk_container'):
+      prebuilt_container_image = SdkContainerBuilder.build_container_imge(

Review comment:
       I see this being called both here and in dataflow_runner.py. Are we invoking it twice on Dataflow?

##########
File path: sdks/python/apache_beam/runners/portability/stager.py
##########
@@ -151,7 +151,8 @@ def create_job_resources(options,  # type: PipelineOptions
     setup_options = options.view_as(SetupOptions)
 
     # Stage a requirements file if present.
-    if setup_options.requirements_file is not None:
+    if (setup_options.requirements_file is not None and

Review comment:
       It may require some refactoring, but I think the over-all result would be cleaner. (Maybe this is also messy due to a partial transition in how Dataflow handles artifacts compared to every other runner...) 
   
   However, if you prefer to keep it like this that's OK. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/a99c6826a067f49ebb60e625c8652900c7d0e810?el=desc) will **increase** coverage by `5.88%`.
   > The diff coverage is `33.80%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   + Coverage   34.32%   40.21%   +5.88%     
   ==========================================
     Files         694      455     -239     
     Lines       82226    53738   -28488     
     Branches     9294        0    -9294     
   ==========================================
   - Hits        28225    21610    -6615     
   + Misses      53578    32128   -21450     
   + Partials      423        0     -423     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `20.20% <28.57%> (ø)` | |
   | [...che\_beam/runners/dataflow/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `34.37% <34.37%> (ø)` | |
   | [runners/direct/sdf\_direct\_runner\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9kaXJlY3Qvc2RmX2RpcmVjdF9ydW5uZXJfdGVzdC5weQ==) | | |
   | [runners/portability/expansion\_service.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9wb3J0YWJpbGl0eS9leHBhbnNpb25fc2VydmljZS5weQ==) | | |
   | [dataframe/convert.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZGF0YWZyYW1lL2NvbnZlcnQucHk=) | | |
   | [runners/worker/statesampler\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy93b3JrZXIvc3RhdGVzYW1wbGVyX3Rlc3QucHk=) | | |
   | [io/range\_trackers.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vcmFuZ2VfdHJhY2tlcnMucHk=) | | |
   | [runners/worker/statesampler.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy93b3JrZXIvc3RhdGVzYW1wbGVyLnB5) | | |
   | [io/gcp/datastore/v1new/types.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vZ2NwL2RhdGFzdG9yZS92MW5ldy90eXBlcy5weQ==) | | |
   | [options/value\_provider.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-b3B0aW9ucy92YWx1ZV9wcm92aWRlci5weQ==) | | |
   | ... and [1141 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [a99c682...ca32229](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/5ef04e945fb1a3948d665af5d6b7f13b86487616?el=desc) will **decrease** coverage by `0.20%`.
   > The diff coverage is `52.86%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   - Coverage   82.36%   82.16%   -0.21%     
   ==========================================
     Files         451      452       +1     
     Lines       53753    54036     +283     
   ==========================================
   + Hits        44273    44398     +125     
   - Misses       9480     9638     +158     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `72.60% <0.00%> (ø)` | |
   | [...eam/testing/benchmarks/nexmark/nexmark\_launcher.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19sYXVuY2hlci5weQ==) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_perf.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19wZXJmLnB5) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_util.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya191dGlsLnB5) | `0.00% <0.00%> (ø)` | |
   | [...\_beam/runners/portability/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9wb3J0YWJpbGl0eS9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `32.23% <32.23%> (ø)` | |
   | [...on/apache\_beam/runners/dataflow/dataflow\_runner.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9kYXRhZmxvd19ydW5uZXIucHk=) | `77.03% <60.00%> (-0.15%)` | :arrow_down: |
   | [...dks/python/apache\_beam/options/pipeline\_options.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vb3B0aW9ucy9waXBlbGluZV9vcHRpb25zLnB5) | `95.00% <66.66%> (+0.01%)` | :arrow_up: |
   | [sdks/python/apache\_beam/transforms/environments.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdHJhbnNmb3Jtcy9lbnZpcm9ubWVudHMucHk=) | `83.49% <66.66%> (-0.33%)` | :arrow_down: |
   | [...beam/runners/interactive/background\_caching\_job.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9iYWNrZ3JvdW5kX2NhY2hpbmdfam9iLnB5) | `94.78% <90.90%> (ø)` | |
   | [sdks/python/apache\_beam/utils/histogram.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdXRpbHMvaGlzdG9ncmFtLnB5) | `94.28% <94.28%> (ø)` | |
   | ... and [67 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [68e7f2e...81f9a9e](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/5ef04e945fb1a3948d665af5d6b7f13b86487616?el=desc) will **decrease** coverage by `44.49%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff             @@
   ##           master   #12727       +/-   ##
   ===========================================
   - Coverage   82.36%   37.86%   -44.50%     
   ===========================================
     Files         451      420       -31     
     Lines       53753    50214     -3539     
     Branches        0     6925     +6925     
   ===========================================
   - Hits        44273    19015    -25258     
   - Misses       9480    30808    +21328     
   - Partials        0      391      +391     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...n/apache\_beam/runners/dataflow/dataflow\_metrics.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9kYXRhZmxvd19tZXRyaWNzLnB5) | | |
   | [.../python/apache\_beam/io/gcp/bigquery\_io\_metadata.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vaW8vZ2NwL2JpZ3F1ZXJ5X2lvX21ldGFkYXRhLnB5) | | |
   | [sdks/python/apache\_beam/transforms/ptransform.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdHJhbnNmb3Jtcy9wdHJhbnNmb3JtLnB5) | | |
   | [...s/python/apache\_beam/examples/complete/\_\_init\_\_.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vZXhhbXBsZXMvY29tcGxldGUvX19pbml0X18ucHk=) | | |
   | [.../apache\_beam/io/gcp/datastore/v1new/datastoreio.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vaW8vZ2NwL2RhdGFzdG9yZS92MW5ldy9kYXRhc3RvcmVpby5weQ==) | | |
   | [...apache\_beam/typehints/native\_type\_compatibility.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdHlwZWhpbnRzL25hdGl2ZV90eXBlX2NvbXBhdGliaWxpdHkucHk=) | | |
   | [...am/portability/api/standard\_window\_fns\_pb2\_urns.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcG9ydGFiaWxpdHkvYXBpL3N0YW5kYXJkX3dpbmRvd19mbnNfcGIyX3VybnMucHk=) | | |
   | [...beam/testing/benchmarks/nexmark/models/\_\_init\_\_.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbW9kZWxzL19faW5pdF9fLnB5) | | |
   | [...ks/python/apache\_beam/runners/dataflow/\_\_init\_\_.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9fX2luaXRfXy5weQ==) | | |
   | [...ers/interactive/display/pipeline\_graph\_renderer.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9kaXNwbGF5L3BpcGVsaW5lX2dyYXBoX3JlbmRlcmVyLnB5) | | |
   | ... and [858 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [68e7f2e...3e6cb8e](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] y1chi commented on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
y1chi commented on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-685141545


   > Could we have a design discussion about this first? This looks very Dataflow specific. I do not believe we had enough chance to discuss this. And it is also overlapping with work @emilymye and @tysonjh working on.
   
   yeah, I previously had a discussion with @tvalentyn and @emilymye, and looks like no one's working on this.
   also shared a doc https://docs.google.com/document/d/11iPwS94t-kXK3ybp3NEUshcu3bxyg94MJHYOqIZ-Fd0/edit to a few people.
   
   Right now this is only intended to provide an experimental shortcut for dataflow job to use dependencies preinstalled custom container. I believe the change doesn't cause any disruption for how currently dataflow or portable job runs.
   
   I can also set up meeting if further discussion is needed.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] robertwb commented on a change in pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
robertwb commented on a change in pull request #12727:
URL: https://github.com/apache/beam/pull/12727#discussion_r492504467



##########
File path: sdks/python/apache_beam/runners/portability/sdk_container_builder.py
##########
@@ -0,0 +1,274 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+"""SdkContainerBuilder builds the portable SDK container with dependencies.
+
+It copies the right boot dependencies, namely: apache beam sdk, python packages
+from requirements.txt, python packages from extra_packages.txt, workflow
+tarball, into the latest public python sdk container image, and run the
+dependencies installation in advance with the boot program in setup only mode
+to build the new image.
+"""
+
+from __future__ import absolute_import
+
+import json
+import logging
+import os
+import shutil
+import subprocess
+import sys
+import tarfile
+import tempfile
+import time
+import uuid
+
+from google.protobuf.duration_pb2 import Duration
+from google.protobuf.json_format import MessageToJson
+
+from apache_beam.internal.gcp.auth import get_service_credentials
+from apache_beam.internal.http_client import get_new_http
+from apache_beam.io.gcp.internal.clients import storage
+from apache_beam.options.pipeline_options import GoogleCloudOptions
+from apache_beam.options.pipeline_options import PipelineOptions  # pylint: disable=unused-import
+from apache_beam.options.pipeline_options import SetupOptions
+from apache_beam.portability import common_urns
+from apache_beam.portability.api import beam_runner_api_pb2
+from apache_beam.runners.portability.stager import Stager
+
+ARTIFACTS_CONTAINER_DIR = '/opt/apache/beam/artifacts'
+ARTIFACTS_MANIFEST_FILE = 'artifacts_info.json'
+SDK_CONTAINER_ENTRYPOINT = '/opt/apache/beam/boot'
+DOCKERFILE_TEMPLATE = (
+    """FROM apache/beam_python{major}.{minor}_sdk:latest
+RUN mkdir -p {workdir}
+COPY ./* {workdir}/
+RUN {entrypoint} --setup_only --artifacts {workdir}/{manifest_file}
+""")
+
+SOURCE_FOLDER = 'source'
+_LOGGER = logging.getLogger(__name__)
+
+
+class SdkContainerBuilder(object):
+  def __init__(self, options):
+    self._options = options
+    self._temp_src_dir = tempfile.mkdtemp()

Review comment:
       Make sure to remove this directory when you're done with it.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/5ef04e945fb1a3948d665af5d6b7f13b86487616?el=desc) will **decrease** coverage by `0.16%`.
   > The diff coverage is `52.76%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   - Coverage   82.36%   82.20%   -0.17%     
   ==========================================
     Files         451      454       +3     
     Lines       53753    54215     +462     
   ==========================================
   + Hits        44273    44566     +293     
   - Misses       9480     9649     +169     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `72.60% <0.00%> (ø)` | |
   | [...eam/testing/benchmarks/nexmark/nexmark\_launcher.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19sYXVuY2hlci5weQ==) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_perf.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19wZXJmLnB5) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_util.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya191dGlsLnB5) | `0.00% <0.00%> (ø)` | |
   | [...\_beam/runners/portability/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9wb3J0YWJpbGl0eS9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `31.78% <31.78%> (ø)` | |
   | [...ks/python/apache\_beam/runners/worker/sdk\_worker.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy93b3JrZXIvc2RrX3dvcmtlci5weQ==) | `88.63% <50.00%> (-0.54%)` | :arrow_down: |
   | [...on/apache\_beam/runners/dataflow/dataflow\_runner.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9kYXRhZmxvd19ydW5uZXIucHk=) | `77.06% <66.66%> (-0.12%)` | :arrow_down: |
   | [sdks/python/apache\_beam/transforms/environments.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdHJhbnNmb3Jtcy9lbnZpcm9ubWVudHMucHk=) | `83.49% <66.66%> (-0.33%)` | :arrow_down: |
   | [...dks/python/apache\_beam/options/pipeline\_options.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vb3B0aW9ucy9waXBlbGluZV9vcHRpb25zLnB5) | `95.01% <70.00%> (+0.02%)` | :arrow_up: |
   | [...beam/runners/interactive/background\_caching\_job.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9iYWNrZ3JvdW5kX2NhY2hpbmdfam9iLnB5) | `94.78% <90.90%> (ø)` | |
   | ... and [73 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [68e7f2e...f8790bf](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/5ef04e945fb1a3948d665af5d6b7f13b86487616?el=desc) will **decrease** coverage by `0.18%`.
   > The diff coverage is `52.68%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   - Coverage   82.36%   82.17%   -0.19%     
   ==========================================
     Files         451      452       +1     
     Lines       53753    54034     +281     
   ==========================================
   + Hits        44273    44403     +130     
   - Misses       9480     9631     +151     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `72.60% <0.00%> (ø)` | |
   | [...eam/testing/benchmarks/nexmark/nexmark\_launcher.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19sYXVuY2hlci5weQ==) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_perf.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19wZXJmLnB5) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_util.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya191dGlsLnB5) | `0.00% <0.00%> (ø)` | |
   | [...\_beam/runners/portability/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9wb3J0YWJpbGl0eS9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `31.78% <31.78%> (ø)` | |
   | [...on/apache\_beam/runners/dataflow/dataflow\_runner.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9kYXRhZmxvd19ydW5uZXIucHk=) | `77.03% <60.00%> (-0.15%)` | :arrow_down: |
   | [...dks/python/apache\_beam/options/pipeline\_options.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vb3B0aW9ucy9waXBlbGluZV9vcHRpb25zLnB5) | `94.98% <62.50%> (ø)` | |
   | [sdks/python/apache\_beam/transforms/environments.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdHJhbnNmb3Jtcy9lbnZpcm9ubWVudHMucHk=) | `83.49% <66.66%> (-0.33%)` | :arrow_down: |
   | [...beam/runners/interactive/background\_caching\_job.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9iYWNrZ3JvdW5kX2NhY2hpbmdfam9iLnB5) | `94.78% <90.90%> (ø)` | |
   | [sdks/python/apache\_beam/utils/histogram.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdXRpbHMvaGlzdG9ncmFtLnB5) | `94.28% <94.28%> (ø)` | |
   | ... and [70 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [68e7f2e...4cab5ec](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/5ef04e945fb1a3948d665af5d6b7f13b86487616?el=desc) will **decrease** coverage by `0.18%`.
   > The diff coverage is `52.68%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   - Coverage   82.36%   82.17%   -0.19%     
   ==========================================
     Files         451      452       +1     
     Lines       53753    54034     +281     
   ==========================================
   + Hits        44273    44403     +130     
   - Misses       9480     9631     +151     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `72.60% <0.00%> (ø)` | |
   | [...eam/testing/benchmarks/nexmark/nexmark\_launcher.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19sYXVuY2hlci5weQ==) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_perf.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19wZXJmLnB5) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_util.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya191dGlsLnB5) | `0.00% <0.00%> (ø)` | |
   | [...\_beam/runners/portability/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9wb3J0YWJpbGl0eS9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `31.78% <31.78%> (ø)` | |
   | [...on/apache\_beam/runners/dataflow/dataflow\_runner.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9kYXRhZmxvd19ydW5uZXIucHk=) | `77.03% <60.00%> (-0.15%)` | :arrow_down: |
   | [...dks/python/apache\_beam/options/pipeline\_options.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vb3B0aW9ucy9waXBlbGluZV9vcHRpb25zLnB5) | `94.98% <62.50%> (ø)` | |
   | [sdks/python/apache\_beam/transforms/environments.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdHJhbnNmb3Jtcy9lbnZpcm9ubWVudHMucHk=) | `83.49% <66.66%> (-0.33%)` | :arrow_down: |
   | [...beam/runners/interactive/background\_caching\_job.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9iYWNrZ3JvdW5kX2NhY2hpbmdfam9iLnB5) | `94.78% <90.90%> (ø)` | |
   | [sdks/python/apache\_beam/utils/histogram.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdXRpbHMvaGlzdG9ncmFtLnB5) | `94.28% <94.28%> (ø)` | |
   | ... and [70 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [68e7f2e...b5073c3](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: Add option to prebuild python sdk container

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/a99c6826a067f49ebb60e625c8652900c7d0e810?el=desc) will **increase** coverage by `5.88%`.
   > The diff coverage is `33.80%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   + Coverage   34.32%   40.21%   +5.88%     
   ==========================================
     Files         694      455     -239     
     Lines       82226    53738   -28488     
     Branches     9294        0    -9294     
   ==========================================
   - Hits        28225    21610    -6615     
   + Misses      53578    32128   -21450     
   + Partials      423        0     -423     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `20.20% <28.57%> (ø)` | |
   | [...che\_beam/runners/dataflow/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `34.37% <34.37%> (ø)` | |
   | [io/\_\_init\_\_.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vX19pbml0X18ucHk=) | | |
   | [options/\_\_init\_\_.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-b3B0aW9ucy9fX2luaXRfXy5weQ==) | | |
   | [io/filebasedsink\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vZmlsZWJhc2Vkc2lua190ZXN0LnB5) | | |
   | [runners/worker/sdk\_worker\_main.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy93b3JrZXIvc2RrX3dvcmtlcl9tYWluLnB5) | | |
   | [examples/complete/juliaset/juliaset/juliaset.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZXhhbXBsZXMvY29tcGxldGUvanVsaWFzZXQvanVsaWFzZXQvanVsaWFzZXQucHk=) | | |
   | [...amples/snippets/transforms/aggregation/top\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZXhhbXBsZXMvc25pcHBldHMvdHJhbnNmb3Jtcy9hZ2dyZWdhdGlvbi90b3BfdGVzdC5weQ==) | | |
   | [io/hadoopfilesystem.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vaGFkb29wZmlsZXN5c3RlbS5weQ==) | | |
   | [testing/benchmarks/chicago\_taxi/preprocess.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dGVzdGluZy9iZW5jaG1hcmtzL2NoaWNhZ29fdGF4aS9wcmVwcm9jZXNzLnB5) | | |
   | ... and [1141 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [a99c682...030594c](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] tvalentyn commented on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
tvalentyn commented on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-698036221


   I looked at codecov errors on the PR, I think the path that codecov reports about are covered by the integration test.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/5ef04e945fb1a3948d665af5d6b7f13b86487616?el=desc) will **decrease** coverage by `0.18%`.
   > The diff coverage is `52.56%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   - Coverage   82.36%   82.17%   -0.19%     
   ==========================================
     Files         451      455       +4     
     Lines       53753    54224     +471     
   ==========================================
   + Hits        44273    44560     +287     
   - Misses       9480     9664     +184     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `72.60% <0.00%> (ø)` | |
   | [...eam/testing/benchmarks/nexmark/nexmark\_launcher.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19sYXVuY2hlci5weQ==) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_perf.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19wZXJmLnB5) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_util.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya191dGlsLnB5) | `0.00% <0.00%> (ø)` | |
   | [...\_beam/runners/portability/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9wb3J0YWJpbGl0eS9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `31.37% <31.37%> (ø)` | |
   | [...ks/python/apache\_beam/runners/worker/sdk\_worker.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy93b3JrZXIvc2RrX3dvcmtlci5weQ==) | `88.80% <50.00%> (-0.36%)` | :arrow_down: |
   | [...on/apache\_beam/runners/dataflow/dataflow\_runner.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9kYXRhZmxvd19ydW5uZXIucHk=) | `77.06% <66.66%> (-0.12%)` | :arrow_down: |
   | [sdks/python/apache\_beam/transforms/environments.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdHJhbnNmb3Jtcy9lbnZpcm9ubWVudHMucHk=) | `83.49% <66.66%> (-0.33%)` | :arrow_down: |
   | [...dks/python/apache\_beam/options/pipeline\_options.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vb3B0aW9ucy9waXBlbGluZV9vcHRpb25zLnB5) | `95.01% <70.00%> (+0.02%)` | :arrow_up: |
   | [...beam/runners/interactive/background\_caching\_job.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9iYWNrZ3JvdW5kX2NhY2hpbmdfam9iLnB5) | `94.78% <90.90%> (ø)` | |
   | ... and [73 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [68e7f2e...f8790bf](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] y1chi commented on a change in pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
y1chi commented on a change in pull request #12727:
URL: https://github.com/apache/beam/pull/12727#discussion_r492221619



##########
File path: sdks/python/apache_beam/runners/portability/stager.py
##########
@@ -119,6 +119,7 @@ def create_job_resources(options,  # type: PipelineOptions
                            temp_dir,  # type: str
                            build_setup_args=None,  # type: Optional[List[str]]
                            populate_requirements_cache=None,  # type: Optional[str]
+                           skip_boot_dependencies=False, # type: Optional[bool]

Review comment:
       There are other dependencies that doesn't seem to be handled explicitly by the boot sequence, for example pickled main session and java jars for x-lang.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/5ef04e945fb1a3948d665af5d6b7f13b86487616?el=desc) will **decrease** coverage by `0.18%`.
   > The diff coverage is `52.77%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   - Coverage   82.36%   82.18%   -0.19%     
   ==========================================
     Files         451      453       +2     
     Lines       53753    54177     +424     
   ==========================================
   + Hits        44273    44524     +251     
   - Misses       9480     9653     +173     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `72.60% <0.00%> (ø)` | |
   | [...eam/testing/benchmarks/nexmark/nexmark\_launcher.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19sYXVuY2hlci5weQ==) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_perf.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19wZXJmLnB5) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_util.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya191dGlsLnB5) | `0.00% <0.00%> (ø)` | |
   | [...\_beam/runners/portability/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9wb3J0YWJpbGl0eS9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `31.78% <31.78%> (ø)` | |
   | [...on/apache\_beam/runners/dataflow/dataflow\_runner.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9kYXRhZmxvd19ydW5uZXIucHk=) | `77.00% <50.00%> (-0.18%)` | :arrow_down: |
   | [sdks/python/apache\_beam/transforms/environments.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdHJhbnNmb3Jtcy9lbnZpcm9ubWVudHMucHk=) | `83.49% <66.66%> (-0.33%)` | :arrow_down: |
   | [...dks/python/apache\_beam/options/pipeline\_options.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vb3B0aW9ucy9waXBlbGluZV9vcHRpb25zLnB5) | `95.01% <70.00%> (+0.02%)` | :arrow_up: |
   | [...beam/runners/interactive/background\_caching\_job.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9iYWNrZ3JvdW5kX2NhY2hpbmdfam9iLnB5) | `94.78% <90.90%> (ø)` | |
   | [sdks/python/apache\_beam/utils/histogram.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdXRpbHMvaGlzdG9ncmFtLnB5) | `94.28% <94.28%> (ø)` | |
   | ... and [70 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [68e7f2e...4f63252](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: Add option to prebuild python sdk container

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/a99c6826a067f49ebb60e625c8652900c7d0e810?el=desc) will **increase** coverage by `5.88%`.
   > The diff coverage is `33.80%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   + Coverage   34.32%   40.21%   +5.88%     
   ==========================================
     Files         694      455     -239     
     Lines       82226    53738   -28488     
     Branches     9294        0    -9294     
   ==========================================
   - Hits        28225    21610    -6615     
   + Misses      53578    32128   -21450     
   + Partials      423        0     -423     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `20.20% <28.57%> (ø)` | |
   | [...che\_beam/runners/dataflow/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `34.37% <34.37%> (ø)` | |
   | [utils/annotations\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dXRpbHMvYW5ub3RhdGlvbnNfdGVzdC5weQ==) | | |
   | [examples/snippets/transforms/elementwise/kvswap.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZXhhbXBsZXMvc25pcHBldHMvdHJhbnNmb3Jtcy9lbGVtZW50d2lzZS9rdnN3YXAucHk=) | | |
   | [examples/complete/game/game\_stats.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZXhhbXBsZXMvY29tcGxldGUvZ2FtZS9nYW1lX3N0YXRzLnB5) | | |
   | [runners/portability/artifact\_service.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9wb3J0YWJpbGl0eS9hcnRpZmFjdF9zZXJ2aWNlLnB5) | | |
   | [runners/worker/statesampler.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy93b3JrZXIvc3RhdGVzYW1wbGVyLnB5) | | |
   | [io/localfilesystem.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vbG9jYWxmaWxlc3lzdGVtLnB5) | | |
   | [runners/portability/fn\_api\_runner/translations.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9wb3J0YWJpbGl0eS9mbl9hcGlfcnVubmVyL3RyYW5zbGF0aW9ucy5weQ==) | | |
   | [examples/snippets/transforms/elementwise/filter.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZXhhbXBsZXMvc25pcHBldHMvdHJhbnNmb3Jtcy9lbGVtZW50d2lzZS9maWx0ZXIucHk=) | | |
   | ... and [1141 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [a99c682...20c8398](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: Add option to prebuild python sdk container

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/a99c6826a067f49ebb60e625c8652900c7d0e810?el=desc) will **increase** coverage by `5.88%`.
   > The diff coverage is `33.80%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   + Coverage   34.32%   40.21%   +5.88%     
   ==========================================
     Files         694      455     -239     
     Lines       82226    53738   -28488     
     Branches     9294        0    -9294     
   ==========================================
   - Hits        28225    21610    -6615     
   + Misses      53578    32128   -21450     
   + Partials      423        0     -423     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `20.20% <28.57%> (ø)` | |
   | [...che\_beam/runners/dataflow/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `34.37% <34.37%> (ø)` | |
   | [internal/gcp/auth.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW50ZXJuYWwvZ2NwL2F1dGgucHk=) | | |
   | [io/aws/\_\_init\_\_.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vYXdzL19faW5pdF9fLnB5) | | |
   | [examples/\_\_init\_\_.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZXhhbXBsZXMvX19pbml0X18ucHk=) | | |
   | [io/external/xlang\_kafkaio\_it\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vZXh0ZXJuYWwveGxhbmdfa2Fma2Fpb19pdF90ZXN0LnB5) | | |
   | [runners/worker/opcounters.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy93b3JrZXIvb3Bjb3VudGVycy5weQ==) | | |
   | [runners/worker/worker\_status.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy93b3JrZXIvd29ya2VyX3N0YXR1cy5weQ==) | | |
   | [tools/sideinput\_microbenchmark.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dG9vbHMvc2lkZWlucHV0X21pY3JvYmVuY2htYXJrLnB5) | | |
   | [...ers/interactive/display/pipeline\_graph\_renderer.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9pbnRlcmFjdGl2ZS9kaXNwbGF5L3BpcGVsaW5lX2dyYXBoX3JlbmRlcmVyLnB5) | | |
   | ... and [1141 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [a99c682...e747445](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/5ef04e945fb1a3948d665af5d6b7f13b86487616?el=desc) will **decrease** coverage by `0.18%`.
   > The diff coverage is `52.68%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   - Coverage   82.36%   82.17%   -0.19%     
   ==========================================
     Files         451      452       +1     
     Lines       53753    54034     +281     
   ==========================================
   + Hits        44273    44403     +130     
   - Misses       9480     9631     +151     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `72.60% <0.00%> (ø)` | |
   | [...eam/testing/benchmarks/nexmark/nexmark\_launcher.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19sYXVuY2hlci5weQ==) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_perf.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19wZXJmLnB5) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_util.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya191dGlsLnB5) | `0.00% <0.00%> (ø)` | |
   | [...\_beam/runners/portability/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9wb3J0YWJpbGl0eS9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `31.78% <31.78%> (ø)` | |
   | [...on/apache\_beam/runners/dataflow/dataflow\_runner.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9kYXRhZmxvd19ydW5uZXIucHk=) | `77.03% <60.00%> (-0.15%)` | :arrow_down: |
   | [...dks/python/apache\_beam/options/pipeline\_options.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vb3B0aW9ucy9waXBlbGluZV9vcHRpb25zLnB5) | `94.98% <62.50%> (ø)` | |
   | [sdks/python/apache\_beam/transforms/environments.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdHJhbnNmb3Jtcy9lbnZpcm9ubWVudHMucHk=) | `83.49% <66.66%> (-0.33%)` | :arrow_down: |
   | [...beam/runners/interactive/background\_caching\_job.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9iYWNrZ3JvdW5kX2NhY2hpbmdfam9iLnB5) | `94.78% <90.90%> (ø)` | |
   | [sdks/python/apache\_beam/utils/histogram.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdXRpbHMvaGlzdG9ncmFtLnB5) | `94.28% <94.28%> (ø)` | |
   | ... and [70 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [68e7f2e...e26ecaf](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/5ef04e945fb1a3948d665af5d6b7f13b86487616?el=desc) will **decrease** coverage by `0.18%`.
   > The diff coverage is `52.68%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   - Coverage   82.36%   82.17%   -0.19%     
   ==========================================
     Files         451      452       +1     
     Lines       53753    54034     +281     
   ==========================================
   + Hits        44273    44402     +129     
   - Misses       9480     9632     +152     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `72.60% <0.00%> (ø)` | |
   | [...eam/testing/benchmarks/nexmark/nexmark\_launcher.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19sYXVuY2hlci5weQ==) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_perf.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19wZXJmLnB5) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_util.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya191dGlsLnB5) | `0.00% <0.00%> (ø)` | |
   | [...\_beam/runners/portability/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9wb3J0YWJpbGl0eS9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `31.78% <31.78%> (ø)` | |
   | [...on/apache\_beam/runners/dataflow/dataflow\_runner.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9kYXRhZmxvd19ydW5uZXIucHk=) | `77.03% <60.00%> (-0.15%)` | :arrow_down: |
   | [...dks/python/apache\_beam/options/pipeline\_options.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vb3B0aW9ucy9waXBlbGluZV9vcHRpb25zLnB5) | `94.98% <62.50%> (ø)` | |
   | [sdks/python/apache\_beam/transforms/environments.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdHJhbnNmb3Jtcy9lbnZpcm9ubWVudHMucHk=) | `83.49% <66.66%> (-0.33%)` | :arrow_down: |
   | [...beam/runners/interactive/background\_caching\_job.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9iYWNrZ3JvdW5kX2NhY2hpbmdfam9iLnB5) | `94.78% <90.90%> (ø)` | |
   | [sdks/python/apache\_beam/utils/histogram.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdXRpbHMvaGlzdG9ncmFtLnB5) | `94.28% <94.28%> (ø)` | |
   | ... and [68 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [68e7f2e...794808f](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/5ef04e945fb1a3948d665af5d6b7f13b86487616?el=desc) will **decrease** coverage by `0.19%`.
   > The diff coverage is `54.59%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   - Coverage   82.36%   82.16%   -0.20%     
   ==========================================
     Files         451      453       +2     
     Lines       53753    54009     +256     
   ==========================================
   + Hits        44273    44378     +105     
   - Misses       9480     9631     +151     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...eam/testing/benchmarks/nexmark/nexmark\_launcher.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19sYXVuY2hlci5weQ==) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_perf.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19wZXJmLnB5) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_util.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya191dGlsLnB5) | `0.00% <0.00%> (ø)` | |
   | [...s/dataflow/internal/sdk\_container\_cloud\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9zZGtfY29udGFpbmVyX2Nsb3VkX2J1aWxkZXIucHk=) | `34.14% <34.14%> (ø)` | |
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `72.02% <42.85%> (-0.58%)` | :arrow_down: |
   | [...\_beam/runners/portability/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9wb3J0YWJpbGl0eS9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `42.85% <42.85%> (ø)` | |
   | [...dks/python/apache\_beam/options/pipeline\_options.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vb3B0aW9ucy9waXBlbGluZV9vcHRpb25zLnB5) | `95.01% <70.00%> (+0.02%)` | :arrow_up: |
   | [...beam/runners/interactive/background\_caching\_job.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9iYWNrZ3JvdW5kX2NhY2hpbmdfam9iLnB5) | `94.78% <90.90%> (ø)` | |
   | [sdks/python/apache\_beam/utils/histogram.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdXRpbHMvaGlzdG9ncmFtLnB5) | `94.28% <94.28%> (ø)` | |
   | [...ache\_beam/runners/interactive/recording\_manager.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9yZWNvcmRpbmdfbWFuYWdlci5weQ==) | `98.05% <95.74%> (+5.19%)` | :arrow_up: |
   | ... and [61 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [68e7f2e...02419f3](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: Add option to prebuild python sdk container

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/a99c6826a067f49ebb60e625c8652900c7d0e810?el=desc) will **increase** coverage by `5.88%`.
   > The diff coverage is `33.80%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   + Coverage   34.32%   40.21%   +5.88%     
   ==========================================
     Files         694      455     -239     
     Lines       82226    53738   -28488     
     Branches     9294        0    -9294     
   ==========================================
   - Hits        28225    21610    -6615     
   + Misses      53578    32128   -21450     
   + Partials      423        0     -423     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `20.20% <28.57%> (ø)` | |
   | [...che\_beam/runners/dataflow/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `34.37% <34.37%> (ø)` | |
   | [examples/windowed\_wordcount.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZXhhbXBsZXMvd2luZG93ZWRfd29yZGNvdW50LnB5) | | |
   | [ml/gcp/videointelligenceml\_test\_it.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-bWwvZ2NwL3ZpZGVvaW50ZWxsaWdlbmNlbWxfdGVzdF9pdC5weQ==) | | |
   | [io/gcp/gcsio\_overrides.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vZ2NwL2djc2lvX292ZXJyaWRlcy5weQ==) | | |
   | [io/gcp/internal/\_\_init\_\_.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vZ2NwL2ludGVybmFsL19faW5pdF9fLnB5) | | |
   | [...nners/portability/fn\_api\_runner/worker\_handlers.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9wb3J0YWJpbGl0eS9mbl9hcGlfcnVubmVyL3dvcmtlcl9oYW5kbGVycy5weQ==) | | |
   | [runners/interactive/display/pipeline\_graph.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9pbnRlcmFjdGl2ZS9kaXNwbGF5L3BpcGVsaW5lX2dyYXBoLnB5) | | |
   | [portability/api/beam\_job\_api\_pb2\_urns.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cG9ydGFiaWxpdHkvYXBpL2JlYW1fam9iX2FwaV9wYjJfdXJucy5weQ==) | | |
   | [runners/dataflow/internal/clients/\_\_init\_\_.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9jbGllbnRzL19faW5pdF9fLnB5) | | |
   | ... and [1141 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [a99c682...a3d80a8](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] y1chi commented on a change in pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
y1chi commented on a change in pull request #12727:
URL: https://github.com/apache/beam/pull/12727#discussion_r492221892



##########
File path: sdks/python/apache_beam/runners/dataflow/dataflow_runner.py
##########
@@ -473,10 +474,19 @@ def run_pipeline(self, pipeline, options):
 
     use_fnapi = apiclient._use_fnapi(options)
     from apache_beam.transforms import environments
-    self._default_environment = (
-        environments.DockerEnvironment.from_container_image(
-            apiclient.get_container_image_from_options(options),
-            artifacts=environments.python_sdk_dependencies(options)))
+    if options.view_as(DebugOptions).lookup_experiment(
+        'prebuild_sdk_container'):

Review comment:
       done.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/5ef04e945fb1a3948d665af5d6b7f13b86487616?el=desc) will **decrease** coverage by `0.16%`.
   > The diff coverage is `52.76%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   - Coverage   82.36%   82.20%   -0.17%     
   ==========================================
     Files         451      454       +3     
     Lines       53753    54215     +462     
   ==========================================
   + Hits        44273    44566     +293     
   - Misses       9480     9649     +169     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `72.60% <0.00%> (ø)` | |
   | [...eam/testing/benchmarks/nexmark/nexmark\_launcher.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19sYXVuY2hlci5weQ==) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_perf.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19wZXJmLnB5) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_util.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya191dGlsLnB5) | `0.00% <0.00%> (ø)` | |
   | [...\_beam/runners/portability/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9wb3J0YWJpbGl0eS9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `31.78% <31.78%> (ø)` | |
   | [...ks/python/apache\_beam/runners/worker/sdk\_worker.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy93b3JrZXIvc2RrX3dvcmtlci5weQ==) | `88.63% <50.00%> (-0.54%)` | :arrow_down: |
   | [...on/apache\_beam/runners/dataflow/dataflow\_runner.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9kYXRhZmxvd19ydW5uZXIucHk=) | `77.06% <66.66%> (-0.12%)` | :arrow_down: |
   | [sdks/python/apache\_beam/transforms/environments.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdHJhbnNmb3Jtcy9lbnZpcm9ubWVudHMucHk=) | `83.49% <66.66%> (-0.33%)` | :arrow_down: |
   | [...dks/python/apache\_beam/options/pipeline\_options.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vb3B0aW9ucy9waXBlbGluZV9vcHRpb25zLnB5) | `95.01% <70.00%> (+0.02%)` | :arrow_up: |
   | [...beam/runners/interactive/background\_caching\_job.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9iYWNrZ3JvdW5kX2NhY2hpbmdfam9iLnB5) | `94.78% <90.90%> (ø)` | |
   | ... and [73 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [68e7f2e...8a1ceaa](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] y1chi commented on a change in pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
y1chi commented on a change in pull request #12727:
URL: https://github.com/apache/beam/pull/12727#discussion_r493105561



##########
File path: sdks/python/apache_beam/runners/portability/sdk_container_builder.py
##########
@@ -0,0 +1,279 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+"""SdkContainerBuilder builds the portable SDK container with dependencies.
+
+It copies the right boot dependencies, namely: apache beam sdk, python packages
+from requirements.txt, python packages from extra_packages.txt, workflow
+tarball, into the latest public python sdk container image, and run the
+dependencies installation in advance with the boot program in setup only mode
+to build the new image.
+"""
+
+from __future__ import absolute_import
+
+import json
+import logging
+import os
+import shutil
+import subprocess
+import sys
+import tarfile
+import tempfile
+import time
+import uuid
+
+from google.protobuf.duration_pb2 import Duration
+from google.protobuf.json_format import MessageToJson
+
+from apache_beam.internal.gcp.auth import get_service_credentials
+from apache_beam.internal.http_client import get_new_http
+from apache_beam.io.gcp.internal.clients import storage
+from apache_beam.options.pipeline_options import GoogleCloudOptions
+from apache_beam.options.pipeline_options import PipelineOptions  # pylint: disable=unused-import
+from apache_beam.options.pipeline_options import SetupOptions
+from apache_beam.portability import common_urns
+from apache_beam.portability.api import beam_runner_api_pb2
+from apache_beam.runners.portability.stager import Stager
+
+ARTIFACTS_CONTAINER_DIR = '/opt/apache/beam/artifacts'
+ARTIFACTS_MANIFEST_FILE = 'artifacts_info.json'
+SDK_CONTAINER_ENTRYPOINT = '/opt/apache/beam/boot'
+DOCKERFILE_TEMPLATE = (
+    """FROM {base_image}
+RUN mkdir -p {workdir}
+COPY ./* {workdir}/
+RUN {entrypoint} --setup_only --artifacts {workdir}/{manifest_file}
+""")
+
+SOURCE_FOLDER = 'source'
+_LOGGER = logging.getLogger(__name__)
+
+
+class SdkContainerBuilder(object):
+  def __init__(self, options):
+    self._options = options
+    self._docker_registry_push_url = self._options.view_as(
+        SetupOptions).docker_registry_push_url
+    self._base_image = (
+        self._options.view_as(SetupOptions).prebuild_sdk_container_base_image or
+        'apache/beam_python%s.%s_sdk:latest' %
+        (sys.version_info[0], sys.version_info[1]))
+    self._temp_src_dir = None
+
+  def build(self):
+    container_id = str(uuid.uuid4())
+    container_tag = os.path.join(
+        self._docker_registry_push_url or '',
+        'beam_python_prebuilt_sdk:%s' % container_id)
+    with tempfile.TemporaryDirectory() as temp_folder:
+      self._temp_src_dir = temp_folder
+      self.prepare_dependencies()
+      self.invoke_docker_build_and_push(container_id, container_tag)
+
+    return container_tag
+
+  def prepare_dependencies(self):
+    with tempfile.TemporaryDirectory() as tmp:
+      resources = Stager.create_job_resources(self._options, tmp)
+      # make a copy of the staged artifacts into the temp source folder.
+      for path, name in resources:
+        shutil.copyfile(path, os.path.join(self._temp_src_dir, name))
+      with open(os.path.join(self._temp_src_dir, 'Dockerfile'), 'w') as file:
+        file.write(
+            DOCKERFILE_TEMPLATE.format(
+                base_image=self._base_image,
+                workdir=ARTIFACTS_CONTAINER_DIR,
+                manifest_file=ARTIFACTS_MANIFEST_FILE,
+                entrypoint=SDK_CONTAINER_ENTRYPOINT))
+      self.generate_artifacts_manifests_json_file(resources, self._temp_src_dir)
+
+  def invoke_docker_build_and_push(self, container_id, container_tag):
+    raise NotImplementedError
+
+  @staticmethod
+  def generate_artifacts_manifests_json_file(resources, temp_dir):
+    infos = []
+    for _, name in resources:
+      info = beam_runner_api_pb2.ArtifactInformation(
+          type_urn=common_urns.StandardArtifacts.Types.FILE.urn,
+          type_payload=beam_runner_api_pb2.ArtifactFilePayload(
+              path=name).SerializeToString(),
+      )
+      infos.append(json.dumps(MessageToJson(info)))
+    with open(os.path.join(temp_dir, ARTIFACTS_MANIFEST_FILE), 'w') as file:
+      file.write('[\n' + ',\n'.join(infos) + '\n]')
+
+  @classmethod
+  def build_container_image(cls, pipeline_options):
+    # type: (PipelineOptions) -> str
+    setup_options = pipeline_options.view_as(SetupOptions)
+    container_build_engine = setup_options.prebuild_sdk_container_engine
+    if container_build_engine:
+      if container_build_engine == 'local_docker':
+        builder = _SdkContainerLocalBuilder(
+            pipeline_options)  # type: SdkContainerBuilder
+      elif container_build_engine == 'cloud_build':
+        builder = _SdkContainerCloudBuilder(pipeline_options)
+      else:
+        raise ValueError(
+            'Only (--prebuild_sdk_container_engine local_docker) and '
+            '(--prebuild_sdk_container_engine cloud_build) are supported')
+    else:
+      raise ValueError('No --prebuild_sdk_container_engine option specified.')
+    return builder.build()
+
+
+class _SdkContainerLocalBuilder(SdkContainerBuilder):
+  """SdkContainerLocalBuilder builds the sdk container image with local
+  docker."""
+  def invoke_docker_build_and_push(self, container_id, container_tag):
+    try:
+      _LOGGER.info("Building sdk container, this may take a few minutes...")
+      now = time.time()
+      subprocess.run(['docker', 'build', '.', '-t', container_tag],
+                     capture_output=True,
+                     check=True,
+                     cwd=self._temp_src_dir)
+    except subprocess.CalledProcessError as err:
+      raise RuntimeError(
+          'Failed to build sdk container with local docker, '
+          'stderr:\n %s.' % err.stderr)
+    else:
+      _LOGGER.info(
+          "Successfully built %s in %.2f seconds" %
+          (container_tag, time.time() - now))
+
+    if self._docker_registry_push_url:
+      _LOGGER.info("Pushing prebuilt sdk container...")
+      try:
+        subprocess.run(['docker', 'push', container_tag],
+                       capture_output=True,
+                       check=True)
+      except subprocess.CalledProcessError as err:
+        raise RuntimeError(
+            'Failed to push prebuilt sdk container %s, stderr: \n%s' %
+            (container_tag, err.stderr))
+      _LOGGER.info(
+          "Successfully pushed %s in %.2f seconds" %
+          (container_tag, time.time() - now))
+    else:
+      _LOGGER.info(
+          "no --docker_registry_push_url option is specified in pipeline "
+          "options, specify it if the new image is intended to be "
+          "pushed to a registry.")
+
+
+class _SdkContainerCloudBuilder(SdkContainerBuilder):
+  """SdkContainerLocalBuilder builds the sdk container image with google cloud
+  build."""
+  def __init__(self, options):
+    super().__init__(options)
+    self._google_cloud_options = options.view_as(GoogleCloudOptions)
+    if self._google_cloud_options.no_auth:
+      credentials = None
+    else:
+      credentials = get_service_credentials()
+    self._storage_client = storage.StorageV1(
+        url='https://www.googleapis.com/storage/v1',
+        credentials=credentials,
+        get_credentials=(not self._google_cloud_options.no_auth),
+        http=get_new_http(),
+        response_encoding='utf8')
+    if not self._docker_registry_push_url:
+      self._docker_registry_push_url = (
+          'gcr.io/%s' % self._google_cloud_options.project)
+
+  def invoke_docker_build_and_push(self, container_id, container_tag):
+    project_id = self._google_cloud_options.project
+    temp_location = self._google_cloud_options.temp_location
+    # google cloud build service expects all the build source file to be
+    # compressed into a tarball.
+    tarball_path = os.path.join(self._temp_src_dir, '%s.tgz' % SOURCE_FOLDER)
+    self._make_tarfile(tarball_path, self._temp_src_dir)
+    _LOGGER.info(
+        "Compressed source files for building sdk container at %s" %
+        tarball_path)
+
+    gcs_location = os.path.join(
+        temp_location, '%s-%s.tgz' % (SOURCE_FOLDER, container_id))
+    self._upload_to_gcs(tarball_path, gcs_location)
+
+    from google.cloud.devtools import cloudbuild_v1
+    client = cloudbuild_v1.CloudBuildClient()
+    build = cloudbuild_v1.Build()
+    build.steps = []
+    step = cloudbuild_v1.BuildStep()
+    step.name = 'gcr.io/cloud-builders/docker'
+    step.args = ['build', '-t', container_tag, '.']
+    step.dir = SOURCE_FOLDER
+
+    build.steps.append(step)
+    build.images = [container_tag]
+
+    source = cloudbuild_v1.Source()
+    source.storage_source = cloudbuild_v1.StorageSource()
+    gcs_bucket, gcs_object = self._get_gcs_bucket_and_name(gcs_location)
+    source.storage_source.bucket = os.path.join(gcs_bucket)
+    source.storage_source.object = gcs_object
+    build.source = source
+    # TODO(zyichi): make timeout configurable
+    build.timeout = Duration().FromSeconds(seconds=1800)
+
+    now = time.time()
+    _LOGGER.info('Building sdk container, this may take a few minutes...')
+    operation = client.create_build(project_id=project_id, build=build)
+    # if build fails exception will be raised and stops the job submission.

Review comment:
       I think use may need to check the failure log first, it could be caused by things such as mistakenly provided wrong base image or wrong docker push url.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] y1chi commented on a change in pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
y1chi commented on a change in pull request #12727:
URL: https://github.com/apache/beam/pull/12727#discussion_r492888461



##########
File path: sdks/python/apache_beam/runners/portability/sdk_container_builder.py
##########
@@ -0,0 +1,274 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+"""SdkContainerBuilder builds the portable SDK container with dependencies.
+
+It copies the right boot dependencies, namely: apache beam sdk, python packages
+from requirements.txt, python packages from extra_packages.txt, workflow
+tarball, into the latest public python sdk container image, and run the
+dependencies installation in advance with the boot program in setup only mode
+to build the new image.
+"""
+
+from __future__ import absolute_import
+
+import json
+import logging
+import os
+import shutil
+import subprocess
+import sys
+import tarfile
+import tempfile
+import time
+import uuid
+
+from google.protobuf.duration_pb2 import Duration
+from google.protobuf.json_format import MessageToJson
+
+from apache_beam.internal.gcp.auth import get_service_credentials
+from apache_beam.internal.http_client import get_new_http
+from apache_beam.io.gcp.internal.clients import storage
+from apache_beam.options.pipeline_options import GoogleCloudOptions
+from apache_beam.options.pipeline_options import PipelineOptions  # pylint: disable=unused-import
+from apache_beam.options.pipeline_options import SetupOptions
+from apache_beam.portability import common_urns
+from apache_beam.portability.api import beam_runner_api_pb2
+from apache_beam.runners.portability.stager import Stager
+
+ARTIFACTS_CONTAINER_DIR = '/opt/apache/beam/artifacts'
+ARTIFACTS_MANIFEST_FILE = 'artifacts_info.json'
+SDK_CONTAINER_ENTRYPOINT = '/opt/apache/beam/boot'
+DOCKERFILE_TEMPLATE = (
+    """FROM apache/beam_python{major}.{minor}_sdk:latest
+RUN mkdir -p {workdir}
+COPY ./* {workdir}/
+RUN {entrypoint} --setup_only --artifacts {workdir}/{manifest_file}
+""")
+
+SOURCE_FOLDER = 'source'
+_LOGGER = logging.getLogger(__name__)
+
+
+class SdkContainerBuilder(object):
+  def __init__(self, options):
+    self._options = options
+    self._temp_src_dir = tempfile.mkdtemp()

Review comment:
       done.

##########
File path: sdks/python/apache_beam/runners/portability/sdk_container_builder.py
##########
@@ -0,0 +1,274 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+"""SdkContainerBuilder builds the portable SDK container with dependencies.
+
+It copies the right boot dependencies, namely: apache beam sdk, python packages
+from requirements.txt, python packages from extra_packages.txt, workflow
+tarball, into the latest public python sdk container image, and run the
+dependencies installation in advance with the boot program in setup only mode
+to build the new image.
+"""
+
+from __future__ import absolute_import
+
+import json
+import logging
+import os
+import shutil
+import subprocess
+import sys
+import tarfile
+import tempfile
+import time
+import uuid
+
+from google.protobuf.duration_pb2 import Duration
+from google.protobuf.json_format import MessageToJson
+
+from apache_beam.internal.gcp.auth import get_service_credentials
+from apache_beam.internal.http_client import get_new_http
+from apache_beam.io.gcp.internal.clients import storage
+from apache_beam.options.pipeline_options import GoogleCloudOptions
+from apache_beam.options.pipeline_options import PipelineOptions  # pylint: disable=unused-import
+from apache_beam.options.pipeline_options import SetupOptions
+from apache_beam.portability import common_urns
+from apache_beam.portability.api import beam_runner_api_pb2
+from apache_beam.runners.portability.stager import Stager
+
+ARTIFACTS_CONTAINER_DIR = '/opt/apache/beam/artifacts'
+ARTIFACTS_MANIFEST_FILE = 'artifacts_info.json'
+SDK_CONTAINER_ENTRYPOINT = '/opt/apache/beam/boot'
+DOCKERFILE_TEMPLATE = (
+    """FROM apache/beam_python{major}.{minor}_sdk:latest
+RUN mkdir -p {workdir}
+COPY ./* {workdir}/
+RUN {entrypoint} --setup_only --artifacts {workdir}/{manifest_file}
+""")
+
+SOURCE_FOLDER = 'source'
+_LOGGER = logging.getLogger(__name__)
+
+
+class SdkContainerBuilder(object):
+  def __init__(self, options):
+    self._options = options
+    self._temp_src_dir = tempfile.mkdtemp()
+    self._docker_registry_push_url = self._options.view_as(
+        SetupOptions).docker_registry_push_url
+
+  def build(self):
+    container_id = str(uuid.uuid4())
+    container_tag = os.path.join(
+        self._docker_registry_push_url or '',
+        'beam_python_prebuilt_sdk:%s' % container_id)
+    self.prepare_dependencies()
+    self.invoke_docker_build_and_push(container_id, container_tag)
+
+    return container_tag
+
+  def prepare_dependencies(self):
+    tmp = tempfile.mkdtemp()

Review comment:
       done.

##########
File path: sdks/python/apache_beam/runners/portability/stager.py
##########
@@ -136,6 +137,8 @@ def create_job_resources(options,  # type: PipelineOptions
             only for testing.
           populate_requirements_cache: Callable for populating the requirements
             cache. Used only for testing.
+          skip_boot_dependencies: Skip apache beam sdk, requirements, extra
+            packages, workflow tarball installs by sdk boot program.

Review comment:
       sounds much better, thanks.

##########
File path: sdks/python/apache_beam/transforms/environments.py
##########
@@ -252,6 +254,13 @@ def from_runner_api_parameter(payload, capabilities, artifacts, context):
   @classmethod
   def from_options(cls, options):
     # type: (PipelineOptions) -> DockerEnvironment
+    if options.view_as(SetupOptions).prebuild_sdk_container_engine:
+      prebuilt_container_image = SdkContainerBuilder.build_container_image(
+          options)
+      return cls.from_container_image(
+          container_image=prebuilt_container_image,
+          artifacts=python_sdk_dependencies(
+              options, skip_boot_dependencies=True))

Review comment:
       I think we still need it for python_sdk_dependencies to produce two sets(complete set or the reduced set) of artifacts

##########
File path: sdks/python/container/boot.go
##########
@@ -203,15 +223,9 @@ func setupAcceptableWheelSpecs() error {
 }
 
 // installSetupPackages installs Beam SDK and user dependencies.
-func installSetupPackages(mds []*jobpb.ArtifactMetadata, workDir string) error {
+func installSetupPackages(files []string, workDir string) error {

Review comment:
       done.

##########
File path: sdks/python/container/boot.go
##########
@@ -30,18 +32,21 @@ import (
 	"time"
 
 	"github.com/apache/beam/sdks/go/pkg/beam/artifact"
-	jobpb "github.com/apache/beam/sdks/go/pkg/beam/model/jobmanagement_v1"
 	pipepb "github.com/apache/beam/sdks/go/pkg/beam/model/pipeline_v1"
 	"github.com/apache/beam/sdks/go/pkg/beam/provision"
 	"github.com/apache/beam/sdks/go/pkg/beam/util/execx"
 	"github.com/apache/beam/sdks/go/pkg/beam/util/grpcx"
+	"github.com/golang/protobuf/jsonpb"
 	"github.com/golang/protobuf/proto"
 	"github.com/nightlyone/lockfile"
 )
 
 var (
 	acceptableWhlSpecs []string
 
+	setupOnly = flag.Bool("setup_only", false, "Execute boot program in setup only mode (optional).")

Review comment:
       done.

##########
File path: sdks/python/apache_beam/runners/portability/sdk_container_builder.py
##########
@@ -0,0 +1,279 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+"""SdkContainerBuilder builds the portable SDK container with dependencies.
+
+It copies the right boot dependencies, namely: apache beam sdk, python packages
+from requirements.txt, python packages from extra_packages.txt, workflow
+tarball, into the latest public python sdk container image, and run the
+dependencies installation in advance with the boot program in setup only mode
+to build the new image.
+"""
+
+from __future__ import absolute_import
+
+import json
+import logging
+import os
+import shutil
+import subprocess
+import sys
+import tarfile
+import tempfile
+import time
+import uuid
+
+from google.protobuf.duration_pb2 import Duration
+from google.protobuf.json_format import MessageToJson
+
+from apache_beam.internal.gcp.auth import get_service_credentials
+from apache_beam.internal.http_client import get_new_http
+from apache_beam.io.gcp.internal.clients import storage
+from apache_beam.options.pipeline_options import GoogleCloudOptions
+from apache_beam.options.pipeline_options import PipelineOptions  # pylint: disable=unused-import
+from apache_beam.options.pipeline_options import SetupOptions
+from apache_beam.portability import common_urns
+from apache_beam.portability.api import beam_runner_api_pb2
+from apache_beam.runners.portability.stager import Stager
+
+ARTIFACTS_CONTAINER_DIR = '/opt/apache/beam/artifacts'
+ARTIFACTS_MANIFEST_FILE = 'artifacts_info.json'
+SDK_CONTAINER_ENTRYPOINT = '/opt/apache/beam/boot'
+DOCKERFILE_TEMPLATE = (
+    """FROM {base_image}
+RUN mkdir -p {workdir}
+COPY ./* {workdir}/
+RUN {entrypoint} --setup_only --artifacts {workdir}/{manifest_file}
+""")
+
+SOURCE_FOLDER = 'source'
+_LOGGER = logging.getLogger(__name__)
+
+
+class SdkContainerBuilder(object):
+  def __init__(self, options):
+    self._options = options
+    self._docker_registry_push_url = self._options.view_as(
+        SetupOptions).docker_registry_push_url
+    self._base_image = (
+        self._options.view_as(SetupOptions).prebuild_sdk_container_base_image or
+        'apache/beam_python%s.%s_sdk:latest' %
+        (sys.version_info[0], sys.version_info[1]))
+    self._temp_src_dir = None
+
+  def build(self):
+    container_id = str(uuid.uuid4())
+    container_tag = os.path.join(
+        self._docker_registry_push_url or '',
+        'beam_python_prebuilt_sdk:%s' % container_id)
+    with tempfile.TemporaryDirectory() as temp_folder:
+      self._temp_src_dir = temp_folder
+      self.prepare_dependencies()
+      self.invoke_docker_build_and_push(container_id, container_tag)
+
+    return container_tag
+
+  def prepare_dependencies(self):
+    with tempfile.TemporaryDirectory() as tmp:
+      resources = Stager.create_job_resources(self._options, tmp)
+      # make a copy of the staged artifacts into the temp source folder.
+      for path, name in resources:
+        shutil.copyfile(path, os.path.join(self._temp_src_dir, name))
+      with open(os.path.join(self._temp_src_dir, 'Dockerfile'), 'w') as file:
+        file.write(
+            DOCKERFILE_TEMPLATE.format(
+                base_image=self._base_image,
+                workdir=ARTIFACTS_CONTAINER_DIR,
+                manifest_file=ARTIFACTS_MANIFEST_FILE,
+                entrypoint=SDK_CONTAINER_ENTRYPOINT))
+      self.generate_artifacts_manifests_json_file(resources, self._temp_src_dir)
+
+  def invoke_docker_build_and_push(self, container_id, container_tag):
+    raise NotImplementedError
+
+  @staticmethod
+  def generate_artifacts_manifests_json_file(resources, temp_dir):
+    infos = []
+    for _, name in resources:
+      info = beam_runner_api_pb2.ArtifactInformation(
+          type_urn=common_urns.StandardArtifacts.Types.FILE.urn,
+          type_payload=beam_runner_api_pb2.ArtifactFilePayload(
+              path=name).SerializeToString(),
+      )
+      infos.append(json.dumps(MessageToJson(info)))
+    with open(os.path.join(temp_dir, ARTIFACTS_MANIFEST_FILE), 'w') as file:
+      file.write('[\n' + ',\n'.join(infos) + '\n]')
+
+  @classmethod
+  def build_container_image(cls, pipeline_options):
+    # type: (PipelineOptions) -> str

Review comment:
       done.

##########
File path: sdks/python/apache_beam/examples/wordcount_it_test.py
##########
@@ -56,6 +57,17 @@ def test_wordcount_it(self):
   def test_wordcount_fnapi_it(self):
     self._run_wordcount_it(wordcount.run, experiment='beam_fn_api')
 
+  @attr('ValidatesContainer')
+  def test_wordcount_it_with_prebuilt_sdk_container(self):
+    if sys.version_info[0] < 3:

Review comment:
       done.

##########
File path: sdks/python/apache_beam/runners/portability/sdk_container_builder.py
##########
@@ -0,0 +1,274 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+"""SdkContainerBuilder builds the portable SDK container with dependencies.
+
+It copies the right boot dependencies, namely: apache beam sdk, python packages
+from requirements.txt, python packages from extra_packages.txt, workflow
+tarball, into the latest public python sdk container image, and run the
+dependencies installation in advance with the boot program in setup only mode
+to build the new image.
+"""
+
+from __future__ import absolute_import
+
+import json
+import logging
+import os
+import shutil
+import subprocess
+import sys
+import tarfile
+import tempfile
+import time
+import uuid
+
+from google.protobuf.duration_pb2 import Duration
+from google.protobuf.json_format import MessageToJson
+
+from apache_beam.internal.gcp.auth import get_service_credentials
+from apache_beam.internal.http_client import get_new_http
+from apache_beam.io.gcp.internal.clients import storage
+from apache_beam.options.pipeline_options import GoogleCloudOptions
+from apache_beam.options.pipeline_options import PipelineOptions  # pylint: disable=unused-import
+from apache_beam.options.pipeline_options import SetupOptions
+from apache_beam.portability import common_urns
+from apache_beam.portability.api import beam_runner_api_pb2
+from apache_beam.runners.portability.stager import Stager
+
+ARTIFACTS_CONTAINER_DIR = '/opt/apache/beam/artifacts'
+ARTIFACTS_MANIFEST_FILE = 'artifacts_info.json'
+SDK_CONTAINER_ENTRYPOINT = '/opt/apache/beam/boot'
+DOCKERFILE_TEMPLATE = (
+    """FROM apache/beam_python{major}.{minor}_sdk:latest
+RUN mkdir -p {workdir}
+COPY ./* {workdir}/
+RUN {entrypoint} --setup_only --artifacts {workdir}/{manifest_file}
+""")
+
+SOURCE_FOLDER = 'source'
+_LOGGER = logging.getLogger(__name__)
+
+
+class SdkContainerBuilder(object):
+  def __init__(self, options):
+    self._options = options
+    self._temp_src_dir = tempfile.mkdtemp()
+    self._docker_registry_push_url = self._options.view_as(
+        SetupOptions).docker_registry_push_url
+
+  def build(self):

Review comment:
       done.

##########
File path: sdks/python/apache_beam/runners/dataflow/dataflow_runner.py
##########
@@ -473,10 +473,16 @@ def run_pipeline(self, pipeline, options):
 
     use_fnapi = apiclient._use_fnapi(options)
     from apache_beam.transforms import environments
-    self._default_environment = (
-        environments.DockerEnvironment.from_container_image(
-            apiclient.get_container_image_from_options(options),
-            artifacts=environments.python_sdk_dependencies(options)))
+    if options.view_as(SetupOptions).prebuild_sdk_container_engine:

Review comment:
       done.

##########
File path: sdks/python/apache_beam/options/pipeline_options.py
##########
@@ -994,6 +994,21 @@ def _add_argparse_args(cls, parser):
             'staged in the staging area (--staging_location option) and the '
             'workers will install them in same order they were specified on '
             'the command line.'))
+    parser.add_argument(
+        '--prebuild_sdk_container_engine',
+        choices=['local_docker', 'cloud_build'],
+        help=(
+            'Pre-builds the sdk worker container image with boot dependencies '

Review comment:
       done.

##########
File path: sdks/python/apache_beam/runners/portability/sdk_container_builder.py
##########
@@ -0,0 +1,279 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+"""SdkContainerBuilder builds the portable SDK container with dependencies.
+
+It copies the right boot dependencies, namely: apache beam sdk, python packages
+from requirements.txt, python packages from extra_packages.txt, workflow
+tarball, into the latest public python sdk container image, and run the
+dependencies installation in advance with the boot program in setup only mode
+to build the new image.
+"""
+
+from __future__ import absolute_import
+
+import json
+import logging
+import os
+import shutil
+import subprocess
+import sys
+import tarfile
+import tempfile
+import time
+import uuid
+
+from google.protobuf.duration_pb2 import Duration
+from google.protobuf.json_format import MessageToJson
+
+from apache_beam.internal.gcp.auth import get_service_credentials
+from apache_beam.internal.http_client import get_new_http
+from apache_beam.io.gcp.internal.clients import storage
+from apache_beam.options.pipeline_options import GoogleCloudOptions
+from apache_beam.options.pipeline_options import PipelineOptions  # pylint: disable=unused-import
+from apache_beam.options.pipeline_options import SetupOptions
+from apache_beam.portability import common_urns
+from apache_beam.portability.api import beam_runner_api_pb2
+from apache_beam.runners.portability.stager import Stager
+
+ARTIFACTS_CONTAINER_DIR = '/opt/apache/beam/artifacts'
+ARTIFACTS_MANIFEST_FILE = 'artifacts_info.json'
+SDK_CONTAINER_ENTRYPOINT = '/opt/apache/beam/boot'
+DOCKERFILE_TEMPLATE = (
+    """FROM {base_image}
+RUN mkdir -p {workdir}
+COPY ./* {workdir}/
+RUN {entrypoint} --setup_only --artifacts {workdir}/{manifest_file}
+""")
+
+SOURCE_FOLDER = 'source'
+_LOGGER = logging.getLogger(__name__)
+
+
+class SdkContainerBuilder(object):
+  def __init__(self, options):
+    self._options = options
+    self._docker_registry_push_url = self._options.view_as(
+        SetupOptions).docker_registry_push_url
+    self._base_image = (
+        self._options.view_as(SetupOptions).prebuild_sdk_container_base_image or
+        'apache/beam_python%s.%s_sdk:latest' %
+        (sys.version_info[0], sys.version_info[1]))
+    self._temp_src_dir = None
+
+  def build(self):
+    container_id = str(uuid.uuid4())
+    container_tag = os.path.join(
+        self._docker_registry_push_url or '',
+        'beam_python_prebuilt_sdk:%s' % container_id)
+    with tempfile.TemporaryDirectory() as temp_folder:
+      self._temp_src_dir = temp_folder
+      self.prepare_dependencies()
+      self.invoke_docker_build_and_push(container_id, container_tag)
+
+    return container_tag
+
+  def prepare_dependencies(self):
+    with tempfile.TemporaryDirectory() as tmp:
+      resources = Stager.create_job_resources(self._options, tmp)
+      # make a copy of the staged artifacts into the temp source folder.
+      for path, name in resources:
+        shutil.copyfile(path, os.path.join(self._temp_src_dir, name))
+      with open(os.path.join(self._temp_src_dir, 'Dockerfile'), 'w') as file:
+        file.write(
+            DOCKERFILE_TEMPLATE.format(
+                base_image=self._base_image,
+                workdir=ARTIFACTS_CONTAINER_DIR,
+                manifest_file=ARTIFACTS_MANIFEST_FILE,
+                entrypoint=SDK_CONTAINER_ENTRYPOINT))
+      self.generate_artifacts_manifests_json_file(resources, self._temp_src_dir)
+
+  def invoke_docker_build_and_push(self, container_id, container_tag):
+    raise NotImplementedError
+
+  @staticmethod
+  def generate_artifacts_manifests_json_file(resources, temp_dir):
+    infos = []
+    for _, name in resources:
+      info = beam_runner_api_pb2.ArtifactInformation(
+          type_urn=common_urns.StandardArtifacts.Types.FILE.urn,
+          type_payload=beam_runner_api_pb2.ArtifactFilePayload(
+              path=name).SerializeToString(),
+      )
+      infos.append(json.dumps(MessageToJson(info)))
+    with open(os.path.join(temp_dir, ARTIFACTS_MANIFEST_FILE), 'w') as file:
+      file.write('[\n' + ',\n'.join(infos) + '\n]')
+
+  @classmethod
+  def build_container_image(cls, pipeline_options):
+    # type: (PipelineOptions) -> str
+    setup_options = pipeline_options.view_as(SetupOptions)
+    container_build_engine = setup_options.prebuild_sdk_container_engine
+    if container_build_engine:
+      if container_build_engine == 'local_docker':
+        builder = _SdkContainerLocalBuilder(
+            pipeline_options)  # type: SdkContainerBuilder
+      elif container_build_engine == 'cloud_build':
+        builder = _SdkContainerCloudBuilder(pipeline_options)
+      else:
+        raise ValueError(
+            'Only (--prebuild_sdk_container_engine local_docker) and '
+            '(--prebuild_sdk_container_engine cloud_build) are supported')
+    else:
+      raise ValueError('No --prebuild_sdk_container_engine option specified.')
+    return builder.build()
+
+
+class _SdkContainerLocalBuilder(SdkContainerBuilder):
+  """SdkContainerLocalBuilder builds the sdk container image with local
+  docker."""
+  def invoke_docker_build_and_push(self, container_id, container_tag):
+    try:
+      _LOGGER.info("Building sdk container, this may take a few minutes...")
+      now = time.time()
+      subprocess.run(['docker', 'build', '.', '-t', container_tag],
+                     capture_output=True,
+                     check=True,
+                     cwd=self._temp_src_dir)
+    except subprocess.CalledProcessError as err:
+      raise RuntimeError(
+          'Failed to build sdk container with local docker, '
+          'stderr:\n %s.' % err.stderr)
+    else:
+      _LOGGER.info(
+          "Successfully built %s in %.2f seconds" %
+          (container_tag, time.time() - now))
+
+    if self._docker_registry_push_url:
+      _LOGGER.info("Pushing prebuilt sdk container...")
+      try:
+        subprocess.run(['docker', 'push', container_tag],
+                       capture_output=True,
+                       check=True)
+      except subprocess.CalledProcessError as err:
+        raise RuntimeError(
+            'Failed to push prebuilt sdk container %s, stderr: \n%s' %
+            (container_tag, err.stderr))
+      _LOGGER.info(
+          "Successfully pushed %s in %.2f seconds" %
+          (container_tag, time.time() - now))
+    else:
+      _LOGGER.info(
+          "no --docker_registry_push_url option is specified in pipeline "
+          "options, specify it if the new image is intended to be "
+          "pushed to a registry.")
+
+
+class _SdkContainerCloudBuilder(SdkContainerBuilder):
+  """SdkContainerLocalBuilder builds the sdk container image with google cloud
+  build."""
+  def __init__(self, options):
+    super().__init__(options)
+    self._google_cloud_options = options.view_as(GoogleCloudOptions)
+    if self._google_cloud_options.no_auth:
+      credentials = None
+    else:
+      credentials = get_service_credentials()
+    self._storage_client = storage.StorageV1(
+        url='https://www.googleapis.com/storage/v1',
+        credentials=credentials,
+        get_credentials=(not self._google_cloud_options.no_auth),
+        http=get_new_http(),
+        response_encoding='utf8')
+    if not self._docker_registry_push_url:
+      self._docker_registry_push_url = (
+          'gcr.io/%s' % self._google_cloud_options.project)
+
+  def invoke_docker_build_and_push(self, container_id, container_tag):
+    project_id = self._google_cloud_options.project
+    temp_location = self._google_cloud_options.temp_location
+    # google cloud build service expects all the build source file to be
+    # compressed into a tarball.
+    tarball_path = os.path.join(self._temp_src_dir, '%s.tgz' % SOURCE_FOLDER)
+    self._make_tarfile(tarball_path, self._temp_src_dir)
+    _LOGGER.info(
+        "Compressed source files for building sdk container at %s" %
+        tarball_path)
+
+    gcs_location = os.path.join(
+        temp_location, '%s-%s.tgz' % (SOURCE_FOLDER, container_id))
+    self._upload_to_gcs(tarball_path, gcs_location)
+
+    from google.cloud.devtools import cloudbuild_v1
+    client = cloudbuild_v1.CloudBuildClient()
+    build = cloudbuild_v1.Build()
+    build.steps = []
+    step = cloudbuild_v1.BuildStep()
+    step.name = 'gcr.io/cloud-builders/docker'
+    step.args = ['build', '-t', container_tag, '.']
+    step.dir = SOURCE_FOLDER
+
+    build.steps.append(step)
+    build.images = [container_tag]
+
+    source = cloudbuild_v1.Source()
+    source.storage_source = cloudbuild_v1.StorageSource()
+    gcs_bucket, gcs_object = self._get_gcs_bucket_and_name(gcs_location)
+    source.storage_source.bucket = os.path.join(gcs_bucket)
+    source.storage_source.object = gcs_object
+    build.source = source
+    # TODO(zyichi): make timeout configurable
+    build.timeout = Duration().FromSeconds(seconds=1800)
+
+    now = time.time()
+    _LOGGER.info('Building sdk container, this may take a few minutes...')
+    operation = client.create_build(project_id=project_id, build=build)
+    # if build fails exception will be raised and stops the job submission.

Review comment:
       I think use may need to check the failure log first, it could be caused by things such as mistakenly provided wrong base image or wrong docker push url.

##########
File path: sdks/python/apache_beam/options/pipeline_options.py
##########
@@ -1003,6 +1003,13 @@ def _add_argparse_args(cls, parser):
             'environment. Choose the docker build engine of local docker '
             'environment or google cloud build by passing the option '
             'local_docker or cloud_build.'))
+    parser.add_argument(
+        '--prebuild_sdk_container_base_image',
+        default=None,
+        help=(
+            'The base image to use when pre-building the sdk container image '
+            'with dependencies, if not specified, the latest public '

Review comment:
       For a dev sdk version, can we use the last released version? 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: Add option to prebuild python sdk container

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/a99c6826a067f49ebb60e625c8652900c7d0e810?el=desc) will **increase** coverage by `5.88%`.
   > The diff coverage is `33.80%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   + Coverage   34.32%   40.21%   +5.88%     
   ==========================================
     Files         694      455     -239     
     Lines       82226    53738   -28488     
     Branches     9294        0    -9294     
   ==========================================
   - Hits        28225    21610    -6615     
   + Misses      53578    32128   -21450     
   + Partials      423        0     -423     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `20.20% <28.57%> (ø)` | |
   | [...che\_beam/runners/dataflow/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `34.37% <34.37%> (ø)` | |
   | [testing/util\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dGVzdGluZy91dGlsX3Rlc3QucHk=) | | |
   | [io/aws/clients/s3/fake\_client.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vYXdzL2NsaWVudHMvczMvZmFrZV9jbGllbnQucHk=) | | |
   | [examples/cookbook/datastore\_wordcount\_it\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZXhhbXBsZXMvY29va2Jvb2svZGF0YXN0b3JlX3dvcmRjb3VudF9pdF90ZXN0LnB5) | | |
   | [dataframe/frames\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZGF0YWZyYW1lL2ZyYW1lc190ZXN0LnB5) | | |
   | [runners/interactive/pipeline\_analyzer\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9pbnRlcmFjdGl2ZS9waXBlbGluZV9hbmFseXplcl90ZXN0LnB5) | | |
   | [io/gcp/pubsub\_integration\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vZ2NwL3B1YnN1Yl9pbnRlZ3JhdGlvbl90ZXN0LnB5) | | |
   | [...amples/snippets/transforms/aggregation/\_\_init\_\_.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZXhhbXBsZXMvc25pcHBldHMvdHJhbnNmb3Jtcy9hZ2dyZWdhdGlvbi9fX2luaXRfXy5weQ==) | | |
   | [examples/complete/top\_wikipedia\_sessions.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZXhhbXBsZXMvY29tcGxldGUvdG9wX3dpa2lwZWRpYV9zZXNzaW9ucy5weQ==) | | |
   | ... and [1141 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [a99c682...20c8398](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] aaltay commented on a change in pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
aaltay commented on a change in pull request #12727:
URL: https://github.com/apache/beam/pull/12727#discussion_r492448750



##########
File path: sdks/python/setup.py
##########
@@ -215,6 +215,8 @@ def get_version():
     'google-cloud-language>=1.3.0,<2',
     'google-cloud-videointelligence>=1.8.0,<2',
     'google-cloud-vision>=0.38.0,<2',
+    # GCP packages required by fast container startup functionality.

Review comment:
       nit: "required by prebuild sdk container functionality". That is what you are calling it in options.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] robertwb commented on a change in pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
robertwb commented on a change in pull request #12727:
URL: https://github.com/apache/beam/pull/12727#discussion_r490632829



##########
File path: sdks/python/apache_beam/options/pipeline_options.py
##########
@@ -994,6 +994,23 @@ def _add_argparse_args(cls, parser):
             'staged in the staging area (--staging_location option) and the '
             'workers will install them in same order they were specified on '
             'the command line.'))
+    parser.add_argument(
+        '--docker_registry_url',

Review comment:
       Maybe `docker_registry_push_url` to make it more clear. 

##########
File path: sdks/python/apache_beam/runners/portability/stager.py
##########
@@ -151,7 +151,8 @@ def create_job_resources(options,  # type: PipelineOptions
     setup_options = options.view_as(SetupOptions)
 
     # Stage a requirements file if present.
-    if setup_options.requirements_file is not None:
+    if (setup_options.requirements_file is not None and

Review comment:
       I don't think we should have to do these checks here. We should get the requirements file (and other artifacts) and populate them in the environment (which is docker + ArtifactInfo). We should then reduce this to a new (docker + ArtifactInfo) invoking the docker build routines, followed by staging the artifacts in ArtifactInfo (if any). 

##########
File path: sdks/python/container/boot.go
##########
@@ -283,3 +306,51 @@ func multiProcessExactlyOnce(actionFunc func(), completeFileName string) {
 	os.OpenFile(installCompleteFile, os.O_RDONLY|os.O_CREATE, 0666)
 
 }
+
+func processArtifactsInSetupOnlyMode() error {
+	if *artifacts == "" {
+		log.Fatal("No --artifacts provided along with --setup_only flag.")
+	}
+	workDir := filepath.Dir(*artifacts)
+	metadata, err := ioutil.ReadFile(*artifacts)
+	if err != nil {
+		log.Fatalf("Unable to open artifacts metadata file %v with error %v", *artifacts, err)
+	}
+	var infoJsons []string
+	if err := json.Unmarshal(metadata, &infoJsons); err != nil {
+		log.Fatalf("Unable to parse metadata, error: %v", err)
+	}
+
+	files := make([]string, len(infoJsons))
+	for i, info := range infoJsons {
+		var artifactInformation pipepb.ArtifactInformation
+		if err := jsonpb.UnmarshalString(info, &artifactInformation); err != nil {
+			log.Fatalf("Unable to unmarshal artifact information from json string %v", info)
+		}
+
+		// For now we only expect artifacts in file type. The condition should be revisited if the assumption is not valid any more.
+		if artifactInformation.GetTypeUrn() != standardArtifactFileTypeUrn {
+			log.Fatalf("Expect file artifact type in setup only mode, found %v.", artifactInformation.GetTypeUrn())
+		}
+		filePayload := &pipepb.ArtifactFilePayload{}
+		if err := proto.Unmarshal(artifactInformation.GetTypePayload(), filePayload); err != nil {
+			log.Fatal("Unable to unmarshal artifact information type payload.")
+		}
+		if dir := filepath.Dir(filePayload.GetPath()); dir != workDir {
+			log.Fatalf("Artifact %v not stored in the same work directory %v of metadata file", filePayload.GetPath(), workDir)

Review comment:
       Why is this a problem?

##########
File path: sdks/python/apache_beam/options/pipeline_options.py
##########
@@ -994,6 +994,23 @@ def _add_argparse_args(cls, parser):
             'staged in the staging area (--staging_location option) and the '
             'workers will install them in same order they were specified on '
             'the command line.'))
+    parser.add_argument(
+        '--docker_registry_url',
+        default=None,
+        help=(
+            'The default docker registry to for pushing additional docker '

Review comment:
       For pushing pre-prepared worker images?

##########
File path: sdks/python/apache_beam/runners/dataflow/internal/apiclient.py
##########
@@ -1070,7 +1075,28 @@ def get_container_image_from_options(pipeline_options):
     Returns:
       str: Container image for remote execution.
   """
+  debug_options = pipeline_options.view_as(DebugOptions)
   worker_options = pipeline_options.view_as(WorkerOptions)
+  container_build_engine = debug_options.lookup_experiment(
+      'prebuild_sdk_container')
+  if (debug_options.lookup_experiment('beam_fn_api') and

Review comment:
       Omit the check on beam_fn_api, as we hope to remove that soon.

##########
File path: sdks/python/apache_beam/runners/dataflow/internal/apiclient.py
##########
@@ -1070,7 +1075,28 @@ def get_container_image_from_options(pipeline_options):
     Returns:
       str: Container image for remote execution.
   """
+  debug_options = pipeline_options.view_as(DebugOptions)
   worker_options = pipeline_options.view_as(WorkerOptions)
+  container_build_engine = debug_options.lookup_experiment(

Review comment:
       Why is this in apiclient? Does not makes sense to limit this to dataflow; perhaps this should instead be put where we get the default environment? 

##########
File path: sdks/python/apache_beam/runners/portability/sdk_container_builder.py
##########
@@ -0,0 +1,138 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+"""SdkContainerBuilder builds the portable SDK container with dependencies.
+
+It copies the right boot dependencies, namely: apache beam sdk, python packages
+from requirements.txt, python packages from extra_packages.txt, workflow
+tarball, into the latest public python sdk container image, and run the
+dependencies installation in advance with the boot program in setup only mode
+to build the new image.
+"""
+
+from __future__ import absolute_import
+
+import json
+import logging
+import os
+import shutil
+import subprocess
+import sys
+import tempfile
+import time
+import uuid
+
+from google.protobuf.json_format import MessageToJson
+
+from apache_beam.options.pipeline_options import SetupOptions
+from apache_beam.portability import common_urns
+from apache_beam.portability.api import beam_runner_api_pb2
+from apache_beam.runners.portability.stager import Stager
+
+ARTIFACTS_CONTAINER_DIR = '/opt/apache/beam/artifacts'
+ARTIFACTS_MANIFEST_FILE = 'artifacts_info.json'
+DOCKERFILE_TEMPLATE = (
+    """FROM apache/beam_python{major}.{minor}_sdk:latest
+RUN mkdir -p {workdir}
+COPY ./* {workdir}/
+RUN /opt/apache/beam/boot --setup_only --artifacts {workdir}/{manifest_file}
+""")
+
+_LOGGER = logging.getLogger(__name__)
+
+
+class SdkContainerBuilder(object):

Review comment:
       Maybe make a local and cloud builder with a common parent, rather than the cloud extending from the local? 

##########
File path: sdks/python/apache_beam/runners/dataflow/internal/apiclient.py
##########
@@ -51,13 +51,18 @@
 from apache_beam.io.gcp.internal.clients import storage
 from apache_beam.options.pipeline_options import DebugOptions
 from apache_beam.options.pipeline_options import GoogleCloudOptions
+from apache_beam.options.pipeline_options import SetupOptions
 from apache_beam.options.pipeline_options import StandardOptions
 from apache_beam.options.pipeline_options import WorkerOptions
 from apache_beam.portability import common_urns
 from apache_beam.portability.api import beam_runner_api_pb2
 from apache_beam.runners.dataflow.internal import names
 from apache_beam.runners.dataflow.internal.clients import dataflow
 from apache_beam.runners.dataflow.internal.names import PropertyNames
+from apache_beam.runners.dataflow.internal.sdk_container_cloud_builder import \

Review comment:
       Just let imports flow long. (Also, if you need to wrap, do so with ()'s.)

##########
File path: sdks/python/apache_beam/options/pipeline_options.py
##########
@@ -994,6 +994,23 @@ def _add_argparse_args(cls, parser):
             'staged in the staging area (--staging_location option) and the '
             'workers will install them in same order they were specified on '
             'the command line.'))
+    parser.add_argument(
+        '--docker_registry_url',
+        default=None,
+        help=(
+            'The default docker registry to for pushing additional docker '
+            'images for the setup.'))
+    parser.add_argument(

Review comment:
       We should simply omit such dependencies, not have an extra flag to skip them. (Or is that not possible?)

##########
File path: sdks/python/container/boot.go
##########
@@ -203,13 +225,14 @@ func setupAcceptableWheelSpecs() error {
 }
 
 // installSetupPackages installs Beam SDK and user dependencies.
-func installSetupPackages(mds []*jobpb.ArtifactMetadata, workDir string) error {
+func installSetupPackages(files []string, workDir string) error {
 	log.Printf("Installing setup packages ...")
 
-	files := make([]string, len(mds))
-	for i, v := range mds {
-		log.Printf("Found artifact: %s", v.Name)
-		files[i] = v.Name
+	// Check if setupResultFile exists, if so we can skip the dependency installation since

Review comment:
       We should install anything offered here, and ensure this list is empty if we don't have anything to install, rather than relying on the details of the install script to leave certain files around. 

##########
File path: sdks/python/container/boot.go
##########
@@ -61,11 +66,22 @@ const (
 	sdkSrcFile        = "dataflow_python_sdk.tar"
 	extraPackagesFile = "extra_packages.txt"
 	workerPoolIdEnv   = "BEAM_PYTHON_WORKER_POOL_ID"
+
+	// Setup result for the setup only mode.
+	setupResultFile             = "/opt/apache/beam/setup_result.json"

Review comment:
       We probably don't need to hard cod this anywhere.

##########
File path: sdks/python/container/boot.go
##########
@@ -61,11 +66,22 @@ const (
 	sdkSrcFile        = "dataflow_python_sdk.tar"
 	extraPackagesFile = "extra_packages.txt"
 	workerPoolIdEnv   = "BEAM_PYTHON_WORKER_POOL_ID"
+
+	// Setup result for the setup only mode.
+	setupResultFile             = "/opt/apache/beam/setup_result.json"
+	standardArtifactFileTypeUrn = "beam:artifact:type:file:v1"

Review comment:
       Isn't this a constant elsewhere?

##########
File path: sdks/python/apache_beam/runners/dataflow/internal/apiclient.py
##########
@@ -1070,7 +1075,28 @@ def get_container_image_from_options(pipeline_options):
     Returns:
       str: Container image for remote execution.
   """
+  debug_options = pipeline_options.view_as(DebugOptions)
   worker_options = pipeline_options.view_as(WorkerOptions)
+  container_build_engine = debug_options.lookup_experiment(

Review comment:
       This would mean we could more easily test it as well. 

##########
File path: sdks/python/apache_beam/runners/portability/sdk_container_builder.py
##########
@@ -0,0 +1,138 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+"""SdkContainerBuilder builds the portable SDK container with dependencies.
+
+It copies the right boot dependencies, namely: apache beam sdk, python packages
+from requirements.txt, python packages from extra_packages.txt, workflow
+tarball, into the latest public python sdk container image, and run the
+dependencies installation in advance with the boot program in setup only mode
+to build the new image.
+"""
+
+from __future__ import absolute_import
+
+import json
+import logging
+import os
+import shutil
+import subprocess
+import sys
+import tempfile
+import time
+import uuid
+
+from google.protobuf.json_format import MessageToJson
+
+from apache_beam.options.pipeline_options import SetupOptions
+from apache_beam.portability import common_urns
+from apache_beam.portability.api import beam_runner_api_pb2
+from apache_beam.runners.portability.stager import Stager
+
+ARTIFACTS_CONTAINER_DIR = '/opt/apache/beam/artifacts'
+ARTIFACTS_MANIFEST_FILE = 'artifacts_info.json'
+DOCKERFILE_TEMPLATE = (
+    """FROM apache/beam_python{major}.{minor}_sdk:latest
+RUN mkdir -p {workdir}
+COPY ./* {workdir}/
+RUN /opt/apache/beam/boot --setup_only --artifacts {workdir}/{manifest_file}

Review comment:
       Make `/opt/apache/beam/boot` a constant as well.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/5ef04e945fb1a3948d665af5d6b7f13b86487616?el=desc) will **decrease** coverage by `0.20%`.
   > The diff coverage is `52.86%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   - Coverage   82.36%   82.16%   -0.21%     
   ==========================================
     Files         451      452       +1     
     Lines       53753    54036     +283     
   ==========================================
   + Hits        44273    44397     +124     
   - Misses       9480     9639     +159     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `72.60% <0.00%> (ø)` | |
   | [...eam/testing/benchmarks/nexmark/nexmark\_launcher.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19sYXVuY2hlci5weQ==) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_perf.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19wZXJmLnB5) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_util.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya191dGlsLnB5) | `0.00% <0.00%> (ø)` | |
   | [...\_beam/runners/portability/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9wb3J0YWJpbGl0eS9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `32.23% <32.23%> (ø)` | |
   | [...on/apache\_beam/runners/dataflow/dataflow\_runner.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9kYXRhZmxvd19ydW5uZXIucHk=) | `77.03% <60.00%> (-0.15%)` | :arrow_down: |
   | [...dks/python/apache\_beam/options/pipeline\_options.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vb3B0aW9ucy9waXBlbGluZV9vcHRpb25zLnB5) | `95.00% <66.66%> (+0.01%)` | :arrow_up: |
   | [sdks/python/apache\_beam/transforms/environments.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdHJhbnNmb3Jtcy9lbnZpcm9ubWVudHMucHk=) | `83.49% <66.66%> (-0.33%)` | :arrow_down: |
   | [...beam/runners/interactive/background\_caching\_job.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9iYWNrZ3JvdW5kX2NhY2hpbmdfam9iLnB5) | `94.78% <90.90%> (ø)` | |
   | [sdks/python/apache\_beam/utils/histogram.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdXRpbHMvaGlzdG9ncmFtLnB5) | `94.28% <94.28%> (ø)` | |
   | ... and [66 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [68e7f2e...984c4e7](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/5ef04e945fb1a3948d665af5d6b7f13b86487616?el=desc) will **decrease** coverage by `0.10%`.
   > The diff coverage is `55.18%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   - Coverage   82.36%   82.26%   -0.11%     
   ==========================================
     Files         451      455       +4     
     Lines       53753    54515     +762     
   ==========================================
   + Hits        44273    44846     +573     
   - Misses       9480     9669     +189     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `72.60% <0.00%> (ø)` | |
   | [...eam/testing/benchmarks/nexmark/nexmark\_launcher.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19sYXVuY2hlci5weQ==) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_perf.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19wZXJmLnB5) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_util.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya191dGlsLnB5) | `0.00% <0.00%> (ø)` | |
   | [...\_beam/runners/portability/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9wb3J0YWJpbGl0eS9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `31.21% <31.21%> (ø)` | |
   | [...on/apache\_beam/runners/dataflow/dataflow\_runner.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9kYXRhZmxvd19ydW5uZXIucHk=) | `77.06% <66.66%> (-0.12%)` | :arrow_down: |
   | [sdks/python/apache\_beam/transforms/environments.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdHJhbnNmb3Jtcy9lbnZpcm9ubWVudHMucHk=) | `83.54% <66.66%> (-0.28%)` | :arrow_down: |
   | [...s/python/apache\_beam/runners/portability/stager.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9wb3J0YWJpbGl0eS9zdGFnZXIucHk=) | `82.62% <89.18%> (+0.34%)` | :arrow_up: |
   | [sdks/python/apache\_beam/io/gcp/bigquery.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vaW8vZ2NwL2JpZ3F1ZXJ5LnB5) | `79.33% <90.90%> (-0.45%)` | :arrow_down: |
   | [...dks/python/apache\_beam/options/pipeline\_options.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vb3B0aW9ucy9waXBlbGluZV9vcHRpb25zLnB5) | `94.79% <92.85%> (-0.20%)` | :arrow_down: |
   | ... and [83 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [68e7f2e...b59a1ba](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/5ef04e945fb1a3948d665af5d6b7f13b86487616?el=desc) will **decrease** coverage by `0.16%`.
   > The diff coverage is `52.66%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   - Coverage   82.36%   82.20%   -0.17%     
   ==========================================
     Files         451      455       +4     
     Lines       53753    54284     +531     
   ==========================================
   + Hits        44273    44623     +350     
   - Misses       9480     9661     +181     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `72.60% <0.00%> (ø)` | |
   | [...eam/testing/benchmarks/nexmark/nexmark\_launcher.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19sYXVuY2hlci5weQ==) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_perf.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19wZXJmLnB5) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_util.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya191dGlsLnB5) | `0.00% <0.00%> (ø)` | |
   | [...\_beam/runners/portability/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9wb3J0YWJpbGl0eS9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `31.16% <31.16%> (ø)` | |
   | [...on/apache\_beam/runners/dataflow/dataflow\_runner.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9kYXRhZmxvd19ydW5uZXIucHk=) | `77.06% <66.66%> (-0.12%)` | :arrow_down: |
   | [sdks/python/apache\_beam/transforms/environments.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdHJhbnNmb3Jtcy9lbnZpcm9ubWVudHMucHk=) | `83.49% <66.66%> (-0.33%)` | :arrow_down: |
   | [...dks/python/apache\_beam/options/pipeline\_options.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vb3B0aW9ucy9waXBlbGluZV9vcHRpb25zLnB5) | `95.02% <72.72%> (+0.04%)` | :arrow_up: |
   | [sdks/python/apache\_beam/io/gcp/bigquery.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vaW8vZ2NwL2JpZ3F1ZXJ5LnB5) | `79.78% <90.90%> (+<0.01%)` | :arrow_up: |
   | [sdks/python/apache\_beam/utils/histogram.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdXRpbHMvaGlzdG9ncmFtLnB5) | `94.28% <94.28%> (ø)` | |
   | ... and [75 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [68e7f2e...ff434c0](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: Add option to prebuild python sdk container

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/a99c6826a067f49ebb60e625c8652900c7d0e810?el=desc) will **increase** coverage by `5.88%`.
   > The diff coverage is `33.80%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   + Coverage   34.32%   40.21%   +5.88%     
   ==========================================
     Files         694      455     -239     
     Lines       82226    53738   -28488     
     Branches     9294        0    -9294     
   ==========================================
   - Hits        28225    21610    -6615     
   + Misses      53578    32128   -21450     
   + Partials      423        0     -423     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `20.20% <28.57%> (ø)` | |
   | [...che\_beam/runners/dataflow/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `34.37% <34.37%> (ø)` | |
   | [ml/gcp/videointelligenceml\_test\_it.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-bWwvZ2NwL3ZpZGVvaW50ZWxsaWdlbmNlbWxfdGVzdF9pdC5weQ==) | | |
   | [testing/test\_stream.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dGVzdGluZy90ZXN0X3N0cmVhbS5weQ==) | | |
   | [transforms/environments\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dHJhbnNmb3Jtcy9lbnZpcm9ubWVudHNfdGVzdC5weQ==) | | |
   | [transforms/util\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dHJhbnNmb3Jtcy91dGlsX3Rlc3QucHk=) | | |
   | [io/gcp/datastore/v1new/query\_splitter\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vZ2NwL2RhdGFzdG9yZS92MW5ldy9xdWVyeV9zcGxpdHRlcl90ZXN0LnB5) | | |
   | [runners/interactive/options/capture\_limiters.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9pbnRlcmFjdGl2ZS9vcHRpb25zL2NhcHR1cmVfbGltaXRlcnMucHk=) | | |
   | [internal/util.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW50ZXJuYWwvdXRpbC5weQ==) | | |
   | [examples/complete/game/leader\_board\_it\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZXhhbXBsZXMvY29tcGxldGUvZ2FtZS9sZWFkZXJfYm9hcmRfaXRfdGVzdC5weQ==) | | |
   | ... and [1141 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [a99c682...030594c](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] robertwb commented on a change in pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
robertwb commented on a change in pull request #12727:
URL: https://github.com/apache/beam/pull/12727#discussion_r492191803



##########
File path: sdks/python/apache_beam/runners/dataflow/dataflow_runner.py
##########
@@ -473,10 +474,19 @@ def run_pipeline(self, pipeline, options):
 
     use_fnapi = apiclient._use_fnapi(options)
     from apache_beam.transforms import environments
-    self._default_environment = (
-        environments.DockerEnvironment.from_container_image(
-            apiclient.get_container_image_from_options(options),
-            artifacts=environments.python_sdk_dependencies(options)))
+    if options.view_as(DebugOptions).lookup_experiment(
+        'prebuild_sdk_container'):

Review comment:
       +1 to being consistent. I would lean towards both being top-level options. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/5ef04e945fb1a3948d665af5d6b7f13b86487616?el=desc) will **decrease** coverage by `0.16%`.
   > The diff coverage is `52.76%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   - Coverage   82.36%   82.20%   -0.17%     
   ==========================================
     Files         451      454       +3     
     Lines       53753    54215     +462     
   ==========================================
   + Hits        44273    44566     +293     
   - Misses       9480     9649     +169     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `72.60% <0.00%> (ø)` | |
   | [...eam/testing/benchmarks/nexmark/nexmark\_launcher.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19sYXVuY2hlci5weQ==) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_perf.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19wZXJmLnB5) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_util.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya191dGlsLnB5) | `0.00% <0.00%> (ø)` | |
   | [...\_beam/runners/portability/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9wb3J0YWJpbGl0eS9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `31.78% <31.78%> (ø)` | |
   | [...ks/python/apache\_beam/runners/worker/sdk\_worker.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy93b3JrZXIvc2RrX3dvcmtlci5weQ==) | `88.63% <50.00%> (-0.54%)` | :arrow_down: |
   | [...on/apache\_beam/runners/dataflow/dataflow\_runner.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9kYXRhZmxvd19ydW5uZXIucHk=) | `77.06% <66.66%> (-0.12%)` | :arrow_down: |
   | [sdks/python/apache\_beam/transforms/environments.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdHJhbnNmb3Jtcy9lbnZpcm9ubWVudHMucHk=) | `83.49% <66.66%> (-0.33%)` | :arrow_down: |
   | [...dks/python/apache\_beam/options/pipeline\_options.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vb3B0aW9ucy9waXBlbGluZV9vcHRpb25zLnB5) | `95.01% <70.00%> (+0.02%)` | :arrow_up: |
   | [...beam/runners/interactive/background\_caching\_job.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9iYWNrZ3JvdW5kX2NhY2hpbmdfam9iLnB5) | `94.78% <90.90%> (ø)` | |
   | ... and [73 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [68e7f2e...8a1ceaa](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/5ef04e945fb1a3948d665af5d6b7f13b86487616?el=desc) will **decrease** coverage by `0.20%`.
   > The diff coverage is `52.86%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   - Coverage   82.36%   82.16%   -0.21%     
   ==========================================
     Files         451      452       +1     
     Lines       53753    54036     +283     
   ==========================================
   + Hits        44273    44398     +125     
   - Misses       9480     9638     +158     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `72.60% <0.00%> (ø)` | |
   | [...eam/testing/benchmarks/nexmark/nexmark\_launcher.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19sYXVuY2hlci5weQ==) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_perf.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19wZXJmLnB5) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_util.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya191dGlsLnB5) | `0.00% <0.00%> (ø)` | |
   | [...\_beam/runners/portability/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9wb3J0YWJpbGl0eS9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `32.23% <32.23%> (ø)` | |
   | [...on/apache\_beam/runners/dataflow/dataflow\_runner.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9kYXRhZmxvd19ydW5uZXIucHk=) | `77.03% <60.00%> (-0.15%)` | :arrow_down: |
   | [...dks/python/apache\_beam/options/pipeline\_options.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vb3B0aW9ucy9waXBlbGluZV9vcHRpb25zLnB5) | `95.00% <66.66%> (+0.01%)` | :arrow_up: |
   | [sdks/python/apache\_beam/transforms/environments.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdHJhbnNmb3Jtcy9lbnZpcm9ubWVudHMucHk=) | `83.49% <66.66%> (-0.33%)` | :arrow_down: |
   | [...beam/runners/interactive/background\_caching\_job.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9iYWNrZ3JvdW5kX2NhY2hpbmdfam9iLnB5) | `94.78% <90.90%> (ø)` | |
   | [sdks/python/apache\_beam/utils/histogram.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdXRpbHMvaGlzdG9ncmFtLnB5) | `94.28% <94.28%> (ø)` | |
   | ... and [67 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [68e7f2e...81f9a9e](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] y1chi commented on a change in pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
y1chi commented on a change in pull request #12727:
URL: https://github.com/apache/beam/pull/12727#discussion_r492220801



##########
File path: sdks/python/apache_beam/transforms/environments.py
##########
@@ -252,6 +254,14 @@ def from_runner_api_parameter(payload, capabilities, artifacts, context):
   @classmethod
   def from_options(cls, options):
     # type: (PipelineOptions) -> DockerEnvironment
+    if options.view_as(DebugOptions).lookup_experiment(
+        'prebuild_sdk_container'):
+      prebuilt_container_image = SdkContainerBuilder.build_container_imge(

Review comment:
       Changed to invoking from_options in dataflow runner.

##########
File path: sdks/python/apache_beam/runners/portability/sdk_container_builder.py
##########
@@ -0,0 +1,275 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+"""SdkContainerBuilder builds the portable SDK container with dependencies.
+
+It copies the right boot dependencies, namely: apache beam sdk, python packages
+from requirements.txt, python packages from extra_packages.txt, workflow
+tarball, into the latest public python sdk container image, and run the
+dependencies installation in advance with the boot program in setup only mode
+to build the new image.
+"""
+
+from __future__ import absolute_import
+
+import json
+import logging
+import os
+import shutil
+import subprocess
+import sys
+import tarfile
+import tempfile
+import time
+import uuid
+
+from google.protobuf.duration_pb2 import Duration
+from google.protobuf.json_format import MessageToJson
+
+from apache_beam.internal.gcp.auth import get_service_credentials
+from apache_beam.internal.http_client import get_new_http
+from apache_beam.io.gcp.internal.clients import storage
+from apache_beam.options.pipeline_options import DebugOptions
+from apache_beam.options.pipeline_options import GoogleCloudOptions
+from apache_beam.options.pipeline_options import PipelineOptions  # pylint: disable=unused-import
+from apache_beam.portability import common_urns
+from apache_beam.portability.api import beam_runner_api_pb2
+from apache_beam.runners.portability.stager import Stager
+
+ARTIFACTS_CONTAINER_DIR = '/opt/apache/beam/artifacts'
+ARTIFACTS_MANIFEST_FILE = 'artifacts_info.json'
+SDK_CONTAINER_ENTRYPOINT = '/opt/apache/beam/boot'
+DOCKERFILE_TEMPLATE = (
+    """FROM apache/beam_python{major}.{minor}_sdk:latest
+RUN mkdir -p {workdir}
+COPY ./* {workdir}/
+RUN {entrypoint} --setup_only --artifacts {workdir}/{manifest_file}
+""")
+
+SOURCE_FOLDER = 'source'
+_LOGGER = logging.getLogger(__name__)
+
+
+class SdkContainerBuilder(object):
+  def __init__(self, options):
+    self._options = options
+    self._temp_src_dir = tempfile.mkdtemp()
+    self._docker_registry_push_url = self._options.view_as(
+        DebugOptions).lookup_experiment('docker_registry_push_url')
+
+  def build(self):
+    container_id = str(uuid.uuid4())
+    container_tag = os.path.join(
+        self._docker_registry_push_url or '',
+        'beam_python_prebuilt_sdk:%s' % container_id)
+    self.prepare_dependencies()
+    self.invoke_docker_build_and_push(container_id, container_tag)
+
+    return container_tag
+
+  def prepare_dependencies(self):
+    tmp = tempfile.mkdtemp()
+    resources = Stager.create_job_resources(self._options, tmp)
+    # make a copy of the staged artifacts into the temp source folder.
+    for path, name in resources:
+      shutil.copyfile(path, os.path.join(self._temp_src_dir, name))
+    with open(os.path.join(self._temp_src_dir, 'Dockerfile'), 'w') as file:
+      file.write(
+          DOCKERFILE_TEMPLATE.format(
+              major=sys.version_info[0],
+              minor=sys.version_info[1],
+              workdir=ARTIFACTS_CONTAINER_DIR,
+              manifest_file=ARTIFACTS_MANIFEST_FILE,
+              entrypoint=SDK_CONTAINER_ENTRYPOINT))
+    self.generate_artifacts_manifests_json_file(resources, self._temp_src_dir)
+
+  def invoke_docker_build_and_push(self, container_id, container_tag):
+    raise NotImplementedError
+
+  @staticmethod
+  def generate_artifacts_manifests_json_file(resources, temp_dir):
+    infos = []
+    for _, name in resources:
+      info = beam_runner_api_pb2.ArtifactInformation(
+          type_urn=common_urns.StandardArtifacts.Types.FILE.urn,
+          type_payload=beam_runner_api_pb2.ArtifactFilePayload(
+              path=name).SerializeToString(),
+      )
+      infos.append(json.dumps(MessageToJson(info)))
+    with open(os.path.join(temp_dir, ARTIFACTS_MANIFEST_FILE), 'w') as file:
+      file.write('[\n' + ',\n'.join(infos) + '\n]')
+
+  @classmethod
+  def build_container_imge(cls, pipeline_options):

Review comment:
       done.

##########
File path: sdks/python/apache_beam/runners/portability/stager.py
##########
@@ -119,6 +119,7 @@ def create_job_resources(options,  # type: PipelineOptions
                            temp_dir,  # type: str
                            build_setup_args=None,  # type: Optional[List[str]]
                            populate_requirements_cache=None,  # type: Optional[str]
+                           skip_boot_dependencies=False, # type: Optional[bool]

Review comment:
       There are other dependencies that doesn't seem to be handled explicitly by the boot sequence, for example pickled main session and java jars for x-lang.

##########
File path: sdks/python/apache_beam/runners/dataflow/dataflow_runner.py
##########
@@ -473,10 +474,19 @@ def run_pipeline(self, pipeline, options):
 
     use_fnapi = apiclient._use_fnapi(options)
     from apache_beam.transforms import environments
-    self._default_environment = (
-        environments.DockerEnvironment.from_container_image(
-            apiclient.get_container_image_from_options(options),
-            artifacts=environments.python_sdk_dependencies(options)))
+    if options.view_as(DebugOptions).lookup_experiment(
+        'prebuild_sdk_container'):

Review comment:
       done.

##########
File path: sdks/python/apache_beam/runners/portability/stager.py
##########
@@ -119,6 +119,7 @@ def create_job_resources(options,  # type: PipelineOptions
                            temp_dir,  # type: str
                            build_setup_args=None,  # type: Optional[List[str]]
                            populate_requirements_cache=None,  # type: Optional[str]
+                           skip_boot_dependencies=False, # type: Optional[bool]

Review comment:
       Sounds good to me. The pickled main session is expected to be stored in semi persistent directory and I believe that is re-mounted at container launch time right now. Should we add another flag to boot.go to specify a separate path for prestaged picked main session directory?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] robertwb commented on a change in pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
robertwb commented on a change in pull request #12727:
URL: https://github.com/apache/beam/pull/12727#discussion_r492422441



##########
File path: sdks/python/apache_beam/runners/portability/stager.py
##########
@@ -119,6 +119,7 @@ def create_job_resources(options,  # type: PipelineOptions
                            temp_dir,  # type: str
                            build_setup_args=None,  # type: Optional[List[str]]
                            populate_requirements_cache=None,  # type: Optional[str]
+                           skip_boot_dependencies=False, # type: Optional[bool]

Review comment:
       Hmm... what we need to do is fix Dataflow to not be so weird. But probably not in this PR. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/5ef04e945fb1a3948d665af5d6b7f13b86487616?el=desc) will **decrease** coverage by `0.18%`.
   > The diff coverage is `52.68%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   - Coverage   82.36%   82.17%   -0.19%     
   ==========================================
     Files         451      452       +1     
     Lines       53753    54034     +281     
   ==========================================
   + Hits        44273    44402     +129     
   - Misses       9480     9632     +152     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `72.60% <0.00%> (ø)` | |
   | [...eam/testing/benchmarks/nexmark/nexmark\_launcher.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19sYXVuY2hlci5weQ==) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_perf.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19wZXJmLnB5) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_util.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya191dGlsLnB5) | `0.00% <0.00%> (ø)` | |
   | [...\_beam/runners/portability/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9wb3J0YWJpbGl0eS9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `31.78% <31.78%> (ø)` | |
   | [...on/apache\_beam/runners/dataflow/dataflow\_runner.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9kYXRhZmxvd19ydW5uZXIucHk=) | `77.03% <60.00%> (-0.15%)` | :arrow_down: |
   | [...dks/python/apache\_beam/options/pipeline\_options.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vb3B0aW9ucy9waXBlbGluZV9vcHRpb25zLnB5) | `94.98% <62.50%> (ø)` | |
   | [sdks/python/apache\_beam/transforms/environments.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdHJhbnNmb3Jtcy9lbnZpcm9ubWVudHMucHk=) | `83.49% <66.66%> (-0.33%)` | :arrow_down: |
   | [...beam/runners/interactive/background\_caching\_job.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9iYWNrZ3JvdW5kX2NhY2hpbmdfam9iLnB5) | `94.78% <90.90%> (ø)` | |
   | [sdks/python/apache\_beam/utils/histogram.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdXRpbHMvaGlzdG9ncmFtLnB5) | `94.28% <94.28%> (ø)` | |
   | ... and [68 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [68e7f2e...794808f](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/5ef04e945fb1a3948d665af5d6b7f13b86487616?el=desc) will **decrease** coverage by `0.19%`.
   > The diff coverage is `54.59%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   - Coverage   82.36%   82.16%   -0.20%     
   ==========================================
     Files         451      453       +2     
     Lines       53753    54009     +256     
   ==========================================
   + Hits        44273    44377     +104     
   - Misses       9480     9632     +152     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...eam/testing/benchmarks/nexmark/nexmark\_launcher.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19sYXVuY2hlci5weQ==) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_perf.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19wZXJmLnB5) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_util.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya191dGlsLnB5) | `0.00% <0.00%> (ø)` | |
   | [...s/dataflow/internal/sdk\_container\_cloud\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9zZGtfY29udGFpbmVyX2Nsb3VkX2J1aWxkZXIucHk=) | `34.14% <34.14%> (ø)` | |
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `72.02% <42.85%> (-0.58%)` | :arrow_down: |
   | [...\_beam/runners/portability/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9wb3J0YWJpbGl0eS9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `42.85% <42.85%> (ø)` | |
   | [...dks/python/apache\_beam/options/pipeline\_options.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vb3B0aW9ucy9waXBlbGluZV9vcHRpb25zLnB5) | `95.01% <70.00%> (+0.02%)` | :arrow_up: |
   | [...beam/runners/interactive/background\_caching\_job.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9iYWNrZ3JvdW5kX2NhY2hpbmdfam9iLnB5) | `94.78% <90.90%> (ø)` | |
   | [sdks/python/apache\_beam/utils/histogram.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdXRpbHMvaGlzdG9ncmFtLnB5) | `94.28% <94.28%> (ø)` | |
   | [...ache\_beam/runners/interactive/recording\_manager.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9yZWNvcmRpbmdfbWFuYWdlci5weQ==) | `98.05% <95.74%> (+5.19%)` | :arrow_up: |
   | ... and [62 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [68e7f2e...02419f3](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] tvalentyn commented on a change in pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
tvalentyn commented on a change in pull request #12727:
URL: https://github.com/apache/beam/pull/12727#discussion_r493136867



##########
File path: sdks/python/apache_beam/transforms/environments.py
##########
@@ -252,6 +254,13 @@ def from_runner_api_parameter(payload, capabilities, artifacts, context):
   @classmethod
   def from_options(cls, options):
     # type: (PipelineOptions) -> DockerEnvironment
+    if options.view_as(SetupOptions).prebuild_sdk_container_engine:
+      prebuilt_container_image = SdkContainerBuilder.build_container_image(
+          options)
+      return cls.from_container_image(
+          container_image=prebuilt_container_image,
+          artifacts=python_sdk_dependencies(
+              options, skip_boot_dependencies=True))

Review comment:
       I meant that `python_sdk_dependencies could` could evaluate whether `options` has `prebuild_sdk_container_engine` to evaluate what deps to return. Feel free to keep as is.  




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/5ef04e945fb1a3948d665af5d6b7f13b86487616?el=desc) will **decrease** coverage by `0.18%`.
   > The diff coverage is `52.56%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   - Coverage   82.36%   82.17%   -0.19%     
   ==========================================
     Files         451      455       +4     
     Lines       53753    54224     +471     
   ==========================================
   + Hits        44273    44560     +287     
   - Misses       9480     9664     +184     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `72.60% <0.00%> (ø)` | |
   | [...eam/testing/benchmarks/nexmark/nexmark\_launcher.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19sYXVuY2hlci5weQ==) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_perf.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19wZXJmLnB5) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_util.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya191dGlsLnB5) | `0.00% <0.00%> (ø)` | |
   | [...\_beam/runners/portability/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9wb3J0YWJpbGl0eS9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `31.37% <31.37%> (ø)` | |
   | [...ks/python/apache\_beam/runners/worker/sdk\_worker.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy93b3JrZXIvc2RrX3dvcmtlci5weQ==) | `88.80% <50.00%> (-0.36%)` | :arrow_down: |
   | [...on/apache\_beam/runners/dataflow/dataflow\_runner.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9kYXRhZmxvd19ydW5uZXIucHk=) | `77.06% <66.66%> (-0.12%)` | :arrow_down: |
   | [sdks/python/apache\_beam/transforms/environments.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdHJhbnNmb3Jtcy9lbnZpcm9ubWVudHMucHk=) | `83.49% <66.66%> (-0.33%)` | :arrow_down: |
   | [...dks/python/apache\_beam/options/pipeline\_options.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vb3B0aW9ucy9waXBlbGluZV9vcHRpb25zLnB5) | `95.01% <70.00%> (+0.02%)` | :arrow_up: |
   | [...beam/runners/interactive/background\_caching\_job.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9iYWNrZ3JvdW5kX2NhY2hpbmdfam9iLnB5) | `94.78% <90.90%> (ø)` | |
   | ... and [73 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [68e7f2e...1fe2d8d](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/5ef04e945fb1a3948d665af5d6b7f13b86487616?el=desc) will **decrease** coverage by `0.18%`.
   > The diff coverage is `52.68%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   - Coverage   82.36%   82.17%   -0.19%     
   ==========================================
     Files         451      452       +1     
     Lines       53753    54034     +281     
   ==========================================
   + Hits        44273    44403     +130     
   - Misses       9480     9631     +151     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `72.60% <0.00%> (ø)` | |
   | [...eam/testing/benchmarks/nexmark/nexmark\_launcher.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19sYXVuY2hlci5weQ==) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_perf.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19wZXJmLnB5) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_util.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya191dGlsLnB5) | `0.00% <0.00%> (ø)` | |
   | [...\_beam/runners/portability/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9wb3J0YWJpbGl0eS9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `31.78% <31.78%> (ø)` | |
   | [...on/apache\_beam/runners/dataflow/dataflow\_runner.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9kYXRhZmxvd19ydW5uZXIucHk=) | `77.03% <60.00%> (-0.15%)` | :arrow_down: |
   | [...dks/python/apache\_beam/options/pipeline\_options.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vb3B0aW9ucy9waXBlbGluZV9vcHRpb25zLnB5) | `94.98% <62.50%> (ø)` | |
   | [sdks/python/apache\_beam/transforms/environments.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdHJhbnNmb3Jtcy9lbnZpcm9ubWVudHMucHk=) | `83.49% <66.66%> (-0.33%)` | :arrow_down: |
   | [...beam/runners/interactive/background\_caching\_job.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9iYWNrZ3JvdW5kX2NhY2hpbmdfam9iLnB5) | `94.78% <90.90%> (ø)` | |
   | [sdks/python/apache\_beam/utils/histogram.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdXRpbHMvaGlzdG9ncmFtLnB5) | `94.28% <94.28%> (ø)` | |
   | ... and [70 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [68e7f2e...4f63252](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: Add option to prebuild python sdk container

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/a99c6826a067f49ebb60e625c8652900c7d0e810?el=desc) will **increase** coverage by `5.88%`.
   > The diff coverage is `33.80%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   + Coverage   34.32%   40.21%   +5.88%     
   ==========================================
     Files         694      455     -239     
     Lines       82226    53738   -28488     
     Branches     9294        0    -9294     
   ==========================================
   - Hits        28225    21610    -6615     
   + Misses      53578    32128   -21450     
   + Partials      423        0     -423     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `20.20% <28.57%> (ø)` | |
   | [...che\_beam/runners/dataflow/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `34.37% <34.37%> (ø)` | |
   | [runners/portability/artifact\_service\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9wb3J0YWJpbGl0eS9hcnRpZmFjdF9zZXJ2aWNlX3Rlc3QucHk=) | | |
   | [tools/microbenchmarks\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dG9vbHMvbWljcm9iZW5jaG1hcmtzX3Rlc3QucHk=) | | |
   | [internal/http\_client.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW50ZXJuYWwvaHR0cF9jbGllbnQucHk=) | | |
   | [...ers/dataflow/dataflow\_exercise\_metrics\_pipeline.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9kYXRhZmxvdy9kYXRhZmxvd19leGVyY2lzZV9tZXRyaWNzX3BpcGVsaW5lLnB5) | | |
   | [runners/dataflow/ptransform\_overrides.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9kYXRhZmxvdy9wdHJhbnNmb3JtX292ZXJyaWRlcy5weQ==) | | |
   | [transforms/create\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dHJhbnNmb3Jtcy9jcmVhdGVfdGVzdC5weQ==) | | |
   | [transforms/display\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dHJhbnNmb3Jtcy9kaXNwbGF5X3Rlc3QucHk=) | | |
   | [io/kafka.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8va2Fma2EucHk=) | | |
   | ... and [1141 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [a99c682...20c8398](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/5ef04e945fb1a3948d665af5d6b7f13b86487616?el=desc) will **decrease** coverage by `0.20%`.
   > The diff coverage is `52.86%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   - Coverage   82.36%   82.16%   -0.21%     
   ==========================================
     Files         451      452       +1     
     Lines       53753    54036     +283     
   ==========================================
   + Hits        44273    44397     +124     
   - Misses       9480     9639     +159     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `72.60% <0.00%> (ø)` | |
   | [...eam/testing/benchmarks/nexmark/nexmark\_launcher.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19sYXVuY2hlci5weQ==) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_perf.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19wZXJmLnB5) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_util.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya191dGlsLnB5) | `0.00% <0.00%> (ø)` | |
   | [...\_beam/runners/portability/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9wb3J0YWJpbGl0eS9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `32.23% <32.23%> (ø)` | |
   | [...on/apache\_beam/runners/dataflow/dataflow\_runner.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9kYXRhZmxvd19ydW5uZXIucHk=) | `77.03% <60.00%> (-0.15%)` | :arrow_down: |
   | [...dks/python/apache\_beam/options/pipeline\_options.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vb3B0aW9ucy9waXBlbGluZV9vcHRpb25zLnB5) | `95.00% <66.66%> (+0.01%)` | :arrow_up: |
   | [sdks/python/apache\_beam/transforms/environments.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdHJhbnNmb3Jtcy9lbnZpcm9ubWVudHMucHk=) | `83.49% <66.66%> (-0.33%)` | :arrow_down: |
   | [...beam/runners/interactive/background\_caching\_job.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9iYWNrZ3JvdW5kX2NhY2hpbmdfam9iLnB5) | `94.78% <90.90%> (ø)` | |
   | [sdks/python/apache\_beam/utils/histogram.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdXRpbHMvaGlzdG9ncmFtLnB5) | `94.28% <94.28%> (ø)` | |
   | ... and [66 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [68e7f2e...984c4e7](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] y1chi commented on a change in pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
y1chi commented on a change in pull request #12727:
URL: https://github.com/apache/beam/pull/12727#discussion_r492888461



##########
File path: sdks/python/apache_beam/runners/portability/sdk_container_builder.py
##########
@@ -0,0 +1,274 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+"""SdkContainerBuilder builds the portable SDK container with dependencies.
+
+It copies the right boot dependencies, namely: apache beam sdk, python packages
+from requirements.txt, python packages from extra_packages.txt, workflow
+tarball, into the latest public python sdk container image, and run the
+dependencies installation in advance with the boot program in setup only mode
+to build the new image.
+"""
+
+from __future__ import absolute_import
+
+import json
+import logging
+import os
+import shutil
+import subprocess
+import sys
+import tarfile
+import tempfile
+import time
+import uuid
+
+from google.protobuf.duration_pb2 import Duration
+from google.protobuf.json_format import MessageToJson
+
+from apache_beam.internal.gcp.auth import get_service_credentials
+from apache_beam.internal.http_client import get_new_http
+from apache_beam.io.gcp.internal.clients import storage
+from apache_beam.options.pipeline_options import GoogleCloudOptions
+from apache_beam.options.pipeline_options import PipelineOptions  # pylint: disable=unused-import
+from apache_beam.options.pipeline_options import SetupOptions
+from apache_beam.portability import common_urns
+from apache_beam.portability.api import beam_runner_api_pb2
+from apache_beam.runners.portability.stager import Stager
+
+ARTIFACTS_CONTAINER_DIR = '/opt/apache/beam/artifacts'
+ARTIFACTS_MANIFEST_FILE = 'artifacts_info.json'
+SDK_CONTAINER_ENTRYPOINT = '/opt/apache/beam/boot'
+DOCKERFILE_TEMPLATE = (
+    """FROM apache/beam_python{major}.{minor}_sdk:latest
+RUN mkdir -p {workdir}
+COPY ./* {workdir}/
+RUN {entrypoint} --setup_only --artifacts {workdir}/{manifest_file}
+""")
+
+SOURCE_FOLDER = 'source'
+_LOGGER = logging.getLogger(__name__)
+
+
+class SdkContainerBuilder(object):
+  def __init__(self, options):
+    self._options = options
+    self._temp_src_dir = tempfile.mkdtemp()

Review comment:
       done.

##########
File path: sdks/python/apache_beam/runners/portability/sdk_container_builder.py
##########
@@ -0,0 +1,274 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+"""SdkContainerBuilder builds the portable SDK container with dependencies.
+
+It copies the right boot dependencies, namely: apache beam sdk, python packages
+from requirements.txt, python packages from extra_packages.txt, workflow
+tarball, into the latest public python sdk container image, and run the
+dependencies installation in advance with the boot program in setup only mode
+to build the new image.
+"""
+
+from __future__ import absolute_import
+
+import json
+import logging
+import os
+import shutil
+import subprocess
+import sys
+import tarfile
+import tempfile
+import time
+import uuid
+
+from google.protobuf.duration_pb2 import Duration
+from google.protobuf.json_format import MessageToJson
+
+from apache_beam.internal.gcp.auth import get_service_credentials
+from apache_beam.internal.http_client import get_new_http
+from apache_beam.io.gcp.internal.clients import storage
+from apache_beam.options.pipeline_options import GoogleCloudOptions
+from apache_beam.options.pipeline_options import PipelineOptions  # pylint: disable=unused-import
+from apache_beam.options.pipeline_options import SetupOptions
+from apache_beam.portability import common_urns
+from apache_beam.portability.api import beam_runner_api_pb2
+from apache_beam.runners.portability.stager import Stager
+
+ARTIFACTS_CONTAINER_DIR = '/opt/apache/beam/artifacts'
+ARTIFACTS_MANIFEST_FILE = 'artifacts_info.json'
+SDK_CONTAINER_ENTRYPOINT = '/opt/apache/beam/boot'
+DOCKERFILE_TEMPLATE = (
+    """FROM apache/beam_python{major}.{minor}_sdk:latest
+RUN mkdir -p {workdir}
+COPY ./* {workdir}/
+RUN {entrypoint} --setup_only --artifacts {workdir}/{manifest_file}
+""")
+
+SOURCE_FOLDER = 'source'
+_LOGGER = logging.getLogger(__name__)
+
+
+class SdkContainerBuilder(object):
+  def __init__(self, options):
+    self._options = options
+    self._temp_src_dir = tempfile.mkdtemp()
+    self._docker_registry_push_url = self._options.view_as(
+        SetupOptions).docker_registry_push_url
+
+  def build(self):
+    container_id = str(uuid.uuid4())
+    container_tag = os.path.join(
+        self._docker_registry_push_url or '',
+        'beam_python_prebuilt_sdk:%s' % container_id)
+    self.prepare_dependencies()
+    self.invoke_docker_build_and_push(container_id, container_tag)
+
+    return container_tag
+
+  def prepare_dependencies(self):
+    tmp = tempfile.mkdtemp()

Review comment:
       done.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/5ef04e945fb1a3948d665af5d6b7f13b86487616?el=desc) will **decrease** coverage by `0.19%`.
   > The diff coverage is `54.59%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   - Coverage   82.36%   82.16%   -0.20%     
   ==========================================
     Files         451      453       +2     
     Lines       53753    54009     +256     
   ==========================================
   + Hits        44273    44377     +104     
   - Misses       9480     9632     +152     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...eam/testing/benchmarks/nexmark/nexmark\_launcher.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19sYXVuY2hlci5weQ==) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_perf.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19wZXJmLnB5) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_util.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya191dGlsLnB5) | `0.00% <0.00%> (ø)` | |
   | [...s/dataflow/internal/sdk\_container\_cloud\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9zZGtfY29udGFpbmVyX2Nsb3VkX2J1aWxkZXIucHk=) | `34.14% <34.14%> (ø)` | |
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `72.02% <42.85%> (-0.58%)` | :arrow_down: |
   | [...\_beam/runners/portability/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9wb3J0YWJpbGl0eS9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `42.85% <42.85%> (ø)` | |
   | [...dks/python/apache\_beam/options/pipeline\_options.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vb3B0aW9ucy9waXBlbGluZV9vcHRpb25zLnB5) | `95.01% <70.00%> (+0.02%)` | :arrow_up: |
   | [...beam/runners/interactive/background\_caching\_job.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9iYWNrZ3JvdW5kX2NhY2hpbmdfam9iLnB5) | `94.78% <90.90%> (ø)` | |
   | [sdks/python/apache\_beam/utils/histogram.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdXRpbHMvaGlzdG9ncmFtLnB5) | `94.28% <94.28%> (ø)` | |
   | [...ache\_beam/runners/interactive/recording\_manager.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9yZWNvcmRpbmdfbWFuYWdlci5weQ==) | `98.05% <95.74%> (+5.19%)` | :arrow_up: |
   | ... and [62 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [68e7f2e...02419f3](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/5ef04e945fb1a3948d665af5d6b7f13b86487616?el=desc) will **decrease** coverage by `0.18%`.
   > The diff coverage is `52.56%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   - Coverage   82.36%   82.17%   -0.19%     
   ==========================================
     Files         451      455       +4     
     Lines       53753    54224     +471     
   ==========================================
   + Hits        44273    44560     +287     
   - Misses       9480     9664     +184     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `72.60% <0.00%> (ø)` | |
   | [...eam/testing/benchmarks/nexmark/nexmark\_launcher.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19sYXVuY2hlci5weQ==) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_perf.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19wZXJmLnB5) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_util.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya191dGlsLnB5) | `0.00% <0.00%> (ø)` | |
   | [...\_beam/runners/portability/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9wb3J0YWJpbGl0eS9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `31.37% <31.37%> (ø)` | |
   | [...ks/python/apache\_beam/runners/worker/sdk\_worker.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy93b3JrZXIvc2RrX3dvcmtlci5weQ==) | `88.80% <50.00%> (-0.36%)` | :arrow_down: |
   | [...on/apache\_beam/runners/dataflow/dataflow\_runner.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9kYXRhZmxvd19ydW5uZXIucHk=) | `77.06% <66.66%> (-0.12%)` | :arrow_down: |
   | [sdks/python/apache\_beam/transforms/environments.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdHJhbnNmb3Jtcy9lbnZpcm9ubWVudHMucHk=) | `83.49% <66.66%> (-0.33%)` | :arrow_down: |
   | [...dks/python/apache\_beam/options/pipeline\_options.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vb3B0aW9ucy9waXBlbGluZV9vcHRpb25zLnB5) | `95.01% <70.00%> (+0.02%)` | :arrow_up: |
   | [...beam/runners/interactive/background\_caching\_job.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9iYWNrZ3JvdW5kX2NhY2hpbmdfam9iLnB5) | `94.78% <90.90%> (ø)` | |
   | ... and [73 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [68e7f2e...f8790bf](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: Add option to prebuild python sdk container

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/a99c6826a067f49ebb60e625c8652900c7d0e810?el=desc) will **increase** coverage by `5.88%`.
   > The diff coverage is `33.80%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   + Coverage   34.32%   40.21%   +5.88%     
   ==========================================
     Files         694      455     -239     
     Lines       82226    53738   -28488     
     Branches     9294        0    -9294     
   ==========================================
   - Hits        28225    21610    -6615     
   + Misses      53578    32128   -21450     
   + Partials      423        0     -423     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `20.20% <28.57%> (ø)` | |
   | [...che\_beam/runners/dataflow/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `34.37% <34.37%> (ø)` | |
   | [transforms/ptransform\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dHJhbnNmb3Jtcy9wdHJhbnNmb3JtX3Rlc3QucHk=) | | |
   | [...ers/dataflow/dataflow\_exercise\_metrics\_pipeline.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9kYXRhZmxvdy9kYXRhZmxvd19leGVyY2lzZV9tZXRyaWNzX3BpcGVsaW5lLnB5) | | |
   | [utils/retry.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-dXRpbHMvcmV0cnkucHk=) | | |
   | [runners/interactive/cache\_manager\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-cnVubmVycy9pbnRlcmFjdGl2ZS9jYWNoZV9tYW5hZ2VyX3Rlc3QucHk=) | | |
   | [examples/complete/game/hourly\_team\_score.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZXhhbXBsZXMvY29tcGxldGUvZ2FtZS9ob3VybHlfdGVhbV9zY29yZS5weQ==) | | |
   | [io/gcp/tests/pubsub\_matcher.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-aW8vZ2NwL3Rlc3RzL3B1YnN1Yl9tYXRjaGVyLnB5) | | |
   | [metrics/execution\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-bWV0cmljcy9leGVjdXRpb25fdGVzdC5weQ==) | | |
   | [...s/snippets/transforms/elementwise/tostring\_test.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-ZXhhbXBsZXMvc25pcHBldHMvdHJhbnNmb3Jtcy9lbGVtZW50d2lzZS90b3N0cmluZ190ZXN0LnB5) | | |
   | ... and [1141 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [a99c682...e747445](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] y1chi commented on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
y1chi commented on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-697023719


   @aaltay @ananvay test added, PTAL.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] tvalentyn commented on a change in pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
tvalentyn commented on a change in pull request #12727:
URL: https://github.com/apache/beam/pull/12727#discussion_r492430139



##########
File path: sdks/python/apache_beam/runners/dataflow/dataflow_runner.py
##########
@@ -473,10 +473,16 @@ def run_pipeline(self, pipeline, options):
 
     use_fnapi = apiclient._use_fnapi(options)
     from apache_beam.transforms import environments
-    self._default_environment = (
-        environments.DockerEnvironment.from_container_image(
-            apiclient.get_container_image_from_options(options),
-            artifacts=environments.python_sdk_dependencies(options)))
+    if options.view_as(SetupOptions).prebuild_sdk_container_engine:

Review comment:
       I don't fully follow why we need this branch - could you add a comment?

##########
File path: sdks/python/apache_beam/runners/portability/sdk_container_builder.py
##########
@@ -0,0 +1,274 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+"""SdkContainerBuilder builds the portable SDK container with dependencies.
+
+It copies the right boot dependencies, namely: apache beam sdk, python packages
+from requirements.txt, python packages from extra_packages.txt, workflow
+tarball, into the latest public python sdk container image, and run the
+dependencies installation in advance with the boot program in setup only mode
+to build the new image.
+"""
+
+from __future__ import absolute_import
+
+import json
+import logging
+import os
+import shutil
+import subprocess
+import sys
+import tarfile
+import tempfile
+import time
+import uuid
+
+from google.protobuf.duration_pb2 import Duration
+from google.protobuf.json_format import MessageToJson
+
+from apache_beam.internal.gcp.auth import get_service_credentials
+from apache_beam.internal.http_client import get_new_http
+from apache_beam.io.gcp.internal.clients import storage
+from apache_beam.options.pipeline_options import GoogleCloudOptions
+from apache_beam.options.pipeline_options import PipelineOptions  # pylint: disable=unused-import
+from apache_beam.options.pipeline_options import SetupOptions
+from apache_beam.portability import common_urns
+from apache_beam.portability.api import beam_runner_api_pb2
+from apache_beam.runners.portability.stager import Stager
+
+ARTIFACTS_CONTAINER_DIR = '/opt/apache/beam/artifacts'
+ARTIFACTS_MANIFEST_FILE = 'artifacts_info.json'
+SDK_CONTAINER_ENTRYPOINT = '/opt/apache/beam/boot'
+DOCKERFILE_TEMPLATE = (
+    """FROM apache/beam_python{major}.{minor}_sdk:latest
+RUN mkdir -p {workdir}
+COPY ./* {workdir}/
+RUN {entrypoint} --setup_only --artifacts {workdir}/{manifest_file}
+""")
+
+SOURCE_FOLDER = 'source'
+_LOGGER = logging.getLogger(__name__)
+
+
+class SdkContainerBuilder(object):
+  def __init__(self, options):
+    self._options = options
+    self._temp_src_dir = tempfile.mkdtemp()
+    self._docker_registry_push_url = self._options.view_as(
+        SetupOptions).docker_registry_push_url
+
+  def build(self):

Review comment:
       The terminology is a bit confusing here.
   
   - Container ID is typically an ID of a running container (see output of `docker ps -a`).
   - We tend to confuse container _images_ and containers (running/stopped instances of an image).
   - Image Tag is the last part of the image name after colon (`/repo/name:tag`), see https://docs.docker.com/engine/reference/commandline/tag/.
   
   Please use the variable names  consistently with Docker terminology.  
   

##########
File path: sdks/python/apache_beam/options/pipeline_options.py
##########
@@ -1003,6 +1003,13 @@ def _add_argparse_args(cls, parser):
             'environment. Choose the docker build engine of local docker '
             'environment or google cloud build by passing the option '
             'local_docker or cloud_build.'))
+    parser.add_argument(
+        '--prebuild_sdk_container_base_image',
+        default=None,
+        help=(
+            'The base image to use when pre-building the sdk container image '
+            'with dependencies, if not specified, the latest public '

Review comment:
       I think for released SDKs, we should use the version that corresponds to the SDK version (`apache_beam.version.__version__`) 

##########
File path: sdks/python/apache_beam/runners/portability/sdk_container_builder.py
##########
@@ -0,0 +1,279 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+"""SdkContainerBuilder builds the portable SDK container with dependencies.
+
+It copies the right boot dependencies, namely: apache beam sdk, python packages
+from requirements.txt, python packages from extra_packages.txt, workflow
+tarball, into the latest public python sdk container image, and run the
+dependencies installation in advance with the boot program in setup only mode
+to build the new image.
+"""
+
+from __future__ import absolute_import
+
+import json
+import logging
+import os
+import shutil
+import subprocess
+import sys
+import tarfile
+import tempfile
+import time
+import uuid
+
+from google.protobuf.duration_pb2 import Duration
+from google.protobuf.json_format import MessageToJson
+
+from apache_beam.internal.gcp.auth import get_service_credentials
+from apache_beam.internal.http_client import get_new_http
+from apache_beam.io.gcp.internal.clients import storage
+from apache_beam.options.pipeline_options import GoogleCloudOptions
+from apache_beam.options.pipeline_options import PipelineOptions  # pylint: disable=unused-import
+from apache_beam.options.pipeline_options import SetupOptions
+from apache_beam.portability import common_urns
+from apache_beam.portability.api import beam_runner_api_pb2
+from apache_beam.runners.portability.stager import Stager
+
+ARTIFACTS_CONTAINER_DIR = '/opt/apache/beam/artifacts'
+ARTIFACTS_MANIFEST_FILE = 'artifacts_info.json'
+SDK_CONTAINER_ENTRYPOINT = '/opt/apache/beam/boot'
+DOCKERFILE_TEMPLATE = (
+    """FROM {base_image}
+RUN mkdir -p {workdir}
+COPY ./* {workdir}/
+RUN {entrypoint} --setup_only --artifacts {workdir}/{manifest_file}
+""")
+
+SOURCE_FOLDER = 'source'
+_LOGGER = logging.getLogger(__name__)
+
+
+class SdkContainerBuilder(object):
+  def __init__(self, options):
+    self._options = options
+    self._docker_registry_push_url = self._options.view_as(
+        SetupOptions).docker_registry_push_url
+    self._base_image = (
+        self._options.view_as(SetupOptions).prebuild_sdk_container_base_image or
+        'apache/beam_python%s.%s_sdk:latest' %
+        (sys.version_info[0], sys.version_info[1]))
+    self._temp_src_dir = None
+
+  def build(self):
+    container_id = str(uuid.uuid4())
+    container_tag = os.path.join(
+        self._docker_registry_push_url or '',
+        'beam_python_prebuilt_sdk:%s' % container_id)
+    with tempfile.TemporaryDirectory() as temp_folder:
+      self._temp_src_dir = temp_folder
+      self.prepare_dependencies()
+      self.invoke_docker_build_and_push(container_id, container_tag)
+
+    return container_tag
+
+  def prepare_dependencies(self):
+    with tempfile.TemporaryDirectory() as tmp:
+      resources = Stager.create_job_resources(self._options, tmp)
+      # make a copy of the staged artifacts into the temp source folder.
+      for path, name in resources:
+        shutil.copyfile(path, os.path.join(self._temp_src_dir, name))
+      with open(os.path.join(self._temp_src_dir, 'Dockerfile'), 'w') as file:
+        file.write(
+            DOCKERFILE_TEMPLATE.format(
+                base_image=self._base_image,
+                workdir=ARTIFACTS_CONTAINER_DIR,
+                manifest_file=ARTIFACTS_MANIFEST_FILE,
+                entrypoint=SDK_CONTAINER_ENTRYPOINT))
+      self.generate_artifacts_manifests_json_file(resources, self._temp_src_dir)
+
+  def invoke_docker_build_and_push(self, container_id, container_tag):
+    raise NotImplementedError
+
+  @staticmethod
+  def generate_artifacts_manifests_json_file(resources, temp_dir):
+    infos = []
+    for _, name in resources:
+      info = beam_runner_api_pb2.ArtifactInformation(
+          type_urn=common_urns.StandardArtifacts.Types.FILE.urn,
+          type_payload=beam_runner_api_pb2.ArtifactFilePayload(
+              path=name).SerializeToString(),
+      )
+      infos.append(json.dumps(MessageToJson(info)))
+    with open(os.path.join(temp_dir, ARTIFACTS_MANIFEST_FILE), 'w') as file:
+      file.write('[\n' + ',\n'.join(infos) + '\n]')
+
+  @classmethod
+  def build_container_image(cls, pipeline_options):
+    # type: (PipelineOptions) -> str
+    setup_options = pipeline_options.view_as(SetupOptions)
+    container_build_engine = setup_options.prebuild_sdk_container_engine
+    if container_build_engine:
+      if container_build_engine == 'local_docker':
+        builder = _SdkContainerLocalBuilder(
+            pipeline_options)  # type: SdkContainerBuilder
+      elif container_build_engine == 'cloud_build':
+        builder = _SdkContainerCloudBuilder(pipeline_options)
+      else:
+        raise ValueError(
+            'Only (--prebuild_sdk_container_engine local_docker) and '
+            '(--prebuild_sdk_container_engine cloud_build) are supported')
+    else:
+      raise ValueError('No --prebuild_sdk_container_engine option specified.')
+    return builder.build()
+
+
+class _SdkContainerLocalBuilder(SdkContainerBuilder):
+  """SdkContainerLocalBuilder builds the sdk container image with local
+  docker."""
+  def invoke_docker_build_and_push(self, container_id, container_tag):
+    try:
+      _LOGGER.info("Building sdk container, this may take a few minutes...")
+      now = time.time()
+      subprocess.run(['docker', 'build', '.', '-t', container_tag],
+                     capture_output=True,
+                     check=True,
+                     cwd=self._temp_src_dir)
+    except subprocess.CalledProcessError as err:
+      raise RuntimeError(
+          'Failed to build sdk container with local docker, '
+          'stderr:\n %s.' % err.stderr)
+    else:
+      _LOGGER.info(
+          "Successfully built %s in %.2f seconds" %
+          (container_tag, time.time() - now))
+
+    if self._docker_registry_push_url:
+      _LOGGER.info("Pushing prebuilt sdk container...")
+      try:
+        subprocess.run(['docker', 'push', container_tag],
+                       capture_output=True,
+                       check=True)
+      except subprocess.CalledProcessError as err:
+        raise RuntimeError(
+            'Failed to push prebuilt sdk container %s, stderr: \n%s' %
+            (container_tag, err.stderr))
+      _LOGGER.info(
+          "Successfully pushed %s in %.2f seconds" %
+          (container_tag, time.time() - now))
+    else:
+      _LOGGER.info(
+          "no --docker_registry_push_url option is specified in pipeline "
+          "options, specify it if the new image is intended to be "
+          "pushed to a registry.")
+
+
+class _SdkContainerCloudBuilder(SdkContainerBuilder):
+  """SdkContainerLocalBuilder builds the sdk container image with google cloud
+  build."""
+  def __init__(self, options):
+    super().__init__(options)
+    self._google_cloud_options = options.view_as(GoogleCloudOptions)
+    if self._google_cloud_options.no_auth:
+      credentials = None
+    else:
+      credentials = get_service_credentials()
+    self._storage_client = storage.StorageV1(
+        url='https://www.googleapis.com/storage/v1',
+        credentials=credentials,
+        get_credentials=(not self._google_cloud_options.no_auth),
+        http=get_new_http(),
+        response_encoding='utf8')
+    if not self._docker_registry_push_url:
+      self._docker_registry_push_url = (
+          'gcr.io/%s' % self._google_cloud_options.project)
+
+  def invoke_docker_build_and_push(self, container_id, container_tag):
+    project_id = self._google_cloud_options.project
+    temp_location = self._google_cloud_options.temp_location
+    # google cloud build service expects all the build source file to be
+    # compressed into a tarball.
+    tarball_path = os.path.join(self._temp_src_dir, '%s.tgz' % SOURCE_FOLDER)
+    self._make_tarfile(tarball_path, self._temp_src_dir)
+    _LOGGER.info(
+        "Compressed source files for building sdk container at %s" %
+        tarball_path)
+
+    gcs_location = os.path.join(
+        temp_location, '%s-%s.tgz' % (SOURCE_FOLDER, container_id))
+    self._upload_to_gcs(tarball_path, gcs_location)
+
+    from google.cloud.devtools import cloudbuild_v1
+    client = cloudbuild_v1.CloudBuildClient()
+    build = cloudbuild_v1.Build()
+    build.steps = []
+    step = cloudbuild_v1.BuildStep()
+    step.name = 'gcr.io/cloud-builders/docker'
+    step.args = ['build', '-t', container_tag, '.']
+    step.dir = SOURCE_FOLDER
+
+    build.steps.append(step)
+    build.images = [container_tag]
+
+    source = cloudbuild_v1.Source()
+    source.storage_source = cloudbuild_v1.StorageSource()
+    gcs_bucket, gcs_object = self._get_gcs_bucket_and_name(gcs_location)
+    source.storage_source.bucket = os.path.join(gcs_bucket)
+    source.storage_source.object = gcs_object
+    build.source = source
+    # TODO(zyichi): make timeout configurable
+    build.timeout = Duration().FromSeconds(seconds=1800)
+
+    now = time.time()
+    _LOGGER.info('Building sdk container, this may take a few minutes...')
+    operation = client.create_build(project_id=project_id, build=build)
+    # if build fails exception will be raised and stops the job submission.

Review comment:
       Can we consider retrying some small number of times? Can be done earlier in the call stack for both engines.

##########
File path: sdks/python/apache_beam/options/pipeline_options.py
##########
@@ -994,6 +994,21 @@ def _add_argparse_args(cls, parser):
             'staged in the staging area (--staging_location option) and the '
             'workers will install them in same order they were specified on '
             'the command line.'))
+    parser.add_argument(
+        '--prebuild_sdk_container_engine',
+        choices=['local_docker', 'cloud_build'],
+        help=(
+            'Pre-builds the sdk worker container image with boot dependencies '

Review comment:
       Wording suggestion: `Prebuild sdk worker container image before job submission. If enabled, SDK invokes the  boot sequence in SDK worker containers to install all pipeline dependencies in the container, and uses the prebuilt image in the pipeline environment. This may speed up pipeline execution. To enable, select  the Docker build engine: local_docker using locally-installed Docker or cloud_build for using  Google Cloud Build.`

##########
File path: sdks/python/apache_beam/examples/wordcount_it_test.py
##########
@@ -56,6 +57,17 @@ def test_wordcount_it(self):
   def test_wordcount_fnapi_it(self):
     self._run_wordcount_it(wordcount.run, experiment='beam_fn_api')
 
+  @attr('ValidatesContainer')
+  def test_wordcount_it_with_prebuilt_sdk_container(self):
+    if sys.version_info[0] < 3:

Review comment:
       We no longer run Py2 tests.

##########
File path: sdks/python/apache_beam/runners/portability/sdk_container_builder.py
##########
@@ -0,0 +1,279 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+"""SdkContainerBuilder builds the portable SDK container with dependencies.
+
+It copies the right boot dependencies, namely: apache beam sdk, python packages
+from requirements.txt, python packages from extra_packages.txt, workflow
+tarball, into the latest public python sdk container image, and run the
+dependencies installation in advance with the boot program in setup only mode
+to build the new image.
+"""
+
+from __future__ import absolute_import
+
+import json
+import logging
+import os
+import shutil
+import subprocess
+import sys
+import tarfile
+import tempfile
+import time
+import uuid
+
+from google.protobuf.duration_pb2 import Duration
+from google.protobuf.json_format import MessageToJson
+
+from apache_beam.internal.gcp.auth import get_service_credentials
+from apache_beam.internal.http_client import get_new_http
+from apache_beam.io.gcp.internal.clients import storage
+from apache_beam.options.pipeline_options import GoogleCloudOptions
+from apache_beam.options.pipeline_options import PipelineOptions  # pylint: disable=unused-import
+from apache_beam.options.pipeline_options import SetupOptions
+from apache_beam.portability import common_urns
+from apache_beam.portability.api import beam_runner_api_pb2
+from apache_beam.runners.portability.stager import Stager
+
+ARTIFACTS_CONTAINER_DIR = '/opt/apache/beam/artifacts'
+ARTIFACTS_MANIFEST_FILE = 'artifacts_info.json'
+SDK_CONTAINER_ENTRYPOINT = '/opt/apache/beam/boot'
+DOCKERFILE_TEMPLATE = (
+    """FROM {base_image}
+RUN mkdir -p {workdir}
+COPY ./* {workdir}/
+RUN {entrypoint} --setup_only --artifacts {workdir}/{manifest_file}
+""")
+
+SOURCE_FOLDER = 'source'
+_LOGGER = logging.getLogger(__name__)
+
+
+class SdkContainerBuilder(object):
+  def __init__(self, options):
+    self._options = options
+    self._docker_registry_push_url = self._options.view_as(
+        SetupOptions).docker_registry_push_url
+    self._base_image = (
+        self._options.view_as(SetupOptions).prebuild_sdk_container_base_image or
+        'apache/beam_python%s.%s_sdk:latest' %
+        (sys.version_info[0], sys.version_info[1]))
+    self._temp_src_dir = None
+
+  def build(self):
+    container_id = str(uuid.uuid4())
+    container_tag = os.path.join(
+        self._docker_registry_push_url or '',
+        'beam_python_prebuilt_sdk:%s' % container_id)
+    with tempfile.TemporaryDirectory() as temp_folder:
+      self._temp_src_dir = temp_folder
+      self.prepare_dependencies()
+      self.invoke_docker_build_and_push(container_id, container_tag)
+
+    return container_tag
+
+  def prepare_dependencies(self):
+    with tempfile.TemporaryDirectory() as tmp:
+      resources = Stager.create_job_resources(self._options, tmp)
+      # make a copy of the staged artifacts into the temp source folder.
+      for path, name in resources:
+        shutil.copyfile(path, os.path.join(self._temp_src_dir, name))
+      with open(os.path.join(self._temp_src_dir, 'Dockerfile'), 'w') as file:
+        file.write(
+            DOCKERFILE_TEMPLATE.format(
+                base_image=self._base_image,
+                workdir=ARTIFACTS_CONTAINER_DIR,
+                manifest_file=ARTIFACTS_MANIFEST_FILE,
+                entrypoint=SDK_CONTAINER_ENTRYPOINT))
+      self.generate_artifacts_manifests_json_file(resources, self._temp_src_dir)
+
+  def invoke_docker_build_and_push(self, container_id, container_tag):
+    raise NotImplementedError
+
+  @staticmethod
+  def generate_artifacts_manifests_json_file(resources, temp_dir):
+    infos = []
+    for _, name in resources:
+      info = beam_runner_api_pb2.ArtifactInformation(
+          type_urn=common_urns.StandardArtifacts.Types.FILE.urn,
+          type_payload=beam_runner_api_pb2.ArtifactFilePayload(
+              path=name).SerializeToString(),
+      )
+      infos.append(json.dumps(MessageToJson(info)))
+    with open(os.path.join(temp_dir, ARTIFACTS_MANIFEST_FILE), 'w') as file:
+      file.write('[\n' + ',\n'.join(infos) + '\n]')
+
+  @classmethod
+  def build_container_image(cls, pipeline_options):
+    # type: (PipelineOptions) -> str

Review comment:
       nit: You can use typehints too now that we use Py3 only.

##########
File path: sdks/python/apache_beam/transforms/environments.py
##########
@@ -252,6 +254,13 @@ def from_runner_api_parameter(payload, capabilities, artifacts, context):
   @classmethod
   def from_options(cls, options):
     # type: (PipelineOptions) -> DockerEnvironment
+    if options.view_as(SetupOptions).prebuild_sdk_container_engine:
+      prebuilt_container_image = SdkContainerBuilder.build_container_image(
+          options)
+      return cls.from_container_image(
+          container_image=prebuilt_container_image,
+          artifacts=python_sdk_dependencies(
+              options, skip_boot_dependencies=True))

Review comment:
       Does `python_sdk_dependencies()` need `skip_boot_dependencies argument` given that it accepts `options` ?

##########
File path: sdks/python/apache_beam/runners/portability/stager.py
##########
@@ -136,6 +137,8 @@ def create_job_resources(options,  # type: PipelineOptions
             only for testing.
           populate_requirements_cache: Callable for populating the requirements
             cache. Used only for testing.
+          skip_boot_dependencies: Skip apache beam sdk, requirements, extra
+            packages, workflow tarball installs by sdk boot program.

Review comment:
       This seems confusing since stager and boot program in SDK containers are different entities.
   
   How about `skip_prestaged_dependencies: Skip staging dependencies that can be added into SDK containers during prebuilding`.

##########
File path: sdks/python/apache_beam/runners/portability/sdk_container_builder.py
##########
@@ -69,6 +69,10 @@ def __init__(self, options):
     self._options = options
     self._docker_registry_push_url = self._options.view_as(
         SetupOptions).docker_registry_push_url
+    self._base_image = (
+        self._options.view_as(SetupOptions).prebuild_sdk_container_base_image or

Review comment:
       I think for released SDKs, we should use the version that corresponds to the SDK version (`apache_beam.version.__version__`)
   
   

##########
File path: sdks/python/container/boot.go
##########
@@ -203,15 +223,9 @@ func setupAcceptableWheelSpecs() error {
 }
 
 // installSetupPackages installs Beam SDK and user dependencies.
-func installSetupPackages(mds []*jobpb.ArtifactMetadata, workDir string) error {
+func installSetupPackages(files []string, workDir string) error {

Review comment:
       Let's move evaluation of correct wheel files (a call to `setupAcceptableWheelSpecs`) inside this method now that we call `installSetupPackages` in two places.

##########
File path: sdks/python/container/boot.go
##########
@@ -30,18 +32,21 @@ import (
 	"time"
 
 	"github.com/apache/beam/sdks/go/pkg/beam/artifact"
-	jobpb "github.com/apache/beam/sdks/go/pkg/beam/model/jobmanagement_v1"
 	pipepb "github.com/apache/beam/sdks/go/pkg/beam/model/pipeline_v1"
 	"github.com/apache/beam/sdks/go/pkg/beam/provision"
 	"github.com/apache/beam/sdks/go/pkg/beam/util/execx"
 	"github.com/apache/beam/sdks/go/pkg/beam/util/grpcx"
+	"github.com/golang/protobuf/jsonpb"
 	"github.com/golang/protobuf/proto"
 	"github.com/nightlyone/lockfile"
 )
 
 var (
 	acceptableWhlSpecs []string
 
+	setupOnly = flag.Bool("setup_only", false, "Execute boot program in setup only mode (optional).")

Review comment:
       Please add explanation of setup_only mode here for people who will be reading boot.go and are not familiar with this change.

##########
File path: sdks/python/apache_beam/runners/portability/stager.py
##########
@@ -119,6 +119,7 @@ def create_job_resources(options,  # type: PipelineOptions
                            temp_dir,  # type: str
                            build_setup_args=None,  # type: Optional[List[str]]
                            populate_requirements_cache=None,  # type: Optional[str]
+                           skip_boot_dependencies=False, # type: Optional[bool]

Review comment:
       You could consider having one 
   ```
   if not skip_boot_dependencies:
     ...
   ```
   and add a comment/TODO to explain why other dependencies currently cannot be included in this if.

##########
File path: sdks/python/apache_beam/options/pipeline_options.py
##########
@@ -994,6 +994,21 @@ def _add_argparse_args(cls, parser):
             'staged in the staging area (--staging_location option) and the '
             'workers will install them in same order they were specified on '
             'the command line.'))
+    parser.add_argument(
+        '--prebuild_sdk_container_engine',
+        choices=['local_docker', 'cloud_build'],
+        help=(
+            'Pre-builds the sdk worker container image with boot dependencies '

Review comment:
       or: `...for using  Google Cloud Build (requires a GCP project with Cloud Build API enabled).`

##########
File path: sdks/python/apache_beam/options/pipeline_options.py
##########
@@ -1003,6 +1003,13 @@ def _add_argparse_args(cls, parser):
             'environment. Choose the docker build engine of local docker '
             'environment or google cloud build by passing the option '
             'local_docker or cloud_build.'))
+    parser.add_argument(
+        '--prebuild_sdk_container_base_image',
+        default=None,
+        help=(
+            'The base image to use when pre-building the sdk container image '
+            'with dependencies, if not specified, the latest public '

Review comment:
       It may be incompatible when breaking changes happen. We could require that for dev sdks users must provide an image (could be 'nightly' if/when we build those, or built from Dockerfile). 

##########
File path: sdks/python/apache_beam/runners/portability/sdk_container_builder.py
##########
@@ -0,0 +1,279 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+"""SdkContainerBuilder builds the portable SDK container with dependencies.
+
+It copies the right boot dependencies, namely: apache beam sdk, python packages
+from requirements.txt, python packages from extra_packages.txt, workflow
+tarball, into the latest public python sdk container image, and run the
+dependencies installation in advance with the boot program in setup only mode
+to build the new image.
+"""
+
+from __future__ import absolute_import
+
+import json
+import logging
+import os
+import shutil
+import subprocess
+import sys
+import tarfile
+import tempfile
+import time
+import uuid
+
+from google.protobuf.duration_pb2 import Duration
+from google.protobuf.json_format import MessageToJson
+
+from apache_beam.internal.gcp.auth import get_service_credentials
+from apache_beam.internal.http_client import get_new_http
+from apache_beam.io.gcp.internal.clients import storage
+from apache_beam.options.pipeline_options import GoogleCloudOptions
+from apache_beam.options.pipeline_options import PipelineOptions  # pylint: disable=unused-import
+from apache_beam.options.pipeline_options import SetupOptions
+from apache_beam.portability import common_urns
+from apache_beam.portability.api import beam_runner_api_pb2
+from apache_beam.runners.portability.stager import Stager
+
+ARTIFACTS_CONTAINER_DIR = '/opt/apache/beam/artifacts'
+ARTIFACTS_MANIFEST_FILE = 'artifacts_info.json'
+SDK_CONTAINER_ENTRYPOINT = '/opt/apache/beam/boot'
+DOCKERFILE_TEMPLATE = (
+    """FROM {base_image}
+RUN mkdir -p {workdir}
+COPY ./* {workdir}/
+RUN {entrypoint} --setup_only --artifacts {workdir}/{manifest_file}
+""")
+
+SOURCE_FOLDER = 'source'
+_LOGGER = logging.getLogger(__name__)
+
+
+class SdkContainerBuilder(object):
+  def __init__(self, options):
+    self._options = options
+    self._docker_registry_push_url = self._options.view_as(
+        SetupOptions).docker_registry_push_url
+    self._base_image = (
+        self._options.view_as(SetupOptions).prebuild_sdk_container_base_image or
+        'apache/beam_python%s.%s_sdk:latest' %
+        (sys.version_info[0], sys.version_info[1]))
+    self._temp_src_dir = None
+
+  def build(self):
+    container_id = str(uuid.uuid4())
+    container_tag = os.path.join(
+        self._docker_registry_push_url or '',
+        'beam_python_prebuilt_sdk:%s' % container_id)
+    with tempfile.TemporaryDirectory() as temp_folder:
+      self._temp_src_dir = temp_folder
+      self.prepare_dependencies()
+      self.invoke_docker_build_and_push(container_id, container_tag)
+
+    return container_tag
+
+  def prepare_dependencies(self):
+    with tempfile.TemporaryDirectory() as tmp:
+      resources = Stager.create_job_resources(self._options, tmp)
+      # make a copy of the staged artifacts into the temp source folder.
+      for path, name in resources:
+        shutil.copyfile(path, os.path.join(self._temp_src_dir, name))
+      with open(os.path.join(self._temp_src_dir, 'Dockerfile'), 'w') as file:
+        file.write(
+            DOCKERFILE_TEMPLATE.format(
+                base_image=self._base_image,
+                workdir=ARTIFACTS_CONTAINER_DIR,
+                manifest_file=ARTIFACTS_MANIFEST_FILE,
+                entrypoint=SDK_CONTAINER_ENTRYPOINT))
+      self.generate_artifacts_manifests_json_file(resources, self._temp_src_dir)
+
+  def invoke_docker_build_and_push(self, container_id, container_tag):
+    raise NotImplementedError
+
+  @staticmethod
+  def generate_artifacts_manifests_json_file(resources, temp_dir):
+    infos = []
+    for _, name in resources:
+      info = beam_runner_api_pb2.ArtifactInformation(
+          type_urn=common_urns.StandardArtifacts.Types.FILE.urn,
+          type_payload=beam_runner_api_pb2.ArtifactFilePayload(
+              path=name).SerializeToString(),
+      )
+      infos.append(json.dumps(MessageToJson(info)))
+    with open(os.path.join(temp_dir, ARTIFACTS_MANIFEST_FILE), 'w') as file:
+      file.write('[\n' + ',\n'.join(infos) + '\n]')
+
+  @classmethod
+  def build_container_image(cls, pipeline_options):
+    # type: (PipelineOptions) -> str
+    setup_options = pipeline_options.view_as(SetupOptions)
+    container_build_engine = setup_options.prebuild_sdk_container_engine
+    if container_build_engine:
+      if container_build_engine == 'local_docker':
+        builder = _SdkContainerLocalBuilder(
+            pipeline_options)  # type: SdkContainerBuilder
+      elif container_build_engine == 'cloud_build':
+        builder = _SdkContainerCloudBuilder(pipeline_options)
+      else:
+        raise ValueError(
+            'Only (--prebuild_sdk_container_engine local_docker) and '
+            '(--prebuild_sdk_container_engine cloud_build) are supported')
+    else:
+      raise ValueError('No --prebuild_sdk_container_engine option specified.')
+    return builder.build()
+
+
+class _SdkContainerLocalBuilder(SdkContainerBuilder):
+  """SdkContainerLocalBuilder builds the sdk container image with local
+  docker."""
+  def invoke_docker_build_and_push(self, container_id, container_tag):
+    try:
+      _LOGGER.info("Building sdk container, this may take a few minutes...")
+      now = time.time()
+      subprocess.run(['docker', 'build', '.', '-t', container_tag],
+                     capture_output=True,
+                     check=True,
+                     cwd=self._temp_src_dir)
+    except subprocess.CalledProcessError as err:
+      raise RuntimeError(
+          'Failed to build sdk container with local docker, '
+          'stderr:\n %s.' % err.stderr)
+    else:
+      _LOGGER.info(
+          "Successfully built %s in %.2f seconds" %
+          (container_tag, time.time() - now))
+
+    if self._docker_registry_push_url:
+      _LOGGER.info("Pushing prebuilt sdk container...")
+      try:
+        subprocess.run(['docker', 'push', container_tag],
+                       capture_output=True,
+                       check=True)
+      except subprocess.CalledProcessError as err:
+        raise RuntimeError(
+            'Failed to push prebuilt sdk container %s, stderr: \n%s' %
+            (container_tag, err.stderr))
+      _LOGGER.info(
+          "Successfully pushed %s in %.2f seconds" %
+          (container_tag, time.time() - now))
+    else:
+      _LOGGER.info(
+          "no --docker_registry_push_url option is specified in pipeline "
+          "options, specify it if the new image is intended to be "
+          "pushed to a registry.")
+
+
+class _SdkContainerCloudBuilder(SdkContainerBuilder):
+  """SdkContainerLocalBuilder builds the sdk container image with google cloud
+  build."""
+  def __init__(self, options):
+    super().__init__(options)
+    self._google_cloud_options = options.view_as(GoogleCloudOptions)
+    if self._google_cloud_options.no_auth:
+      credentials = None
+    else:
+      credentials = get_service_credentials()
+    self._storage_client = storage.StorageV1(
+        url='https://www.googleapis.com/storage/v1',
+        credentials=credentials,
+        get_credentials=(not self._google_cloud_options.no_auth),
+        http=get_new_http(),
+        response_encoding='utf8')
+    if not self._docker_registry_push_url:
+      self._docker_registry_push_url = (
+          'gcr.io/%s' % self._google_cloud_options.project)
+
+  def invoke_docker_build_and_push(self, container_id, container_tag):
+    project_id = self._google_cloud_options.project
+    temp_location = self._google_cloud_options.temp_location
+    # google cloud build service expects all the build source file to be
+    # compressed into a tarball.
+    tarball_path = os.path.join(self._temp_src_dir, '%s.tgz' % SOURCE_FOLDER)
+    self._make_tarfile(tarball_path, self._temp_src_dir)
+    _LOGGER.info(
+        "Compressed source files for building sdk container at %s" %
+        tarball_path)
+
+    gcs_location = os.path.join(
+        temp_location, '%s-%s.tgz' % (SOURCE_FOLDER, container_id))
+    self._upload_to_gcs(tarball_path, gcs_location)
+
+    from google.cloud.devtools import cloudbuild_v1
+    client = cloudbuild_v1.CloudBuildClient()
+    build = cloudbuild_v1.Build()
+    build.steps = []
+    step = cloudbuild_v1.BuildStep()
+    step.name = 'gcr.io/cloud-builders/docker'
+    step.args = ['build', '-t', container_tag, '.']
+    step.dir = SOURCE_FOLDER
+
+    build.steps.append(step)
+    build.images = [container_tag]
+
+    source = cloudbuild_v1.Source()
+    source.storage_source = cloudbuild_v1.StorageSource()
+    gcs_bucket, gcs_object = self._get_gcs_bucket_and_name(gcs_location)
+    source.storage_source.bucket = os.path.join(gcs_bucket)
+    source.storage_source.object = gcs_object
+    build.source = source
+    # TODO(zyichi): make timeout configurable
+    build.timeout = Duration().FromSeconds(seconds=1800)
+
+    now = time.time()
+    _LOGGER.info('Building sdk container, this may take a few minutes...')
+    operation = client.create_build(project_id=project_id, build=build)
+    # if build fails exception will be raised and stops the job submission.

Review comment:
       Ok, but it can also be a flake during build. We can also add a retry later.

##########
File path: sdks/python/apache_beam/transforms/environments.py
##########
@@ -252,6 +254,13 @@ def from_runner_api_parameter(payload, capabilities, artifacts, context):
   @classmethod
   def from_options(cls, options):
     # type: (PipelineOptions) -> DockerEnvironment
+    if options.view_as(SetupOptions).prebuild_sdk_container_engine:
+      prebuilt_container_image = SdkContainerBuilder.build_container_image(
+          options)
+      return cls.from_container_image(
+          container_image=prebuilt_container_image,
+          artifacts=python_sdk_dependencies(
+              options, skip_boot_dependencies=True))

Review comment:
       I meant that `python_sdk_dependencies could` could evaluate whether `options` has `prebuild_sdk_container_engine` to evaluate what deps to return. Feel free to keep as is.  




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] codecov[bot] edited a comment on pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #12727:
URL: https://github.com/apache/beam/pull/12727#issuecomment-683229966


   # [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=h1) Report
   > Merging [#12727](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=desc) into [master](https://codecov.io/gh/apache/beam/commit/5ef04e945fb1a3948d665af5d6b7f13b86487616?el=desc) will **decrease** coverage by `0.19%`.
   > The diff coverage is `52.86%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/12727/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1)](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12727      +/-   ##
   ==========================================
   - Coverage   82.36%   82.16%   -0.20%     
   ==========================================
     Files         451      452       +1     
     Lines       53753    54036     +283     
   ==========================================
   + Hits        44273    44400     +127     
   - Misses       9480     9636     +156     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `72.60% <0.00%> (ø)` | |
   | [...eam/testing/benchmarks/nexmark/nexmark\_launcher.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19sYXVuY2hlci5weQ==) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_perf.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya19wZXJmLnB5) | `0.00% <0.00%> (ø)` | |
   | [...he\_beam/testing/benchmarks/nexmark/nexmark\_util.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9iZW5jaG1hcmtzL25leG1hcmsvbmV4bWFya191dGlsLnB5) | `0.00% <0.00%> (ø)` | |
   | [...\_beam/runners/portability/sdk\_container\_builder.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9wb3J0YWJpbGl0eS9zZGtfY29udGFpbmVyX2J1aWxkZXIucHk=) | `32.23% <32.23%> (ø)` | |
   | [...on/apache\_beam/runners/dataflow/dataflow\_runner.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9kYXRhZmxvd19ydW5uZXIucHk=) | `77.03% <60.00%> (-0.15%)` | :arrow_down: |
   | [...dks/python/apache\_beam/options/pipeline\_options.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vb3B0aW9ucy9waXBlbGluZV9vcHRpb25zLnB5) | `95.00% <66.66%> (+0.01%)` | :arrow_up: |
   | [sdks/python/apache\_beam/transforms/environments.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdHJhbnNmb3Jtcy9lbnZpcm9ubWVudHMucHk=) | `83.49% <66.66%> (-0.33%)` | :arrow_down: |
   | [...beam/runners/interactive/background\_caching\_job.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9iYWNrZ3JvdW5kX2NhY2hpbmdfam9iLnB5) | `94.78% <90.90%> (ø)` | |
   | [sdks/python/apache\_beam/utils/histogram.py](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdXRpbHMvaGlzdG9ncmFtLnB5) | `94.28% <94.28%> (ø)` | |
   | ... and [66 more](https://codecov.io/gh/apache/beam/pull/12727/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=footer). Last update [68e7f2e...984c4e7](https://codecov.io/gh/apache/beam/pull/12727?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [beam] tvalentyn commented on a change in pull request #12727: [BEAM-10844] Add experiment option prebuild_sdk_container to prebuild python sdk container with dependencies.

Posted by GitBox <gi...@apache.org>.
tvalentyn commented on a change in pull request #12727:
URL: https://github.com/apache/beam/pull/12727#discussion_r493135900



##########
File path: sdks/python/apache_beam/runners/portability/sdk_container_builder.py
##########
@@ -0,0 +1,279 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+"""SdkContainerBuilder builds the portable SDK container with dependencies.
+
+It copies the right boot dependencies, namely: apache beam sdk, python packages
+from requirements.txt, python packages from extra_packages.txt, workflow
+tarball, into the latest public python sdk container image, and run the
+dependencies installation in advance with the boot program in setup only mode
+to build the new image.
+"""
+
+from __future__ import absolute_import
+
+import json
+import logging
+import os
+import shutil
+import subprocess
+import sys
+import tarfile
+import tempfile
+import time
+import uuid
+
+from google.protobuf.duration_pb2 import Duration
+from google.protobuf.json_format import MessageToJson
+
+from apache_beam.internal.gcp.auth import get_service_credentials
+from apache_beam.internal.http_client import get_new_http
+from apache_beam.io.gcp.internal.clients import storage
+from apache_beam.options.pipeline_options import GoogleCloudOptions
+from apache_beam.options.pipeline_options import PipelineOptions  # pylint: disable=unused-import
+from apache_beam.options.pipeline_options import SetupOptions
+from apache_beam.portability import common_urns
+from apache_beam.portability.api import beam_runner_api_pb2
+from apache_beam.runners.portability.stager import Stager
+
+ARTIFACTS_CONTAINER_DIR = '/opt/apache/beam/artifacts'
+ARTIFACTS_MANIFEST_FILE = 'artifacts_info.json'
+SDK_CONTAINER_ENTRYPOINT = '/opt/apache/beam/boot'
+DOCKERFILE_TEMPLATE = (
+    """FROM {base_image}
+RUN mkdir -p {workdir}
+COPY ./* {workdir}/
+RUN {entrypoint} --setup_only --artifacts {workdir}/{manifest_file}
+""")
+
+SOURCE_FOLDER = 'source'
+_LOGGER = logging.getLogger(__name__)
+
+
+class SdkContainerBuilder(object):
+  def __init__(self, options):
+    self._options = options
+    self._docker_registry_push_url = self._options.view_as(
+        SetupOptions).docker_registry_push_url
+    self._base_image = (
+        self._options.view_as(SetupOptions).prebuild_sdk_container_base_image or
+        'apache/beam_python%s.%s_sdk:latest' %
+        (sys.version_info[0], sys.version_info[1]))
+    self._temp_src_dir = None
+
+  def build(self):
+    container_id = str(uuid.uuid4())
+    container_tag = os.path.join(
+        self._docker_registry_push_url or '',
+        'beam_python_prebuilt_sdk:%s' % container_id)
+    with tempfile.TemporaryDirectory() as temp_folder:
+      self._temp_src_dir = temp_folder
+      self.prepare_dependencies()
+      self.invoke_docker_build_and_push(container_id, container_tag)
+
+    return container_tag
+
+  def prepare_dependencies(self):
+    with tempfile.TemporaryDirectory() as tmp:
+      resources = Stager.create_job_resources(self._options, tmp)
+      # make a copy of the staged artifacts into the temp source folder.
+      for path, name in resources:
+        shutil.copyfile(path, os.path.join(self._temp_src_dir, name))
+      with open(os.path.join(self._temp_src_dir, 'Dockerfile'), 'w') as file:
+        file.write(
+            DOCKERFILE_TEMPLATE.format(
+                base_image=self._base_image,
+                workdir=ARTIFACTS_CONTAINER_DIR,
+                manifest_file=ARTIFACTS_MANIFEST_FILE,
+                entrypoint=SDK_CONTAINER_ENTRYPOINT))
+      self.generate_artifacts_manifests_json_file(resources, self._temp_src_dir)
+
+  def invoke_docker_build_and_push(self, container_id, container_tag):
+    raise NotImplementedError
+
+  @staticmethod
+  def generate_artifacts_manifests_json_file(resources, temp_dir):
+    infos = []
+    for _, name in resources:
+      info = beam_runner_api_pb2.ArtifactInformation(
+          type_urn=common_urns.StandardArtifacts.Types.FILE.urn,
+          type_payload=beam_runner_api_pb2.ArtifactFilePayload(
+              path=name).SerializeToString(),
+      )
+      infos.append(json.dumps(MessageToJson(info)))
+    with open(os.path.join(temp_dir, ARTIFACTS_MANIFEST_FILE), 'w') as file:
+      file.write('[\n' + ',\n'.join(infos) + '\n]')
+
+  @classmethod
+  def build_container_image(cls, pipeline_options):
+    # type: (PipelineOptions) -> str
+    setup_options = pipeline_options.view_as(SetupOptions)
+    container_build_engine = setup_options.prebuild_sdk_container_engine
+    if container_build_engine:
+      if container_build_engine == 'local_docker':
+        builder = _SdkContainerLocalBuilder(
+            pipeline_options)  # type: SdkContainerBuilder
+      elif container_build_engine == 'cloud_build':
+        builder = _SdkContainerCloudBuilder(pipeline_options)
+      else:
+        raise ValueError(
+            'Only (--prebuild_sdk_container_engine local_docker) and '
+            '(--prebuild_sdk_container_engine cloud_build) are supported')
+    else:
+      raise ValueError('No --prebuild_sdk_container_engine option specified.')
+    return builder.build()
+
+
+class _SdkContainerLocalBuilder(SdkContainerBuilder):
+  """SdkContainerLocalBuilder builds the sdk container image with local
+  docker."""
+  def invoke_docker_build_and_push(self, container_id, container_tag):
+    try:
+      _LOGGER.info("Building sdk container, this may take a few minutes...")
+      now = time.time()
+      subprocess.run(['docker', 'build', '.', '-t', container_tag],
+                     capture_output=True,
+                     check=True,
+                     cwd=self._temp_src_dir)
+    except subprocess.CalledProcessError as err:
+      raise RuntimeError(
+          'Failed to build sdk container with local docker, '
+          'stderr:\n %s.' % err.stderr)
+    else:
+      _LOGGER.info(
+          "Successfully built %s in %.2f seconds" %
+          (container_tag, time.time() - now))
+
+    if self._docker_registry_push_url:
+      _LOGGER.info("Pushing prebuilt sdk container...")
+      try:
+        subprocess.run(['docker', 'push', container_tag],
+                       capture_output=True,
+                       check=True)
+      except subprocess.CalledProcessError as err:
+        raise RuntimeError(
+            'Failed to push prebuilt sdk container %s, stderr: \n%s' %
+            (container_tag, err.stderr))
+      _LOGGER.info(
+          "Successfully pushed %s in %.2f seconds" %
+          (container_tag, time.time() - now))
+    else:
+      _LOGGER.info(
+          "no --docker_registry_push_url option is specified in pipeline "
+          "options, specify it if the new image is intended to be "
+          "pushed to a registry.")
+
+
+class _SdkContainerCloudBuilder(SdkContainerBuilder):
+  """SdkContainerLocalBuilder builds the sdk container image with google cloud
+  build."""
+  def __init__(self, options):
+    super().__init__(options)
+    self._google_cloud_options = options.view_as(GoogleCloudOptions)
+    if self._google_cloud_options.no_auth:
+      credentials = None
+    else:
+      credentials = get_service_credentials()
+    self._storage_client = storage.StorageV1(
+        url='https://www.googleapis.com/storage/v1',
+        credentials=credentials,
+        get_credentials=(not self._google_cloud_options.no_auth),
+        http=get_new_http(),
+        response_encoding='utf8')
+    if not self._docker_registry_push_url:
+      self._docker_registry_push_url = (
+          'gcr.io/%s' % self._google_cloud_options.project)
+
+  def invoke_docker_build_and_push(self, container_id, container_tag):
+    project_id = self._google_cloud_options.project
+    temp_location = self._google_cloud_options.temp_location
+    # google cloud build service expects all the build source file to be
+    # compressed into a tarball.
+    tarball_path = os.path.join(self._temp_src_dir, '%s.tgz' % SOURCE_FOLDER)
+    self._make_tarfile(tarball_path, self._temp_src_dir)
+    _LOGGER.info(
+        "Compressed source files for building sdk container at %s" %
+        tarball_path)
+
+    gcs_location = os.path.join(
+        temp_location, '%s-%s.tgz' % (SOURCE_FOLDER, container_id))
+    self._upload_to_gcs(tarball_path, gcs_location)
+
+    from google.cloud.devtools import cloudbuild_v1
+    client = cloudbuild_v1.CloudBuildClient()
+    build = cloudbuild_v1.Build()
+    build.steps = []
+    step = cloudbuild_v1.BuildStep()
+    step.name = 'gcr.io/cloud-builders/docker'
+    step.args = ['build', '-t', container_tag, '.']
+    step.dir = SOURCE_FOLDER
+
+    build.steps.append(step)
+    build.images = [container_tag]
+
+    source = cloudbuild_v1.Source()
+    source.storage_source = cloudbuild_v1.StorageSource()
+    gcs_bucket, gcs_object = self._get_gcs_bucket_and_name(gcs_location)
+    source.storage_source.bucket = os.path.join(gcs_bucket)
+    source.storage_source.object = gcs_object
+    build.source = source
+    # TODO(zyichi): make timeout configurable
+    build.timeout = Duration().FromSeconds(seconds=1800)
+
+    now = time.time()
+    _LOGGER.info('Building sdk container, this may take a few minutes...')
+    operation = client.create_build(project_id=project_id, build=build)
+    # if build fails exception will be raised and stops the job submission.

Review comment:
       Ok, but it can also be a flake during build. We can also add a retry later.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org