Skip to content

Commit

Permalink
Remove unmasked variables, and outputs (#2)
Browse files Browse the repository at this point in the history
* Remove unmasked variables in pipeline

* Added extra commands and removed test pulumi stack
  • Loading branch information
rsergiuistoc authored Mar 22, 2024
1 parent aa773f6 commit 4c2df6d
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 3,149 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/crawler.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Crawlers

on: [pull_request]
on:
push:
branches:
- main

jobs:
build:
Expand All @@ -15,12 +18,9 @@ jobs:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
mask-aws-account-id: 'false'
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
with:
mask-password: 'false'
- name: Build images & push to ECR
id: build-image
uses: docker/build-push-action@v4
Expand All @@ -31,8 +31,6 @@ jobs:
${{ steps.login-ecr.outputs.registry }}/crawler:${{ github.sha }}
${{ steps.login-ecr.outputs.registry }}/crawler:latest
push: true
outputs:
registry: ${{ steps.login-ecr.outputs.registry }}

deploy:
name: Deploy Crawler
Expand All @@ -55,6 +53,6 @@ jobs:
echo "Successfully updated lambda"
env:
AWS_REGION: ${{ secrets.AWS_REGION }}
ECR_REPOSITORY: ${{ needs.build.outputs.registry }}
ECR_REPOSITORY: ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com
PROJECT_VERSION: ${{ github.sha }}
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
12 changes: 11 additions & 1 deletion course/module1/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
AWS_CURRENT_REGION_ID := $(shell aws configure get region)
AWS_CURRENT_ACCOUNT_ID := $(shell aws sts get-caller-identity --query "Account" --output text)

help:
@grep -E '^[a-zA-Z0-9 -]+:.*#' Makefile | sort | while read -r l; do printf "\033[1;32m$$(echo $$l | cut -f 1 -d':')\033[00m:$$(echo $$l | cut -f 2- -d'#')\n"; done

Expand All @@ -14,13 +17,20 @@ local-test: # Send test command on local to test the lambda
curl -X POST "http://localhost:9000/2015-03-31/functions/function/invocations" \
-d '{"user": "Paul Iuztin", "link": "https://medium.com/@pauliusztin/the-llms-kit-build-a-production-ready-real-time-financial-advisor-system-using-streaming-ffdcb2b50714"}'

invoke:
invoke: # Invoke remote lambda from local
aws lambda invoke \
--function-name crawler \
--cli-binary-format raw-in-base64-out \
--payload '{"user": "Paul Iuztin", "link": "https://github.com/iusztinpaul/hands-on-llms"}' \
response.json

push: # Build & push image to docker ECR (e.g make push IMAGE_TAG=latest)
echo "Logging into AWS ECR..."
aws ecr get-login-password --region $(AWS_CURRENT_REGION_ID) | docker login --username AWS --password-stdin $(AWS_CURRENT_ACCOUNT_ID).dkr.ecr.$(AWS_CURRENT_REGION_ID).amazonaws.com
echo "Build & Push Docker image..."
docker buildx build --platform linux/amd64 -t $(AWS_CURRENT_ACCOUNT_ID).dkr.ecr.$(AWS_CURRENT_REGION_ID).amazonaws.com/crawler:$(IMAGE_TAG) .
echo "Push completed successfully."

clean: # Cleanup files generated during sam building.
@echo "Cleaning old files..."
rm -rf /.pytest_cache
Expand Down
37 changes: 0 additions & 37 deletions course/module1/scripts/deploy_github_lambda.sh

This file was deleted.

37 changes: 0 additions & 37 deletions course/module1/scripts/deploy_linkedin_lambda.sh

This file was deleted.

37 changes: 0 additions & 37 deletions course/module1/scripts/deploy_medium_lambda.sh

This file was deleted.

Loading

0 comments on commit 4c2df6d

Please sign in to comment.