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): add Job L2 construct #11128

Closed
wants to merge 1 commit into from
Closed

feat(glue): add Job L2 construct #11128

wants to merge 1 commit into from

Conversation

adamdottv
Copy link
Contributor

@iliapolo looking to start a conversation here around a Job L2 construct in aws-glue. I'm using my own Job, Crawler and Trigger constructs, and I think they could be useful here. Starting with Job, there's the need to push a local script to S3; sort of a lite version of Lambda bundling.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@gitpod-io
Copy link

gitpod-io bot commented Oct 26, 2020

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 33a420b
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

Comment on lines +211 to +220
The only required parameter is `script` which defines the relative path to your Python or Scala file. A `CustomResource` pushes your script to S3 and configures the `Job` with necessary permissions and the final location of the script.

```ts
new glue.Job(stack, 'MyJob', {
script: './lib/scripts/etlJob.py'
});
```

By default, an S3 bucket will be created to store the provided script but you can manually pass the `bucket` and `s3Prefix`:

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like it is more natural to use the s3-assets module here. This would work similar to how Lambda deals with assets.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adamelmore I agree with @tdikland that we should just use the regular asset mechanism.

Regarding the API, I want to provide something similar to what we have in Lambda and CloudWatch Synthetics, which also accept code from the user.

new glue.Job(this, 'Job', {
  code: glue.Code.fromAsset(...) // glue.Code.fromInline(...)
});

Is it even possible to use a directory or does it have to be a single script file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all sounds good to me. And pretty certain only a single script is allowed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case the api shouldn't Code.fromAsset but rather Code.fromScript or Code.fromFile

@adamdottv
Copy link
Contributor Author

@iliapolo have a chance to look at this?

@iliapolo
Copy link
Contributor

@adamelmore sorry its taking a while. I'll try to have a look by EOW. thanks for this!

@iliapolo iliapolo added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Dec 6, 2020
@github-actions
Copy link

github-actions bot commented Dec 7, 2020

This PR has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added the closing-soon This issue will automatically close in 4 days unless further comments are made. label Dec 7, 2020
@iliapolo
Copy link
Contributor

iliapolo commented Dec 7, 2020

Dont close

@github-actions github-actions bot removed closing-soon This issue will automatically close in 4 days unless further comments are made. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. labels Dec 8, 2020
@iliapolo
Copy link
Contributor

@adamelmore What do you think about closing this in favor of #12506 ? Would love your input their as well.

@iliapolo iliapolo added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Jan 15, 2021
@adamdottv
Copy link
Contributor Author

@adamelmore What do you think about closing this in favor of #12506 ? Would love your input their as well.

Absolutely. I never did make time to work on an implementation, here. I do use my own Job construct, and have some opinions around the API, so I'll try to review that PR as I have time!

@iliapolo
Copy link
Contributor

Closing in favor of #12506

@iliapolo iliapolo closed this Jan 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants