-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[dagster-airlift] mwaa example #23574
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
270a9b8
to
2bf3cd2
Compare
2b89a72
to
c68134c
Compare
2bf3cd2
to
5d41734
Compare
c68134c
to
78b6db8
Compare
5d41734
to
4beb211
Compare
78b6db8
to
2d3bba1
Compare
4beb211
to
34a1db3
Compare
2d3bba1
to
c0b0d6b
Compare
34a1db3
to
32dc1ca
Compare
@@ -31,16 +32,17 @@ def get_session_info(region: str, env_name: str) -> Tuple[str, str]: | |||
|
|||
|
|||
class MwaaSessionAuthBackend(AirflowAuthBackend): | |||
def __init__(self, region: str, env_name: str): | |||
def __init__(self, region: str, env_name: str, profile_name: Optional[str] = None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm maybe we should just take in the boto.Session
object directly as we might just replicate the entire interface here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should just revisit the interface in general. I think we should be aiming to only auth the mwaa session once in general, not just retrieving the client I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I bias towards getting this in so you guys can build on top of mwaa if needed, and then iterating on the API once it's under test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kk
"""This script uploads DAG files and requirements.txt to an S3 bucket in a directory | ||
matching the name of the specified MWAA environment. It then attempts to update | ||
the MWAA environment with the new S3 location. If the environment doesn't exist, | ||
it provides instructions for creating one. | ||
|
||
The script prompts for user confirmation before deleting any existing contents | ||
in the target S3 directory, then uploads the new files, ensuring a clean deployment. | ||
""" | ||
|
||
import os | ||
from typing import List | ||
|
||
import boto3 | ||
import click | ||
from botocore.exceptions import ClientError | ||
|
||
|
||
def get_s3_objects(s3_client: boto3.client, bucket: str, prefix: str) -> List[dict]: | ||
"""Get list of objects in the S3 bucket with the given prefix.""" | ||
try: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a lot of code. Does MWAA not provide some of this stuff as utilities? This looks like we are reimplementing AWS tooling with ChatGPT or something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MWAA has pretty bad tooling for this stuff unfortunately. I pulled a lot of this from examples colton has shown me of previous mwaa deploy scripts (+ chat GPT to throw it in python land). The utilities here really are this bad unfortunately though; if you look at the AWS documentation it's exactly the steps we take here more or less: https://docs.aws.amazon.com/mwaa/latest/userguide/configuring-dag-folder.html#configuring-dag-folder-uploading
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inline comments
c0b0d6b
to
8ceea9f
Compare
32dc1ca
to
08cfa7f
Compare
8ceea9f
to
82c5dd1
Compare
08cfa7f
to
3044ea5
Compare
82c5dd1
to
11ecaf3
Compare
3044ea5
to
f7ad1a4
Compare
11ecaf3
to
ebd571c
Compare
f7ad1a4
to
96183a0
Compare
ebd571c
to
ca408aa
Compare
96183a0
to
c6858a9
Compare
ca408aa
to
28f23c8
Compare
c6858a9
to
551bdb1
Compare
Adds example code for having dags running in mwaa and observing them running locally in dagster. The goal here is twofold: - Provide sample code for using the mwaa utility functions we build - Provide an easily stood up and reproducible test bed for deploying code to mwaa and testing underlying dagster functionality.
Adds example code for having dags running in mwaa and observing them running locally in dagster.
The goal here is twofold: