Skip to content

Start expansion service containers before the controller container#27273

Merged
chamikaramj merged 1 commit intoapache:masterfrom
chamikaramj:beam_transform_service_order
Jun 27, 2023
Merged

Start expansion service containers before the controller container#27273
chamikaramj merged 1 commit intoapache:masterfrom
chamikaramj:beam_transform_service_order

Conversation

@chamikaramj
Copy link
Contributor

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:

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

@github-actions github-actions bot added the java label Jun 27, 2023
@chamikaramj
Copy link
Contributor Author

R: @ahmedabu98

@github-actions
Copy link
Contributor

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

@ahmedabu98
Copy link
Contributor

ahmedabu98 commented Jun 27, 2023

If we're starting both containers at the same time, we should probably have different port numbers so they don't conflict:

expansion-service-1:
image: "apache/beam_java_expansion_service:${BEAM_VERSION}"
restart: on-failure
command: -id expansion-service-1 -port 5001
volumes:
- ${CREDENTIALS_VOLUME}:/credentials_volume
environment:
- GOOGLE_APPLICATION_CREDENTIALS=/credentials_volume/${GOOGLE_APPLICATION_CREDENTIALS_FILE_NAME}
expansion-service-2:
image: "apache/beam_python_expansion_service:${BEAM_VERSION}"
restart: on-failure
command: -id expansion-service-2 -port 5001

P.S. The transform service also has this same port number, should that be changed as well?

- "${TRANSFORM_SERVICE_PORT}:5001"
depends_on:
- expansion-service-1
- expansion-service-2
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not too familiar with how this works. Does this mean both expansion services will be built and run whenever we use the transform service?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a docker compose feature. It allows specifying a dependency order between services (containers) of the Docker Compose service.

https://docs.docker.com/compose/compose-file/compose-file-v3/#depends_on

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok I see. Maybe later we should consider specifying the services needed for transform-service. Most use-cases won't need both java and python expansion services. Not blocking though, this LGTM

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Most use-cases won't need both java and python expansion services

I'm hoping to use this as a generalized service that support all transforms. The main cost will be container download and storage. Once downloaded the expansion service containers can be started very quickly. Also, hoping to push changes to reduce size of the Java container in the future by removing the duplications due to using multiple shaded jars.

@chamikaramj
Copy link
Contributor Author

"5001" is the internal port number of the containers (not the external port) so there's no port conflict here.

@chamikaramj
Copy link
Contributor Author

Thanks.

@chamikaramj chamikaramj merged commit 4ff952a into apache:master Jun 27, 2023
@chamikaramj
Copy link
Contributor Author

(test failures are unrelated)

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