-
Notifications
You must be signed in to change notification settings - Fork 37
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
modernization #8
base: airflow-v2
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -Eeuxo pipefail | ||
|
||
airflow initdb | ||
airflow db init | ||
sleep 5 | ||
|
||
airflow create_user -r Admin -u admin -f FirstName -l LastName -p ${ADMIN_PASS} -e [email protected] | ||
airflow users create -r Admin -u admin -f FirstName -l LastName -p ${ADMIN_PASS} -e [email protected] | ||
sleep 5 | ||
|
||
airflow webserver |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -Eeuxo pipefail | ||
|
||
sleep 30 | ||
airflow worker | ||
airflow celery worker |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
import { Duration, Construct } from "@aws-cdk/core"; | ||
import { Duration} from "aws-cdk-lib/core"; | ||
import { Construct } from 'constructs'; | ||
import { | ||
DatabaseInstance, | ||
DatabaseInstanceEngine, PostgresEngineVersion, | ||
StorageType | ||
} from "@aws-cdk/aws-rds"; | ||
import { ISecret, Secret } from "@aws-cdk/aws-secretsmanager"; | ||
} from "aws-cdk-lib/aws-rds"; | ||
import { ISecret, Secret } from "aws-cdk-lib/aws-secretsmanager"; | ||
import { | ||
InstanceType, | ||
ISecurityGroup, | ||
IVpc, | ||
SubnetType | ||
} from "@aws-cdk/aws-ec2"; | ||
} from "aws-cdk-lib/aws-ec2"; | ||
|
||
import { defaultDBConfig } from "../config"; | ||
|
||
|
@@ -60,13 +61,13 @@ export class RDSConstruct extends Construct { | |
|
||
this.rdsInstance = new DatabaseInstance(this, "RDSInstance", { | ||
engine: DatabaseInstanceEngine.postgres({ | ||
version: PostgresEngineVersion.VER_12_4 | ||
version: PostgresEngineVersion.VER_13_4 | ||
}), | ||
instanceType: defaultDBConfig.instanceType, | ||
instanceIdentifier: defaultDBConfig.dbName, | ||
vpc: props.vpc, | ||
securityGroups: [props.defaultVpcSecurityGroup], | ||
vpcPlacement: { subnetType: SubnetType.PRIVATE }, | ||
vpcSubnets: { subnetType: SubnetType.PRIVATE_WITH_NAT }, | ||
storageEncrypted: true, | ||
multiAz: false, | ||
autoMinorVersionUpgrade: false, | ||
|
@@ -94,6 +95,6 @@ export class RDSConstruct extends Construct { | |
endpoint: string, | ||
password: string | ||
): string { | ||
return `postgresql+pygresql://${dbConfig.masterUsername}:${password}@${endpoint}:${dbConfig.port}/${dbConfig.dbName}`; | ||
return `postgresql+psycopg2://${dbConfig.masterUsername}:${password}@${endpoint}:${dbConfig.port}/${dbConfig.dbName}`; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the motive behind this change? Are there any added benefits, as this is used only for metadata? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. psycopg is much more active open source project than pygresql https://github.com/psycopg https://github.com/PyGreSQL so that is why the change was made |
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
import { Construct } from "@aws-cdk/core"; | ||
//import { Construct } from "aws-cdk-lib/core"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Delete commented code from this file and other files as well |
||
import { Construct } from 'constructs'; | ||
|
||
import ecs = require('aws-cdk-lib/aws-ecs'); | ||
import { DockerImageAsset } from 'aws-cdk-lib/aws-ecr-assets'; | ||
import { FargateTaskDefinition } from 'aws-cdk-lib/aws-ecs'; | ||
import {ManagedPolicy} from "aws-cdk-lib/aws-iam"; | ||
|
||
|
||
import ecs = require('@aws-cdk/aws-ecs'); | ||
import { DockerImageAsset } from '@aws-cdk/aws-ecr-assets'; | ||
import { FargateTaskDefinition } from '@aws-cdk/aws-ecs'; | ||
import {ManagedPolicy} from "@aws-cdk/aws-iam"; | ||
|
||
export interface AirflowDagTaskDefinitionProps { | ||
readonly taskFamilyName: string; | ||
|
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.
Instead of bundling in too many packages, consider moving them to optional
requirements.txt
, which user can fill in.If needed, update ReadMe with details
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.
Isn't requirements.txt a Python thing?
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.
Yes. And all these packages are being installed using pip.
I should have included Line #11. It looks like this..