Skip to content

fix: maketplace integs #3925

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

Conversation

mufaddal-rohawala
Copy link
Member

@mufaddal-rohawala mufaddal-rohawala commented Jun 12, 2023

Issue #, if available:

Description of changes:

2 integ-tests are failing due to ParamValidation Error:
Can you take a look once
FAILED tests/integ/test_marketplace.py::test_marketplace_attach - botocore.ex...
FAILED tests/integ/test_marketplace.py::test_marketplace_transform_job - boto...

=================================== FAILURES ===================================
___________________________ test_marketplace_attach ____________________________
[gw220] linux -- Python 3.7.13 /codebuild/output/src470532371/src/github.com/aws/sagemaker-python-sdk/.tox/py37/bin/python

sagemaker_session = <sagemaker.session.Session object at 0x7f9e43fa5a90>
cpu_instance_type = 'ml.m4.xlarge'

    @pytest.mark.skipif(
        tests.integ.test_region() in tests.integ.NO_MARKET_PLACE_REGIONS,
        reason="Marketplace is not available in {}".format(tests.integ.test_region()),
    )
    def test_marketplace_attach(sagemaker_session, cpu_instance_type):
        with timeout(minutes=15):
            data_path = os.path.join(DATA_DIR, "marketplace", "training")
            region = sagemaker_session.boto_region_name
            account = REGION_ACCOUNT_MAP[region]
            algorithm_arn = ALGORITHM_ARN.format(
                partition=_aws_partition(region), region=region, account=account
            )
    
            mktplace = AlgorithmEstimator(
                algorithm_arn=algorithm_arn,
                role="SageMakerRole",
                instance_count=1,
                instance_type=cpu_instance_type,
                sagemaker_session=sagemaker_session,
                base_job_name=unique_name_from_base("test-marketplace"),
            )
    
            train_input = mktplace.sagemaker_session.upload_data(
                path=data_path, key_prefix="integ-test-data/marketplace/train"
            )
    
            mktplace.fit({"training": train_input}, wait=False)
            training_job_name = mktplace.latest_training_job.name
    
            print("Waiting to re-attach to the training job: %s" % training_job_name)
            time.sleep(20)
            endpoint_name = "test-marketplace-estimator{}".format(sagemaker_timestamp())
    
        with timeout_and_delete_endpoint_by_name(endpoint_name, sagemaker_session, minutes=20):
            print("Re-attaching now to: %s" % training_job_name)
            estimator = AlgorithmEstimator.attach(
                training_job_name=training_job_name, sagemaker_session=sagemaker_session
            )
            predictor = estimator.deploy(
>               1, cpu_instance_type, endpoint_name=endpoint_name, serializer=CSVSerializer()
            )

tests/integ/test_marketplace.py:150: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.tox/py37/lib/python3.7/site-packages/sagemaker/estimator.py:1632: in deploy
    inference_recommendation_id=inference_recommendation_id,
.tox/py37/lib/python3.7/site-packages/sagemaker/model.py:1301: in deploy
    instance_type, accelerator_type, tags, serverless_inference_config
.tox/py37/lib/python3.7/site-packages/sagemaker/model.py:1800: in _create_sagemaker_model
    tags=kwargs.get("tags"),
.tox/py37/lib/python3.7/site-packages/sagemaker/session.py:3548: in create_model
    self._intercept_create_request(create_model_request, submit, self.create_model.__name__)
.tox/py37/lib/python3.7/site-packages/sagemaker/session.py:5427: in _intercept_create_request
    return create(request)
.tox/py37/lib/python3.7/site-packages/sagemaker/session.py:3536: in submit
    self.sagemaker_client.create_model(**request)
.tox/py37/lib/python3.7/site-packages/botocore/client.py:530: in _api_call
    return self._make_api_call(operation_name, kwargs)
.tox/py37/lib/python3.7/site-packages/botocore/client.py:928: in _make_api_call
    headers=additional_headers,
.tox/py37/lib/python3.7/site-packages/botocore/client.py:992: in _convert_to_request_dict
    api_params, operation_model
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <botocore.validate.ParamValidationDecorator object at 0x7f9e449c1c50>
parameters = {'Containers': [{'ModelPackageName': None}], 'EnableNetworkIsolation': True, 'ExecutionRoleArn': 'arn:aws:iam::142577830533:role/SageMakerRole', 'ModelName': 'test-marketplace-1686350945-f70d-2023-06-09-22-51-43-805'}
operation_model = OperationModel(name=CreateModel)

    def serialize_to_request(self, parameters, operation_model):
        input_shape = operation_model.input_shape
        if input_shape is not None:
            report = self._param_validator.validate(
                parameters, operation_model.input_shape
            )
            if report.has_errors():
>               raise ParamValidationError(report=report.generate_report())
E               botocore.exceptions.ParamValidationError: Parameter validation failed:
E               Invalid type for parameter Containers[0].ModelPackageName, value: None, type: <class 'NoneType'>, valid types: <class 'str'>

.tox/py37/lib/python3.7/site-packages/botocore/validate.py:381: ParamValidationError
----------------------------- Captured stdout call -----------------------------

Testing done:

Merge Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.

General

  • I have read the CONTRIBUTING doc
  • I certify that the changes I am introducing will be backward compatible, and I have discussed concerns about this, if any, with the Python SDK team
  • I used the commit message format described in CONTRIBUTING
  • I have passed the region in to all S3 and STS clients that I've initialized as part of this change.
  • I have updated any necessary documentation, including READMEs and API docs (if appropriate)

Tests

  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have added unit and/or integration tests as appropriate to ensure backward compatibility of the changes
  • I have checked that my tests are not configured for a specific region or account (if appropriate)
  • I have used unique_name_from_base to create resource names in integ tests (if appropriate)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@mufaddal-rohawala mufaddal-rohawala requested a review from a team as a code owner June 12, 2023 18:54
@mufaddal-rohawala mufaddal-rohawala requested review from trajanikant and removed request for a team June 12, 2023 18:54
@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-notebook-tests
  • Commit ID: 8d8aef8
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-local-mode-tests
  • Commit ID: 8d8aef8
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

Copy link
Member Author

@mufaddal-rohawala mufaddal-rohawala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/bot run notebook-tests

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-unit-tests
  • Commit ID: 8d8aef8
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@codecov-commenter
Copy link

codecov-commenter commented Jun 12, 2023

Codecov Report

Merging #3925 (8d8aef8) into master (12b19ee) will decrease coverage by 0.71%.
The diff coverage is 50.00%.

@@            Coverage Diff             @@
##           master    #3925      +/-   ##
==========================================
- Coverage   90.07%   89.37%   -0.71%     
==========================================
  Files        1156      271     -885     
  Lines      106844    26410   -80434     
==========================================
- Hits        96245    23603   -72642     
+ Misses      10599     2807    -7792     
Impacted Files Coverage Δ
src/sagemaker/model.py 93.62% <50.00%> (ø)

... and 1426 files with indirect coverage changes

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-pr
  • Commit ID: 8d8aef8
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-notebook-tests
  • Commit ID: 8d8aef8
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-notebook-tests
  • Commit ID: 8d8aef8
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

Copy link
Member Author

@mufaddal-rohawala mufaddal-rohawala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/bot run notebook-tests

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-slow-tests
  • Commit ID: 8d8aef8
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-notebook-tests
  • Commit ID: 8d8aef8
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mufaddal-rohawala mufaddal-rohawala merged commit 09aa2e1 into aws:master Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants