/* * Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.sagemaker.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* Describes the Docker container for the model package. *
* * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class ModelPackageContainerDefinition implements Serializable, Cloneable, StructuredPojo { /** ** The DNS host name for the Docker container. *
*/ private String containerHostname; /** ** The Amazon EC2 Container Registry (Amazon ECR) path where inference code is stored. *
*
* If you are using your own custom algorithm instead of an algorithm provided by SageMaker, the inference code must
* meet SageMaker requirements. SageMaker supports both registry/repository[:tag]
and
* registry/repository[@digest]
image path formats. For more information, see Using Your Own Algorithms with Amazon
* SageMaker.
*
* An MD5 hash of the training algorithm that identifies the Docker image used for training. *
*/ private String imageDigest; /** *
* The Amazon S3 path where the model artifacts, which result from model training, are stored. This path must point
* to a single gzip
compressed tar archive (.tar.gz
suffix).
*
* The model artifacts must be in an S3 bucket that is in the same region as the model package. *
** The Amazon Web Services Marketplace product ID of the model package. *
*/ private String productId; /** *
* The environment variables to set in the Docker container. Each key and value in the Environment
* string to string map can have length of up to 1024. We support up to 16 entries in the map.
*
* A structure with Model Input details. *
*/ private ModelInput modelInput; /** ** The machine learning framework of the model package container image. *
*/ private String framework; /** ** The framework version of the Model Package Container Image. *
*/ private String frameworkVersion; /** *
* The name of a pre-trained machine learning benchmarked by Amazon SageMaker Inference Recommender model that
* matches your model. You can find a list of benchmarked models by calling ListModelMetadata
.
*
* The DNS host name for the Docker container. *
* * @param containerHostname * The DNS host name for the Docker container. */ public void setContainerHostname(String containerHostname) { this.containerHostname = containerHostname; } /** ** The DNS host name for the Docker container. *
* * @return The DNS host name for the Docker container. */ public String getContainerHostname() { return this.containerHostname; } /** ** The DNS host name for the Docker container. *
* * @param containerHostname * The DNS host name for the Docker container. * @return Returns a reference to this object so that method calls can be chained together. */ public ModelPackageContainerDefinition withContainerHostname(String containerHostname) { setContainerHostname(containerHostname); return this; } /** ** The Amazon EC2 Container Registry (Amazon ECR) path where inference code is stored. *
*
* If you are using your own custom algorithm instead of an algorithm provided by SageMaker, the inference code must
* meet SageMaker requirements. SageMaker supports both registry/repository[:tag]
and
* registry/repository[@digest]
image path formats. For more information, see Using Your Own Algorithms with Amazon
* SageMaker.
*
* If you are using your own custom algorithm instead of an algorithm provided by SageMaker, the inference
* code must meet SageMaker requirements. SageMaker supports both registry/repository[:tag]
and
* registry/repository[@digest]
image path formats. For more information, see Using Your Own Algorithms with
* Amazon SageMaker.
*/
public void setImage(String image) {
this.image = image;
}
/**
*
* The Amazon EC2 Container Registry (Amazon ECR) path where inference code is stored. *
*
* If you are using your own custom algorithm instead of an algorithm provided by SageMaker, the inference code must
* meet SageMaker requirements. SageMaker supports both registry/repository[:tag]
and
* registry/repository[@digest]
image path formats. For more information, see Using Your Own Algorithms with Amazon
* SageMaker.
*
* If you are using your own custom algorithm instead of an algorithm provided by SageMaker, the inference
* code must meet SageMaker requirements. SageMaker supports both registry/repository[:tag]
and
* registry/repository[@digest]
image path formats. For more information, see Using Your Own Algorithms
* with Amazon SageMaker.
*/
public String getImage() {
return this.image;
}
/**
*
* The Amazon EC2 Container Registry (Amazon ECR) path where inference code is stored. *
*
* If you are using your own custom algorithm instead of an algorithm provided by SageMaker, the inference code must
* meet SageMaker requirements. SageMaker supports both registry/repository[:tag]
and
* registry/repository[@digest]
image path formats. For more information, see Using Your Own Algorithms with Amazon
* SageMaker.
*
* If you are using your own custom algorithm instead of an algorithm provided by SageMaker, the inference
* code must meet SageMaker requirements. SageMaker supports both registry/repository[:tag]
and
* registry/repository[@digest]
image path formats. For more information, see Using Your Own Algorithms with
* Amazon SageMaker.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ModelPackageContainerDefinition withImage(String image) {
setImage(image);
return this;
}
/**
*
* An MD5 hash of the training algorithm that identifies the Docker image used for training. *
* * @param imageDigest * An MD5 hash of the training algorithm that identifies the Docker image used for training. */ public void setImageDigest(String imageDigest) { this.imageDigest = imageDigest; } /** ** An MD5 hash of the training algorithm that identifies the Docker image used for training. *
* * @return An MD5 hash of the training algorithm that identifies the Docker image used for training. */ public String getImageDigest() { return this.imageDigest; } /** ** An MD5 hash of the training algorithm that identifies the Docker image used for training. *
* * @param imageDigest * An MD5 hash of the training algorithm that identifies the Docker image used for training. * @return Returns a reference to this object so that method calls can be chained together. */ public ModelPackageContainerDefinition withImageDigest(String imageDigest) { setImageDigest(imageDigest); return this; } /** *
* The Amazon S3 path where the model artifacts, which result from model training, are stored. This path must point
* to a single gzip
compressed tar archive (.tar.gz
suffix).
*
* The model artifacts must be in an S3 bucket that is in the same region as the model package. *
*gzip
compressed tar archive (.tar.gz
suffix). * The model artifacts must be in an S3 bucket that is in the same region as the model package. *
*/ public void setModelDataUrl(String modelDataUrl) { this.modelDataUrl = modelDataUrl; } /** *
* The Amazon S3 path where the model artifacts, which result from model training, are stored. This path must point
* to a single gzip
compressed tar archive (.tar.gz
suffix).
*
* The model artifacts must be in an S3 bucket that is in the same region as the model package. *
*gzip
compressed tar archive (.tar.gz
suffix). * The model artifacts must be in an S3 bucket that is in the same region as the model package. *
*/ public String getModelDataUrl() { return this.modelDataUrl; } /** *
* The Amazon S3 path where the model artifacts, which result from model training, are stored. This path must point
* to a single gzip
compressed tar archive (.tar.gz
suffix).
*
* The model artifacts must be in an S3 bucket that is in the same region as the model package. *
*gzip
compressed tar archive (.tar.gz
suffix). * The model artifacts must be in an S3 bucket that is in the same region as the model package. *
* @return Returns a reference to this object so that method calls can be chained together. */ public ModelPackageContainerDefinition withModelDataUrl(String modelDataUrl) { setModelDataUrl(modelDataUrl); return this; } /** ** The Amazon Web Services Marketplace product ID of the model package. *
* * @param productId * The Amazon Web Services Marketplace product ID of the model package. */ public void setProductId(String productId) { this.productId = productId; } /** ** The Amazon Web Services Marketplace product ID of the model package. *
* * @return The Amazon Web Services Marketplace product ID of the model package. */ public String getProductId() { return this.productId; } /** ** The Amazon Web Services Marketplace product ID of the model package. *
* * @param productId * The Amazon Web Services Marketplace product ID of the model package. * @return Returns a reference to this object so that method calls can be chained together. */ public ModelPackageContainerDefinition withProductId(String productId) { setProductId(productId); return this; } /** *
* The environment variables to set in the Docker container. Each key and value in the Environment
* string to string map can have length of up to 1024. We support up to 16 entries in the map.
*
Environment
string to string map can have length of up to 1024. We support up to 16 entries
* in the map.
*/
public java.util.Map
* The environment variables to set in the Docker container. Each key and value in the Environment
* string to string map can have length of up to 1024. We support up to 16 entries in the map.
*
Environment
string to string map can have length of up to 1024. We support up to 16 entries
* in the map.
*/
public void setEnvironment(java.util.Map
* The environment variables to set in the Docker container. Each key and value in the Environment
* string to string map can have length of up to 1024. We support up to 16 entries in the map.
*
Environment
string to string map can have length of up to 1024. We support up to 16 entries
* in the map.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ModelPackageContainerDefinition withEnvironment(java.util.Map* A structure with Model Input details. *
* * @param modelInput * A structure with Model Input details. */ public void setModelInput(ModelInput modelInput) { this.modelInput = modelInput; } /** ** A structure with Model Input details. *
* * @return A structure with Model Input details. */ public ModelInput getModelInput() { return this.modelInput; } /** ** A structure with Model Input details. *
* * @param modelInput * A structure with Model Input details. * @return Returns a reference to this object so that method calls can be chained together. */ public ModelPackageContainerDefinition withModelInput(ModelInput modelInput) { setModelInput(modelInput); return this; } /** ** The machine learning framework of the model package container image. *
* * @param framework * The machine learning framework of the model package container image. */ public void setFramework(String framework) { this.framework = framework; } /** ** The machine learning framework of the model package container image. *
* * @return The machine learning framework of the model package container image. */ public String getFramework() { return this.framework; } /** ** The machine learning framework of the model package container image. *
* * @param framework * The machine learning framework of the model package container image. * @return Returns a reference to this object so that method calls can be chained together. */ public ModelPackageContainerDefinition withFramework(String framework) { setFramework(framework); return this; } /** ** The framework version of the Model Package Container Image. *
* * @param frameworkVersion * The framework version of the Model Package Container Image. */ public void setFrameworkVersion(String frameworkVersion) { this.frameworkVersion = frameworkVersion; } /** ** The framework version of the Model Package Container Image. *
* * @return The framework version of the Model Package Container Image. */ public String getFrameworkVersion() { return this.frameworkVersion; } /** ** The framework version of the Model Package Container Image. *
* * @param frameworkVersion * The framework version of the Model Package Container Image. * @return Returns a reference to this object so that method calls can be chained together. */ public ModelPackageContainerDefinition withFrameworkVersion(String frameworkVersion) { setFrameworkVersion(frameworkVersion); return this; } /** *
* The name of a pre-trained machine learning benchmarked by Amazon SageMaker Inference Recommender model that
* matches your model. You can find a list of benchmarked models by calling ListModelMetadata
.
*
ListModelMetadata
.
*/
public void setNearestModelName(String nearestModelName) {
this.nearestModelName = nearestModelName;
}
/**
*
* The name of a pre-trained machine learning benchmarked by Amazon SageMaker Inference Recommender model that
* matches your model. You can find a list of benchmarked models by calling ListModelMetadata
.
*
ListModelMetadata
.
*/
public String getNearestModelName() {
return this.nearestModelName;
}
/**
*
* The name of a pre-trained machine learning benchmarked by Amazon SageMaker Inference Recommender model that
* matches your model. You can find a list of benchmarked models by calling ListModelMetadata
.
*
ListModelMetadata
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ModelPackageContainerDefinition withNearestModelName(String nearestModelName) {
setNearestModelName(nearestModelName);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getContainerHostname() != null)
sb.append("ContainerHostname: ").append(getContainerHostname()).append(",");
if (getImage() != null)
sb.append("Image: ").append(getImage()).append(",");
if (getImageDigest() != null)
sb.append("ImageDigest: ").append(getImageDigest()).append(",");
if (getModelDataUrl() != null)
sb.append("ModelDataUrl: ").append(getModelDataUrl()).append(",");
if (getProductId() != null)
sb.append("ProductId: ").append(getProductId()).append(",");
if (getEnvironment() != null)
sb.append("Environment: ").append(getEnvironment()).append(",");
if (getModelInput() != null)
sb.append("ModelInput: ").append(getModelInput()).append(",");
if (getFramework() != null)
sb.append("Framework: ").append(getFramework()).append(",");
if (getFrameworkVersion() != null)
sb.append("FrameworkVersion: ").append(getFrameworkVersion()).append(",");
if (getNearestModelName() != null)
sb.append("NearestModelName: ").append(getNearestModelName());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ModelPackageContainerDefinition == false)
return false;
ModelPackageContainerDefinition other = (ModelPackageContainerDefinition) obj;
if (other.getContainerHostname() == null ^ this.getContainerHostname() == null)
return false;
if (other.getContainerHostname() != null && other.getContainerHostname().equals(this.getContainerHostname()) == false)
return false;
if (other.getImage() == null ^ this.getImage() == null)
return false;
if (other.getImage() != null && other.getImage().equals(this.getImage()) == false)
return false;
if (other.getImageDigest() == null ^ this.getImageDigest() == null)
return false;
if (other.getImageDigest() != null && other.getImageDigest().equals(this.getImageDigest()) == false)
return false;
if (other.getModelDataUrl() == null ^ this.getModelDataUrl() == null)
return false;
if (other.getModelDataUrl() != null && other.getModelDataUrl().equals(this.getModelDataUrl()) == false)
return false;
if (other.getProductId() == null ^ this.getProductId() == null)
return false;
if (other.getProductId() != null && other.getProductId().equals(this.getProductId()) == false)
return false;
if (other.getEnvironment() == null ^ this.getEnvironment() == null)
return false;
if (other.getEnvironment() != null && other.getEnvironment().equals(this.getEnvironment()) == false)
return false;
if (other.getModelInput() == null ^ this.getModelInput() == null)
return false;
if (other.getModelInput() != null && other.getModelInput().equals(this.getModelInput()) == false)
return false;
if (other.getFramework() == null ^ this.getFramework() == null)
return false;
if (other.getFramework() != null && other.getFramework().equals(this.getFramework()) == false)
return false;
if (other.getFrameworkVersion() == null ^ this.getFrameworkVersion() == null)
return false;
if (other.getFrameworkVersion() != null && other.getFrameworkVersion().equals(this.getFrameworkVersion()) == false)
return false;
if (other.getNearestModelName() == null ^ this.getNearestModelName() == null)
return false;
if (other.getNearestModelName() != null && other.getNearestModelName().equals(this.getNearestModelName()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getContainerHostname() == null) ? 0 : getContainerHostname().hashCode());
hashCode = prime * hashCode + ((getImage() == null) ? 0 : getImage().hashCode());
hashCode = prime * hashCode + ((getImageDigest() == null) ? 0 : getImageDigest().hashCode());
hashCode = prime * hashCode + ((getModelDataUrl() == null) ? 0 : getModelDataUrl().hashCode());
hashCode = prime * hashCode + ((getProductId() == null) ? 0 : getProductId().hashCode());
hashCode = prime * hashCode + ((getEnvironment() == null) ? 0 : getEnvironment().hashCode());
hashCode = prime * hashCode + ((getModelInput() == null) ? 0 : getModelInput().hashCode());
hashCode = prime * hashCode + ((getFramework() == null) ? 0 : getFramework().hashCode());
hashCode = prime * hashCode + ((getFrameworkVersion() == null) ? 0 : getFrameworkVersion().hashCode());
hashCode = prime * hashCode + ((getNearestModelName() == null) ? 0 : getNearestModelName().hashCode());
return hashCode;
}
@Override
public ModelPackageContainerDefinition clone() {
try {
return (ModelPackageContainerDefinition) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.sagemaker.model.transform.ModelPackageContainerDefinitionMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}