Skip to content

Commit

Permalink
2.0.5 release (#82)
Browse files Browse the repository at this point in the history
This release coincides with Media Insights Engine release v2.0.5.

Bug fixes:

    Use correct units for video bit rate in Media Summary box

Documentation changes:

    Explain how to get the URL for the user interface in the README
    Explain how to invoke workflows from the command line in the README.

New features:

    Bring back dropzone for the multi file drag-and-drop upload capability
    Include the cloud formation stack name in the invitation email
    Add puppeteer scripts for automated UI testing
    Allow users to specify a KMS key in the workflow configuration form for enabling encryption in Amazon Comprehend
  • Loading branch information
ianwow committed May 26, 2021
1 parent a52afd6 commit dd4cbf9
Show file tree
Hide file tree
Showing 32 changed files with 958 additions and 560 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/pr-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ jobs:
# If $STACK_NAME exists...
if [ $(echo $(aws cloudformation list-stacks --query 'StackSummaries[?StackName==`$STACK_NAME`]' --output text) | tr -d '\n' | wc -c) > 0 ]; then
# Then delete $STACK_NAME...
echo "Removing $STACK_NAME so we can use that stack name again:"
aws cloudformation list-stacks --query 'StackSummaries[?StackName==`$STACK_NAME`]' --output text
echo "Removing $STACK_NAME so we can use that stack name again"
aws cloudformation delete-stack --stack-name $STACK_NAME --region $REGION
aws cloudformation wait stack-delete-complete --stack-name $STACK_NAME
fi
Expand Down Expand Up @@ -187,4 +186,3 @@ jobs:
else
echo "User requested not to delete stack."
fi
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.idea
.idea/*
node_modules
package
dist
Expand Down
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions .idea/aws-media-insights.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 42 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@ The following Cloudformation templates will deploy the Media Insights front-end

Region| Launch
------|-----
US East (N. Virginia) | [![Launch in us-east-1](doc/images/launch-stack.png)](https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/new?stackName=mie&templateURL=https://rodeolabz-us-east-1.s3.us-east-1.amazonaws.com/content-analysis-solution/v2.0.4/cf/aws-content-analysis.template)
US West (Oregon) | [![Launch in us-west-2](doc/images/launch-stack.png)](https://console.aws.amazon.com/cloudformation/home?region=us-west-2#/stacks/new?stackName=mie&templateURL=https://rodeolabz-us-west-2.s3.us-west-2.amazonaws.com/content-analysis-solution/v2.0.4/cf/aws-content-analysis.template)
US East (N. Virginia) | [![Launch in us-east-1](doc/images/launch-stack.png)](https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/new?stackName=mie&templateURL=https://rodeolabz-us-east-1.s3.us-east-1.amazonaws.com/content-analysis-solution/v2.0.5/cf/aws-content-analysis.template)
US West (Oregon) | [![Launch in us-west-2](doc/images/launch-stack.png)](https://console.aws.amazon.com/cloudformation/home?region=us-west-2#/stacks/new?stackName=mie&templateURL=https://rodeolabz-us-west-2.s3.us-west-2.amazonaws.com/content-analysis-solution/v2.0.5/cf/aws-content-analysis.template)

Once the Cloud Formation stack has been created, open the URL shown in the `ContentAnalyisSolution` output of the base stack. You can also get this URL with the following AWS CLI command:

```
aws cloudformation --region $REGION describe-stacks --stack-name $STACK_NAME --query "Stacks[0].Outputs[?OutputKey=='ContentAnalyisSolution'].OutputValue" --output text
```

For more installation options, see the [Advanced Installation](#advanced-installation-options) section.

Expand Down Expand Up @@ -111,6 +117,40 @@ When finished your stack should look like this:

# Advanced Usage

## Starting workflows from the command line
***(Difficulty: 10 minutes)***

The video analysis workflow used by this application can be invoked from any HTTP client that supports AWS_IAM authorization, such as [awscurl](https://github.com/okigan/awscurl). The following commands show how to start the video analysis workflow using `awscurl`. Prior to running this command you must configure `awscurl` to use your AWS access key and secret key for authorization, and define values for `SOURCE_BUCKET`, `SOURCE_KEY`, and `WORKFLOW_API_ENDPOINT`.

```
SOURCE_BUCKET=
SOURCE_KEY=
WORKFLOW_API_ENDPOINT=
# CasVideoWorkflow with default configuration:
awscurl -X POST --region us-west-2 --data '{"Name":"CasVideoWorkflow", "Input":{"Media":{"Video":{"S3Bucket": "'${SOURCE_BUCKET}'", "S3Key":"'${SOURCE_KEY}'"}}}}' ${WORKFLOW_API_ENDPOINT}workflow/execution | cut -f 2 -d "'" | perl -pe 's/"Definition.+?}]}}}",//g' | jq
# CasVideoWorkflow with custom configuration:
awscurl -X POST --region us-west-2 --data '{"Name":"CasVideoWorkflow", "Configuration":{"defaultVideoStage":{"faceDetection":{"MediaType":"Video","Enabled":true},"textDetection":{"MediaType":"Video","Enabled":true},"celebrityRecognition":{"MediaType":"Video","Enabled":true},"GenericDataLookup":{"MediaType":"Video","Enabled":false},"labelDetection":{"MediaType":"Video","Enabled":true},"personTracking":{"MediaType":"Video","Enabled":true},"shotDetection":{"MediaType":"Video","Enabled":true},"technicalCueDetection":{"MediaType":"Video","Enabled":true},"contentModeration":{"MediaType":"Video","Enabled":true},"faceSearch":{"MediaType":"Video","Enabled":false,"CollectionId":""}}}, "Input":{"Media":{"Video":{"S3Bucket": "'${SOURCE_BUCKET}'", "S3Key":"'${SOURCE_KEY}'"}}}}' ${WORKFLOW_API_ENDPOINT}workflow/execution | cut -f 2 -d "'" | perl -pe 's/"Definition.+?}]}}}",//g' | jq
```

Similarly, here's how to run the image analysis workflow:

```
awscurl -X POST --region us-west-2 --data '{"Name":"CasImageWorkflow", "Input":{"Media":{"Video":{"S3Bucket": "'${SOURCE_BUCKET}'", "S3Key":"'${SOURCE_KEY}'"}}}}' ${WORKFLOW_API_ENDPOINT}workflow/execution | cut -f 2 -d "'" | perl -pe 's/"Definition.+?}]}}}",//g' | jq
```

## Starting workflows from a Python Lambda function
***(Difficulty: 10 minutes)***

The following Python code can be used in an AWS Lambda function to execute the video analysis workflow:




## Starting workflows from an S3 trigger
***(Difficulty: 10 minutes)***

Workflows can be started automatically when files are copied to a target S3 bucket by using the following

## Adding new operators and extending data stream consumers:
***(Difficulty: 60 minutes)***

Expand Down
13 changes: 7 additions & 6 deletions cloudformation/aws-content-analysis-auth.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ Parameters:
DataplaneBucket:
Description: Name of the MIE dataplane bucket
Type: String
ParentStackName:
Description: Name of the parent Cloud Formation stack
Type: String

Resources:
ContentAnalysisUserPool:
Expand All @@ -26,15 +29,13 @@ Resources:
AllowAdminCreateUserOnly: True
InviteMessageTemplate:
EmailMessage: !Join ["", [
"Your username is {username} and temporary password is {####}<br>Stack Name: ",
Ref: "AWS::StackName",
"<br>Stack Overview:<br>",
"Your username is {username} and temporary password is {####}<br>AWS CloudFormation stack:<br>",
"https://",
Ref: "AWS::Region",
Ref: AWS::Region,
".console.aws.amazon.com/cloudformation/home?region=",
Ref: "AWS::Region",
Ref: AWS::Region,
"#/stacks/stackinfo?stackId=",
Ref: "AWS::StackId"
Ref: ParentStackName
]]
EmailSubject: "Welcome to AWS Content Analysis"
EmailConfiguration:
Expand Down
15 changes: 6 additions & 9 deletions cloudformation/aws-content-analysis-image-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ Parameters:
OperatorLibraryStack:
Description: "Name of the MIE operator library stack"
Type: String
ShortUUID:
Description: "Unique ID for resource naming"
Type: String

Resources:
# Stages
Expand All @@ -20,7 +17,7 @@ Resources:
Properties:
ServiceToken: !Ref WorkflowCustomResourceArn
ResourceType: "Stage"
Name: !Join ["", ["ValidationStage-", !Ref ShortUUID]]
Name: "ValidationStage"
Operations:
- Fn::ImportValue:
Fn::Sub: "${OperatorLibraryStack}:MediainfoImage"
Expand All @@ -30,7 +27,7 @@ Resources:
Properties:
ServiceToken: !Ref WorkflowCustomResourceArn
ResourceType: "Stage"
Name: !Join ["", ["parallelRekognitionStage-", !Ref ShortUUID]]
Name: "parallelRekognitionStage"
Operations:
- Fn::ImportValue:
Fn::Sub: "${OperatorLibraryStack}:CelebRecognition"
Expand All @@ -55,7 +52,7 @@ Resources:
Properties:
ServiceToken: !Ref WorkflowCustomResourceArn
ResourceType: "Stage"
Name: !Join ["", ["RekognitionVideoNoFaceSearchStage-", !Ref ShortUUID]]
Name: "RekognitionVideoNoFaceSearchStage"
Operations:
- Fn::ImportValue:
Fn::Sub: "${OperatorLibraryStack}:LabelDetection"
Expand All @@ -73,7 +70,7 @@ Resources:
Properties:
ServiceToken: !Ref WorkflowCustomResourceArn
ResourceType: "Stage"
Name: !Join ["", ["RekognitionStage-", !Ref ShortUUID]]
Name: "RekognitionStage"
Operations:
- Fn::ImportValue:
Fn::Sub: "${OperatorLibraryStack}:CelebRecognitionImage"
Expand All @@ -95,7 +92,7 @@ Resources:
Properties:
ServiceToken: !Ref WorkflowCustomResourceArn
ResourceType: "Stage"
Name: !Join ["", ["RekognitionImageNoFaceSearchStage-", !Ref ShortUUID]]
Name: "RekognitionImageNoFaceSearchStage"
Operations:
- Fn::ImportValue:
Fn::Sub: "${OperatorLibraryStack}:CelebRecognitionImage"
Expand All @@ -118,7 +115,7 @@ Resources:
Properties:
ServiceToken: !Ref WorkflowCustomResourceArn
ResourceType: "Workflow"
Name: !Join ["", ["CasImageWorkflow-", !Ref ShortUUID]]
Name: "CasImageWorkflow"
StartAt: !GetAtt ValidationStage.Name
Stages: !Sub
- |-
Expand Down
67 changes: 1 addition & 66 deletions cloudformation/aws-content-analysis-use-existing-mie-stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,8 @@ Parameters:
- "c4.xlarge.elasticsearch"
- "r4.large.elasticsearch"
- "r4.xlarge.elasticsearch"
ShortUUID:
Description: Uuid to use for uniquely naming step functions in workflows
Type: String
Default: "0"

Mappings:
<<<<<<< HEAD:cloudformation/aws-content-analysis-use-existing-mie-stack.yaml
=======
MediaInsightsEngine:
Release:
Version: "v2.0.3"
>>>>>>> ef8e22eb9e28d8057d207ce692c76279ca15d5b2:cloudformation/aws-content-analysis-create-new-mie-stack.yaml
ContentAnalysisApp:
SourceCode:
S3Bucket: "%%BUCKET_NAME%%"
Expand Down Expand Up @@ -61,17 +51,12 @@ Resources:
- TemplateKeyPrefix
- "/aws-content-analysis-elasticsearch.template"
Parameters:
<<<<<<< HEAD:cloudformation/aws-content-analysis-use-existing-mie-stack.yaml
AnalyticsStreamArn:
Fn::ImportValue:
!Sub "${MieStackName}:AnalyticsStreamArn"
MieDataplaneBucket:
Fn::ImportValue:
!Sub "${MieStackName}:DataplaneBucket"
=======
AnalyticsStreamArn: !GetAtt MieStack.Outputs.AnalyticsStreamArn
MieDataplaneBucket: !GetAtt MieStack.Outputs.DataplaneBucket
>>>>>>> ef8e22eb9e28d8057d207ce692c76279ca15d5b2:cloudformation/aws-content-analysis-create-new-mie-stack.yaml
NodeType: !Ref ElasticSearchNodeSize

# Deploy Auth stack
Expand All @@ -96,7 +81,6 @@ Resources:
- "/aws-content-analysis-auth.template"
Parameters:
AdminEmail: !Ref AdminEmail
<<<<<<< HEAD:cloudformation/aws-content-analysis-use-existing-mie-stack.yaml
WorkflowApiId:
Fn::ImportValue:
!Sub "${MieStackName}:WorkflowApiId"
Expand All @@ -107,42 +91,7 @@ Resources:
DataplaneBucket:
Fn::ImportValue:
!Sub "${MieStackName}:DataplaneBucket"
=======
WorkflowApiId: !GetAtt MieStack.Outputs.WorkflowApiRestID
DataplaneApiId: !GetAtt MieStack.Outputs.DataplaneApiRestID
ElasticDomainArn: !GetAtt ContentAnalysisElasticsearchStack.Outputs.DomainArn
DataplaneBucket: !GetAtt MieStack.Outputs.DataplaneBucket

ContentAnalysisWebStack:
Type: "AWS::CloudFormation::Stack"
Properties:
TemplateURL: !Join
- ""
- - "https://"
- !FindInMap
- ContentAnalysisApp
- SourceCode
- S3Bucket
- ".s3."
- !Ref AWS::Region
- ".amazonaws.com/"
- !FindInMap
- ContentAnalysisApp
- SourceCode
- TemplateKeyPrefix
- "/aws-content-analysis-web.template"
Parameters:
DataplaneEndpoint: !GetAtt MieStack.Outputs.DataplaneApiEndpoint
WorkflowEndpoint: !GetAtt MieStack.Outputs.WorkflowApiEndpoint
ElasticEndpoint: !GetAtt ContentAnalysisElasticsearchStack.Outputs.ElasticEndpoint
DataplaneBucket: !GetAtt MieStack.Outputs.DataplaneBucket
UserPoolId: !GetAtt ContentAnalysisAuthStack.Outputs.UserPoolId
IdentityPoolId: !GetAtt ContentAnalysisAuthStack.Outputs.IdentityPoolId
PoolClientId: !GetAtt ContentAnalysisAuthStack.Outputs.UserPoolClientId
ShortUUID: !Ref ShortUUID

# Deploy video workflow
>>>>>>> ef8e22eb9e28d8057d207ce692c76279ca15d5b2:cloudformation/aws-content-analysis-create-new-mie-stack.yaml
ParentStackName: !Ref AWS::StackId

# Deploy Video Workflow
CompleteVideoWorkflow:
Expand All @@ -168,15 +117,8 @@ Resources:
Fn::ImportValue:
!Sub "${MieStackName}:WorkflowCustomResourceArn"
OperatorLibraryStack:
<<<<<<< HEAD:cloudformation/aws-content-analysis-use-existing-mie-stack.yaml
Fn::ImportValue:
!Sub "${MieStackName}:OperatorLibraryStack"
=======
Fn::GetAtt:
- MieStack
- Outputs.OperatorLibraryStack
ShortUUID: !Ref ShortUUID
>>>>>>> ef8e22eb9e28d8057d207ce692c76279ca15d5b2:cloudformation/aws-content-analysis-create-new-mie-stack.yaml

# Deploy image workflow
CompleteImageWorkflow:
Expand All @@ -202,7 +144,6 @@ Resources:
Fn::ImportValue:
!Sub "${MieStackName}:WorkflowCustomResourceArn"
OperatorLibraryStack:
<<<<<<< HEAD:cloudformation/aws-content-analysis-use-existing-mie-stack.yaml
Fn::ImportValue:
!Sub "${MieStackName}:OperatorLibraryStack"

Expand Down Expand Up @@ -238,12 +179,6 @@ Resources:
UserPoolId: !GetAtt ContentAnalysisAuthStack.Outputs.UserPoolId
IdentityPoolId: !GetAtt ContentAnalysisAuthStack.Outputs.IdentityPoolId
PoolClientId: !GetAtt ContentAnalysisAuthStack.Outputs.UserPoolClientId
=======
Fn::GetAtt:
- MieStack
- Outputs.OperatorLibraryStack
ShortUUID: !Ref ShortUUID
>>>>>>> ef8e22eb9e28d8057d207ce692c76279ca15d5b2:cloudformation/aws-content-analysis-create-new-mie-stack.yaml

Outputs:
CloudfrontUrl:
Expand Down
Loading

0 comments on commit dd4cbf9

Please sign in to comment.