Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a guide to build custom Beam Python SDK image #33048

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

baeminbo
Copy link
Contributor

@baeminbo baeminbo commented Nov 8, 2024

This is a guide for users who needs customized Python SDK image. b/375969331


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.

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

To check the build health, please visit 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
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.

Copy link
Contributor

github-actions bot commented Nov 8, 2024

Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment assign set of reviewers

@baeminbo
Copy link
Contributor Author

baeminbo commented Nov 8, 2024

R: @tvalentyn

Copy link
Contributor

github-actions bot commented Nov 8, 2024

Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment assign set of reviewers

# Create a simple Dockerfile to use custom boot entrypoint.
cat >Dockerfile <<EOF
FROM apache/beam_python3.10_sdk:2.60.0
COPY boot /opt/apache/beam/boot_modified
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will docker overwrite the file if we don't change the name? we could keep it as is to avoid having two entrypoints.


## (Optional) Update Boot Application Only.

If you only need to make a change to the Python SDK boot application. You can
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
If you only need to make a change to the Python SDK boot application. You can
If you only need to make a change to the Python SDK boot entrypoint binary, you can

docker push <my-account>/beam_python3.10_sdk:2.60.0-custom
```

## (Optional) Update Boot Application Only.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should start with this, in case this is sufficient, as steps are simpler.

# Building Beam Python SDK Image Guide

You can build a docker image if your local environment has Java, Python, Golang
and Docker properly. Try
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
and Docker properly. Try
and Docker installation. Try

@@ -44,6 +44,7 @@
<li><a href="/documentation/sdks/python-pipeline-dependencies/">Managing pipeline dependencies</a></li>
<li><a href="/documentation/sdks/python-multi-language-pipelines/">Python multi-language pipelines quickstart</a></li>
<li><a href="/documentation/sdks/python-unrecoverable-errors/">Python Unrecoverable Errors</a></li>
<li><a href="/documentation/sdks/python-sdk-image-build/">Python SDK image build</a></li>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have related content in: https://beam.apache.org/documentation/runtime/environments/. I think it might be easier to find this link if we add a reference from that page.

We could also integrate (a portion of?) this this content into that page, but having only have a reference : for self-contained instructions on building a container image, follow this guide (link to new page), is ok too.

@tvalentyn
Copy link
Contributor

Thanks a lot for putting this together!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants