Skip to content

Commit

Permalink
More cleanup of docker run machinery. (grpc#28734)
Browse files Browse the repository at this point in the history
* update copyrights as per review comments

* docker run.sh cleanup: unnecessary to set CONFIG

Originally added in as
https://github.com/grpc/grpc/pull/2225/files#diff-156ef223959550cc6280d4747c600c187f275e5bb1a8f73c297e282898bf5a60R34
and no longer needed.

* XML_REPORT env variable is not used anywhere, run_tests_cmd carries the args

* remove unnecessary POST_GIT_STEP setting

It was originally added in gcc4.4 compatibility test and gcc4.4 is no
longer supported
grpc#5384

* more docker_run.sh cleanup
  • Loading branch information
jtattermusch authored Feb 10, 2022
1 parent 14169dd commit dd84445
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 16 deletions.
5 changes: 3 additions & 2 deletions tools/run_tests/dockerize/build_and_run_docker.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright 2015 gRPC authors.
# Copyright 2016 The gRPC Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -51,6 +51,8 @@ else
fi

# Git root as seen by the docker instance
# TODO(jtattermusch): rename to a more descriptive directory name
# currently that's nontrivial because the name is hardcoded in many places.
EXTERNAL_GIT_ROOT=/var/local/jenkins/grpc

# temporary directory that will be mounted to the docker container
Expand Down Expand Up @@ -78,7 +80,6 @@ docker run \
-v "${git_root}:${EXTERNAL_GIT_ROOT}" \
-v "${TEMP_REPORT_DIR}:/var/local/report_dir" \
-v "${TEMP_OUTPUT_DIR}:/var/local/output_dir" \
-w /var/local/git/grpc \
"${DOCKER_IMAGE_NAME}" \
bash -l "/var/local/jenkins/grpc/${DOCKER_RUN_SCRIPT}" || DOCKER_EXIT_CODE=$?

Expand Down
21 changes: 7 additions & 14 deletions tools/run_tests/dockerize/docker_run.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright 2015 gRPC authors.
# Copyright 2016 The gRPC Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -18,32 +18,25 @@

set -e

# TODO(jtattermusch): added in https://github.com/grpc/grpc/pull/17303, should be removed.
export CONFIG=${config:-opt}

if [ "$RELATIVE_COPY_PATH" == "" ]
if [ "${RELATIVE_COPY_PATH}" == "" ]
then
mkdir -p /var/local/git
git clone "$EXTERNAL_GIT_ROOT" /var/local/git/grpc
git clone "${EXTERNAL_GIT_ROOT}" /var/local/git/grpc
# clone gRPC submodules, use data from locally cloned submodules where possible
# TODO: figure out a way to eliminate this following shellcheck suppressions
# shellcheck disable=SC2016,SC1004
(cd "${EXTERNAL_GIT_ROOT}" && git submodule foreach 'git clone ${EXTERNAL_GIT_ROOT}/${name} /var/local/git/grpc/${name}')
(cd /var/local/git/grpc && git submodule init)
else
mkdir -p "/var/local/git/grpc/$RELATIVE_COPY_PATH"
cp -r "$EXTERNAL_GIT_ROOT/$RELATIVE_COPY_PATH"/* "/var/local/git/grpc/$RELATIVE_COPY_PATH"
mkdir -p "/var/local/git/grpc/${RELATIVE_COPY_PATH}"
cp -r "${EXTERNAL_GIT_ROOT}/${RELATIVE_COPY_PATH}"/* "/var/local/git/grpc/${RELATIVE_COPY_PATH}"
fi

cd /var/local/git/grpc

# ensure the "reports" directory exists
mkdir -p reports

# TODO(jtattermusch): this is garbage, remove it.
$POST_GIT_STEP

# TODO(jtattermusch): is this necessary?
cd /var/local/git/grpc

exit_code=0
${DOCKER_RUN_SCRIPT_COMMAND} || exit_code=$?

Expand Down

0 comments on commit dd84445

Please sign in to comment.