Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This section describes the commands that are used to build, publish, run tests and examples for the images.

Prerequisites

  • docker

Build images

Set repository and tag as variables:

Code Block
languagebash
titleFor snapshot
linenumberstrue
export REPOSITORY=gcr.io/apache-beam-testing/beam/sdk/snapshot/`date +"%Y/%m/%d"`
export TAG=`date +"%Y%m%d"`

...

Code Block
languagebash
titleFor release
linenumberstrue
export REPOSITORY=gcr.io/apache-beam-testing/beam/sdk/release
export TAG=2.15.0

To build docker images run:

Code Block
languagebash
titlePython
linenumberstrue
$ pwd
[...]/beam/
$ ./gradlew :sdks:python:container:py2:docker -Pdocker-repository-root=$REPOSITORY -Pdocker-tag=$TAG --info
$ ./gradlew :sdks:python:container:py35:docker -Pdocker-repository-root=$REPOSITORY -Pdocker-tag=$TAG --info
$ ./gradlew :sdks:python:container:py36:docker -Pdocker-repository-root=$REPOSITORY -Pdocker-tag=$TAG --info
$ ./gradlew :sdks:python:container:py37:docker -Pdocker-repository-root=$REPOSITORY -Pdocker-tag=$TAG --info

...

Please note all following tests create new images each time, so they don't use the images we created above, however, since they are created from the same code, so we assume images are exactly same and if all tests passed with the new created images then assume images created above also pass the tests.

Running precommit tests at local

...

Code Block
languagebash
titlePython
linenumberstrue
$ ./gradlew :sdks:python:test-suites:portable:py2:preCommitPy2
$ ./gradlew :sdks:python:test-suites:portable:py35:preCommitPy35
$ ./gradlew :sdks:python:test-suites:portable:py35:preCommitPy36
$ ./gradlew :sdks:python:test-suites:portable:py35:preCommitPy37

...

Code Block
languagebash
titleGo
linenumberstrue
$ ./gradlew :goPreCommit

Run postcommit tests at local

...

Code Block
languagebash
titlePython
linenumberstrue
$ ./gradlew :python2PostCommit
$ ./gradlew :python35PostCommit
$ ./gradlew :python36PostCommit
$ ./gradlew :python37PostCommit

...