Skip to content

Commit d2eb527

Browse files
committed
testing fix
1 parent 1688073 commit d2eb527

File tree

5 files changed

+21
-54
lines changed

5 files changed

+21
-54
lines changed

cloudbuild/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,7 @@ RUN update-alternatives --install /usr/bin/bazel bazel /usr/bin/bazel-${bazel_ve
3030
update-alternatives --set bazel /usr/bin/bazel-${bazel_version}
3131

3232
USER ia-tests
33+
34+
# Install Python dependencies
35+
RUN python3 -m pip install --upgrade pip && \
36+
python3 -m pip install -r /init-actions/requirements.txt

gpu/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ RUN apt-get -y -qq install emacs-nox vim uuid-runtime > /dev/null 2>&1 && apt-ge
4040
WORKDIR /init-actions
4141

4242
USER ia-tests
43+
COPY --chown=ia-tests:ia-tests "cloudbuild/key.json" /key.json
4344
COPY --chown=ia-tests:ia-tests . ${WORKDIR}
4445

4546
ENTRYPOINT ["/bin/bash"]

gpu/install_gpu_driver.sh

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -2637,50 +2637,6 @@ function cache_fetched_package() {
26372637
fi
26382638
}
26392639

2640-
function fix_nodemanager_init_script() {
2641-
local lsb_script="/etc/init.d/hadoop-yarn-nodemanager"
2642-
local service_name="hadoop-yarn-nodemanager"
2643-
local generated_unit_file="/run/systemd/generator.late/${service_name}.service"
2644-
local changed=0
2645-
2646-
if [[ ! -f "${lsb_script}" ]]; then
2647-
echo "WARN: LSB script ${lsb_script} not found."
2648-
return
2649-
fi
2650-
2651-
# 1. Fix the stop command
2652-
local broken_stop_cmd='start_daemon $EXEC_PATH --config "$CONF_DIR" stop $DAEMON_FLAGS'
2653-
local fixed_stop_cmd='start_daemon $EXEC_PATH --config "$CONF_DIR" --daemon stop $DAEMON_FLAGS'
2654-
2655-
if grep -qF "${broken_stop_cmd}" "${lsb_script}"; then
2656-
echo "Fixing stop command in ${lsb_script}..."
2657-
local sed_broken_stop_cmd=$(printf '%s\\n' "${broken_stop_cmd}" | sed 's/[][\\/.^$*]/\\\\&/g')
2658-
local sed_fixed_stop_cmd=$(printf '%s\\n' "${fixed_cmd}" | sed 's/[][\\/.^$*]/\\\\&/g')
2659-
sed -i "s|${sed_broken_stop_cmd}|${sed_fixed_stop_cmd}|" "${lsb_script}"
2660-
changed=1
2661-
fi
2662-
2663-
# 2. Prepend source commands to the 'su -c' line in the start function
2664-
local start_line_marker='--daemon start $DAEMON_FLAGS'
2665-
if grep -qF "${start_line_marker}" "${lsb_script}" && ! grep -qF "source /etc/environment && source /etc/default/hadoop-yarn-nodemanager" "${lsb_script}"; then
2666-
echo "Adding source commands to su -c in start() for ${lsb_script}"
2667-
sed -i '/su -s \/bin\/bash yarn -c "/s|yarn -c "|yarn -c "source /etc/environment && source /etc/default/hadoop-yarn-nodemanager && |' "${lsb_script}"
2668-
changed=1
2669-
fi
2670-
2671-
if [[ "${changed}" -eq 1 ]]; then
2672-
if [[ -f "${generated_unit_file}" ]]; then
2673-
echo "Removing old generated unit file: ${generated_unit_file}"
2674-
rm -f "${generated_unit_file}"
2675-
fi
2676-
echo "Reloading systemd daemon to regenerate units..."
2677-
systemctl daemon-reload
2678-
echo "Systemd daemon reloaded."
2679-
else
2680-
echo "No changes made to ${lsb_script}."
2681-
fi
2682-
}
2683-
26842640
function clean_up_sources_lists() {
26852641
if ! is_debuntu; then return; fi
26862642
#

integration_tests/dataproc_test_case.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import sys
1010
from threading import Timer
1111

12-
from packaging import version
12+
import pkg_resources
1313
from absl import flags
1414
from absl.testing import parameterized
1515

@@ -252,7 +252,7 @@ def getImageVersion():
252252
# Special case a 'preview' image versions and return a large number
253253
# instead to make it a higher image version in comparisons
254254
version = FLAGS.image_version
255-
return version.parse('999') if version.startswith(
255+
return pkg_resources.parse_version('999') if version.startswith(
256256
'preview') else pkg_resources.parse_version(version.split('-')[0])
257257

258258
@staticmethod
@@ -307,21 +307,23 @@ def assert_dataproc_job(self,
307307
308308
Args:
309309
cluster_name: cluster name to submit job to
310-
job_type: type of the job, e.g. spark, hadoop, pyspark
311-
job_params: job parameters
312-
timeout_in_minutes: timeout in minutes
310+
job_type: job type (hadoop, spark, etc)
311+
job_params: job command parameters
312+
timeout_in_minutes: timeout in minutes after which process that
313+
waits on job will be killed if job did not
314+
finish
315+
Returns:
316+
ret_code: the return code of the job
317+
stdout: standard output of the job
318+
stderr: error output of the job
313319
Raises:
314320
AssertionError: if job returned non-0 exit code.
315321
"""
316322

317-
ret_code, stdout, stderr = DataprocTestCase.run_command(
323+
ret_code, stdout, stderr = self.assert_command(
318324
'gcloud dataproc jobs submit {} --cluster={} --region={} {}'.
319325
format(job_type, cluster_name, self.REGION,
320326
job_params), timeout_in_minutes)
321-
self.assertEqual(
322-
ret_code, 0,
323-
"Job failed with code {}. stdout: {}. stderr: {}".format(
324-
ret_code, stdout, stderr))
325327
return ret_code, stdout, stderr
326328

327329
def assert_command(self, cmd, timeout_in_minutes=DEFAULT_TIMEOUT):

requirements.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
bootstrapping==0.1.2
2+
click==8.1.7
3+
packaging
4+
setuptools<70.0.0

0 commit comments

Comments
 (0)