Skip to content

Conversation

@marcinczeczko
Copy link
Contributor

@marcinczeczko marcinczeczko commented Oct 29, 2019

I'd like to introduce a broader integration with AWS SDK v2. It consists of:

  • Amazon services extensions root module
  • Introduction of Amazon services common module to easily add support for other AWS clients.
  • Refactored DynamoDB extension to be part of amazon services
  • Added S3 client extension
  • Quickstart guide that shows how to store and retrieve file using S3

More clients (SNS, SQS, etc.) to be added if the concept in this PR will be finalised and merged

@gsmet
Copy link
Member

gsmet commented Oct 29, 2019

I cancelled the build, we are scarce on CI resources right now.

@gsmet
Copy link
Member

gsmet commented Nov 1, 2019

Oh man, this is a large one :). It looks very interesting, I need to take more time to think about it and review it.

@marcinczeczko
Copy link
Contributor Author

Yes I know it's quite large :) No worries, we are not in the rush.

@marcinczeczko
Copy link
Contributor Author

@gsmet - Any thoughts on this PR ?

@gsmet
Copy link
Member

gsmet commented Nov 28, 2019

I reviewed the Flyway PR yesterday, this one is next in line once I'm done with releasing 1.0.1.Final so you should have some feedback soon.

Sorry, the 1.0 work got me very late on reviewing large PRs.

@gsmet
Copy link
Member

gsmet commented Dec 4, 2019

@marcinczeczko sorry about the delay. I'm starting to have a look just now.

Copy link
Member

@gsmet gsmet left a comment

Choose a reason for hiding this comment

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

So, in general, that's a big +1. I really like what you have here. Thanks for your work (and for your patience...).

It needs a rebase and some changes to the extension descriptor. The rest is mostly some small comments.

Also I'm not entirely sure about how your architected the configuration. I think we need to discuss it and it would probably be better to do it live if you can.

<version>${project.version}</version>
</dependency>


Copy link
Member

Choose a reason for hiding this comment

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

Micro comment: I don't think we need these artificial new lines.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

- amazon-lambda-http
name: amazon
dynamodb: true
amazonStack: true
Copy link
Member

Choose a reason for hiding this comment

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

Maybe let's call it amazonServices (or even better amazon-services but I'm not sure dashes are allowed).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only underscores are supported but doesn't looks good, so I kept camelCase with amazonServices as value

* Blocking access using URL Connection HTTP client (by default) or the Apache HTTP Client
* https://docs.aws.amazon.com/sdk-for-java/v2/developer-guide/basics-async.html[Asynchronous programming] based on JDK's `CompletableFuture` objects and the Netty HTTP client.

In this guide, we see how you can get your REST services to use the DynamoDB locally and on AWS.
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this whole introduction be about S3? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I forgot to mention, that S3 guide I'm about to work on later :) it's just a stub atm. Will polish it later this week.

</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-amazon-common</artifactId>
Copy link
Member

Choose a reason for hiding this comment

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

This should come with the above, no?

quarkus.amazon.aws.dynamodb.region=us-east-1
quarkus.amazon.aws.dynamodb.credentials.type=static
quarkus.amazon.aws.dynamodb.credentials.static-provider.access-key-id=test-key
quarkus.amazon.aws.dynamodb.credentials.static-provider.secret-access-key=test-secret
Copy link
Member

Choose a reason for hiding this comment

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

I think we need to have a discussion about this config stuff. Would you have a moment for a call so that we can discuss it live?

"dynamo",
"aws",
"amazon"
]
Copy link
Member

Choose a reason for hiding this comment

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

Same here about the format being YAML 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.

fixed

"s3",
"aws",
"amazon"
]
Copy link
Member

Choose a reason for hiding this comment

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

Same here about the format.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@gsmet
Copy link
Member

gsmet commented Jan 6, 2020

@marcinczeczko happy new year! Any chance we could restart the progress on this? It looked very promising!

@marcinczeczko
Copy link
Contributor Author

