Skip to content

Instantly share code, notes, and snippets.

@nivleshc
nivleshc / publish-amazon-sumerian-scene-privately-app.js
Created Aug 4, 2020
App.js that is used in react app to publish an Amazon Sumerian scene privately
View publish-amazon-sumerian-scene-privately-app.js
import React, { Component } from 'react';
import './App.css';
import { withAuthenticator, SumerianScene } from 'aws-amplify-react';
import Amplify from 'aws-amplify';
import awsmobile from './aws-exports';
import '@aws-amplify/ui/dist/style.css';
Amplify.configure(awsmobile);
class App extends Component {
@nivleshc
nivleshc / stepfunctions-sagemaker-state-machine.json
Created Apr 30, 2020
This is the AWS Step Function to automate training, build and deployment of an Amazon SageMaker model
View stepfunctions-sagemaker-state-machine.json
{
"Comment": "An AWS Step Function State Machine to train, build and deploy an Amazon SageMaker model endpoint",
"StartAt": "Create Training Job",
"States": {
"Create Training Job": {
"Type": "Task",
"Resource": "arn:aws:states:::sagemaker:createTrainingJob.sync",
"Parameters": {
"TrainingJobName.$": "$$.Execution.Name",
"ResourceConfig": {
@nivleshc
nivleshc / stepfunctions-state-05.json
Created Apr 30, 2020
This is the fifth state for the AWS Step Function to automate training, build and deployment of an Amazon SageMaker model
View stepfunctions-state-05.json
"Display Error":{
"Type": "Pass",
"Result": "Finished with errors. Please check the individual steps for more information",
"End": true
}
@nivleshc
nivleshc / stepfunctions-state-04.json
Created Apr 30, 2020
This is the fourth state for the AWS Step Function to automate training, build and deployment of an Amazon SageMaker model
View stepfunctions-state-04.json
"Create Endpoint":{
"Type":"Task",
"Resource":"arn:aws:states:::sagemaker:createEndpoint",
"Parameters":{
"EndpointConfigName.$": "$.TrainingJobName",
"EndpointName.$": "$.TrainingJobName"
},
"End": true
},
@nivleshc
nivleshc / stepfunctions-state-03.json
Created Apr 30, 2020
This is the third state for the AWS Step Function to automate training, build and deployment of an Amazon SageMaker model
View stepfunctions-state-03.json
"Create Endpoint Config": {
"Type": "Task",
"Resource": "arn:aws:states:::sagemaker:createEndpointConfig",
"Parameters":{
"EndpointConfigName.$": "$.TrainingJobName",
"ProductionVariants": [
{
"InitialInstanceCount": 1,
"InstanceType": "ml.t2.medium",
"ModelName.$": "$.TrainingJobName",
@nivleshc
nivleshc / stepfunctions-state-02.json
Created Apr 30, 2020
This is the second state for the AWS Step Function to automate training, build and deployment of an Amazon SageMaker model
View stepfunctions-state-02.json
"Create Model": {
"Parameters": {
"PrimaryContainer": {
"Image": "544295431143.dkr.ecr.ap-southeast-2.amazonaws.com/xgboost:1",
"Environment": {},
"ModelDataUrl.$": "$.ModelArtifacts.S3ModelArtifacts"
},
"ExecutionRoleArn": "iam-role-arn",
"ModelName.$": "$.TrainingJobName"
},
@nivleshc
nivleshc / stepfunctions-state-01.json
Created Apr 30, 2020
This is the first state for the AWS Step Function to automate training, build and deployment of an Amazon SageMaker model
View stepfunctions-state-01.json
"States": {
"Create Training Job": {
"Type": "Task",
"Resource": "arn:aws:states:::sagemaker:createTrainingJob.sync",
"Parameters": {
"TrainingJobName.$": "$$.Execution.Name",
"ResourceConfig": {
"InstanceCount": 1,
"InstanceType": "ml.m4.xlarge",
"VolumeSizeInGB": 5
@nivleshc
nivleshc / stepfunctions-header.json
Last active Apr 30, 2020
The beginning of the AWS Step Function to automate training, build and deployment of an Amazon SageMaker model
View stepfunctions-header.json
{
"Comment": "An AWS Step Function State Machine to train, build and deploy an Amazon SageMaker model endpoint",
"StartAt": "Create Training Job",
@nivleshc
nivleshc / stepfunctions-sagemaker-iam-s3-policy.json
Created Apr 30, 2020
An AWS IAM Policy for AWS Step Functions to access the Amazon S3 Bucket that contains the training and validation data. The model artifacts will also be uploaded to the Amazon S3 Bucket
View stepfunctions-sagemaker-iam-s3-policy.json
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"s3:ListBucket"
],
"Effect": "Allow",
"Resource": [
"arn:aws:s3:::bucketName"
@nivleshc
nivleshc / lifeinsurancebot-error.html
Created Apr 8, 2020
This is the page that will be displayed when there is an error
View lifeinsurancebot-error.html
<html>
<head>
<title>There was an error</title>
</head>
<body>
There was an error. Please check back later or contact the webmaster
</body>
</html>
You can’t perform that action at this time.