Skip to content
This repository was archived by the owner on Dec 30, 2024. It is now read-only.

Commit 551da71

Browse files
committed
release v2.0.1
1 parent 8075a42 commit 551da71

File tree

95 files changed

+49280
-33403
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+49280
-33403
lines changed

CHANGELOG.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [2.0.1] - 2022-11-16
9+
10+
### Fixed
11+
12+
- Github [issue #69](https://github.com/aws-solutions/discovering-hot-topics-using-machine-learning/issues/69). The fix required the ingestion infrastructure code in CDK to be pass the AWS CloudFormation parameter to be passed to the Reddit nested stack.
13+
14+
### Updated
15+
16+
- CDK version 1.177.0
17+
- AWS SDK verson 2.1223.0
18+
819
## [2.0.0] - 2022-05-31
920

1021
### Added
@@ -79,7 +90,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7990

8091
### Fixed
8192

82-
- Truncated tweets through merging [GitHub pull request #26](https://github.com/awslabs/discovering-hot-topics-using-machine-learning/pull/26)
93+
- Truncated tweets through merging [GitHub pull request #26](https://github.com/aws-solutions/discovering-hot-topics-using-machine-learning/pull/26)
8394

8495
## [1.4.0] - 2021-02-04
8596

CONTRIBUTING.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ documentation, we greatly value feedback and contributions from our community.
66
Please read through this document before submitting any issues or pull requests to ensure we have all the necessary
77
information to effectively respond to your bug report or contribution.
88

9-
109
## Reporting Bugs/Feature Requests
1110

1211
We welcome you to use the GitHub issue tracker to report bugs or suggest features.
@@ -19,8 +18,8 @@ reported the issue. Please try to include as much information as you can. Detail
1918
* Any modifications you've made relevant to the bug
2019
* Anything unusual about your environment or deployment
2120

22-
2321
## Contributing via Pull Requests
22+
2423
Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:
2524

2625
1. You are working against the latest source on the *master* branch.
@@ -39,20 +38,19 @@ To send us a pull request, please:
3938
GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
4039
[creating a pull request](https://help.github.com/articles/creating-a-pull-request/).
4140

42-
4341
## Finding contributions to work on
44-
Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels ((enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any ['help wanted'](https://github.com/aws-solutions/discovering-hot-topics-using-machine-learning/labels/help%20wanted) issues is a great place to start.
4542

43+
Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels ((enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any ['help wanted'](https://github.com/aws-solutions/discovering-hot-topics-using-machine-learning/labels/help%20wanted) issues is a great place to start.
4644

4745
## Code of Conduct
46+
4847
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
4948
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
5049
[email protected] with any additional questions or comments.
5150

52-
5351
## Security issue notifications
54-
If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue.
5552

53+
If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue.
5654

5755
## Licensing
5856

README.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -80,46 +80,46 @@ The solution is deployed using a CloudFormation template with a lambda backed cu
8080

8181
```
8282
├── deployment [folder containing build scripts]
83-
   ├── cdk-solution-helper [A helper function to help deploy lambda function code through S3 buckets]
83+
├── cdk-solution-helper [A helper function to help deploy lambda function code through S3 buckets]
8484
│ ├── build-s3-dist.sh [Build script to build the solution]
8585
└── source [source code containing CDK App and lambda functions]
8686
├── bin [entrypoint of the CDK application]
8787
├── lambda [folder containing source code the lambda functions]
8888
│ ├── capture_news_feed [lambda function to ingest news feeds]
89-
   ├── firehose_topic_proxy [lambda function to write topic analysis output to Amazon Kinesis Firehose]
90-
   ├── firehose-text-proxy [lambda function to write text analysis output to Amazon Kinesis Firehose]
91-
   ├── ingestion-consumer [lambda function that consumes messages from Amazon Kinesis Data Streams]
92-
   ├── ingestion-custom [lambda function that reads files from Amazon S3 bucket and pushes data to Amazon Kinesis Data Streams]
93-
   ├── ingestion-producer [lambda function that makes Twitter API call and pushes data to Amazon Kinesis Data Stream]
94-
   ├── ingestion-reddit [lambda function that makes Reddit API call to retrieve comments from subreddits of interest and pushes data to Amazon Kinesis Data Stream]
95-
   ├── ingestion-youtube [lambda function that ingests comments from YouTube videos and pushes data to Amazon Kinesis Data Streams]
96-
   ├── integration [lambda function that publishes inference outputs to Amazon Events Bridge]
89+
├── firehose_topic_proxy [lambda function to write topic analysis output to Amazon Kinesis Firehose]
90+
├── firehose-text-proxy [lambda function to write text analysis output to Amazon Kinesis Firehose]
91+
├── ingestion-consumer [lambda function that consumes messages from Amazon Kinesis Data Streams]
92+
├── ingestion-custom [lambda function that reads files from Amazon S3 bucket and pushes data to Amazon Kinesis Data Streams]
93+
├── ingestion-producer [lambda function that makes Twitter API call and pushes data to Amazon Kinesis Data Stream]
94+
├── ingestion-reddit [lambda function that makes Reddit API call to retrieve comments from subreddits of interest and pushes data to Amazon Kinesis Data Stream]
95+
├── ingestion-youtube [lambda function that ingests comments from YouTube videos and pushes data to Amazon Kinesis Data Streams]
96+
├── integration [lambda function that publishes inference outputs to Amazon Events Bridge]
9797
│ ├── layers [lambda layer function library for Node and Python layers]
9898
│ │ ├── aws-nodesdk-custom-config
9999
│ │ ├── python_lambda_layer
100100
│ ├── quicksight-custom-resources [lambda function to create Amazon QuickSight resources, example: data source, data sets, analysis and dashboards]
101101
│ ├── solution_helper [lambda function that allows capturing metrics for this solution]
102-
   ├── storage-firehose-processor [lambda function that writes data to S3 buckets to build a relational model]
103-
   ├── wf-analyze-text [lambda function to detect sentiments, key phrases and entities using Amazon Comprehend]
104-
   ├── wf-check-topic-model [lambda function to check status of topic modeling jobs on Amazon Comprehend]
102+
├── storage-firehose-processor [lambda function that writes data to S3 buckets to build a relational model]
103+
├── wf-analyze-text [lambda function to detect sentiments, key phrases and entities using Amazon Comprehend]
104+
├── wf-check-topic-model [lambda function to check status of topic modeling jobs on Amazon Comprehend]
105105
│ ├── wf-detect-language [lambda function to detect language of ingested text content using Amazon Comprehend]
106-
   ├── wf-detect-moderation-labels [lambda function to detect content moderation using Amazon Rekognition]
107-
   ├── wf-extract-text-in-image [lambda function to extract text content from images using Amazon Rekognition]
108-
   ├── wf-publish-text-inference [lambda function to publish Amazon Comprehend inferences]
109-
   ├── wf-submit-topic-model [lambda function to submit topic modeling job]
110-
   ├── wf-translate-text [lambda function to translate non-english text using Amazon Translate]
111-
   └── wf_publish_topic_model [lambda function to publish topic modeling inferences from Amazon Comprehend]
106+
├── wf-detect-moderation-labels [lambda function to detect content moderation using Amazon Rekognition]
107+
├── wf-extract-text-in-image [lambda function to extract text content from images using Amazon Rekognition]
108+
├── wf-publish-text-inference [lambda function to publish Amazon Comprehend inferences]
109+
├── wf-submit-topic-model [lambda function to submit topic modeling job]
110+
├── wf-translate-text [lambda function to translate non-english text using Amazon Translate]
111+
└── wf_publish_topic_model [lambda function to publish topic modeling inferences from Amazon Comprehend]
112112
├── lib
113113
│ ├── aspects [CDK Aspects definitions to inject attributes during the prepare phase]
114114
│ ├── awsnodejs-lambda-layer [Lambda layer construct for lambda functions that run on Nodejs runtime]
115-
   ├── ingestion [CDK constructs for data ingestion]
116-
   ├── integration [CDK constructs for Amazon Events Bridge]
115+
├── ingestion [CDK constructs for data ingestion]
116+
├── integration [CDK constructs for Amazon Events Bridge]
117117
│ ├── quicksight-custom-resources [CDK construct that invokes custom resources to create Amazon QuickSight resources]
118118
│ ├── s3-event-notification [CDK construct that configures S3 events to be pushed to Amazon EventBridge]
119-
   ├── storage [CDK constructs that define storage of the inference events]
120-
   ├── text-analysis-workflow [CDK constructs for text analysis of ingested data]
121-
   ├── topic-analysis-workflow [CDK constructs for topic visualization of ingested data]
122-
   └── visualization [CDK constructs to build a relational database model for visualization]
119+
├── storage [CDK constructs that define storage of the inference events]
120+
├── text-analysis-workflow [CDK constructs for text analysis of ingested data]
121+
├── topic-analysis-workflow [CDK constructs for topic visualization of ingested data]
122+
└── visualization [CDK constructs to build a relational database model for visualization]
123123
├── discovering-hot-topics.ts
124124
```
125125

deployment/build-s3-dist.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,11 @@ done
144144

145145
node $template_dir/cdk-solution-helper/index
146146

147+
app_registry_name=$(echo "$solution_name" | sed 's/ /-/g' | awk '{print tolower($0)}' | cut -c 1-64)
148+
echo "-----------------------------------------------------------------------------"
149+
echo "Setting App Registry Application Name as $app_registry_name"
150+
echo "-----------------------------------------------------------------------------"
151+
147152
echo "------------------------------------------------------------------------------"
148153
echo "Updating placeholders"
149154
echo "------------------------------------------------------------------------------"
@@ -155,6 +160,9 @@ do
155160
replace="s/%%SOLUTION_NAME%%/$solution_name/g"
156161
sed -i -e $replace $file
157162

163+
replace="s/%%APP_REG_NAME%%/$app_registry_name/g"
164+
sed -i -e $replace $file
165+
158166
replace="s/%%VERSION%%/$solution_version/g"
159167
sed -i -e $replace $file
160168

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/usr/bin/env node
22
/**********************************************************************************************************************
3-
* Copyright 2020-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. *
3+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. *
44
* *
5-
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance *
5+
* Licensed under the Apache License, Version 2.0 (the 'License'). You may not use this file except in compliance *
66
* with the License. A copy of the License is located at *
77
* *
88
* http://www.apache.org/licenses/LICENSE-2.0 *
@@ -12,14 +12,15 @@
1212
* and limitations under the License. *
1313
*********************************************************************************************************************/
1414

15-
1615
import * as cdk from '@aws-cdk/core';
1716
import { ApplytoLambda } from '../lib/aspects/apply-to-lambda';
1817
import { DiscoveringHotTopicsStack } from '../lib/discovering-hot-topics-stack';
1918

2019
const app = new cdk.App();
2120
const dht = new DiscoveringHotTopicsStack(app, 'discovering-hot-topics-using-machine-learning', {
22-
description: `(${app.node.tryGetContext('solution_id')}) - Discovering Hot Topics using Machine Learning. Version %%VERSION%%`
21+
description: `(${app.node.tryGetContext(
22+
'solution_id'
23+
)}) - Discovering Hot Topics using Machine Learning. Version %%VERSION%%`
2324
});
2425

2526
cdk.Aspects.of(app).add(new ApplytoLambda(dht, 'CustomConfig'));

source/cdk.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
"quicksight_source_template_arn": "arn:aws:quicksight:us-east-1:%%TEMPLATE_ACCOUNT_ID%%:template/%%DIST_QUICKSIGHT_NAMESPACE%%_%%SOLUTION_NAME%%_%%DASHED_VERSION%%",
55
"solution_id": "SO0122",
66
"solution_name": "%%SOLUTION_NAME%%",
7-
"solution_version": "%%VERSION%%"
7+
"solution_version": "%%VERSION%%",
8+
"app_registry_name": "%%APP_REG_NAME%%",
9+
"application_type": "AWS-Solutions"
810
}
9-
}
11+
}

source/lambda/capture_news_feed/lambda_function.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class IncorrectEventNameSpaceError(Exception):
2929
pass
3030

3131

32-
def publish_config_handler(event, context):
32+
def publish_config_handler(event, _): # NOSONAR - lambda signature
3333
""" If lambda environment variable is set to read from os.environ, if not read from DDB """
3434
if os.environ.get("CONFIG_PARAM", None):
3535
"""
@@ -63,7 +63,7 @@ def publish_config_handler(event, context):
6363
logger.debug(f"Event published is: {config_event}")
6464

6565

66-
def process_config_handler(event, context):
66+
def process_config_handler(event, _): # NOSONAR - lambda signature
6767
if event["source"] == os.environ["INGESTION_NAMESPACE"]:
6868
data = event["detail"]
6969

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
moto==3.1.7
2-
pytest==7.1.2
3-
pytest-cov==3.0.0
1+
moto==4.0.5
2+
pytest==7.1.3
3+
pytest-cov==4.0.0
44
botocore
55
mock==4.0.3
6-
responses==0.20.0
6+
responses==0.21.0

source/lambda/capture_news_feed/util/ddb_helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def update_query_tracker(account, url, search_query, topic=None):
8080
)
8181

8282

83-
def get_query_tracker(account, url, search_query, topic=None, **item_kwargs):
83+
def get_query_tracker(account, url, search_query, topic=None, **item_kwargs): # NOSONAR allow passing keyword args
8484
dynamodb = service_helper.get_service_resource("dynamodb")
8585

8686
table = dynamodb.Table(os.environ["TARGET_DDB_TABLE"])

0 commit comments

Comments
 (0)