@gsmet Happy new year too !! I just came back from long Christmas break :) I'm gonna to restart that work this week. I think we can talk about in live as you suggested - let's catchup on zulip to get up to speed.

@oztimpower
Copy link
Contributor

Any progress on this one?

It's super fiddly and time consuming trying to get basic AWS Java SDK v2 (or v1) integrations working. I have SNS working using the sync client UrlConnectionHttpClient yet couldn't get it working with Apache (SSL issues).

Required reflect-config.json for the UrlConnectionHttpClient:
[
{
"name":"com.sun.xml.internal.stream.XMLInputFactoryImpl",
"methods":[{"name":"","parameterTypes":[] }]
}
]

@marcinczeczko marcinczeczko force-pushed the amazon-services branch 2 times, most recently from 660981f to 6c266a2 Compare February 25, 2020 09:37
@gastaldi gastaldi added the triage/needs-rebase This PR needs to be rebased first because it has merge conflicts label Mar 28, 2020
@sherl0cks
Copy link
Contributor

Is there any plans to move this forward @marcinczeczko ?

@gsmet @oscerd @oztimpower I must admit that I worry about the strategy being employed here, which seems to be taken from the initial dynamodb extension. Specifically, all the work being done to actually initiate clients and proxy the AWS SDK configuration model. It is seems unnecessarily complex and hard to maintain, and perhaps why this PR is stalled after months of works and 120 files edited.

As a user deploy service to production with S3, Dynamo, SNS and SQS with quarkus / graal native / aws lambda, all I want quarkus to do is to handle the ugly internals of the build system (e.g. proxy generation, reflection config, resources config, maven dependency management) such that when I create AWS SDK clients in my CDI configuration (which is easy to do), they just work. On occasion it might be necessary to do bytecode replacement to ensure effective integration with quarkus, as well. I don't need the beans created for me. You can see this alternative model in https://github.com/quarkusio/quarkus/tree/master/extensions/amazon-lambda-xray we worked on with @patriot1burke .

I have the above approach working in the applications I'm deploying now to production, and if there was interest in trying this new strategy, then we can discuss how best to build out these features together (along with a guide). I will probably need support from the maintainers give my existing job responsibilities. That said, if maintainers are set on the existing strategy, then I don't want to waste time implementing an alternative.

@oscerd
Copy link
Contributor

oscerd commented Apr 10, 2020

Is there any plans to move this forward @marcinczeczko ?

@gsmet @oscerd @oztimpower I must admit that I worry about the strategy being employed here, which seems to be taken from the initial dynamodb extension. Specifically, all the work being done to actually initiate clients and proxy the AWS SDK configuration model. It is seems unnecessarily complex and hard to maintain, and perhaps why this PR is stalled after months of works and 120 files edited.

As a user deploy service to production with S3, Dynamo, SNS and SQS with quarkus / graal native / aws lambda, all I want quarkus to do is to handle the ugly internals of the build system (e.g. proxy generation, reflection config, resources config, maven dependency management) such that when I create AWS SDK clients in my CDI configuration (which is easy to do), they just work. On occasion it might be necessary to do bytecode replacement to ensure effective integration with quarkus, as well. I don't need the beans created for me. You can see this alternative model in https://github.com/quarkusio/quarkus/tree/master/extensions/amazon-lambda-xray we worked on with @patriot1burke .

I have the above approach working in the applications I'm deploying now to production, and if there was interest in trying this new strategy, then we can discuss how best to build out these features together (along with a guide). I will probably need support from the maintainers give my existing job responsibilities. That said, if maintainers are set on the existing strategy, then I don't want to waste time implementing an alternative.

Hello, personally I'm working on supporting the AWS SDK v2 in the https://github.com/apache/camel-quarkus and I'm still trying to find a common way between the multiple components. I will post my findings here whenever I have some.

@sherl0cks
Copy link
Contributor

@oscerd Interesting. I have some thoughts on this from my work and also a lot of experience with camel (I use to work with Red Hat consulting). I'll send you an email - perhaps we can discuss this over a video call quickly to coordinate?

@oscerd
Copy link
Contributor

