Bitnami Content

Tuesday, January 8, 2019

How Stacksmith helps to package, optimize and maintain your application in a consistent way

Authored by Jota Martos, Engineer 

Building an application from scratch requires a huge effort from the developers of the application. Apart from defining the pre-requisites (language, runtime to use...), it is the time you spend in writing the code and building, packaging and deploying the solution. If your application will support different platforms, you will also need to spend time building a system that meets these additional needs, and that requires knowledge and time to integrate into your system. 

On the other hand, there are cases in which you will use a commercial or Open Source application that does not require code changes but does require changes in the way it’s deployed and configured. In these cases, automating the process to package and deploy the application so it meets your needs can deliver key benefits to your business. 

These benefits include time saving from the reduced effort it takes to incorporate your changes (and not just once, but every time the application package needs updating), and it improves the consistency and quality of what you produce by minimizing human intervention and the possibility of human errors. That’s why you need to put a system in place to automatically package and deploy it every time you integrate a new change in your application.

Many organizations that are evaluating what this means look to Continuous Integration and Continuous Deployment tools (CI/CD) to solve the problem. These tools are often either overly prescriptive - they only work with particular application runtimes or cloud targets, for example - or overly flexible, requiring substantial customization for them to work in your specific environment. 

While these tools are right for many situations, they won’t be right for all. For those situations that don’t require a fully automated CI/CD software delivery process, there is still an opportunity to gain many of the benefits they can deliver without having to implement a full CI/CD strategy. By packaging the application code and configuration as deploy-ready artifacts, images, and associated deployment templates, and delivering that application in an automated, repeatable way, you can obtain the transformational effect and long-term maintenance benefits typically only achieved with CI/CD tools. Here is how it can be done.


The importance of automating the application packaging and delivery process


The process of packaging and deploying your application is time-consuming so increasing productivity when performing these tasks is always a good idea. Automating these tasks allows teams to focus more on the development of applications and less on the system details of delivering it to computing environments.

Some of the benefits are: 


  • Teams can test the changes easily and frequently, which leads to a better performance. Because the process is automated, it is easy to validate even a small change in the application by packaging and testing your solution with the changes. 
  • Automating the delivery provides a repeatable and reliable way to promote application changes - not only for the production environment, but also for the development, test or any other environment that the team uses when deploying an application.


Bitnami Stacksmith is a tool that automates and optimizes the packaging of your applications for deployment to cloud and container platforms. It also includes many more features such as multi-platform support, security checks or methods to upgrade or downgrade and maintain your application.

Stacksmith only needs the files of your already-built application (for example a .tar.gz file or your Node.js application) and it will package it for the cloud or container platform you select. Stacksmith provides a consistent, reproducible, and automated way to package your applications. 

In addition, Stacksmith can be integrated with your CI/CD pipeline. After the application itself has been built and tested, the build output can be passed to your CD tool for the deployment of the updated version of the application to the staging environment. This Bitnami blog post has some examples on how to integrate Stacksmith with other services.


Not only packaging automation: Other benefits of Stacksmith


Target different platforms in a single process

Stacksmith lets you package your applications for multiple platforms. This means you can package your software for AWS and Azure with just a few clicks. When you package for AWS, Stacksmith creates an AWS CloudFormation template for you, along with an Amazon Machine Image (AMI) that contains all the necessary dependencies for your application. When packaging for Azure, Stacksmith creates an Azure Resource Manager template for you and a managed virtual machine image. If your focus is Kubernetes / containers, Stacksmith also lets you create container images and Helm Chart that can be deployed to the container services of those platforms.  

Stacksmith also allows you to create different applications depending on the target and the files and scripts you want to package. For example, you can configure the AWS solution to use the “Java Tomcat Application with DB (MySQL)” architecture, yet configure Stacksmith to use PostgreSQL when packaging for other platforms.



Security

One of the goals of Stacksmith is to maintain your application by keeping it secure and up-to-date. To accomplish this, Stacksmith documents the components that were installed when packaging your application, then continuously checks for updates and known security vulnerabilities for any of these components. All this information is shown in the “System Packages” section of the build you select.



Here you will also find alerts about security issues affecting these components and information on how to repackage the application.

This ensures a smooth process for upgrading your application, making it easy to repackage a fixed version of the application and update existing deployments to fix any security issues.

Upgrades, downgrades, and maintenance

Stacksmith allows you to update your application at any time by uploading new files, and it also supports downgrades for when you wish to return an application to a previous state. To illustrate this, I am going to update the application by providing new files and packaging a new version of it:  


  1. From the “Applications” dashboard of your project, select the application you want to update. 
  2. Click “Edit configuration”.
  3. Provide the new files of the application and add a version number for the new build. 



This feature is extremely useful for those users who don’t have any automation in place because it gives them the opportunity to easily package any other version of the application in just a few clicks. Stacksmith will save the information about all the packages it has been generating, all the previous versions, and the new ones that will be accessible through its dashboard. 

When editing the configuration, you can also perform other tasks, such as changing the template you wish to use (in case you want to change the database the application uses, for example) or the target platforms (you can add or remove support for AWS or Kubernetes in the different versions you build).

Once Stacksmith has built an updated version of your application, it can be used  to update the existing out-of-date one.

Stacksmith's built-in stack templates are designed to make it easy to update the application in mind. In most cases, the upgrade or downgrade can be done with zero downtime for your application. This is because Stacksmith lets you use the cloud-native load balancing and other mechanisms available on each platform. In the case of AWS, Stacksmith leverages Elastic Load Balancers and Auto-Scaling Groups to achieve this goal.

In order to update an existing deployment, you only need to copy the CloudFormation template HTTPS URL, go to AWS CloudFormation console, choose the ‘Update Stack’ option, and provide the new template URL.


Automation is the key


This article explains how Bitnami Stacksmith is a really useful tool to package your application, regardless of the source of your application files or how automated your current process to package your application is. It will provide a consistent and reproducible way to package your applications, and  leads to better quality and reliability of your application.

With Stacksmith, your application can be packaged for multiple platforms in just a few clicks. Once you provide your application files, the system will package the application and make it accessible in the platforms you select. Stacksmith automates ongoing maintenance, keeping your applications secure and up-to-date by applying the latest security patches as well as the latest configuration and other internal updates you integrated into the application. 

Try Stacksmith Public for free now for your Open Source projects, or enroll into one of the other Stacksmith plans to experience all the benefits of Stacksmith.





Have questions about how Stacksmith can fit with the CI/CD tools you currently use? Contact us at enterprise@bitnami.com.