jhipster / generator-jhipster

JHipster is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures.
https://www.jhipster.tech
Apache License 2.0
21.51k stars 4.02k forks source link

Provide a deployment option for Azure #7930

Closed kkraemer42 closed 6 years ago

kkraemer42 commented 6 years ago
Overview of the feature request

I think it would be nice to have a handy way to deploy Jhipster microservices as container to azure (as already possible for aws using the aws-containers subgenerator).

Motivation for our Use Case

I am a volunteer at a nonprofit. We are currently redesigning some of our applications and are using the azure nonprofit subscription which allows us to use azure services for free (up to a certain amount). We want to use jhipster microservices for this but could not yet find a description on how to do this, nor an experience report.

Related issues or PR

I did not find a similar Issue or PR for this.

jdubois commented 6 years ago

We'd love to have this, but unless someone volunteers to do it, it just won't be done by the current team:

If anybody is ready to do this with his own spare time & money, I would be more than willing to merge this code and have official Azure support. And of course if Microsoft wants to sponsor the project, I'd be very happy to have them on board - but I already asked them 3-4 times and that was refused each time.

brunoborges commented 6 years ago

Hi @jdubois, as you may know, I am part of the Azure for Java Cloud Developer Advocacy team, and I'd be happy to find ways we can support JHipster.

We recently submitted sponsorship to AdoptOpenJDK with Azure credits, and I'm sure we can find a way to sponsor JHipster too. I just need more details of what is needed.

My email is brborges at microsoft dot com.

jdubois commented 6 years ago

Hey Bruno, of course I know you!! I'll email you with more details. To everyone following this thread: this is great news, we'll always be happy to have contributors on Azure support, so don't hesitate to participate.

brunoborges commented 6 years ago

As to access to Azure resources, a free account should give enough time (12 months) with some free quota in some services, plus free credits (up to $200 during the first 30 days for not-always-free services), enough to build and test the support.

https://azure.microsoft.com/free

But again, happy to help beyond that for sure!

I'll be waiting for your email and then we will follow up.

Cheers mate!

brunoborges commented 6 years ago

To get this conversation started, I would appreciate some feedback on how you believe JHipster based apps would be best deployed on Azure, or at the very least, which method you'd prefer to see implemented first.

Thx!

deepu105 commented 6 years ago

@brunoborges Jhipster can create simple monolith apps and complex microservices hence I think option 1 (azure app service) will fit well for monolith applications and option 3 will fit well for microservice apps, since we already have 3 k8s based deployment flavours

deepu105 commented 6 years ago

And to answer your question to start with I think it might be easier to do option 1, since it can be modelled after the heroku sub generator

atomfrede commented 6 years ago

I have seen application insights (pretty impressive) last week during the review of another team. So it would be great to have it configured automatically

brunoborges commented 6 years ago

@atomfrede do people deploy JHipster apps on Tomcat? If yes, that's easy to configure. If not and the only way is Spring Boot uber jar apps, then the App Insights Spring Starter needs to be added to the project.

But I believe App Insights would go to a Phase 2 though.

brunoborges commented 6 years ago

@deepu105 ACI is like Fargate. One can get a Docker container up and running with two Azure CLI commands.

az group create --name mygroup --location eastus
az container create --name myapp --image mycorp/myapp:1.0.0 --resource-group mygroup --ip-address public --port 8080

For Kubernetes, since AKS is vanilla managed Kubernetes service, I wonder if there is anything really to be implemented here. Once the K8S cluster is up and running, kubectl can point to it, and JHipster developers can use existing Kubernetes deployment procedures as usual.

deepu105 commented 6 years ago

@brunoborges I get your point. Then I guess its best to start with option 1 for now. @PierreBesson what do you think, does this sound ok to you?

deepu105 commented 6 years ago

@kkraemer42 in the meantime can you see if you can use AKS for your microservice? you should be able to generate all required K8S setup using the Kubernetes sub generator

brunoborges commented 6 years ago

Back to K8S, any suggestion where I could add a documentation contribution about Azure Kubernetes Service? Perhaps some pointers on how to get an Azure account, and how to create a basic Kubernetes cluster for deploying JHipster app, and then how to set up kubectl for that.

This documentation article covers creating k8s cluster on AKS with Azure CLI: https://docs.microsoft.com/en-us/azure/aks/kubernetes-walkthrough

deepu105 commented 6 years ago

We have documentation for k8s, Openshift and so on and maybe we could add a page for Azure as well. You can do a PR to https://github.com/jhipster/jhipster.github.io and refer to the steps in K8S page and then with instructions specific to Azure

PierreBesson commented 6 years ago

Yes option 1 is a good start. The 1st step is to create a documentation page with instructions for doing a simple monolith deployments. If the setup can be automated similarly to heroku/gae then a subgen can be created. @brunoborges don't hesitate to do a PR and we will try to help you as much as we can but as was said before, sadly the team can't invest too much time in this.

For kubernetes, what we generate should not be specific to any given cloud provider so we would only need to do some testing and documentation on this part.

kkraemer42 commented 6 years ago

Hello again,

glad to see that this conversation is so active! @deepu105 thanks for the recommendation, I will definitively try this!

Maybe I can wrap this also, but I do not have any experience with this.

jdubois commented 6 years ago

I know it's the summer and that's why this has slowed down - I'm adding a $100 bug bounty on this, to help it move forward

danielpetisme commented 6 years ago

I found an official maven plugin to deploy java web app https://github.com/Microsoft/azure-maven-plugins/tree/master/azure-webapp-maven-plugin

It's used in the official spring boot doc: https://spring.io/guides/gs/spring-boot-for-azure/

Wouldn't be enough for step 1 ?

The creation of the Azure service principal and configuration of Maven settings.xml could be documented in Jhipster documentation. I don't think we need to go further in terms of generations. Indeed, we could propose prompts to collect the user details + run de command but we would have to generate a custom settings.xml but it would conflict with existing corporate settings.xml for instance plus we would have to override the mvn command to provide the -s <path to settings.xml> each time.

What do you think?

Note: I didn't find the official gradle plugin but we could use this one https://github.com/lenala/azure-gradle-plugins

brunoborges commented 6 years ago

Hey @danielpetisme , check the proposed documentation in this PR: https://github.com/jhipster/jhipster.github.io/pull/615

jdubois commented 6 years ago

Congrats to @danielpetisme for contributing to the project just 2 hours after having a baby (see https://twitter.com/danielpetisme/status/1034348125039849472 )!!!!

danielpetisme commented 6 years ago

@brunoborges will do! @jdubois thanks :smiley: she (yes it's a girl) is born couple of days ago, so no merits (but I do appreciate!)

jdubois commented 6 years ago

@danielpetisme oh I though you were still at the hospital - this is one of the most quiet places to work, when everybody sleeps :-) Congrats to you, girls are awesome!

jdubois commented 6 years ago

I'm closing this as the documentation page is live on https://www.jhipster.tech/azure/ @brunoborges don't forget to ask for your Bug bounty!

brunoborges commented 6 years ago

Hey @jdubois, thanks! While I appreciate the offer, I am happy to take that and put back into the project bug bounty bucket for future contributions from other folks :)

jdubois commented 6 years ago

Thanks, I'll put the bounty on another ticket right now!

deepu105 commented 6 years ago

@brunoborges spoken with true OSS spirit :)