Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 0.1.0 #79

Merged
merged 40 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
49cc224
changes for upgraded python version
AndrewPlayer3 Jun 28, 2024
a33692c
changes for python version upgrade
AndrewPlayer3 Jun 28, 2024
0786c0b
set version correctly
AndrewPlayer3 Jun 28, 2024
e47d76a
updated changelog
AndrewPlayer3 Jun 28, 2024
653c23a
flake8
AndrewPlayer3 Jun 28, 2024
2ed4491
Update find_new/requirements.txt
AndrewPlayer3 Jun 28, 2024
3dd60b6
Update harvest_products/requirements.txt
AndrewPlayer3 Jun 28, 2024
57906af
reverted unnecessary changes
AndrewPlayer3 Jun 28, 2024
b389597
pinning versions
AndrewPlayer3 Jun 28, 2024
59abc55
pin pytest
AndrewPlayer3 Jun 28, 2024
c6d2f8d
add dependabot
jtherrmann Jun 28, 2024
906c8c3
Merge branch 'deprecate_python38' of github.com:ASFHyP3/hyp3-event-mo…
jtherrmann Jun 28, 2024
60a1dfa
rename requirements files
jtherrmann Jun 28, 2024
bc991cb
Merge pull request #71 from ASFHyP3/add-dependabot
jtherrmann Jun 28, 2024
34dc35e
Add Default Bucket OwnershipControls
AndrewPlayer3 Jun 28, 2024
a9b471e
Merge branch 'deprecate_python38' of https://github.com/asfhyp3/hyp3-…
AndrewPlayer3 Jun 28, 2024
daca881
Update github workflows and delete pull request template
jtherrmann Jun 28, 2024
4c63bf2
Merge pull request #72 from ASFHyP3/actions
jtherrmann Jul 1, 2024
908b418
Updated S3 Logging
AndrewPlayer3 Jul 1, 2024
2ead7f8
renamed back to LogBucket
AndrewPlayer3 Jul 1, 2024
e59e169
cleaning
AndrewPlayer3 Jul 1, 2024
d92f4ea
cleaning
AndrewPlayer3 Jul 1, 2024
ee2c605
Update cloudformation.yml
AndrewPlayer3 Jul 1, 2024
6bf1204
Merge pull request #70 from ASFHyP3/deprecate_python38
AndrewPlayer3 Jul 1, 2024
f3d9017
Bump actions/setup-python from 1 to 5
dependabot[bot] Jul 1, 2024
d481146
Bump aws-actions/configure-aws-credentials from 1 to 4
dependabot[bot] Jul 1, 2024
be44b95
Bump actions/checkout from 2 to 4
dependabot[bot] Jul 1, 2024
80b411f
Bump moto from 5.0.10.dev36 to 5.0.11.dev2
dependabot[bot] Jul 1, 2024
a770c71
Bump boto3 from 1.34.135 to 1.34.136
dependabot[bot] Jul 1, 2024
2b9f0ce
Merge pull request #81 from ASFHyP3/dependabot/pip/boto3-1.34.136
jtherrmann Jul 1, 2024
4fc8539
Update requirements-all.txt
jtherrmann Jul 1, 2024
830f63a
Merge pull request #80 from ASFHyP3/dependabot/pip/moto-5.0.11.dev2
jtherrmann Jul 1, 2024
ed0ff25
Merge pull request #75 from ASFHyP3/dependabot/github_actions/actions…
jtherrmann Jul 1, 2024
375cbbb
Merge pull request #73 from ASFHyP3/dependabot/github_actions/actions…
jtherrmann Jul 1, 2024
ee7bb02
Merge pull request #74 from ASFHyP3/dependabot/github_actions/aws-act…
jtherrmann Jul 1, 2024
c5293b2
add deploy concurrency
jtherrmann Jul 1, 2024
415d9a6
fix flask versioning issues
AndrewPlayer3 Jul 1, 2024
9fc0e44
Merge branch 'develop' of https://github.com/asfhyp3/hyp3-event-monit…
AndrewPlayer3 Jul 1, 2024
179ca22
Merge pull request #82 from ASFHyP3/deploy-concurrency
jtherrmann Jul 1, 2024
4878227
Merge pull request #83 from ASFHyP3/deprecate_python38
AndrewPlayer3 Jul 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 0 additions & 37 deletions .github/PULL_REQUEST_TEMPLATE/release.md

