Deploy Spring Cloud Function to OpenFaaS - spring-boot

Spring Cloud Function is a way to write serverless functions with Spring Boot. There are only adapters for AWS, Azure, etc. but no way to deploy to OpenFaaS yet.
How do I deploy a Spring Cloud Function to OpenFaaS?

I created something using the official Java11 template but I am not sure if this is a good solution. You can find the code here: https://github.com/PySualk/spring-cloud-function-openfaas

Related

Warmup of a Spring cloud functions based solution in azure

We are working in a spring cloud functions based solution, this solution will be deployed into azure.
We have implemented several functions but we have some warmup time when we start the spring context that we would like to remove.
I have been following Microsoft documentation (https://github.com/MicrosoftDocs/azure-docs/blob/main/articles/azure-functions/functions-bindings-warmup.md)
I have created trigger that is called when the instances are created but I am unable to load the spring context.
Is there any support for this type of binding in the azure java libraries or in spring cloud functions?

GCP Cloud Functions with spring cloud function and spring native

I have been trying to deploy a GCP cloud function using Spring Cloud Function and Spring Native unfortunately it seems that GCP is blocking the AOT mode as shown in the photo "AOT mode disabled"
Does anyone had success deploying a native spring cloud function ?
Jonathan.
As Mentioned by #guillaume blaquiere,
AOT isn’t supported by Cloud Functions, you can use Cloud Run instead, to compile and deploy your container.
You can also try referring to this codelabs quickstart to get you started with the Spring Native on Google Cloud.

Can we deploy spring micro services on AWS Lambda?

Is it recommended to deploy spring micro services on Lambda. I have recently deployed a sample spring boot app returning a sample data from AWS RDS Oracle DB on Lambda, Just analyzing the possibility if we could deploy two micro services in different Lambda functions and configure them using API gateway.
I am entirely new to it and trying to understand if Lambda can really support micro services patterns like Service discovery/Circuit breaker or Saga patterns if I deploy two or more services on different lambda functions. Would Lambda be used for such scenarios in Real Time ?
Can anyone help me if there would be limitations other than package/payload size limit or timeout limitations ?
Thanks in Advance
If you use java for serverless application like AWS lambdas I would recommend for looking a framework which supports Ahead-of-Time compilation which will boost a lot your application start. If your application is not bit it will be very easy to be rewritten with Micronaut (very similar to Spring boot development)
For instance have a look at Micronaut, Quarkus using with Graalvm. Spring Boot is not the best option using with directly with AWS lambdas, it is big package size + really a lot of initial time, not good for API services.
Target of max package sizes of 25 MB for small cold start with adjustable memory starting from 256MB, with spring boot this is not doable.
In case you are referring to Spring Boot Cloud Functions that's exactly they were made for.
Google Cloud Functions already have an Alpha product for running Java functions.
AWS Lambda seems to have support for this as well.
In case you simply wrote a Spring Boot app with embedded Tomcat that you packaged in a Docker container which you're spinning up on demand, beware that cold start can be an issue, especially with the overhead of the Tomcat.

Deploy my spring boot application into google cloud computer engine

I got a query to ask you all. I am looking for guides that help me deploy my spring boot application on google cloud computer engine, I type in my instance IP address when I test my spring boot application I unable to access it in REST API.
May I know do you have any guides or steps for me to follow to deploy successfully in google cloud computing engine. Why do I need to deploy in computer engine is because I deployed my angular at it and I deploy it both it seems that my angular project being replaced by my spring boot application.
Codelabs GCP / Spring series has deployment tutorials:
https://codelabs.developers.google.com/spring/
GCP has some "Getting Started" tutorials you can use here:
https://cloud.google.com/java/docs/
where the specific one for deploying a java app to GCE is here:
https://cloud.google.com/java/docs/tutorials/bookshelf-on-compute-engine
But the basic steps are as follows:
Write your Spring app
Build your Spring app
Run / test your jar locally
Push your jar to a location in Storage
Create a startup script for your GCE instance
Create a new GCE VM which uses your startup script using Console, Deployment API, or gcloud tool
After that, you need to ensure you have the proper network rules in place to be able to access your API publicly. If you do not wish to learn how to use GCE, I would suggest you look into using App Engine instead because then you do not need to learn how to deploy and instead can concentrate on your api. Here is a guide to do that

Creating a Spring Cloud microservice

I am trying to learn and create a microservice using Spring Cloud. I am using Spring mvc and Spring Boot for development. I added separate Spring Boot application for both Eureka server and Zuul client. I have three Spring Boot application now. One Sureka server, one for Zuul routing and third one is for my microservice application. I run the Eureka server and the microservice and Zuul found to be running properly in Eureka server UI.
My doubt is that, I am planned to use routing and service discovery in my microservice. So I have a total of three Spring Boot applications. Can I deploy these three applications into AWS Elastic Beanstalk?
When I exploring I found that Pivotal Cloud Foundry topic. Since I am planing to use AWS Elastic Beanstalk. So what is the role of Pivotal Cloud Foundry in my application?
I am still confused about microservice development using Spring Cloud.
So there are two elements in your confusion. Is Amazon Beanstalk suitable?
So answer is yes. but you have overhead of orchestrating various services of amazon over then. Basically Amazon Elastic Beanstalk is more form based which means you need to tell what exactly you want to do with application for example route setup , scaling mechanism , application portability, application health management , Integration with external log aggregators etc. This is big learning curve to many people (including me :) ). Where as these with PCF these things are easy and straightforward and sometimes implicitly done.
Now Can I use pivotal cloud foundry with amazon? answer will be absolutely yes.
Pivotal cloud foundry is Wrapper written over open source Cloud Foundry project.
It is more succinct PaaS option than Amazon Beanstalk. You can host PCF on amazon ec2 ( IaaS )boxes using BOSH software. To answer you PCF is a alternative to Amazon Beanstalk. You don't need PCF is you want to use Amazon Beanstalk and vice versa.

Resources