Skip to content

Commit

Permalink
update unit test to fix some failures
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruinong Tian committed Jul 17, 2024
1 parent 22d5518 commit c496065
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion test/test_artifacts/v0/keras.test.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN sudo apt-get update && sudo apt-get install -y git graphviz && \
:

# Some of the keras guides requires pydot and graphviz to be installed
RUN micromamba install -y --freeze-installed conda-forge::pydot nvidia::cuda-nvcc
RUN micromamba install -y --freeze-installed -c conda-forge pydot cuda-nvcc jax
ENV XLA_FLAGS=--xla_gpu_cuda_data_dir=/opt/conda

WORKDIR "keras-io/guides"
Expand Down
1 change: 1 addition & 0 deletions test/test_artifacts/v0/run_pandas_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import sys

import pandas
import boto3

# We change the working directory here because there is at least one test (`test_html_template_extends_options`) which
# expects the directory to be 'pandas'. Ideally, we would have changed directories through a `WORKDIR` in Dockerfile
Expand Down
3 changes: 3 additions & 0 deletions test/test_artifacts/v0/scripts/run_pysdk_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

# We need to checkout the version of sagemaker-python-sdk that is installed in the mamba environment.

# Sagemaker Python SDK's unit tests requires AWS_DEFAULT_REGION to be set. So, using an arbitrary value of us-east-1
export AWS_DEFAULT_REGION=us-west-2

pysdk_version=$(micromamba list | grep sagemaker-python-sdk | tr -s ' ' | cut -d ' ' -f 3)
# Checkout the corresponding sagemaker-python-sdk version
git checkout tags/v$pysdk_version
Expand Down
3 changes: 1 addition & 2 deletions test/test_artifacts/v0/sm-python-sdk.test.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ ARG MAMBA_DOCKERFILE_ACTIVATE=1
RUN sudo apt-get update && sudo apt-get install -y git && \
git clone --recursive https://github.com/aws/sagemaker-python-sdk.git && \
:
# Sagemaker Python SDK's unit tests requires AWS_DEFAULT_REGION to be set. So, using an arbitrary value of us-east-1
ENV AWS_DEFAULT_REGION=us-east-1

WORKDIR "sagemaker-python-sdk"
COPY --chown=$MAMBA_USER:$MAMBA_USER scripts/run_pysdk_tests.sh .
RUN chmod +x run_pysdk_tests.sh
Expand Down
2 changes: 1 addition & 1 deletion test/test_artifacts/v1/keras.test.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN sudo apt-get update && sudo apt-get install -y git graphviz && \
:

# Some of the keras guides requires pydot and graphviz to be installed
RUN micromamba install -y --freeze-installed conda-forge::pydot "nvidia::cuda-nvcc>=11.8,<11.9"
RUN micromamba install -y --freeze-installed conda-forge::pydot "nvidia::cuda-nvcc>=11.8,<11.9" jax
ENV XLA_FLAGS=--xla_gpu_cuda_data_dir=/opt/conda

WORKDIR "keras-io/guides"
Expand Down
3 changes: 3 additions & 0 deletions test/test_artifacts/v1/scripts/run_pysdk_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

# We need to checkout the version of sagemaker-python-sdk that is installed in the mamba environment.

# Sagemaker Python SDK's unit tests requires AWS_DEFAULT_REGION to be set. So, using an arbitrary value of us-east-1
export AWS_DEFAULT_REGION=us-west-2

pysdk_version=$(micromamba list | grep sagemaker-python-sdk | tr -s ' ' | cut -d ' ' -f 3)
# Checkout the corresponding sagemaker-python-sdk version
git checkout tags/v$pysdk_version
Expand Down
2 changes: 0 additions & 2 deletions test/test_artifacts/v1/sm-python-sdk.test.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ FROM $SAGEMAKER_DISTRIBUTION_IMAGE
ARG MAMBA_DOCKERFILE_ACTIVATE=1
RUN git clone --recursive https://github.com/aws/sagemaker-python-sdk.git

# Sagemaker Python SDK's unit tests requires AWS_DEFAULT_REGION to be set. So, using an arbitrary value of us-east-1
ENV AWS_DEFAULT_REGION=us-east-1
WORKDIR "sagemaker-python-sdk"
COPY --chown=$MAMBA_USER:$MAMBA_USER scripts/run_pysdk_tests.sh .
RUN chmod +x run_pysdk_tests.sh
Expand Down

0 comments on commit c496065

Please sign in to comment.