This file was deleted.

19 changes: 19 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: pip
directory: /
schedule:
interval: weekly
labels:
- bumpless
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
labels:
- bumpless
8 changes: 0 additions & 8 deletions .github/pull_request_template.md

This file was deleted.

4 changes: 1 addition & 3 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,4 @@ on:

jobs:
call-changelog-check-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-changelog-check.yml@main
secrets:
USER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: ASFHyP3/actions/.github/workflows/[email protected]
15 changes: 15 additions & 0 deletions .github/workflows/create-jira-issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Create Jira issue

on:
issues:
types: [labeled]

jobs:
call-create-jira-issue-workflow:
uses: ASFHyP3/actions/.github/workflows/[email protected]
secrets:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
JIRA_PROJECT: ${{ secrets.JIRA_PROJECT }}
JIRA_FIELDS: ${{ secrets.JIRA_FIELDS }}
19 changes: 10 additions & 9 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

name: Deploy to AWS

on:
Expand All @@ -7,6 +6,8 @@ on:
- main
- develop

concurrency: ${{ github.workflow }}-${{ github.ref }}

env:
AWS_REGION: us-west-2
TEMPLATE_BUCKET: cf-templates-aubvn3i9olmk-us-west-2
Expand All @@ -21,7 +22,7 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.TOOLS_BOT_PAK }}
Expand All @@ -36,22 +37,22 @@ jobs:
echo "STACK_NAME=hyp3-event-monitoring" >> $GITHUB_ENV
echo "HYP3_URL=https://hyp3-api.asf.alaska.edu" >> $GITHUB_ENV

- uses: aws-actions/configure-aws-credentials@v1
- uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ env.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ env.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}

- uses: actions/setup-python@v1
- uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.12

- name: install dependencies and render templates
run: |
python -m pip install --upgrade pip
python -m pip install -r find_new/requirements.txt -t find_new/src
python -m pip install -r api/requirements.txt -t api/src
python -m pip install -r harvest_products/requirements.txt -t harvest_products/src
python -m pip install -r requirements-find-new.txt -t find_new/src
python -m pip install -r requirements-api.txt -t api/src
python -m pip install -r requirements-harvest-products.txt -t harvest_products/src

- name: Package and deploy
run: |
Expand All @@ -73,6 +74,6 @@ jobs:
call-bump-version-workflow:
if: github.ref == 'refs/heads/main'
needs: deploy
uses: ASFHyP3/actions/.github/workflows/reusable-bump-version.yml@main
uses: ASFHyP3/actions/.github/workflows/reusable-bump-version.yml@v0.11.2
secrets:
USER_TOKEN: ${{ secrets.TOOLS_BOT_PAK }}
15 changes: 15 additions & 0 deletions .github/workflows/labeled-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Is PR labeled?

on:
pull_request:
types:
- opened
- labeled
- unlabeled
- synchronize
branches:
- main

jobs:
call-labeled-pr-check-workflow:
uses: ASFHyP3/actions/.github/workflows/[email protected]
14 changes: 14 additions & 0 deletions .github/workflows/release-template-comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
on:
pull_request:
types:
- opened
branches:
- main

jobs:
call-release-checklist-workflow:
uses: ASFHyP3/actions/.github/workflows/[email protected]
permissions:
pull-requests: write
secrets:
USER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
call-release-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-release.yml@main
uses: ASFHyP3/actions/.github/workflows/reusable-release.yml@v0.11.2
with:
release_prefix: HyP3 Event Monitoring
secrets:
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@ on: push

jobs:
call-flake8-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-flake8.yml@main
uses: ASFHyP3/actions/.github/workflows/reusable-flake8.yml@v0.11.2
with:
local_package_names: api,database,find_new,harvest_products

cfn-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: scottbrenner/cfn-lint-action@master
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
args: "--ignore-checks W3002 --template cloudformation.yml **/cloudformation.yml"
python-version: 3.12
- run: |
python -m pip install --upgrade pip
python -m pip install -r requirements-all.txt
- run: |
cfn-lint --info --ignore-checks W3002 --template cloudformation.yml **/cloudformation.yml
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ jobs:
pytest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: actions/setup-python@v1
- uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.12

