Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
jacksonj04 committed Oct 9, 2023
1 parent c27376b commit 43fba55
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 18 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.9"
python-version: "3.11"
cache: pip
cache-dependency-path: |
requirements/base.txt
Expand All @@ -29,9 +29,9 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@main
- name: Set up Python 3.9
- name: Set up Python 3.11
uses: actions/setup-python@v1
with:
python-version: "3.9"
python-version: "3.11"
- run: pip install -r requirements/local.txt
- run: python -m pytest ds-caselaw-ingester/tests.py
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.11
7 changes: 1 addition & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
build:
@mkdir -p dist
@STATIC_DEPS=true python3 -m pip install -t package -r requirements/base.txt
@rm dist/lambda.zip & 2>&1
@cd package && zip -r ../dist/lambda.zip * && cd ..
@zip -g dist/lambda.zip ds-caselaw-ingester/lambda_function.py
@echo 'Built dist/lambda.zip'
samlocal build --use-container -m requirements/base.txt

ifeq (setup,$(firstword $(MAKECMDGOALS)))
# use the rest as arguments for "setup"
Expand Down
4 changes: 1 addition & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
version: "3.8"

services:
localstack:
image: localstack/localstack
image: localstack/localstack:2.3.2
network_mode: bridge
environment:
SERVICES: lambda,sns,s3,sqs,iam
Expand Down
4 changes: 2 additions & 2 deletions scripts/setup-localstack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ awslocal lambda create-function \
--function-name te-lambda \
--zip-file fileb://dist/lambda.zip \
--handler ds-caselaw-ingester/lambda_function.handler \
--runtime python3.9 \
--runtime python3.11 \
--environment "Variables={MARKLOGIC_HOST=$MARKLOGIC_HOST,MARKLOGIC_USER=$MARKLOGIC_USER,MARKLOGIC_PASSWORD=$MARKLOGIC_PASSWORD,AWS_BUCKET_NAME=$AWS_BUCKET_NAME,AWS_SECRET_KEY=$AWS_SECRET_KEY,AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID,AWS_ENDPOINT_URL=$AWS_ENDPOINT_URL,SQS_QUEUE_URL=$SQS_QUEUE_URL,ROLLBAR_TOKEN=$ROLLBAR_TOKEN,ROLLBAR_ENV=$ROLLBAR_ENV,NOTIFY_API_KEY=$NOTIFY_API_KEY,NOTIFY_EDITORIAL_ADDRESS=$NOTIFY_EDITORIAL_ADDRESS,NOTIFY_NEW_JUDGMENT_TEMPLATE_ID=$NOTIFY_NEW_JUDGMENT_TEMPLATE_ID,EDITORIAL_UI_BASE_URL=$EDITORIAL_UI_BASE_URL,PUBLIC_ASSET_BUCKET=$PUBLIC_ASSET_BUCKET}" \
--role arn:aws:iam::000000000000:role/lambda-role \

Expand All @@ -19,7 +19,7 @@ awslocal sns create-topic \
awslocal sns subscribe \
--topic-arn arn:aws:sns:us-east-1:000000000000:judgments \
--protocol lambda \
--notification-endpoint arn:aws:lambda:us-east-1:000000000000:function:te-lambda
--notification-endpoint arn:aws:lambda:eu-west-2:000000000000:function:ds-caselaw-ingester-TNACaselawIngesterFuncti-b824e251

awslocal s3api create-bucket \
--bucket te-editorial-out-int
Expand Down
4 changes: 2 additions & 2 deletions scripts/update-lambda.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source .env

awslocal lambda update-function-code --function-name te-lambda --zip-file fileb://dist/lambda.zip
samlocal deploy --no-confirm-changeset --no-fail-on-empty-changeset --stack-name ds-caselaw-ingester --resolve-s3 --capabilities CAPABILITY_IAM --region us-east-1

awslocal lambda update-function-configuration --function-name te-lambda \
awslocal lambda update-function-configuration --function-name te-lambda --region=us-east-1 \
--environment "Variables={MARKLOGIC_HOST=$MARKLOGIC_HOST,MARKLOGIC_USER=$MARKLOGIC_USER,MARKLOGIC_PASSWORD=$MARKLOGIC_PASSWORD,AWS_BUCKET_NAME=$AWS_BUCKET_NAME,AWS_SECRET_KEY=$AWS_SECRET_KEY,AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID,AWS_ENDPOINT_URL=$AWS_ENDPOINT_URL,SQS_QUEUE_URL=$SQS_QUEUE_URL,ROLLBAR_TOKEN=$ROLLBAR_TOKEN,ROLLBAR_ENV=$ROLLBAR_ENV,NOTIFY_API_KEY=$NOTIFY_API_KEY,NOTIFY_EDITORIAL_ADDRESS=$NOTIFY_EDITORIAL_ADDRESS,NOTIFY_NEW_JUDGMENT_TEMPLATE_ID=$NOTIFY_NEW_JUDGMENT_TEMPLATE_ID,EDITORIAL_UI_BASE_URL=$EDITORIAL_UI_BASE_URL,PUBLIC_ASSET_BUCKET=$PUBLIC_ASSET_BUCKET}"
4 changes: 2 additions & 2 deletions template.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AWSTemplateFormatVersion: '2010-09-09'
AWSTemplateFormatVersion: "2010-09-09"
Transform: AWS::Serverless-2016-10-31
Description: >
ds-caselaw-ingester
Expand All @@ -16,7 +16,7 @@ Resources:
Properties:
CodeUri: ds-caselaw-ingester/
Handler: lambda_function.handler
Runtime: python3.9
Runtime: python3.11
Architectures:
- x86_64

Expand Down

0 comments on commit 43fba55

Please sign in to comment.