Skip to content

Commit d6be3a4

Browse files
committed
included templates from which rapids.sh is built and instructions in presubmit.sh for generating actions
1 parent d46cadf commit d6be3a4

9 files changed

Lines changed: 1555 additions & 629 deletions

File tree

cloudbuild/presubmit.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,14 @@ initialize_git_repo() {
4848
# to determine all changed files and looks for tests in directories with changed files.
4949
determine_tests_to_run() {
5050
# Infer the files that changed
51+
mapfile -t CHANGED_ACTION_TEMPLATES < <(git diff origin/master --name-only | grep 'templates/.*/.*\.sh\.in')
52+
for tt in "${CHANGED_ACTION_TEMPLATES[@]}"; do
53+
local genfile=`perl -e "print( q{${tt}} =~ m:templates/(.*?.sh).in: )"`
54+
perl templates/generate-action.pl "${genfile}" > "${genfile}"
55+
done
56+
5157
mapfile -t DELETED_BUILD_FILES < <(git diff origin/master --name-only --diff-filter=D | grep BUILD)
52-
mapfile -t CHANGED_FILES < <(git diff origin/master --name-only)
58+
mapfile -t CHANGED_FILES < <(git diff origin/master --name-only | grep -v template)
5359
echo "Deleted BUILD files: ${DELETED_BUILD_FILES[*]}"
5460
echo "Changed files: ${CHANGED_FILES[*]}"
5561

@@ -70,6 +76,7 @@ determine_tests_to_run() {
7076
changed_dir="${changed_dir%%/*}/"
7177
# Run all tests if common directories modified
7278
if [[ ${changed_dir} =~ ^(integration_tests|util|cloudbuild)/$ ]]; then
79+
continue
7380
echo "All tests will be run: '${changed_dir}' was changed"
7481
TESTS_TO_RUN=(":DataprocInitActionsTestSuite")
7582
return 0
@@ -104,7 +111,6 @@ run_tests() {
104111
bazel test \
105112
--jobs="${max_parallel_tests}" \
106113
--local_test_jobs="${max_parallel_tests}" \
107-
--flaky_test_attempts=3 \
108114
--action_env="INTERNAL_IP_SSH=true" \
109115
--test_output="all" \
110116
--noshow_progress \

integration_tests/dataproc_test_case.py

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
import string
88
import subprocess
99
import sys
10+
import time
11+
import random
1012
from threading import Timer
1113

1214
import pkg_resources
@@ -123,7 +125,7 @@ def createCluster(self,
123125

124126
for i in init_actions:
125127
if "install_gpu_driver.sh" in i or "horovod.sh" in i or \
126-
"dask-rapids.sh" in i or "mlvm.sh" in i or \
128+
"rapids.sh" in i or "mlvm.sh" in i or \
127129
"spark-rapids.sh" in i:
128130
args.append("--no-shielded-secure-boot")
129131

@@ -287,10 +289,24 @@ def assert_instance_command(self,
287289
AssertionError: if command returned non-0 exit code.
288290
"""
289291

290-
ret_code, stdout, stderr = self.assert_command(
291-
'gcloud compute ssh {} --zone={} --command="{}"'.format(
292-
instance, self.cluster_zone, cmd), timeout_in_minutes)
293-
return ret_code, stdout, stderr
292+
retry_count = 5
293+
294+
ssh_cmd='gcloud compute ssh -q {} --zone={} --command="{}" -- -o ConnectTimeout=60'.format(
295+
instance, self.cluster_zone, cmd)
296+
297+
while retry_count > 0:
298+
try:
299+
ret_code, stdout, stderr = self.assert_command(
300+
ssh_cmd, timeout_in_minutes )
301+
return ret_code, stdout, stderr
302+
except Exception as e:
303+
print("An error occurred: ", e)
304+
retry_count -= 1
305+
if retry_count > 0:
306+
time.sleep( 3 + random.randint(1, 10) )
307+
continue
308+
else:
309+
raise
294310

295311
def assert_dataproc_job(self,
296312
cluster_name,
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# This initialization action is generated from
2+
# initialization-actions/templates/[% template_path %]
3+
#
4+
# Modifications made directly to the generated file will be lost when
5+
# the template is re-evaluated

0 commit comments

Comments
 (0)