- run: |
python -m pip install --upgrade pip
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [PEP 440](https://www.python.org/dev/peps/pep-0440/)
and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.1.0]
### Removed
- Support for Python 3.8 has been removed. Python 3.12 is now supported.

## [0.0.13]
### Changed
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ Review the parameters in [cloudformation.yml](cloudformation.yml) for deploy tim

### Deploy with CloudFormation

- Install dependencies for each component (requires pip for python 3.8)
- Install dependencies for each component (requires pip for python 3.12)

```sh
python -m pip install -r find_new/requirements.txt -t find_new/src
python -m pip install -r api/requirements.txt -t api/src
python -m pip install -r harvest_products/requirements.txt -t harvest_products/src
python -m pip install -r requirements-find-new.txt -t find_new/src
python -m pip install -r requirements-api.txt -t api/src
python -m pip install -r requirements-harvest-products.txt -t harvest_products/src
```

- Package the CloudFormation template
Expand Down
5 changes: 0 additions & 5 deletions api/requirements.txt

This file was deleted.

5 changes: 2 additions & 3 deletions api/src/api.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
from datetime import datetime, timedelta, timezone
from decimal import Decimal
from json import JSONEncoder

from flask import Flask, abort, jsonify
from flask.json import JSONEncoder
from flask_api.status import HTTP_404_NOT_FOUND
from flask_cors import CORS
from serverless_wsgi import handle_request

Expand Down Expand Up @@ -35,7 +34,7 @@ def get_event_by_id(event_id):
try:
event = database.get_event(event_id)
except ValueError:
abort(HTTP_404_NOT_FOUND)
abort(404)
event['products'] = database.get_products_for_event(event_id, status_code='SUCCEEDED')
return jsonify(event)

Expand Down
32 changes: 30 additions & 2 deletions cloudformation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,39 @@ Parameters:

Resources:
LogBucket:
Type: AWS::S3::Bucket
Type: "AWS::S3::Bucket"
Properties:
AccessControl: LogDeliveryWrite
PublicAccessBlockConfiguration:
BlockPublicAcls: True
IgnorePublicAcls: True
BlockPublicPolicy: True
RestrictPublicBuckets: True
BucketEncryption:
ServerSideEncryptionConfiguration:
- ServerSideEncryptionByDefault:
SSEAlgorithm: AES256
BucketKeyEnabled: true
OwnershipControls:
Rules:
- ObjectOwnership: BucketOwnerEnforced

LogBucketPolicy:
Type: "AWS::S3::BucketPolicy"
Properties:
Bucket: !Ref LogBucket
PolicyDocument:
Version: 2012-10-17
Statement:
- Action: "s3:PutObject"
Effect: Allow
Principal:
Service: logging.s3.amazonaws.com
Resource: !Sub "${LogBucket.Arn}/*"
Condition:
ArnLike:
"aws:SourceArn": !GetAtt ProductBucket.Arn
StringEquals:
"aws:SourceAccount": !Sub "${AWS::AccountId}"

ProductBucket:
Type: AWS::S3::Bucket
Expand Down Expand Up @@ -55,6 +80,9 @@ Resources:
- HEAD
AllowedOrigins:
- "*.asf.alaska.edu"
OwnershipControls:
Rules:
- ObjectOwnership: BucketOwnerEnforced

BucketPolicy:
Type: AWS::S3::BucketPolicy
Expand Down
2 changes: 1 addition & 1 deletion database/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
license='BSD',
include_package_data=True,

python_requires='~=3.8',
python_requires='~=3.12',

packages=find_packages(),
)
2 changes: 1 addition & 1 deletion find_new/cloudformation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Resources:
Handler: find_new.lambda_handler
MemorySize: 128
Role: !GetAtt Role.Arn
Runtime: python3.8
Runtime: python3.12
Timeout: 900

EventInvokeConfig:
Expand Down
5 changes: 0 additions & 5 deletions find_new/requirements.txt

This file was deleted.

2 changes: 1 addition & 1 deletion harvest_products/cloudformation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Resources:
Handler: harvest_products.lambda_handler
MemorySize: 2048
Role: !GetAtt Role.Arn
Runtime: python3.8
Runtime: python3.12
Timeout: 900

EventInvokeConfig:
Expand Down
3 changes: 0 additions & 3 deletions harvest_products/requirements.txt

This file was deleted.

Loading