Skip to content

fix: use ECR public for multidatamodel tests #2153

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

Merged
merged 5 commits into from
Feb 17, 2021
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
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
6 changes: 5 additions & 1 deletion buildspec-slowtests.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
version: 0.2

phases:
pre_build:
commands:
- start-dockerd

build:
commands:
- IGNORE_COVERAGE=-

# slow tests
- start_time=`date +%s`
- execute-command-if-has-matching-changes "tox -e py38 -- tests/integ -m slow_test -n 10 --durations 0" "tests/integ" "tests/data" "tests/conftest.py" "tests/__init__.py" "src/*.py" "setup.py" "setup.cfg" "buildspec-slowtests.yml"
- execute-command-if-has-matching-changes "tox -e py38 -- tests/integ -m slow_test -n 16 --durations 0" "tests/integ" "tests/data" "tests/conftest.py" "tests/__init__.py" "src/*.py" "setup.py" "setup.cfg" "buildspec-slowtests.yml"
- ./ci-scripts/displaytime.sh 'py38 slow tests' $start_time
4 changes: 2 additions & 2 deletions tests/data/multimodel/container/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM 142577830533.dkr.ecr.us-east-2.amazonaws.com/ubuntu:16.04
FROM public.ecr.aws/ubuntu/ubuntu:18.04

# Set a docker label to advertise multi-model support on the container
LABEL com.amazonaws.sagemaker.capabilities.multi-models=true
Expand All @@ -15,7 +15,7 @@ RUN apt-get update && \
curl \
vim \
&& rm -rf /var/lib/apt/lists/* \
&& curl -O https://bootstrap.pypa.io/3.5/get-pip.py \
&& curl -O https://bootstrap.pypa.io/get-pip.py \
&& python3 get-pip.py

RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1
Expand Down
1 change: 1 addition & 0 deletions tests/integ/test_lda.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from tests.integ.record_set import prepare_record_set_from_local_files


@pytest.mark.slow_test
@pytest.mark.skipif(
tests.integ.test_region() in tests.integ.NO_LDA_REGIONS,
reason="LDA image is not supported in certain regions",
Expand Down
1 change: 1 addition & 0 deletions tests/integ/test_model_quality_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ def test_model_quality_monitor(
monitor.delete_monitoring_schedule()


@pytest.mark.slow_test
@pytest.mark.skipif(
tests.integ.test_region() in tests.integ.NO_MODEL_MONITORING_REGIONS,
reason="ModelMonitoring is not yet supported in this region.",
Expand Down
29 changes: 1 addition & 28 deletions tests/integ/test_multidatamodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
import pytest
from botocore.exceptions import ClientError

import tests

from sagemaker import utils
from sagemaker.amazon.randomcutforest import RandomCutForest
from sagemaker.deserializers import StringDeserializer
Expand Down Expand Up @@ -53,10 +51,6 @@ def container_image(sagemaker_session):

docker_client = docker.from_env()

# Base image pull
base_image = "142577830533.dkr.ecr.us-east-2.amazonaws.com/ubuntu:16.04"
docker_client.images.pull(base_image, auth_config={"username": username, "password": password})

# Build and tag docker image locally
image, build_log = docker_client.images.build(
path=os.path.join(DATA_DIR, "multimodel", "container"),
Expand Down Expand Up @@ -134,10 +128,6 @@ def _ecr_login(ecr_client):
return username, password


@pytest.mark.skipif(
tests.integ.test_region() != "us-east-2",
reason="Pulling the base image is currently limited to us-east-2.",
)
def test_multi_data_model_deploy_pretrained_models(
container_image, sagemaker_session, cpu_instance_type
):
Expand Down Expand Up @@ -198,10 +188,6 @@ def test_multi_data_model_deploy_pretrained_models(


@pytest.mark.local_mode
@pytest.mark.skipif(
tests.integ.test_region() != "us-east-2",
reason="Pulling the base image is currently limited to us-east-2.",
)
def test_multi_data_model_deploy_pretrained_models_local_mode(container_image, sagemaker_session):
timestamp = sagemaker_timestamp()
endpoint_name = "test-multimodel-endpoint-{}".format(timestamp)
Expand Down Expand Up @@ -262,11 +248,6 @@ def test_multi_data_model_deploy_pretrained_models_local_mode(container_image, s
assert "Could not find endpoint" in str(exception.value)


@pytest.mark.slow_test
@pytest.mark.skipif(
tests.integ.test_region() != "us-east-2",
reason="Pulling the base image is currently limited to us-east-2.",
)
def test_multi_data_model_deploy_trained_model_from_framework_estimator(
container_image,
sagemaker_session,
Expand Down Expand Up @@ -381,10 +362,7 @@ def _mxnet_training_job(
return mx.create_model(image_uri=container_image)


@pytest.mark.skipif(
tests.integ.test_region() != "us-east-2",
reason="Pulling the base image is currently limited to us-east-2.",
)
@pytest.mark.slow_test
def test_multi_data_model_deploy_train_model_from_amazon_first_party_estimator(
container_image, sagemaker_session, cpu_instance_type
):
Expand Down Expand Up @@ -482,11 +460,6 @@ def __rcf_training_job(
return rcf_model


@pytest.mark.slow_test
@pytest.mark.skipif(
tests.integ.test_region() != "us-east-2",
reason="Pulling the base image is currently limited to us-east-2.",
)
def test_multi_data_model_deploy_pretrained_models_update_endpoint(
container_image, sagemaker_session, cpu_instance_type, alternative_cpu_instance_type
):
Expand Down
1 change: 1 addition & 0 deletions tests/integ/test_tf.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ def test_mnist_distributed(
)


@pytest.mark.slow_test
def test_mnist_async(sagemaker_session, cpu_instance_type, tf_full_version, tf_full_py_version):
estimator = TensorFlow(
entry_point=SCRIPT,
Expand Down
1 change: 1 addition & 0 deletions tests/integ/test_tuner.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ def test_tuning_kmeans_identical_dataset_algorithm_tuner_from_non_terminal_paren
)


@pytest.mark.slow_test
@pytest.mark.skipif(
tests.integ.test_region() in tests.integ.NO_LDA_REGIONS,
reason="LDA image is not supported in certain regions",
Expand Down