Skip to content

Commit

Permalink
updates 2024-08-16 - Minor refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
CHRISCARLON committed Aug 16, 2024
1 parent 97e9087 commit 4e04e7e
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 12 deletions.
10 changes: 5 additions & 5 deletions analytics_platform_dagster/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from os import getenv
import os
from dagster import Definitions, load_assets_from_modules
from dagster_slack import SlackResource, make_slack_on_run_failure_sensor

Expand Down Expand Up @@ -58,14 +58,14 @@
sensors=[slack_failure_sensor],
resources={
"S3Parquet": S3ParquetManager(
bucket_name=getenv("BRONZE_DATA_BUCKET")
bucket_name=os.getenv("BRONZE_DATA_BUCKET")
),
"S3Json": S3JSONManager(
bucket_name=getenv("BRONZE_DATA_BUCKET")
bucket_name=os.getenv("BRONZE_DATA_BUCKET")
),
"DeltaLake": AwsWranglerDeltaLakeIOManager(
bucket_name=getenv("SILVER_DATA_BUCKET")
bucket_name=os.getenv("SILVER_DATA_BUCKET")
),
"slack": SlackResource(token=getenv("SLACKBOT")),
"slack": SlackResource(token=os.getenv("SLACKBOT")),
},
)
35 changes: 28 additions & 7 deletions makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,38 @@
# Push to main quicker
# Make the deployment of updated docker containers quick and easy in the future.

.PHONY: all add commit push
# Docker and AWS section
.PHONY: docker-login docker-build docker-tag docker-push docker-verify docker-all

docker-all: docker-login docker-build docker-tag docker-push docker-verify

docker-login:
aws ecr get-login-password --region $(REGION) | docker login --username AWS --password-stdin $(ACCOUNT_ID).dkr.ecr.$(REGION).amazonaws.com

docker-build:
docker build -t $(REPO_NAME) .

docker-tag:
docker tag $(REPO_NAME):latest $(ACCOUNT_ID).dkr.ecr.$(REGION).amazonaws.com/$(REPO_NAME):latest

docker-push:
docker push $(ACCOUNT_ID).dkr.ecr.$(REGION).amazonaws.com/$(REPO_NAME):latest

docker-verify:
aws ecr describe-images --repository-name $(REPO_NAME) --region $(REGION)

# Git section
.PHONY: git-all git-add git-commit git-push

DATE := $(shell date +%Y-%m-%d)

all: add commit push
git-all: git-add git-commit git-push

add:
git-add:
git add .

commit:
git-commit:
@read -p "Please enter an additional commit message: " msg; \
git commit -m "Updates $(DATE) - $$msg"
git commit -m "updates $(DATE) - $$msg"

push:
git-push:
git push

0 comments on commit 4e04e7e

Please sign in to comment.