oscerd commented Apr 10, 2020

Sure thing!

@marcinczeczko
Copy link
Contributor Author

Hi @oscard, yes I planned to resume that work. I had to stop for a while because of client work. I think we can discuss it in a wider group.

@sherl0cks
Copy link
Contributor

@marcinczeczko sent email to your gmail to coordinate a discussion. Looking forward to discussing with you soon.

@marcinczeczko
Copy link
Contributor Author

@machi1990 - thanks, checked it and works perfect.

@marcinczeczko
Copy link
Contributor Author

@gsmet - I rebased with master to pick up #8994. So documentation generates correctly now, I think you can proceed with the final review now.

Copy link
Member

@gsmet gsmet left a comment

Choose a reason for hiding this comment

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

@marcinczeczko I added some minor comments that needs fixing, could you take care of them and squash everything into a single commit?

There are a few things we need to discuss as I have a few questions but I suggest that we merge this one first and then we can have further discussions/improvements later on.

<artifactId>quarkus-amazon-dynamodb</artifactId>
<name>Quarkus - Amazon DynamoDB - Runtime</name>
<description>A client for the Amazon DynamoDB datastore</description>
<name>Quarkus - Amazon Services - DynamoDB - Runtime</name>
Copy link
Member

Choose a reason for hiding this comment

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

The description of the runtime modules is used by code.quarkus.io so we need one.

Better if it starts with a verb e.g. something like "Connect to...". Same for all the user facing extensions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@gsmet
Copy link
Member

gsmet commented May 6, 2020

Also, I saw we break the existing configuration properties. I suppose you find it better this way?

We can do that but we need to document it properly in the migration guide. We can do that later but prior to the release!

@gsmet gsmet added release/breaking-change and removed triage/needs-rebase This PR needs to be rebased first because it has merge conflicts labels May 6, 2020
@marcinczeczko
Copy link
Contributor Author

Also, I saw we break the existing configuration properties. I suppose you find it better this way?

We can do that but we need to document it properly in the migration guide. We can do that later but prior to the release!

Do you mean configurations that had .aws.. If yes, I think there were no a strong reason. Since the sdk config properties are not prefixed I simply decided to do so for aws onces. If you think it's better to keep as it was before I can easily change it.

@gsmet
Copy link
Member

gsmet commented May 6, 2020

I dunno. The SDK ones were purely technical. The AWS ones were more like "let's configure the AWS part" so it kinda makes sense to me.

If there's no good reason, I would say we could keep them as is and avoid breaking user configuration?

- Refactored DynamoDB extension
- Added S3 client extension
- Bump up AWSSDK
@marcinczeczko
Copy link
Contributor Author

I dunno. The SDK ones were purely technical. The AWS ones were more like "let's configure the AWS part" so it kinda makes sense to me.

If there's no good reason, I would say we could keep them as is and avoid breaking user configuration?

Agree & done

@gsmet
Copy link
Member

gsmet commented May 6, 2020

OK, let's wait for CI and merge :).

Thanks @marcinczeczko for this great work and your patience and tenacity!

@marcinczeczko
Copy link
Contributor Author

marcinczeczko commented May 6, 2020 via email

@machi1990 machi1990 merged commit 9a09b2f into quarkusio:master May 6, 2020
@sherl0cks
Copy link
Contributor

@marcinczeczko Thanks for making this happen!

@oscerd
Copy link
Contributor

oscerd commented May 6, 2020

Thanks @marcinczeczko

@gsmet
Copy link
Member

gsmet commented May 7, 2020

Cool, looking forward to it. Now that the basics are covered, it should be easier.

@hrstoyanov
Copy link

@marcinczeczko thanks for the effort! Any chance we can get SES (simple email service)

@marcinczeczko
Copy link
Contributor Author

@hrstoyanov - thanks :) Actually I just opened PR #9413 with SES (and KMS)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/core area/dependencies Pull requests that update a dependency file area/documentation area/infra-automation anything related to CI, bots, etc. that are used to automated our infrastructure release/noteworthy-feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants