You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "damccorm (via GitHub)" <gi...@apache.org> on 2023/04/21 17:37:23 UTC

[GitHub] [beam] damccorm opened a new pull request, #26383: Update dataflow python to use external containers

damccorm opened a new pull request, #26383:
URL: https://github.com/apache/beam/pull/26383

   This updates python to use containers created as part of the Beam snapshot process instead of containers built by Dataflow.
   
   These containers are initially published to https://pantheon.corp.google.com/gcr/images/apache-beam-testing/global/beam_portability/ and then mirrored to https://pantheon.corp.google.com/gcr/images/cloud-dataflow/global/v1beta3/ (for example, for 3.8 containers are mirrored to - https://pantheon.corp.google.com/gcr/images/cloud-dataflow/global/v1beta3/beam_python3.8_sdk)
   
   ------------------------
   
   Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
   
    - [ ] Mention the appropriate issue in your description (for example: `addresses #123`), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment `fixes #<ISSUE NUMBER>` instead.
    - [ ] 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/get-started-contributing/#make-the-reviewers-job-easier).
   
   To check the build health, please visit [https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md](https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md)
   
   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?branch=master&event=schedule)](https://github.com/apache/beam/actions?query=workflow%3A%22Build+python+source+distribution+and+wheels%22+branch%3Amaster+event%3Aschedule)
   [![Python tests](https://github.com/apache/beam/workflows/Python%20tests/badge.svg?branch=master&event=schedule)](https://github.com/apache/beam/actions?query=workflow%3A%22Python+Tests%22+branch%3Amaster+event%3Aschedule)
   [![Java tests](https://github.com/apache/beam/workflows/Java%20Tests/badge.svg?branch=master&event=schedule)](https://github.com/apache/beam/actions?query=workflow%3A%22Java+Tests%22+branch%3Amaster+event%3Aschedule)
   [![Go tests](https://github.com/apache/beam/workflows/Go%20tests/badge.svg?branch=master&event=schedule)](https://github.com/apache/beam/actions?query=workflow%3A%22Go+tests%22+branch%3Amaster+event%3Aschedule)
   
   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.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

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


[GitHub] [beam] damccorm commented on pull request #26383: Update dataflow python to use external containers

Posted by "damccorm (via GitHub)" <gi...@apache.org>.
damccorm commented on PR #26383:
URL: https://github.com/apache/beam/pull/26383#issuecomment-1520877380

   Run Python Dataflow ValidatesContainer


-- 
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.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

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


[GitHub] [beam] damccorm commented on pull request #26383: Update dataflow python to use external containers

Posted by "damccorm (via GitHub)" <gi...@apache.org>.
damccorm commented on PR #26383:
URL: https://github.com/apache/beam/pull/26383#issuecomment-1519229987

   Run Python Dataflow ValidatesRunner


-- 
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.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

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


[GitHub] [beam] tvalentyn commented on a diff in pull request #26383: Update dataflow python to use external containers

Posted by "tvalentyn (via GitHub)" <gi...@apache.org>.
tvalentyn commented on code in PR #26383:
URL: https://github.com/apache/beam/pull/26383#discussion_r1175720682


##########
sdks/python/apache_beam/runners/dataflow/internal/apiclient.py:
##########
@@ -1207,19 +1207,21 @@ def get_container_image_from_options(pipeline_options):
   if worker_options.sdk_container_image:
     return worker_options.sdk_container_image
 
-  # TODO(tvalentyn): Use enumerated type instead of strings for job types.
-  if _is_runner_v2(pipeline_options):
-    fnapi_suffix = '-fnapi'
-  else:
-    fnapi_suffix = ''
+  is_runner_v2 = _is_runner_v2(pipeline_options)
 
+  # Legacy and runner v2 exist in different repositories.
+  # Set to legacy format, override if runner v2
   version_suffix = '%s%s' % (sys.version_info[0:2])
-  image_name = '{repository}/python{version_suffix}{fnapi_suffix}'.format(
-      repository=names.DATAFLOW_CONTAINER_IMAGE_REPOSITORY,
-      version_suffix=version_suffix,
-      fnapi_suffix=fnapi_suffix)
+  container_repo = names.DATAFLOW_CONTAINER_IMAGE_REPOSITORY
+  image_name = '{repository}/python{version_suffix}'.format(
+      repository=container_repo, version_suffix=version_suffix)
+
+  if is_runner_v2:
+    version_suffix = '%s.%s' % (sys.version_info[0:2])

Review Comment:
   nit: extra line



-- 
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.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

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


[GitHub] [beam] damccorm commented on pull request #26383: Update dataflow python to use external containers

Posted by "damccorm (via GitHub)" <gi...@apache.org>.
damccorm commented on PR #26383:
URL: https://github.com/apache/beam/pull/26383#issuecomment-1520097534

   R: @tvalentyn 


-- 
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.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

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


[GitHub] [beam] codecov[bot] commented on pull request #26383: Update dataflow python to use external containers

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #26383:
URL: https://github.com/apache/beam/pull/26383#issuecomment-1518631482

   ## [Codecov](https://codecov.io/gh/apache/beam/pull/26383?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#26383](https://codecov.io/gh/apache/beam/pull/26383?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a5ae1fe) into [master](https://codecov.io/gh/apache/beam/commit/f549fd33abdc672143ccbe3f0f66104995d30fe6?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (f549fd3) will **decrease** coverage by `0.01%`.
   > The diff coverage is `100.00%`.
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #26383      +/-   ##
   ==========================================
   - Coverage   81.07%   81.07%   -0.01%     
   ==========================================
     Files         469      469              
     Lines       67185    67187       +2     
   ==========================================
   - Hits        54473    54472       -1     
   - Misses      12712    12715       +3     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | python | `81.07% <100.00%> (-0.01%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/26383?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...apache\_beam/runners/dataflow/internal/apiclient.py](https://codecov.io/gh/apache/beam/pull/26383?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9hcGljbGllbnQucHk=) | `77.09% <100.00%> (+0.07%)` | :arrow_up: |
   | [...hon/apache\_beam/runners/dataflow/internal/names.py](https://codecov.io/gh/apache/beam/pull/26383?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kYXRhZmxvdy9pbnRlcm5hbC9uYW1lcy5weQ==) | `100.00% <100.00%> (ø)` | |
   
   ... and [6 files with indirect coverage changes](https://codecov.io/gh/apache/beam/pull/26383/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


-- 
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.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

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


[GitHub] [beam] damccorm commented on a diff in pull request #26383: Update dataflow python to use external containers

Posted by "damccorm (via GitHub)" <gi...@apache.org>.
damccorm commented on code in PR #26383:
URL: https://github.com/apache/beam/pull/26383#discussion_r1175757306


##########
sdks/python/apache_beam/runners/dataflow/internal/apiclient.py:
##########
@@ -1207,19 +1207,21 @@ def get_container_image_from_options(pipeline_options):
   if worker_options.sdk_container_image:
     return worker_options.sdk_container_image
 
-  # TODO(tvalentyn): Use enumerated type instead of strings for job types.
-  if _is_runner_v2(pipeline_options):
-    fnapi_suffix = '-fnapi'
-  else:
-    fnapi_suffix = ''
+  is_runner_v2 = _is_runner_v2(pipeline_options)
 
+  # Legacy and runner v2 exist in different repositories.
+  # Set to legacy format, override if runner v2
   version_suffix = '%s%s' % (sys.version_info[0:2])
-  image_name = '{repository}/python{version_suffix}{fnapi_suffix}'.format(
-      repository=names.DATAFLOW_CONTAINER_IMAGE_REPOSITORY,
-      version_suffix=version_suffix,
-      fnapi_suffix=fnapi_suffix)
+  container_repo = names.DATAFLOW_CONTAINER_IMAGE_REPOSITORY
+  image_name = '{repository}/python{version_suffix}'.format(
+      repository=container_repo, version_suffix=version_suffix)
+
+  if is_runner_v2:
+    version_suffix = '%s.%s' % (sys.version_info[0:2])

Review Comment:
   We actually need this, it inserts a . while the last one does not.
   
   With that said, I don't think this is helpful (the difference is too subtle), so I removed version_suffix entirely and replaced it with major/minor



-- 
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.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

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


[GitHub] [beam] damccorm commented on pull request #26383: Update dataflow python to use external containers

Posted by "damccorm (via GitHub)" <gi...@apache.org>.
damccorm commented on PR #26383:
URL: https://github.com/apache/beam/pull/26383#issuecomment-1520792446

   Run Python Dataflow ValidatesRunner


-- 
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.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

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


[GitHub] [beam] damccorm commented on pull request #26383: Update dataflow python to use external containers

Posted by "damccorm (via GitHub)" <gi...@apache.org>.
damccorm commented on PR #26383:
URL: https://github.com/apache/beam/pull/26383#issuecomment-1519236100

   Run Python Dataflow ValidatesContainer


-- 
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.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

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


[GitHub] [beam] damccorm commented on pull request #26383: Update dataflow python to use external containers

Posted by "damccorm (via GitHub)" <gi...@apache.org>.
damccorm commented on PR #26383:
URL: https://github.com/apache/beam/pull/26383#issuecomment-1519235973

   Run Python Dataflow ValidatesRunner


-- 
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.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

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


[GitHub] [beam] github-actions[bot] commented on pull request #26383: Update dataflow python to use external containers

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #26383:
URL: https://github.com/apache/beam/pull/26383#issuecomment-1520100029

   Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control


-- 
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.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

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


[GitHub] [beam] damccorm commented on pull request #26383: Update dataflow python to use external containers

Posted by "damccorm (via GitHub)" <gi...@apache.org>.
damccorm commented on PR #26383:
URL: https://github.com/apache/beam/pull/26383#issuecomment-1520792542

   Run Python Dataflow V2 ValidatesRunner


-- 
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.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

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


[GitHub] [beam] damccorm merged pull request #26383: Update dataflow python to use external containers

Posted by "damccorm (via GitHub)" <gi...@apache.org>.
damccorm merged PR #26383:
URL: https://github.com/apache/beam/pull/26383


-- 
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.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

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


[GitHub] [beam] damccorm commented on pull request #26383: Update dataflow python to use external containers

Posted by "damccorm (via GitHub)" <gi...@apache.org>.
damccorm commented on PR #26383:
URL: https://github.com/apache/beam/pull/26383#issuecomment-1520792683

   Run Python Dataflow ValidatesContainer


-- 
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.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

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


[GitHub] [beam] damccorm commented on pull request #26383: Update dataflow python to use external containers

Posted by "damccorm (via GitHub)" <gi...@apache.org>.
damccorm commented on PR #26383:
URL: https://github.com/apache/beam/pull/26383#issuecomment-1519230082

   Run Python Dataflow V2 ValidatesRunner


-- 
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.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

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


[GitHub] [beam] damccorm commented on pull request #26383: Update dataflow python to use external containers

Posted by "damccorm (via GitHub)" <gi...@apache.org>.
damccorm commented on PR #26383:
URL: https://github.com/apache/beam/pull/26383#issuecomment-1519236026

   Run Python Dataflow V2 ValidatesRunner


-- 
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.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

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