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

Add Dekorate support #446

Merged
merged 1 commit into from
Sep 29, 2020
Merged

Conversation

pgressa
Copy link
Contributor

@pgressa pgressa commented Sep 8, 2020

Dekorate in latests stable version 1.0.1 covers in this MR:

  • Kubernetes
  • OpenShift
  • Knative
  • Prometheus
  • Jaeger
  • Service Catalog
  • Halkyon CRD

Left to do:

@Nullable
@Override
public String getMicronautDocumentation() {
return "https://micronaut-projects.github.io/micronaut-kubernetes/latest/guide/index.html";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure whether to link to kubernetes micronaut documentation. Strictly speaking, to generate k8s manifests, that module is not needed.

Copy link
Contributor Author

@pgressa pgressa Sep 8, 2020

Choose a reason for hiding this comment

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

  • this module is not now required, so either I'll add dependency on micronaut-kubernetes, or will remove this method. WDYT?

Copy link
Contributor

@ilopmar ilopmar left a comment

Choose a reason for hiding this comment

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

Some minor changes and a question. Overall looks good!

@pgressa pgressa force-pushed the dekorate branch 3 times, most recently from c3de202 to ddd5a77 Compare September 9, 2020 19:35
@pgressa
Copy link
Contributor Author

pgressa commented Sep 9, 2020

@graemerocher @ilopmar what's left to discuss:

  • to make Dekorate work properly, either openshift, kubernetes or knative modules must be included. These features distinguished by DekoratePlatformFeature Anyway to make it work properly, I have added this DekorateFeatureValidator. So basically this dependency causes that the test does not add an unmodifiable map to config FAILED Question is how to make that test work. What comes to my mind is, in case no DekoratePlatformFeature is among selected features, to add default Kubernetes one.

@alvarosanchez
Copy link
Member

@pgressa nice! I see they removed their support for Micronaut in dekorateio/dekorate@466e892#diff-4f6f5cc3fccf73f75ae9ccf4ad2f4d1e

I think we should have a better integration so that stuff like hardcoding the port in @Port isn't necessary.

@alvarosanchez alvarosanchez self-requested a review September 10, 2020 07:51
@pgressa
Copy link
Contributor Author

pgressa commented Sep 10, 2020

@alvarosanchez from that commit it seems they never supported it at all, as the classes are basically empty.

What you mean better support integration? Do you mean to implement framework support to dekorate?

This PR basically introduces and configures the dekorate annotations that should produce manifest with similarconfiguration to the one that the Kubernetes feature produces. Once micronaut-projects/micronaut-core#4012 will be merged the readiness/liveness probes should be used here as well.

@alvarosanchez
Copy link
Member

Yes, implement framework support for Dekorate. Not in starter, but as part of micronaut-projects/micronaut-kubernetes#46 (which is what I originally intended when I created the issue).

Regarding the commit, the classes weren't empty. You need to click "Load diff" to see them. However, they didn't do a great job at detecting the port: dekorateio/dekorate@466e892#diff-e5672fa55806c7dfd54773de95f3fedbL40

If you look at the Spring Boot support, they actually read the configuration files to detect the port, among many other things.

@pgressa
Copy link
Contributor Author

pgressa commented Sep 10, 2020

:D well I'm aware of the "Load diff" button.. but exactly because they won't read configuration I would say the integration was more a generated project, otherwise they wouldn't remove it. But that's not important at this moment.

What is important like how to proceed with this PR. Could you elaborate more on the integration from micronaut-kubernetes and how it would be supporter from starter project. Because from my poor understanding of how are things working:

  • from dekorate PoV contains framework support what means that once knative/openshift/kubernetes is on class path, then respective platform manifests are generated. Of course except the services like jaeger, prometheus, ... .
  • or from micronaut side, we have this starter project or respective modules

But how would that module work? Like we would have our annotation processor that feeds the values directly into dekorate generator?

@alvarosanchez
Copy link
Member

:D well I'm aware of the "Load diff" button

Sorry, I didn't understand you correctly in the first place.

But how would that module work? Like we would have our annotation processor that feeds the values directly into dekorate generator?

Exactly that, the same as the Spring Boot integration does.

I'm ok with moving this PR forward if then we work on such integration.

@pgressa pgressa marked this pull request as ready for review September 10, 2020 12:00
@graemerocher
Copy link
Contributor

What @alvarosanchez says makes sense, you want to be able to set the correct port automatically I guess.

@pgressa
Copy link
Contributor Author

pgressa commented Sep 17, 2020

@graemerocher @alvarosanchez guys, I can go for it if you think current version is not usable for users. I would personally prefer to merge this one, then introduce the module that will feed the values from within the app context, and after that I would adjust the starter project and remove hard-coded values and leave just the annotation. WDYT?

@alvarosanchez
Copy link
Member

I already said I'm ok with doing that.

@graemerocher graemerocher added this to the 2.1.0 milestone Sep 17, 2020
@pgressa
Copy link
Contributor Author

pgressa commented Sep 17, 2020

@alvarosanchez OK, I'm just not sure whether @graemerocher requires those changes or not :)

@pgressa
Copy link
Contributor Author

pgressa commented Sep 18, 2020

Ok so seems like 1.0.2 works with gradle and java. Unfortunately Kotlin is not working with our setup, so I have created new issue there dekorateio/dekorate#632 and will disallow combination of Kotlin + Gradle in DekorateValidator so we can move forward. So here's the bump to 1.0.2 micronaut-projects/micronaut-core#4131

@pgressa pgressa force-pushed the dekorate branch 3 times, most recently from d18f2a4 to 614b450 Compare September 22, 2020 07:12
@pgressa pgressa force-pushed the dekorate branch 2 times, most recently from 56d3ac2 to 4d870c3 Compare September 22, 2020 07:51
@pgressa pgressa mentioned this pull request Sep 23, 2020
@pgressa
Copy link
Contributor Author

pgressa commented Sep 23, 2020

@graemerocher pls review

@jameskleeh
Copy link
Contributor

@pgressa The dekorate kotlin + gradle is supposedly fixed. dekorateio/dekorate#632. Can you test/review and update this PR?

@pgressa
Copy link
Contributor Author

pgressa commented Sep 29, 2020

@jameskleeh oh I didn't notice they fixed... going for it

@pgressa
Copy link
Contributor Author

pgressa commented Sep 29, 2020

@jameskleeh works.. will force push fix

@graemerocher graemerocher merged commit 57fa65e into micronaut-projects:master Sep 29, 2020
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.

5 participants