Microservice templates in Onesait Platform
In release 5.1.0-Survivor, we have added a new system for creating microservice templates based on Git projects, which will allow you to create Platform microservices from those templates, and to be able to build the same microservice in different environments.
In this way, we have incorporated several models, as well as transferred the archetypes that we had before, so as to improve their maintenance. The templates we have by default are the following:
- Native Spring Boot 3 with GraalVM.
- Spring Boot 3 with Docker.
- ML Model archetype.
- IoT Client archetype.
- Notebook archetype.
How does it work?
From the beginning, navigate to the menu of Development > Microservice Templates option, where you can create templates in Java8, Java17 and Java17 with GraalVM. Then specify the URL of the Git where you have created the microservice, and you will be able to publish it from the Platform, creating a microservice from this template.
When creating a template, you need indicate the path where the «pom.xml» file of the microservice is located in Git, and the Dockerfile, as long as you have not been indicated that GraalVM is used with Java17, since if that was the case, the Dockerfile is not needed to create the image.
Although you cannot create templates with other languages, we have preloaded templates that are identical to the options you previously had when creating a microservice. This allows for better maintenance of the templates as they are externalized in Git. For example, you can change the version of Spring Boot in the Git repository and bring those changes.
This way, you will be able to see a template for each of the archetypes. Bear in mind that these templates will not be editable. The following image shows the template for the ML Model archetype:
This other one corresponds to the IoT client archetype:
In the case of a Notebook archetype, it would be like this:
To create a new microservice, navigate to the Development > Microservice Management menu, where the templates, both already created and preloaded, will appear as options to choose from in the drop-down menu.
In this way, you can have the template created in a repository and decide if you want to clone it in another different Git, indicating as always the URL, user and token, and selecting the Jenkins and CaaS configuration, thus allowing you to deploy the same templated microservice in different environments.
Header image: Nihat Sinan Erul at Unsplash.