|
| 1 | +# Pipeline Sample |
| 2 | + |
| 3 | +This sample demonstrates how to submit a pipeline to Sagemaker for execution using your own JSON pipeline definition, using the AWS Controllers for Kubernetes (ACK) service controller for Amazon SageMaker. |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +This sample assumes that you have completed the [common prerequisites](/samples/README.md). |
| 8 | + |
| 9 | +### Updating the Pipeline Specification |
| 10 | + |
| 11 | +In the `pipeline.yaml` file, modify the placeholder values with those associated with your account. |
| 12 | + |
| 13 | +## Submitting your Pipeline Specification |
| 14 | + |
| 15 | +### Modify/Create a JSON pipeline definition |
| 16 | + |
| 17 | +Create the JSON pipeline definition using the JSON schema documented at https://aws-sagemaker-mlops.github.io/sagemaker-model-building-pipeline-definition-JSON-schema/. In this sample, you are provided a sample pipeline definition with one Training step. |
| 18 | + |
| 19 | +There are two ways to modify the *.spec.pipelineDefinition* key in the Kubernetes YAML spec. Choose one: |
| 20 | + |
| 21 | +Option 1: You can pass JSON pipeline definition inline as a JSON object. Example of this option is included in the `pipeline.yaml` file. |
| 22 | + |
| 23 | +Option 2: You can convert your JSON pipeline definition into String format. You may use online third-party tools to convert from JSON to String format. |
| 24 | + |
| 25 | +### Submit pipeline to Sagemaker and start an execution |
| 26 | + |
| 27 | +To submit your prepared pipeline specification, apply the specification to your Kubernetes cluster as such: |
| 28 | +``` |
| 29 | +$ kubectl apply -f my-pipeline.yaml |
| 30 | +pipeline.sagemaker.services.k8s.aws/my-kubernetes-pipeline created |
| 31 | +``` |
| 32 | +To start an execution run of the pipeline: |
| 33 | +``` |
| 34 | +$ kubectl apply -f pipeline-execution.yaml |
| 35 | +pipelineexecution.sagemaker.services.k8s.aws/my-kubernetes-pipeline-execution created |
| 36 | +``` |
| 37 | + |
| 38 | +### List pipelines and pipeline executions |
| 39 | + |
| 40 | +To list all pipelines created using the ACK controller use the following command: |
| 41 | +``` |
| 42 | +$ kubectl get pipeline |
| 43 | +``` |
| 44 | +If it is a pipeline executions it is endpointsconfigs.sagemaker.services.k8s.aws |
| 45 | +``` |
| 46 | +$ kubectl get pipelineexecution |
| 47 | +``` |
| 48 | + |
| 49 | +### Describe a pipeline and pipeline execution |
| 50 | + |
| 51 | +To get more details about the pipeline once it's submitted, like checking the status, errors or parameters of the pipeline, use the following command: |
| 52 | +``` |
| 53 | +$ kubectl describe pipeline my-kubernetes-pipeline |
| 54 | +``` |
| 55 | + |
| 56 | +If it is a endpoint config it is endpointsconfigs.sagemaker.services.k8s.aws |
| 57 | +``` |
| 58 | +$ kubectl describe pipelineexecution my-kubernetes-pipeline-execution |
| 59 | +``` |
| 60 | + |
| 61 | +### Delete a pipeline and a pipeline execution |
| 62 | + |
| 63 | +To delete the pipeline, use the following command: |
| 64 | +``` |
| 65 | +$ kubectl delete pipeline my-kubernetes-pipeline |
| 66 | +``` |
| 67 | + |
| 68 | +If it is a endpoint config it is endpointsconfigs.sagemaker.services.k8s.aws |
| 69 | +``` |
| 70 | +$ kubectl delete pipelineexecution my-kubernetes-pipeline-execution |
| 71 | +``` |
0 commit comments