Skip to content

feat: Add support for Amazon EKS #156

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

Merged
merged 8 commits into from
Sep 2, 2021
Merged

Conversation

ca-nguyen
Copy link
Contributor

@ca-nguyen ca-nguyen commented Aug 17, 2021

Issue #, if available: #106

Description of changes:
Added:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@ca-nguyen ca-nguyen requested review from shivlaks and wong-a August 17, 2021 17:56
Copy link
Contributor

@shivlaks shivlaks left a comment

Choose a reason for hiding this comment

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

thanks for adding these!! looks great for a first cut.
had some minor nits I think we should address. take a look and let me know if you have any questions!

output_path (str, optional): Path applied to the state’s output after the application of `result_path`, producing the effective output which serves as the raw input for the next state. (default: '$')
wait_for_completion (bool, optional): Boolean value set to `True` if the Task state should wait to complete before proceeding to the next step in the workflow. (default: True)
"""
if wait_for_completion:
Copy link
Contributor

Choose a reason for hiding this comment

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

question: with defaults, I know we're being consistent by setting the default to be synchronous, but I wonder if that's the most pragmatic/idiomatic thing.

not asking for changes, just pondering out loud for now

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good question - you're right this was done this way for consistency.

A point to consider: If we were to change the defaults, we would need to notify of the change of behaviour as this might cause breaking change for our customers. Not sure if this is worth bumping the version

Copy link
Contributor

Choose a reason for hiding this comment

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

we haven't set defaults for these steps yet as they're unreleased, so now is the time to make that decision. depending on API/service, I think it'd be sensible to consider alternatives...

somewhat related: I'm quickly writing up the StepFunctions startExecution integration step... and that supports all 3 (wait for completion, wait for task token, request/response)... what would be a sensible default there? all the other service integrations only offer 2 options.

I think this is fine to leave it as is for now for Eks - if we were to change defaults, it would need to go with the next major version bump.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My last comment, might not have been clear, but we are on the same page! :)
Let's keep the defaults as is to be consistent with the other released steps for now

Copy link
Contributor

Choose a reason for hiding this comment

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

I expect wait_for_completion=True is what most customers usually want. Since all other steps supporting .sync use it by default, we should probably be consistent so there are less surprises.

@ca-nguyen ca-nguyen requested a review from shivlaks August 17, 2021 23:01
shivlaks
shivlaks previously approved these changes Aug 18, 2021
Copy link
Contributor

@shivlaks shivlaks left a comment

Choose a reason for hiding this comment

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

go for it - please be sure to update the PR description to include runJob and call APIs that were added in the most recent commit.

@ca-nguyen
Copy link
Contributor Author

go for it - please be sure to update the PR description to include runJob and call APIs that were added in the most recent commit.

Done! Thank you!

Copy link
Contributor

@wong-a wong-a left a comment

Choose a reason for hiding this comment

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

LGTM besides some minor updates to the docs.

I see there are unit tests, but did you do any manual testing to ensure each step can be created with Step Functions through the SDK?

output_path (str, optional): Path applied to the state’s output after the application of `result_path`, producing the effective output which serves as the raw input for the next state. (default: '$')
wait_for_completion (bool, optional): Boolean value set to `True` if the Task state should wait to complete before proceeding to the next step in the workflow. (default: True)
"""
if wait_for_completion:
Copy link
Contributor

Choose a reason for hiding this comment

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

I expect wait_for_completion=True is what most customers usually want. Since all other steps supporting .sync use it by default, we should probably be consistent so there are less surprises.

Update documentation

Co-authored-by: Adam Wong <[email protected]>
wong-a
wong-a previously approved these changes Aug 25, 2021
Copy link
Contributor

@wong-a wong-a left a comment

Choose a reason for hiding this comment

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

☸️

@ca-nguyen
Copy link
Contributor Author

LGTM besides some minor updates to the docs.

Thanks for reviewing! I applied your suggested changes

I see there are unit tests, but did you do any manual testing to ensure each step can be created with Step Functions through the SDK?

I did not do any testing outside of unit tests. I'll make sure to manual test before merging

shivlaks
shivlaks previously approved these changes Aug 25, 2021
@ca-nguyen ca-nguyen dismissed stale reviews from shivlaks and wong-a via 9a670ef September 1, 2021 07:54
@StepFunctions-Bot
Copy link
Contributor

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-sEHrOdk7acJc
  • Commit ID: 1cef855
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@ca-nguyen ca-nguyen requested review from shivlaks and wong-a September 1, 2021 22:44
@ca-nguyen
Copy link
Contributor Author

I see there are unit tests, but did you do any manual testing to ensure each step can be created with Step Functions through the SDK?

Tested manually and uncovered a few bugs:

  • eks::call does not have option to run a job (.sync)
  • removed LogOptions param from eks::runJob example as it does not allow to retrieve of logs (only possible with eks::runJob.sync)
    Made the changes in the last commits

@shivlaks
Copy link
Contributor

shivlaks commented Sep 1, 2021

I see there are unit tests, but did you do any manual testing to ensure each step can be created with Step Functions through the SDK?

Tested manually and uncovered a few bugs:

  • eks::call does not have option to run a job (.sync)
  • removed LogOptions param from eks::runJob example as it does not allow to retrieve of logs (only possible with eks::runJob.sync)
    Made the changes in the last commits

glad we caught those. be sure to expand on testing methodology and the steps we followed.

not for this PR:

thought: how can we automate that testing (via unit/simple integ tests). It will be helpful to establish so that we responsibly introduce service integrations. More importantly, regressions are easy to introduce if we don't have automated tests in place.

"""
if wait_for_completion:
Copy link
Contributor

Choose a reason for hiding this comment

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

Glad we caught this. The public documentation isn't really clear about which service integrations support .sync.

https://docs.aws.amazon.com/step-functions/latest/dg/connect-supported-services.html
https://docs.aws.amazon.com/step-functions/latest/dg/connect-eks.html

@ca-nguyen ca-nguyen merged commit f8bbfaf into aws:main Sep 2, 2021
@ca-nguyen ca-nguyen deleted the add-support-for-eks branch October 27, 2021 01:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants