Skip to content

Commit

Permalink
Merge pull request #16 from anyangml/fix/denpendency-install-cicd
Browse files Browse the repository at this point in the history
Chore(aws): rename folder
  • Loading branch information
anyangml authored Oct 13, 2023
2 parents b487d50 + 781c372 commit cf5b5b1
Show file tree
Hide file tree
Showing 14 changed files with 27 additions and 847 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
845 changes: 1 addition & 844 deletions aws-terraform/poetry.lock → aws_terraform/poetry.lock

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tool.poetry]
name = "aws-terraform"
name = "aws_terraform"
version = "0.1.0"
description = ""
authors = ["anyangml"]
Expand All @@ -12,7 +12,6 @@ pydantic = "1.10.0"
scikit-learn = "^1.3.1"
pytest = "^7.4.2"
prefect = "^2.13.5"
mlflow = "^2.7.1"
boto3 = "^1.28.62"
black = "^23.9.1"

Expand Down
24 changes: 24 additions & 0 deletions aws_terraform/terraform/lambda_trigger.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"""
This is a sample Lambda function that is triggered by a GitHub webhook.
The code is not runnable as is, credentails need to be filled in.
A better approach would be using AWS Secrets Manager, but it's not free.
For the purpose of this example, the credentials are hardcoded in the code.
"""
import requests


def lambda_handler(event, context):
url = "https://api.github.com/repos/anyangml/mlops_projects/actions/workflows/72577098/dispatches"
#
headers = {
"Authorization": "Bearer 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",
"Accept": "application/vnd.github+json",
"X-GitHub-Api-Version": "2022-11-28",
}
payload = '{"ref": "main","inputs": {}}'
response = requests.post(url, headers=headers, data=payload)

if response.status_code == 204:
return {"statusCode": 200, "body": "Workflow triggered successfully!"}
else:
return {"statusCode": response.status_code, "body": "Failed to trigger workflow!"}
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import pytest
from src.datagen import Data, DataGenerator
from aws_terraform.datagen import Data, DataGenerator
import numpy as np


Expand Down
File renamed without changes.

0 comments on commit cf5b5b1

Please sign in to comment.