Skip to content
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

feat(glue): Job construct #12506

Merged
merged 67 commits into from
Sep 8, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
c158a05
feat(aws-glue): add Job construct (#12443)
humanzz Jan 10, 2021
9ea48b6
support job's event rules and rule-based metrics
humanzz Jan 14, 2021
638129c
add metric helper method
humanzz Jan 14, 2021
b99dbce
add JobSpecialArgumentNames for glue special parameters
humanzz Jan 15, 2021
06b4d55
rebase to use Connection and SecurityConfiguration
humanzz Feb 17, 2021
6bcdad8
address some comments
humanzz Jul 27, 2021
e0eb941
Merge branch 'master' into glue-job
humanzz Jul 27, 2021
b2d866f
improve docs
humanzz Jul 27, 2021
29ff157
rename JobCommandName constants and JobCommand methods
humanzz Jul 28, 2021
c615c8e
Merge branch 'master' into glue-job
humanzz Jul 29, 2021
c31d7e4
drop unnecessry toString() methods
humanzz Jul 30, 2021
f05afa7
indicate PythonVersion.TWO is the default for JobCommand
humanzz Jul 30, 2021
5a46dc5
make metricRule and buildJobArn protected
humanzz Jul 30, 2021
f59d688
address more comments
humanzz Jul 30, 2021
fba208d
drop jobRunId from metric()'s arguments
humanzz Aug 2, 2021
6032807
change how event.Rules caching is done
humanzz Aug 2, 2021
8b74200
Merge branch 'master' into glue-job
humanzz Aug 2, 2021
98c19df
drop JobSpecialArgumentNames
humanzz Aug 2, 2021
933ebcd
introduce JobExecutable and refactor accordingly
humanzz Aug 11, 2021
6b3d31e
refactor JobExecutable and add more tests
humanzz Aug 12, 2021
2f02798
add enableProfilingMetrics to JobProps
humanzz Aug 12, 2021
52ae192
Merge branch 'master' into glue-job
humanzz Aug 12, 2021
fe08089
add @aws-cdk/assert-internal to package.json after merge
humanzz Aug 12, 2021
55b5ee4
add sparkUI optional prop to JobProps
humanzz Aug 12, 2021
3235ae7
add continuousLogging optional prop to JobProps
humanzz Aug 13, 2021
ee74a8a
Merge branch 'master' into glue-job
humanzz Aug 13, 2021
1367813
Merge branch 'master' into glue-job
humanzz Aug 20, 2021
c3c9e80
Merge branch 'master' into glue-job
humanzz Aug 24, 2021
0ff9d01
add GlueVersion.V3_0
humanzz Aug 24, 2021
cd27ef7
Merge branch 'master' into glue-job
humanzz Aug 24, 2021
4353f22
Merge branch 'master' into glue-job
humanzz Aug 30, 2021
fb7e376
address smaller comments
humanzz Aug 30, 2021
818be70
Merge branch 'master' into glue-job
humanzz Aug 30, 2021
7072a6f
address metric comments
humanzz Aug 31, 2021
e860f4d
take 1 at glue.Code (not fulyl tested)
humanzz Aug 31, 2021
1068229
test glue.Code
humanzz Aug 31, 2021
bf896fa
Merge branch 'master' into glue-job
humanzz Aug 31, 2021
9f5f85a
address some comments
humanzz Aug 31, 2021
0f587c9
fix build issues from previous round of comments
humanzz Aug 31, 2021
87dee59
address comments
humanzz Aug 31, 2021
0ded0f2
refactor JobExecutableProps
humanzz Aug 31, 2021
82c1d98
drop @aws-cdk/aws-s3-assets from devDependencies
humanzz Aug 31, 2021
c81e736
restore docs about individual files support
humanzz Aug 31, 2021
8ce0fe8
apply suggestions from comments
humanzz Sep 1, 2021
2ed79e1
add optional role to JobAttributes
humanzz Sep 1, 2021
1eb9c20
drop @aws-cdk/assert-internal in favour of @aws-cdk/assertions
humanzz Sep 1, 2021
16e3265
Merge branch 'master' into glue-job
humanzz Sep 1, 2021
7df0c1f
update README
humanzz Sep 1, 2021
8884ad7
increase test coverage to 100% for the new files
humanzz Sep 1, 2021
13b03e8
increase test coverage to 100%
humanzz Sep 1, 2021
2b5f47e
Merge branch 'master' into glue-job
humanzz Sep 1, 2021
bc82d60
tweak tests
humanzz Sep 3, 2021
550b919
Merge branch 'master' into glue-job
humanzz Sep 3, 2021
70b3e24
tweak tests #2
humanzz Sep 3, 2021
a500cf2
Merge branch 'master' into glue-job
humanzz Sep 3, 2021
32ba2ae
remove role from IJob
BenChaimberg Sep 8, 2021
babd3ec
address some comments
humanzz Sep 8, 2021
7379066
Merge branch 'master' into glue-job
humanzz Sep 8, 2021
b62a868
simplify job.test.ts
humanzz Sep 8, 2021
80c3f15
simplify testing success/failure/timeout rules and metrics
humanzz Sep 8, 2021
094929c
better handling for extraPythonFiles with non-Python jobs
humanzz Sep 8, 2021
f01c0be
update integ.job.ts
humanzz Sep 8, 2021
cd2d2ee
fix issues identified trying to run jobs from integ tests
humanzz Sep 8, 2021
ea32eab
update integ test verification documentation
humanzz Sep 8, 2021
98cc575
update Code.bind signature and PythonShell supported glue versions
humanzz Sep 8, 2021
0328615
narrow the permissions granted by S3Code
humanzz Sep 8, 2021
6bb18eb
Merge branch 'master' into glue-job
humanzz Sep 8, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
264 changes: 129 additions & 135 deletions packages/@aws-cdk/aws-glue/test/integ.job.expected.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Resources": {
"MinimalGlueEtlJobServiceRole60989380": {
"EtlJobServiceRole837F781B": {
"Type": "AWS::IAM::Role",
"Properties": {
"AssumeRolePolicyDocument": {
Expand Down Expand Up @@ -31,99 +31,65 @@
]
}
},
"MinimalGlueEtlJobF8C90254": {
"Type": "AWS::Glue::Job",
"EtlJobServiceRoleDefaultPolicy8BFE343B": {
"Type": "AWS::IAM::Policy",
"Properties": {
"Command": {
"Name": "glueetl",
"PythonVersion": "3",
"ScriptLocation": {
"Fn::Join": [
"",
[
"s3://",
{
"Ref": "AssetParameters894df8f835015940e27548bfbf722885cb247378af70effdc8ecbe342419fc6bS3Bucket252142A8"
},
"/",
"PolicyDocument": {
"Statement": [
{
"Action": [
"s3:GetObject*",
"s3:GetBucket*",
"s3:List*",
"s3:DeleteObject*",
"s3:PutObject",
"s3:Abort*"
],
"Effect": "Allow",
"Resource": [
{
"Fn::Select": [
0,
{
"Fn::Split": [
"||",
{
"Ref": "AssetParameters894df8f835015940e27548bfbf722885cb247378af70effdc8ecbe342419fc6bS3VersionKey7D45B377"
}
]
}
"Fn::GetAtt": [
"EtlJobSparkUIBucketBF23744B",
"Arn"
]
},
{
"Fn::Select": [
1,
{
"Fn::Split": [
"||",
{
"Ref": "AssetParameters894df8f835015940e27548bfbf722885cb247378af70effdc8ecbe342419fc6bS3VersionKey7D45B377"
}
]
}
"Fn::Join": [
"",
[
{
"Fn::GetAtt": [
"EtlJobSparkUIBucketBF23744B",
"Arn"
]
},
"/*"
]
]
}
]
]
}
},
"Role": {
"Fn::GetAtt": [
"MinimalGlueEtlJobServiceRole60989380",
"Arn"
]
},
"DefaultArguments": {
"--job-language": "python"
},
"GlueVersion": "2.0"
}
},
"MinimalGlueStreamingJobServiceRole77973DB5": {
"Type": "AWS::IAM::Role",
"Properties": {
"AssumeRolePolicyDocument": {
"Statement": [
{
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": "glue.amazonaws.com"
}
}
],
"Version": "2012-10-17"
},
"ManagedPolicyArns": [
"PolicyName": "EtlJobServiceRoleDefaultPolicy8BFE343B",
"Roles": [
{
"Fn::Join": [
"",
[
"arn:",
{
"Ref": "AWS::Partition"
},
":iam::aws:policy/service-role/AWSGlueServiceRole"
]
]
"Ref": "EtlJobServiceRole837F781B"
}
]
}
},
"MinimalGlueStreamingJobC58FD856": {
"EtlJobSparkUIBucketBF23744B": {
"Type": "AWS::S3::Bucket",
"UpdateReplacePolicy": "Retain",
"DeletionPolicy": "Retain"
},
"EtlJob7FC88E45": {
"Type": "AWS::Glue::Job",
"Properties": {
"Command": {
"Name": "gluestreaming",
"Name": "glueetl",
"PythonVersion": "3",
"ScriptLocation": {
"Fn::Join": [
Expand Down Expand Up @@ -166,17 +132,85 @@
},
"Role": {
"Fn::GetAtt": [
"MinimalGlueStreamingJobServiceRole77973DB5",
"EtlJobServiceRole837F781B",
"Arn"
]
},
"DefaultArguments": {
"--job-language": "python"
"--job-language": "python",
"--enable-continuous-cloudwatch-log": "true",
"--enable-continuous-log-filter": "true",
"--continuous-log-logStreamPrefix": "EtlJob",
"--enable-spark-ui": "true",
"--spark-event-logs-path": {
"Fn::Join": [
"",
[
"s3://",
{
"Ref": "EtlJobSparkUIBucketBF23744B"
}
]
]
},
"arg1": "value1",
"arg2": "value2"
},
"ExecutionProperty": {
"MaxConcurrentRuns": 2
},
"GlueVersion": "2.0",
"MaxRetries": 2,
"Name": "EtlJob",
"NotificationProperty": {
"NotifyDelayAfter": 1
},
"NumberOfWorkers": 10,
"Tags": {
"key": "value"
},
"GlueVersion": "2.0"
"Timeout": 5,
"WorkerType": "G.2X"
}
},
"MinimalPythonShellJobServiceRole4944649D": {
"EtlJobSuccessMetricRuleA72A3EF6": {
"Type": "AWS::Events::Rule",
"Properties": {
"Description": {
"Fn::Join": [
"",
[
"Rule triggered when Glue job ",
{
"Ref": "EtlJob7FC88E45"
},
" is in SUCCEEDED state"
]
]
},
"EventPattern": {
"source": [
"aws.glue"
],
"detail-type": [
"Glue Job State Change",
"Glue Job Run Status"
],
"detail": {
"jobName": [
{
"Ref": "EtlJob7FC88E45"
}
],
"state": [
"SUCCEEDED"
]
}
},
"State": "ENABLED"
}
},
"StreamingJobServiceRole1B4B8BF9": {
"Type": "AWS::IAM::Role",
"Properties": {
"AssumeRolePolicyDocument": {
Expand Down Expand Up @@ -207,11 +241,11 @@
]
}
},
"MinimalPythonShellJob43B4A269": {
"StreamingJob3783CC17": {
"Type": "AWS::Glue::Job",
"Properties": {
"Command": {
"Name": "pythonshell",
"Name": "gluestreaming",
"PythonVersion": "3",
"ScriptLocation": {
"Fn::Join": [
Expand Down Expand Up @@ -254,17 +288,23 @@
},
"Role": {
"Fn::GetAtt": [
"MinimalPythonShellJobServiceRole4944649D",
"StreamingJobServiceRole1B4B8BF9",
"Arn"
]
},
"DefaultArguments": {
"--job-language": "python"
"--job-language": "python",
"arg1": "value1",
"arg2": "value2"
},
"GlueVersion": "2.0"
"GlueVersion": "2.0",
"Name": "StreamingJob",
"Tags": {
"key": "value"
}
}
},
"JobServiceRole4F432993": {
"ShellJobServiceRoleCF97BC4B": {
"Type": "AWS::IAM::Role",
"Properties": {
"AssumeRolePolicyDocument": {
Expand Down Expand Up @@ -295,11 +335,11 @@
]
}
},
"JobB9D00F9F": {
"ShellJob42E81F95": {
"Type": "AWS::Glue::Job",
"Properties": {
"Command": {
"Name": "glueetl",
"Name": "pythonshell",
"PythonVersion": "3",
"ScriptLocation": {
"Fn::Join": [
Expand Down Expand Up @@ -342,7 +382,7 @@
},
"Role": {
"Fn::GetAtt": [
"JobServiceRole4F432993",
"ShellJobServiceRoleCF97BC4B",
"Arn"
]
},
Expand All @@ -351,57 +391,11 @@
"arg1": "value1",
"arg2": "value2"
},
"ExecutionProperty": {
"MaxConcurrentRuns": 2
},
"GlueVersion": "2.0",
"MaxRetries": 2,
"NotificationProperty": {
"NotifyDelayAfter": 1
},
"NumberOfWorkers": 10,
"Name": "ShellJob",
"Tags": {
"key": "value"
},
"Timeout": 5,
"WorkerType": "G.2X"
}
},
"JobSuccessMetricRule80747C33": {
"Type": "AWS::Events::Rule",
"Properties": {
"Description": {
"Fn::Join": [
"",
[
"Rule triggered when Glue job ",
{
"Ref": "JobB9D00F9F"
},
" is in SUCCEEDED state"
]
]
},
"EventPattern": {
"source": [
"aws.glue"
],
"detail-type": [
"Glue Job State Change",
"Glue Job Run Status"
],
"detail": {
"jobName": [
{
"Ref": "JobB9D00F9F"
}
],
"state": [
"SUCCEEDED"
]
}
},
"State": "ENABLED"
}
}
}
},
Expand Down
Loading