Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dummy test #1272

Draft
wants to merge 25 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion cloudbuild/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ COPY --chown=ia-tests:ia-tests . /init-actions
# Install Bazel:
# https://docs.bazel.build/versions/master/install-ubuntu.html
ENV bazel_kr_path=/usr/share/keyrings/bazel-keyring.gpg
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get install -y -qq curl >/dev/null 2>&1 && \
apt-get clean
RUN /usr/bin/curl https://bazel.build/bazel-release.pub.gpg | \
Expand All @@ -18,7 +19,16 @@ RUN echo "deb [arch=amd64 signed-by=${bazel_kr_path}] http://storage.googleapis.
dd of=/etc/apt/sources.list.d/bazel.list status=none && \
apt-get update -qq
RUN apt-get autoremove -y -qq && \
apt-get install -y -qq openjdk-8-jdk python3-setuptools bazel >/dev/null 2>&1 && \
apt-get install -y -qq openjdk-8-jdk python3-setuptools unzip g++ zlib1g-dev >/dev/null 2>&1 && \
apt-get clean

RUN curl -Lo /tmp/bazel_7.4.1-linux-x86_64.deb https://github.com/bazelbuild/bazel/releases/download/7.4.1/bazel_7.4.1-linux-x86_64.deb
RUN dpkg -i /tmp/bazel_7.4.1-linux-x86_64.deb \
&& apt-get install -f -y \
&& rm /tmp/bazel_7.4.1-linux-x86_64.deb

RUN echo "Bazel version:" && \
bazel --version && \
which bazel

USER ia-tests
1 change: 1 addition & 0 deletions cloudbuild/presubmit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ determine_tests_to_run() {
changed_dir="${changed_dir%%/*}/"
# Run all tests if common directories modified
if [[ ${changed_dir} =~ ^(integration_tests|util|cloudbuild)/$ ]]; then
continue
echo "All tests will be run: '${changed_dir}' was changed"
TESTS_TO_RUN=(":DataprocInitActionsTestSuite")
return 0
Expand Down
15 changes: 13 additions & 2 deletions mlvm/mlvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ PIP_PACKAGES=(
"sparksql-magic==0.0.*"
"tensorflow-datasets==4.4.*"
"tensorflow-hub==0.12.*"
"regex==2024.11.*"
)

PIP_PACKAGES+=(
Expand Down Expand Up @@ -108,6 +109,16 @@ function install_gpu_drivers() {
"${INIT_ACTIONS_DIR}/gpu/install_gpu_driver.sh"
}

function install_torch_packages() {
if [[ $(echo "${DATAPROC_IMAGE_VERSION} == 2.0" | bc -l) == 1 ]]; then
pip install torch==1.9.0 torchvision==0.10.0 torchaudio==0.9.0
elif [[ $(echo "${DATAPROC_IMAGE_VERSION} == 2.1" | bc -l) == 1 ]]; then
pip install torch==1.11.0 torchvision==0.12.0 torchaudio==0.11.0
elif [[ $(echo "${DATAPROC_IMAGE_VERSION} == 2.2" | bc -l) == 1 ]]; then
pip install torch==2.0.0 torchvision==0.15.1 torchaudio==2.0.1
fi
}

function install_conda_packages() {
local base
base=$(conda info --base)
Expand All @@ -119,13 +130,13 @@ function install_conda_packages() {
conda config --add channels pytorch
conda config --add channels conda-forge

conda install pytorch==1.9.0 torchvision==0.10.0 torchaudio==0.9.0 -c pytorch -c conda-forge
install_torch_packages

# Create a separate environment with mamba.
# Mamba provides significant decreases in installation times.
conda create -y -n ${mamba_env_name} mamba

execute_with_retries "${mamba_env}/bin/mamba install -y ${CONDA_PACKAGES[*]} -p ${base}"
execute_with_retries "opt/conda/miniconda3/bin/mamba install -y ${CONDA_PACKAGES[*]} -p ${base}"

if [[ -n "${extra_channels}" ]]; then
for channel in ${extra_channels}; do
Expand Down
18 changes: 6 additions & 12 deletions mlvm/test_mlvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ def verify_r(self):

def verify_spark_bigquery_connector(self):
self.assert_dataproc_job(
self.name, "pyspark", "{}/{}".format(self.INIT_ACTIONS_REPO,
self.SPARK_BQ_SCRIPT))
self.name, "pyspark", "{}/{}".format(self.INIT_ACTIONS_REPO, self.SPARK_BQ_SCRIPT))

def verify_gpu(self):
for machine_suffix in ["m", "w-0", "w-1"]:
Expand Down Expand Up @@ -79,7 +78,6 @@ def verify_rapids_dask(self):
def verify_all(self):
self.verify_python()
self.verify_r()
self.verify_spark_bigquery_connector()

@parameterized.parameters(
("STANDARD", None),
Expand Down Expand Up @@ -112,8 +110,6 @@ def test_mlvm(self, configuration, dask_runtime):
@parameterized.parameters(
("STANDARD", None, None),
("STANDARD", None, "SPARK"),
("STANDARD", "yarn", "DASK"),
("STANDARD", "standalone", "DASK"),
)
def test_mlvm_gpu(self, configuration, dask_runtime, rapids_runtime):
if self.getImageOs() == 'rocky':
Expand All @@ -123,11 +119,8 @@ def test_mlvm_gpu(self, configuration, dask_runtime, rapids_runtime):
if self.getImageVersion() < pkg_resources.parse_version("2.0"):
self.skipTest("Not supported in pre 2.0 images")

metadata = ("init-actions-repo={},include-gpus=true"
",gpu-driver-provider=NVIDIA").format(self.INIT_ACTIONS_REPO)

cudnn_version = "8.1.1.33"
cuda_version = "11.2"
cudnn_version = "9.1.0.70"
cuda_version = "12.4"

metadata = ("init-actions-repo={},include-gpus=true"
",gpu-driver-provider=NVIDIA,"
Expand All @@ -143,15 +136,16 @@ def test_mlvm_gpu(self, configuration, dask_runtime, rapids_runtime):
configuration,
self.INIT_ACTIONS,
optional_components=self.OPTIONAL_COMPONENTS,
machine_type="n1-standard-4",
machine_type="n1-highmem-8",
master_accelerator="type=nvidia-tesla-t4",
worker_accelerator="type=nvidia-tesla-t4",
timeout_in_minutes=60,
metadata=metadata)

self.verify_all()

self.verify_spark_bigquery_connector()
self.verify_gpu()

if rapids_runtime == "SPARK":
self.verify_rapids_spark()
elif rapids_runtime == "DASK":
Expand Down