Versions Compared

Key

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

...

Code Block
languagebash
titleconfirm docker is installed
linenumberstrue
$ docker -v
Docker version 18.09.3, build 774a1f4

...

Run a test against containers

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
titleJava
linenumberstrue
$ ./gradlew :javaPreCommitPortabilityApi --continue --info


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


Code Block
languagebash
titleJava
linenumberstrue
$ ./gradlew :javaPostCommitPortabilityApi --continue --info


Code Block
languagebash
titleGo
linenumberstrue
$ ./gradlew :goPostCommit

Publish

Publishing images to gcr.io/beam requires permissions in apache-beam-testing project.

Please note this will create new images (not used for above testings). Since they are created from the same code, we assume exactly same and if all tests passed with the new created images then assume images created above also pass the tests.

Set repository and tag as variables:

...

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

To build and push 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

...

Code Block
languagebash
titleJava
linenumberstrue
$ ./gradlew :sdks:java:container:dockerdockerPush -Pdocker-repository-root=$REPOSITORY -Pdocker-tag=$TAG --info

...

Code Block
languagebash
titleGo
linenumberstrue
$ ./gradlew :sdks:go:container:dockerdockerPush -Pdocker-repository-root=$REPOSITORY -Pdocker-tag=$TAG --info

This produces local images named

Code Block
languagebash
titledocker images list
linenumberstrue
$ docker images
$REPOSITORY/python2.7:$TAG
$REPOSITORY/python3.5:$TAG
$REPOSITORY/python3.6:$TAG
$REPOSITORY/python3.7:$TAG
$REPOSITORY/java:$TAG
$REPOSITORY/go:$TAG

They can be examined by running docker commands:

Code Block
languagebash
linenumberstrue
$ docker image ls
$ docker run --entrypoint bash -it $REPOSITORY/python3.5:$TAG

Run a test against locally built container

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
titleJava
linenumberstrue
$ ./gradlew :javaPreCommitPortabilityApi --continue --info
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
Code Block
languagebash
titleJava
linenumberstrue
$ ./gradlew :javaPostCommitPortabilityApi --continue --info
Code Block
languagebash
titleGo
linenumberstrue
$ ./gradlew :goPostCommit

Publish

Publishing images to gcr.io/beam requires permissions in apache-beam-testing project.

Code Block
languagebash
titlePython
linenumberstrue
$ docker push $REPOSITORY/python2.7:$TAG
$ docker push $REPOSITORY/python3.5:$TAG
$ docker push $REPOSITORY/python3.6:$TAG
$ docker push $REPOSITORY/python3.7:$TAG
Code Block
languagebash
titleJava
linenumberstrue
$ docker push $REPOSITORY/java:$TAG
Code Block
languagebash
titleGo
linenumberstrue
$ docker push $REPOSITORY/go:$TAG


Release Images Validation

...