You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@avro.apache.org by ie...@apache.org on 2021/01/16 05:49:52 UTC

[avro] branch master updated (1cc5f7b -> 3c99902)

This is an automated email from the ASF dual-hosted git repository.

iemejia pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/avro.git.


    from 1cc5f7b  Fix typos in C++ header files (#1033)
     new 1ee0e27  AVRO-2963: Add docker configurability from env
     new 3c99902  AVRO-2963: Build documentation update

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 BUILD.md | 22 ++++++++++++++++++++--
 build.sh | 20 +++++++++++++++-----
 2 files changed, 35 insertions(+), 7 deletions(-)


[avro] 01/02: AVRO-2963: Add docker configurability from env

Posted by ie...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

iemejia pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/avro.git

commit 1ee0e2778e8e6d95c9def1e94cb59c72ef0da369
Author: Ryan Skraba <ry...@skraba.com>
AuthorDate: Mon Nov 30 10:33:17 2020 +0100

    AVRO-2963: Add docker configurability from env
---
 build.sh | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/build.sh b/build.sh
index 352aa4f..137bd7b 100755
--- a/build.sh
+++ b/build.sh
@@ -43,7 +43,15 @@ set -xe
 cd "${0%/*}"
 
 VERSION=$(<share/VERSION.txt)
-DOCKER_XTRA_ARGS=""
+
+# Extra flags to add to the docker run command.  This can be overridden using the --args argument.
+DOCKER_RUN_XTRA_ARGS=${DOCKER_RUN_XTRA_ARGS-}
+# The entrypoint when running the avro docker from this script.
+DOCKER_RUN_ENTRYPOINT=${DOCKER_RUN_ENTRYPOINT-bash}
+# Extra flags to add to the docker build command.
+DOCKER_BUILD_XTRA_ARGS=${DOCKER_BUILD_XTRA_ARGS-}
+# Override the docker image name used.
+DOCKER_IMAGE_NAME=${DOCKER_IMAGE_NAME-}
 
 usage() {
   echo "Usage: $0 {lint|test|dist|sign|clean|veryclean|docker [--args \"docker-args\"]|rat|githooks|docker-test}"
@@ -280,7 +288,7 @@ do
 
     docker)
       if [[ $1 =~ ^--args ]]; then
-        DOCKER_XTRA_ARGS=$2
+        DOCKER_RUN_XTRA_ARGS=$2
         shift 2
       fi
       if [[ "$(uname -s)" = Linux ]]; then
@@ -292,6 +300,7 @@ do
         USER_ID=1000
         GROUP_ID=50
       fi
+      DOCKER_IMAGE_NAME=${DOCKER_IMAGE_NAME:-"avro-build-$USER_NAME:latest"}
       {
         cat share/docker/Dockerfile
         grep -vF 'FROM avro-build-ci' share/docker/DockerfileLocal
@@ -299,7 +308,8 @@ do
         echo "RUN getent group $GROUP_ID || groupadd -g $GROUP_ID $USER_NAME"
         echo "RUN getent passwd $USER_ID || useradd -g $GROUP_ID -u $USER_ID -k /root -m $USER_NAME"
       } > Dockerfile
-      tar -cf- lang/ruby/Gemfile Dockerfile | docker build -t "avro-build-$USER_NAME" -
+      # shellcheck disable=SC2086
+      tar -cf- lang/ruby/Gemfile Dockerfile | docker build $DOCKER_BUILD_XTRA_ARGS -t "$DOCKER_IMAGE_NAME" -
       rm Dockerfile
       # By mapping the .m2 directory you can do an mvn install from
       # within the container and use the result on your normal
@@ -311,6 +321,7 @@ do
       # Using :delegated will drop the "mvn install" time from over 30 minutes
       # down to under 10.  However, editing files from OSX may take a few
       # extra second before the changes are available within the docker container.
+      # shellcheck disable=SC2086
       docker run --rm -t -i \
         --env "JAVA=${JAVA:-8}" \
         --user "${USER_NAME}" \
@@ -318,8 +329,7 @@ do
         --volume "${HOME}/.m2:/home/${USER_NAME}/.m2${DOCKER_MOUNT_FLAG}" \
         --volume "${PWD}:/home/${USER_NAME}/avro${DOCKER_MOUNT_FLAG}" \
         --workdir "/home/${USER_NAME}/avro" \
-        ${DOCKER_XTRA_ARGS} \
-        "avro-build-${USER_NAME}" bash
+        ${DOCKER_RUN_XTRA_ARGS} "$DOCKER_IMAGE_NAME" ${DOCKER_RUN_ENTRYPOINT}
       ;;
 
     rat)


[avro] 02/02: AVRO-2963: Build documentation update

Posted by ie...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

iemejia pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/avro.git

commit 3c99902f50e7998f972c491bfaecac2e3cacc981
Author: Ryan Skraba <ry...@skraba.com>
AuthorDate: Mon Jan 11 11:31:02 2021 +0100

    AVRO-2963: Build documentation update
---
 BUILD.md | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/BUILD.md b/BUILD.md
index d5febea..29cb324 100644
--- a/BUILD.md
+++ b/BUILD.md
@@ -22,8 +22,11 @@ The following packages must be installed before Avro can be built:
  - Apache Forrest 0.9 (for documentation)
  - md5sum, sha1sum, used by top-level dist target
 
-To simplify this, you can run a Docker container with all the above
-dependencies installed by installing Docker and run:
+## Using docker
+
+It can be simpler to use a Docker image with all of the requirements already
+installed. If you have Docker installed on your host machine, you can build
+inside a container by running:
 
 ```bash
 ./build.sh docker
@@ -42,6 +45,21 @@ The working directory in the container is mounted from your host. This
 allows you to access the files in your Avro development tree from the
 Docker container.
 
+There are some additional `DOCKER_` environment variables described in 
+[build.sh](./build.sh) that can be used to interact with the image using
+the build script. Some examples:
+
+```bash
+# Rebuild the docker image without using the build cache.
+DOCKER_BUILD_XTRA_ARGS=--no-cache ./build.sh docker
+
+# Build a docker image with a specific tag (for an RC or poc, for example)
+DOCKER_IMAGE_NAME=avro-build:1.10.1-rc1 ./build.sh docker
+
+# Run a command and return.
+DOCKER_RUN_ENTRYPOINT="mvn --version" ./build.sh docker
+```
+
 ## Building
 
 Once the requirements are installed (or from the Docker container),