From 7e4ad25bf4be90881ebac9bfed1d2f7c6a2ca757 Mon Sep 17 00:00:00 2001 From: Lauren Yu <6631887+laurenyu@users.noreply.github.com> Date: Fri, 24 Apr 2020 17:53:26 -0700 Subject: [PATCH 1/4] infra: add doc8 check for documentation files --- buildspec-release.yml | 3 +-- buildspec-unittests.yml | 4 ++-- tox.ini | 10 +++++++++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/buildspec-release.yml b/buildspec-release.yml index e8acf68bec..7bcea98ee3 100644 --- a/buildspec-release.yml +++ b/buildspec-release.yml @@ -13,8 +13,7 @@ phases: - tox -e black-check # run package and docbuild checks - - tox -e twine - - tox -e sphinx + - tox -e twine,sphinx,doc8 # run unit tests - AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= AWS_SESSION_TOKEN= diff --git a/buildspec-unittests.yml b/buildspec-unittests.yml index 3b2d17d9db..b2b977f0a0 100644 --- a/buildspec-unittests.yml +++ b/buildspec-unittests.yml @@ -11,8 +11,8 @@ phases: - ./ci-scripts/displaytime.sh 'flake8,pylint,twine,black-check' $start_time - start_time=`date +%s` - - tox -e sphinx - - ./ci-scripts/displaytime.sh 'sphinx' $start_time + - tox -e sphinx,doc8 + - ./ci-scripts/displaytime.sh 'sphinx,doc8' $start_time # run unit tests - start_time=`date +%s` diff --git a/tox.ini b/tox.ini index ebb1a4a0f7..07e9a4c3aa 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,7 @@ # and then run "tox" from this directory. [tox] -envlist = black-format,flake8,pylint,twine,sphinx,py27,py36 +envlist = black-format,flake8,pylint,twine,sphinx,doc8,py27,py36 skip_missing_interpreters = False @@ -114,6 +114,14 @@ commands = pip install --exists-action=w -r requirements.txt sphinx-build -T -W -b html -d _build/doctrees-readthedocs -D language=en . _build/html +[testenv:doc8] +deps = + doc8 + Pygments +# TODO: fix files before enabling max-line-length (D001) +commands = + doc8 --ignore-path=.tox --ignore=D001 + [testenv:black-format] # Used during development (before committing) to format .py files. basepython = python3 From 8371fcef99f98eaffa7339585e09a1dcfe0b096a Mon Sep 17 00:00:00 2001 From: Lauren Yu <6631887+laurenyu@users.noreply.github.com> Date: Mon, 27 Apr 2020 10:08:20 -0700 Subject: [PATCH 2/4] ignore .egg-info --- tox.ini | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tox.ini b/tox.ini index 07e9a4c3aa..d283657b11 100644 --- a/tox.ini +++ b/tox.ini @@ -46,6 +46,11 @@ ignore = require-code = True +[doc8] +ignore-path=.tox,src/sagemaker.egg-info +# TODO: fix files before enabling max-line-length (D001) +ignore=D001 + [testenv] passenv = AWS_ACCESS_KEY_ID @@ -118,9 +123,7 @@ commands = deps = doc8 Pygments -# TODO: fix files before enabling max-line-length (D001) -commands = - doc8 --ignore-path=.tox --ignore=D001 +commands = doc8 [testenv:black-format] # Used during development (before committing) to format .py files. From 0cf43fba3a79d758d2d1c578cea88e3f4471996d Mon Sep 17 00:00:00 2001 From: Lauren Yu <6631887+laurenyu@users.noreply.github.com> Date: Mon, 27 Apr 2020 10:24:19 -0700 Subject: [PATCH 3/4] add basepython to match others --- tox.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/tox.ini b/tox.ini index d283657b11..979b211cdc 100644 --- a/tox.ini +++ b/tox.ini @@ -120,6 +120,7 @@ commands = sphinx-build -T -W -b html -d _build/doctrees-readthedocs -D language=en . _build/html [testenv:doc8] +basepython = python3 deps = doc8 Pygments From ebd8d80f36ead23b66b1db04880a8a87605ba73c Mon Sep 17 00:00:00 2001 From: Lauren Yu <6631887+laurenyu@users.noreply.github.com> Date: Fri, 24 Apr 2020 18:01:28 -0700 Subject: [PATCH 4/4] fix errors --- ...zon_sagemaker_operators_for_kubernetes.rst | 163 +++++++++--------- doc/analytics.rst | 2 +- doc/predictors.rst | 2 +- doc/using_xgboost.rst | 19 +- doc/xgboost.rst | 2 +- src/sagemaker/chainer/README.rst | 4 +- .../deploying_tensorflow_serving.rst | 3 +- src/sagemaker/workflow/README.rst | 2 +- .../123/assets/foo.txt | 2 +- .../00000123/assets/foo.txt | 2 +- 10 files changed, 99 insertions(+), 102 deletions(-) diff --git a/doc/amazon_sagemaker_operators_for_kubernetes.rst b/doc/amazon_sagemaker_operators_for_kubernetes.rst index 9e8941d443..f434126047 100644 --- a/doc/amazon_sagemaker_operators_for_kubernetes.rst +++ b/doc/amazon_sagemaker_operators_for_kubernetes.rst @@ -48,7 +48,7 @@ completed the following prerequisites: - (optional) `Helm `__ Version 3.0 or later - - `aws-iam-authenticator `__ + - `aws-iam-authenticator `__ - Have IAM permissions to create roles and attach policies to roles. @@ -140,7 +140,7 @@ The OIDC ID for your cluster will be different. You need this OIDC ID value to create a role. If your output is ``None``, it means that your client version is old. -To work around this, run the following command: +To work around this, run the following command: :: @@ -152,7 +152,7 @@ The OIDC URL will be returned as follows: OIDC https://oidc.eks.us-east-1.amazonaws.com/id/D48675832CA65BD10A532F597OIDCID -Create an IAM Role +Create an IAM Role ^^^^^^^^^^^^^^^^^^^ Create a file named ``trust.json`` and insert the following trust @@ -198,7 +198,7 @@ Your output should look like the following: PRINCIPAL arn:aws:iam::123456789012:oidc-provider/oidc.eks.us-east-1.amazonaws.com/id/ Take note of ``ROLE ARN``, you pass this value to your -operator. +operator. Attach the AmazonSageMakerFullAccess Policy to the Role ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -223,13 +223,13 @@ Deploy the Operator ^^^^^^^^^^^^^^^^^^^ When deploying your operator, you can use either a YAML file or Helm -charts. +charts. Deploy the Operator Using YAML '''''''''''''''''''''''''''''' This is the simplest way to deploy your operators. The process is as -follows: +follows: - Download the installer script using the following command: @@ -239,9 +239,9 @@ follows: - Edit the ``installer.yaml`` file to replace ``eks.amazonaws.com/role-arn``. Replace the ARN here with - the Amazon Resource Name (ARN) for the OIDC-based role you’ve created. + the Amazon Resource Name (ARN) for the OIDC-based role you’ve created. -- Use the following command to deploy the cluster: +- Use the following command to deploy the cluster: :: @@ -264,7 +264,7 @@ Navigate to the ``amazon-sagemaker-operator-for-k8s/hack/charts/installer`` folder. Edit the ``rolebased/values.yaml`` file, which includes high-level parameters for the Chart. Replace the role ARN here with the Amazon Resource Name (ARN) for the OIDC-based role you’ve -created. +created. Install the Helm Chart using the following command: @@ -298,7 +298,7 @@ Verify the operator deployment ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ You should be able to see the Amazon SageMaker Custom Resource Definitions (CRDs) for each operator deployed to your cluster by running -the following command: +the following command: :: @@ -330,8 +330,8 @@ namespace ``sagemaker-k8s-operator-system`` as follows: NAME READY STATUS RESTARTS AGE sagemaker-k8s-operator-controller-manager-12345678-r8abc 2/2 Running 0 23s - -​ + + Namespace-scoped deployment ~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -401,7 +401,7 @@ The OIDC ID for your cluster will be different. You need this OIDC ID value to create a role. If your output is ``None``, it means that your client version is old. -To work around this, run the following command: +To work around this, run the following command: :: @@ -413,7 +413,7 @@ The OIDC URL will be returned as follows: OIDC https://oidc.eks.us-east-1.amazonaws.com/id/D48675832CA65BD10A532F597OIDCID -Create your IAM Role +Create your IAM Role ^^^^^^^^^^^^^^^^^^^^ Create a file named ``trust.json`` and insert the following trust @@ -426,7 +426,7 @@ relationship code block into it. Be sure to replace all ````, ``:oidc-provider/oidc.eks..amazonaws.com/id/" }, "Action": "sts:AssumeRoleWithWebIdentity", @@ -459,7 +459,7 @@ Your output should look like the following: PRINCIPAL arn:aws:iam::123456789012:oidc-provider/oidc.eks.us-east-1.amazonaws.com/id/ Take note of ``ROLE ARN``, you pass this value to your -operator. +operator. Attach the AmazonSageMakerFullAccess Policy to your Role ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -484,7 +484,7 @@ Deploy the Operator to Your Namespace ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ When deploying your operator, you can use either a YAML file or Helm -charts. +charts. Deploy the Operator to Your Namespace Using YAML '''''''''''''''''''''''''''''''''''''''''''''''' @@ -496,7 +496,7 @@ If you have not already installed the CRDs into the cluster, apply the CRD insta :: kubectl apply -f https://raw.githubusercontent.com/aws/amazon-sagemaker-operator-for-k8s/master/release/rolebased/namespaced/crd.yaml - + To install the operator onto the cluster: - Download the operator installer YAML using the following command: @@ -505,16 +505,17 @@ To install the operator onto the cluster: wget https://raw.githubusercontent.com/aws/amazon-sagemaker-operator-for-k8s/master/release/rolebased/namespaced/operator.yaml -- Update the installer YAML to place the resources into your specified namespace using the following command: - :: - +- Update the installer YAML to place the resources into your specified namespace using the following command: + + :: + sed -i -e 's/PLACEHOLDER-NAMESPACE//g' operator.yaml - Edit the ``operator.yaml`` file to place resources into your ``eks.amazonaws.com/role-arn``. Replace the ARN here with - the Amazon Resource Name (ARN) for the OIDC-based role you’ve created. + the Amazon Resource Name (ARN) for the OIDC-based role you’ve created. -- Use the following command to deploy the cluster: +- Use the following command to deploy the cluster: :: @@ -536,7 +537,7 @@ Navigate to the ``amazon-sagemaker-operator-for-k8s/hack/charts/installer/namespaced`` folder. Edit the ``rolebased/values.yaml`` file, which includes high-level parameters for the Chart. Replace the role ARN here with the Amazon Resource Name (ARN) for the OIDC-based role you’ve -created. +created. Install the Helm Chart using the following command: @@ -573,7 +574,7 @@ Verify the operator deployment to your namespace ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ You should be able to see the Amazon SageMaker Custom Resource Definitions (CRDs) for each operator deployed to your cluster by running -the following command: +the following command: :: @@ -606,7 +607,7 @@ namespace ``my-namespace`` as follows: NAME READY STATUS RESTARTS AGE sagemaker-k8s-operator-controller-manager-12345678-r8abc 2/2 Running 0 23s -​ + Install the Amazon SageMaker logs \ ``kubectl`` plugin ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -631,7 +632,7 @@ that directory to your ``PATH``. mkdir ~/sagemaker-k8s-bin cp ./kubectl-smlogs.${os}.amd64/kubectl-smlogs ~/sagemaker-k8s-bin/. - # This line will add the binaries to your PATH in your .bashrc. + # This line will add the binaries to your PATH in your .bashrc. echo 'export PATH=$PATH:~/sagemaker-k8s-bin' >> ~/.bashrc @@ -735,17 +736,17 @@ Operators installed using Helm Charts To delete the operator CRDs, first delete all the running jobs. Then delete the helm chart that was used to deploy the operators using the -following commands: +following commands: :: - # get the helm charts + # get the helm charts $ helm ls # delete the charts $ helm delete -​ + Delete namespace-based operators ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -771,7 +772,7 @@ all jobs and delete the operator from the cluster: :: - # Delete the operator using the same yaml file that was used to install the operator + # Delete the operator using the same yaml file that was used to install the operator kubectl delete -f operator.yaml # Now delete the CRDs using the CRD installer yaml @@ -785,7 +786,7 @@ Operators installed with Helm Charts To delete the operator CRDs, first delete all the running jobs. Then delete the helm chart that was used to deploy the operators using the -following commands: +following commands: :: @@ -798,7 +799,7 @@ following commands: # optionally delete the namespace $ kubectl delete namespace -​ + Troubleshooting @@ -814,14 +815,14 @@ Check the job status by running: kubectl get If the job was created in Amazon SageMaker, you can use the following -command to see the ``STATUS`` and the ``SageMaker Job Name``: +command to see the ``STATUS`` and the ``SageMaker Job Name``: :: kubectl get - You can use ``smlogs`` to find the cause of the issue using the - following command: + following command: :: @@ -842,7 +843,7 @@ operator’s pod to find the cause of the issue as follows: :: $ kubectl get pods -A | grep sagemaker - # Output: + # Output: sagemaker-k8s-operator-system sagemaker-k8s-operator-controller-manager-5cd7df4d74-wh22z 2/2 Running 0 3h33m $ kubectl logs -p -c manager -n sagemaker-k8s-operator-system @@ -855,18 +856,18 @@ operator is not running, then you will have to delete the finalizer using the following steps: - In a new terminal, open the job in an editor using ``kubectl edit`` - as follows: + as follows: :: $ kubectl edit # for example for the batchtransformjob xgboost-mnist - $ kubectl edit batchtransformjobs xgboost-mnist + $ kubectl edit batchtransformjobs xgboost-mnist - Edit the job to delete the finalizer by removing the following two lines from the file. Save the file and the job should immediately get - deleted/updated. + deleted/updated. :: @@ -917,7 +918,7 @@ documentation ``, and ``outputPath`` with your S3 bucket that the Amazon SageMaker execution role has write access to. The ``roleArn`` must have permissions so that Amazon SageMaker -can access Amazon S3, Amazon CloudWatch, and other services on your +can access Amazon S3, Amazon CloudWatch, and other services on your behalf. For more information on creating an Amazon SageMaker ExecutionRole, see `Amazon SageMaker Roles `__. @@ -939,9 +940,9 @@ following command: Create a TrainingJob Using a Helm Chart ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -You can use Helm Charts to run TrainingJobs. +You can use Helm Charts to run TrainingJobs. -Clone the github repo to get the source using the following command: +Clone the github repo to get the source using the following command: :: @@ -957,7 +958,7 @@ behalf. For more information on creating an Amazon SageMaker ExecutionRole, see `Amazon SageMaker Roles `__. -Create the Training Job +Create the Training Job '''''''''''''''''''''''' With the roles and S3 buckets replaced with appropriate values @@ -1032,12 +1033,12 @@ The output listing all jobs should look like the following: A training job continues to be listed after the job has completed or failed. You can remove a ``TrainingJob`` job from the list by following the Delete a Training Job steps. Jobs that have completed or -stopped do not incur any charges for Amazon SageMaker resources. +stopped do not incur any charges for Amazon SageMaker resources. Training Job Status Values '''''''''''''''''''''''''' -The ``STATUS`` field can be one of the following values: +The ``STATUS`` field can be one of the following values: - ``Completed`` @@ -1154,7 +1155,7 @@ The output for your training job should look like the following: View Logs from Training Jobs ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Use the following command to see the logs from the ``kmeans-mnist`` +Use the following command to see the logs from the ``kmeans-mnist`` training job: :: @@ -1191,7 +1192,7 @@ command returns the following output: If the job is still in progress on Amazon SageMaker, the job will stop. You do not incur any charges for Amazon SageMaker resources after your -job stops or completes. +job stops or completes. **Note**: Amazon SageMaker does not delete training jobs. Stopped jobs continue to show on the Amazon SageMaker console. The delete command @@ -1211,7 +1212,7 @@ Create a HyperParameterTuningJob Using a Simple YAML File ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Download the sample YAML file for the hyperparameter tuning job using -the following command: +the following command: :: @@ -1233,7 +1234,7 @@ Create a HyperParameterTuningJob using a Helm Chart You can use Helm Charts to run HyperParameterTuningJobs. -Clone the github repo to get the source using the following command: +Clone the github repo to get the source using the following command: :: @@ -1245,8 +1246,8 @@ folder. Edit the ``values.yaml`` file to replace the ``roleArn`` parameter with your . For HyperparameterTuningJob to -succeed, you must also change the ``s3InputPath`` -and ``s3OutputPath`` to values that correspond to your account. +succeed, you must also change the ``s3InputPath`` +and ``s3OutputPath`` to values that correspond to your account. Create the HPO Job '''''''''''''''''' @@ -1286,7 +1287,7 @@ Your output should look like the following: :: - NAME NAMESPACE REVISION UPDATED + NAME NAMESPACE REVISION UPDATED chart-1474292948 default 1 2019-11-20 23:35:49.9136092 +0000 UTC deployed sagemaker-k8s-hyperparametertuningjob-0.1.0 STATUS CHART APP VERSION chart-1574292948 default 1 2019-11-20 23:35:49.9136092 +0000 UTC deployed sagemaker-k8s-trainingjob-0.1.0 rolebased-1574291698 default 1 2019-11-20 23:14:59.6777082 +0000 UTC deployed sagemaker-k8s-operator-0.1.0 @@ -1312,7 +1313,7 @@ operator: :: - kubectl get hyperparametertuningjob + kubectl get hyperparametertuningjob Your output will look like the following: @@ -1322,15 +1323,15 @@ Your output will look like the following: xgboost-mnist-hpo Completed 2019-10-17T01:15:52Z 10 0 0 0 xgboostha92f5e3cf07b11e9bf6c06d6-009-4c7a123 xgboostha92f5e3cf07b11e9bf6c123 A hyper parameter tuning job will continue to be listed after the job -has completed or failed. You can remove a ``hyperparametertuningjob`` +has completed or failed. You can remove a ``hyperparametertuningjob`` from the list by following the steps in Delete a Hyper Parameter Tuning Job. Jobs that have completed or stopped do not incur any charges for -Amazon SageMaker resources. +Amazon SageMaker resources. Hyperparameter Tuning Job Status Values ''''''''''''''''''''''''''''''''''''''' -The ``STATUS`` field can be one of the following values: +The ``STATUS`` field can be one of the following values: - ``Completed`` @@ -1357,7 +1358,7 @@ like ``COMPLETED`` and ``INPROGRESS``. These represent how many training jobs have completed and are in progress, respectively. For more information about how these are determined, see `TrainingJobStatusCounters `__ in -the Amazon SageMaker API documentation. +the Amazon SageMaker API documentation. Best Training Job ''''''''''''''''' @@ -1392,7 +1393,7 @@ Describe a Hyperparameter Tuning Job ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ You can obtain debugging details using the ``describe`` kubectl verb -by running the following command. +by running the following command. :: @@ -1517,7 +1518,7 @@ follows: Creation Time: 2019-10-17T01:16:14Z Final Hyper Parameter Tuning Job Objective Metric: Metric Name: validation:error - Value: + Value: Objective Status: Succeeded Training End Time: 2019-10-17T01:20:24Z Training Job Arn: arn:aws:sagemaker:us-east-2:123456789012:training-job/xgboostha92f5e3cf07b11e9bf6c06d6-009-4sample @@ -1551,7 +1552,7 @@ Delete HyperParameterTuning jobs ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Use the following command to stop a hyperparameter job in -Amazon SageMaker. +Amazon SageMaker. :: @@ -1562,9 +1563,9 @@ training jobs from your Kubernetes cluster, as well as stops them in Amazon SageMaker. Jobs that have stopped or completed do not incur any charges for Amazon SageMaker resources. Amazon SageMaker does not delete hyperparameter tuning jobs. Stopped jobs continue to show on the -Amazon SageMaker Console. +Amazon SageMaker Console. -Your output should look like the following: +Your output should look like the following: :: @@ -1586,7 +1587,7 @@ Create a BatchTransformJob Using a Simple YAML File ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Download the sample YAML file for the batch transform job using the -following command: +following command: :: @@ -1595,7 +1596,7 @@ following command: Edit the file ``xgboost-mnist-batchtransform.yaml`` to change necessary parameters to replace the ``inputdataconfig`` with your input data and ``s3OutputPath`` with your S3 buckets that the Amazon -SageMaker execution role has write access to. +SageMaker execution role has write access to. Apply the YAML file using the following command: @@ -1611,7 +1612,7 @@ You can use Helm Charts to run batch transform jobs. Get the Helm installer directory '''''''''''''''''''''''''''''''' -Clone the github repo to get the source using the following command: +Clone the github repo to get the source using the following command: :: @@ -1622,11 +1623,11 @@ Configure the Helm Chart Navigate to the ``amazon-sagemaker-operator-for-k8s/hack/charts/batch-transform-jobs/`` -folder. +folder. -Edit the ``values.yaml`` file to replace the ``inputdataconfig`` +Edit the ``values.yaml`` file to replace the ``inputdataconfig`` with your input data and outputPath with your S3 buckets that the Amazon -SageMaker execution role has write access to. +SageMaker execution role has write access to. Create a Batch Transform Job '''''''''''''''''''''''''''' @@ -1683,7 +1684,7 @@ operator: :: - kubectl get batchtransformjob + kubectl get batchtransformjob Your output should look like the following: @@ -1693,15 +1694,15 @@ Your output should look like the following: xgboost-mnist-batch-transform Completed 2019-11-18T03:44:00Z xgboost-mnist-a88fb19809b511eaac440aa8axgboost A batch transform job will continue to be listed after the job has -completed or failed. You can remove a ``hyperparametertuningjob`` +completed or failed. You can remove a ``hyperparametertuningjob`` from the list by following the Delete a Batch Transform Job steps. Jobs that have completed or stopped do not incur any charges for -Amazon SageMaker resources. +Amazon SageMaker resources. Batch Transform Status Values ''''''''''''''''''''''''''''' -The ``STATUS`` field can be one of the following values: +The ``STATUS`` field can be one of the following values: - ``Completed`` @@ -1725,7 +1726,7 @@ Describe a Batch Transform Job ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ You can obtain debugging details using the ``describe`` kubectl verb -by running the following command. +by running the following command. :: @@ -1774,7 +1775,7 @@ Your output should look like the following: View Logs from Batch Transform Jobs ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Use the following command to see the logs from the ``xgboost-mnist`` +Use the following command to see the logs from the ``xgboost-mnist`` batch transform job: :: @@ -1785,7 +1786,7 @@ Delete a Batch Transform Job ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Use the following command to stop a batch transform job in -Amazon SageMaker. +Amazon SageMaker. :: @@ -1804,7 +1805,7 @@ resources. Delete takes about 2 minutes to clean up the resources from Amazon SageMaker. **Note**: Amazon SageMaker does not delete batch transform jobs. Stopped -jobs continue to show on the Amazon SageMaker console. +jobs continue to show on the Amazon SageMaker console. Real-time inference ~~~~~~~~~~~~~~~~~~~ @@ -1821,7 +1822,7 @@ Configure a HostingDeployment Resource ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Download the sample YAML file for the hosting deployment job using the -following command: +following command: :: @@ -1936,7 +1937,7 @@ Describe a Hostingdeployment ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ You can obtain debugging details using the ``describe`` kubectl verb -by running the following command. +by running the following command. :: @@ -2072,7 +2073,7 @@ Update HostingDeployment Once a HostingDeployment has a status of ``InService``, it can be updated. It might take about 10 minutes for HostingDeployment to be in service. To verify that the status is ``InService``, use the following -command: +command: :: @@ -2137,7 +2138,7 @@ Delete the HostingDeployment ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Use ``kubectl`` to delete a HostingDeployment with the following -command: +command: :: diff --git a/doc/analytics.rst b/doc/analytics.rst index a4fedff38d..e60d6f21f8 100644 --- a/doc/analytics.rst +++ b/doc/analytics.rst @@ -19,4 +19,4 @@ Analytics .. autoclass:: sagemaker.analytics.ExperimentAnalytics :members: :undoc-members: - :show-inheritance: \ No newline at end of file + :show-inheritance: diff --git a/doc/predictors.rst b/doc/predictors.rst index f9576276d9..632d7e6872 100644 --- a/doc/predictors.rst +++ b/doc/predictors.rst @@ -6,4 +6,4 @@ Make real-time predictions against SageMaker endpoints with Python objects .. autoclass:: sagemaker.predictor.RealTimePredictor :members: :undoc-members: - :show-inheritance: \ No newline at end of file + :show-inheritance: diff --git a/doc/using_xgboost.rst b/doc/using_xgboost.rst index da6f987690..830150da86 100644 --- a/doc/using_xgboost.rst +++ b/doc/using_xgboost.rst @@ -17,7 +17,7 @@ The XGBoost open source algorithm provides the following benefits over the built * Latest version - The open source XGBoost algorithm typically supports a more recent version of XGBoost. To see the XGBoost version that is currently supported, see `XGBoost SageMaker Estimators and Models `__. -* Flexibility - Take advantage of the full range of XGBoost functionality, such as cross-validation support. +* Flexibility - Take advantage of the full range of XGBoost functionality, such as cross-validation support. You can add custom pre- and post-processing logic and run additional code after training. * Scalability - The XGBoost open source algorithm has a more efficient implementation of distributed training, which enables it to scale out to more instances and reduce out-of-memory errors. @@ -100,14 +100,14 @@ such as the location of input data and location where we want to save the model. parser.add_argument('--max_depth', type=int, default=5) parser.add_argument('--eta', type=float, default=0.2) parser.add_argument('--objective', type=str, default='reg:squarederror') - + # SageMaker specific arguments. Defaults are set in the environment variables. parser.add_argument('--model_dir', type=str, default=os.environ.get('SM_MODEL_DIR')) parser.add_argument('--train', type=str, default=os.environ['SM_CHANNEL_TRAIN']) parser.add_argument('--validation', type=str, default=os.environ['SM_CHANNEL_VALIDATION']) - + args = parser.parse_args() - + train_hp = { 'max_depth': args.max_depth, 'eta': args.eta, @@ -117,7 +117,7 @@ such as the location of input data and location where we want to save the model. 'silent': args.silent, 'objective': args.objective } - + dtrain = xgb.DMatrix(args.train) dval = xgb.DMatrix(args.validation) watchlist = [(dtrain, 'train'), (dval, 'validation')] if dval is not None else [(dtrain, 'train')] @@ -125,7 +125,7 @@ such as the location of input data and location where we want to save the model. callbacks = [] prev_checkpoint, n_iterations_prev_run = add_checkpointing(callbacks) # If checkpoint is found then we reduce num_boost_round by previously run number of iterations - + bst = xgb.train( params=train_hp, dtrain=dtrain, @@ -134,7 +134,7 @@ such as the location of input data and location where we want to save the model. xgb_model=prev_checkpoint, callbacks=callbacks ) - + # Save the model to the location specified by ``model_dir`` model_location = args.model_dir + '/xgboost-model' pkl.dump(bst, open(model_location, 'wb')) @@ -154,7 +154,7 @@ and a dictionary of the hyperparameters to pass to the training script. xgb_estimator = XGBoost( entry_point="abalone.py", hyperparameters=hyperparameters, - role=role, + role=role, train_instance_count=1, train_instance_type="ml.m5.2xlarge", framework_version="0.90-1", @@ -210,6 +210,3 @@ SageMaker XGBoost Docker Containers *********************************** For information about SageMaker XGBoost Docker container and its dependencies, see `SageMaker XGBoost Container `_. - - - diff --git a/doc/xgboost.rst b/doc/xgboost.rst index 53f84087ea..4f6ab3696d 100644 --- a/doc/xgboost.rst +++ b/doc/xgboost.rst @@ -15,4 +15,4 @@ The Amazon SageMaker XGBoost open source framework algorithm. .. autoclass:: sagemaker.xgboost.model.XGBoostPredictor :members: :undoc-members: - :show-inheritance: \ No newline at end of file + :show-inheritance: diff --git a/src/sagemaker/chainer/README.rst b/src/sagemaker/chainer/README.rst index aa9045e1d0..c3a2aa9b2b 100644 --- a/src/sagemaker/chainer/README.rst +++ b/src/sagemaker/chainer/README.rst @@ -11,7 +11,7 @@ You can visit the Chainer repository at https://github.com/chainer/chainer. For information about using Chainer with the SageMaker Python SDK, see https://sagemaker.readthedocs.io/en/stable/using_chainer.html. Chainer Training Examples -~~~~~~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~~ Amazon provides several example Jupyter notebooks that demonstrate end-to-end training on Amazon SageMaker using Chainer. Please refer to: @@ -22,7 +22,7 @@ These are also available in SageMaker Notebook Instance hosted Jupyter notebooks SageMaker Chainer Docker containers -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ When training and deploying training scripts, SageMaker runs your Python script in a Docker container with several libraries installed. When creating the Estimator and calling deploy to create the SageMaker Endpoint, you can control diff --git a/src/sagemaker/tensorflow/deploying_tensorflow_serving.rst b/src/sagemaker/tensorflow/deploying_tensorflow_serving.rst index dbb08be50d..45b607ae94 100644 --- a/src/sagemaker/tensorflow/deploying_tensorflow_serving.rst +++ b/src/sagemaker/tensorflow/deploying_tensorflow_serving.rst @@ -262,8 +262,7 @@ Specifying the output of a prediction request ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The structure of the prediction ``result`` is determined at the end of the training process before SavedModel is created. For example, if -you are using TensorFlow's Estimator API for training, you control inference outputs using the ``export_outputs`` parameter of the `tf.estimator.EstimatorSpec `_ that you return from -your ``model_fn`` (see `Example of a complete model_fn`_ for an example of ``export_outputs``). +you are using TensorFlow's Estimator API for training, you control inference outputs using the ``export_outputs`` parameter of the `tf.estimator.EstimatorSpec `_ that you return from your ``model_fn``. More information on how to create ``export_outputs`` can be found in `specifying the outputs of a custom model `_. You can also refer to TensorFlow's `Save and Restore `_ documentation for other ways to control the diff --git a/src/sagemaker/workflow/README.rst b/src/sagemaker/workflow/README.rst index 07273b44c2..84a8077a7d 100644 --- a/src/sagemaker/workflow/README.rst +++ b/src/sagemaker/workflow/README.rst @@ -10,4 +10,4 @@ is a platform that enables you to programmatically author, schedule, and monitor you can build a workflow for SageMaker training, hyperparameter tuning, batch transform and endpoint deployment. You can use any SageMaker deep learning framework or Amazon algorithms to perform above operations in Airflow. -For information about using SageMaker Workflow, see https://sagemaker.readthedocs.io/en/stable/using_workflow.html. \ No newline at end of file +For information about using SageMaker Workflow, see https://sagemaker.readthedocs.io/en/stable/using_workflow.html. diff --git a/tests/data/tfs/tfs-test-entrypoint-with-handler/123/assets/foo.txt b/tests/data/tfs/tfs-test-entrypoint-with-handler/123/assets/foo.txt index f9ff036688..56c3e54a43 100644 --- a/tests/data/tfs/tfs-test-entrypoint-with-handler/123/assets/foo.txt +++ b/tests/data/tfs/tfs-test-entrypoint-with-handler/123/assets/foo.txt @@ -1 +1 @@ -asset-file-contents \ No newline at end of file +asset-file-contents diff --git a/tests/data/tfs/tfs-test-model-with-inference/00000123/assets/foo.txt b/tests/data/tfs/tfs-test-model-with-inference/00000123/assets/foo.txt index f9ff036688..56c3e54a43 100644 --- a/tests/data/tfs/tfs-test-model-with-inference/00000123/assets/foo.txt +++ b/tests/data/tfs/tfs-test-model-with-inference/00000123/assets/foo.txt @@ -1 +1 @@ -asset-file-contents \ No newline at end of file +asset-file-contents