Understanding Cloud-Hosted CI

Cloud computing has had a huge impact on software development. Cloud-native applications and services – designed to take advantage of scalable, cloud-hosted infrastructure – are increasingly commonplace.

Cloud-hosted CI extends the benefits of cloud-hosted infrastructure to the process of building, testing, and deploying your software.

If you’re new to CI/CD or have an existing on-premises setup, this page will help you understand how cloud-hosted CI/CD could benefit you.

Cloud CI explained

Continuous integration, delivery, and deployment make releasing software to your users faster and more reliable. Each time you make a change to your codebase, CI/CD puts your software through a series of automated steps to verify that it works as expected. This system reduces the time from development to release while minimizing the number of bugs in production, as well as offering a raft of other benefits.

Although moving to automated CI/CD from a manual process saves time and effort, it also puts more demand on your infrastructure. Instead of deploying a new version of your product to testing and staging environments every few weeks or months, CI/CD means you’re testing the latest code several times a day or more.

The more people you have working on the same codebase and contributing changes, the more often you put your code through that automated build, test, and deployment process. If you are hosting your CI/CD process on your own servers, the number of available servers will soon become the limiting factor. During times of high demand – such as when teams are swarming on a critical fix or finalizing features for a launch – you may find your in-house CI/CD infrastructure becomes a bottleneck.

In these scenarios, hosting your CI/CD process in the cloud can help. Cloud CI can either involve setting up your pipelines to run on cloud-hosted infrastructure or using a fully managed cloud-based CI/CD service.

Both options enable you to take advantage of cloud computing’s scalability. Rather than trying to strike a balance between having enough capacity at high-demand periods versus the cost of idle servers, you can scale your build farm as needed.

The benefits of cloud-hosted CI

Hosting CI/CD in the cloud expands your resources on demand and can make your processes more robust, reduce maintenance costs, and facilitate cloud-native development.

Simplify your workflow with infrastructure-as-code (IaC)

With cloud-hosted infrastructure, configuring environments with scripts is the norm. By putting your infrastructure configuration into code, you ensure that each build and test environment is the same. This process also makes it possible to bring more infrastructure online when you need it.

Just like software under development, the infrastructure itself can be put through a CI/CD pipeline to ensure it works as expected. This step allows changes to be rolled back easily.

Make the most of containerization

If you’re developing a cloud-native application, there’s a good chance you’re using containers. With containers, the environmental dependencies and configuration details are packaged with the software into a single artifact – this can be deployed on any machine with the container runtime.

Container orchestration tools, such as Kubernetes, have been developed to make it easier to work with large numbers of containers. They automate tasks like deployments, management, and scaling.

Using containers in a CI/CD workflow makes deploying the latest build to different pipeline stages more straightforward. The build artifact is a container image that can be consistently deployed to each test environment before being released to production.

With cloud CI/CD, containers make efficient use of compute resources and allow you to leverage automation tools. You can increase capacity when demand is high but save on costs by killing off containers and releasing the underlying infrastructure when it’s lower.

Get rid of the hassle of server maintenance

Moving your CI/CD process to the cloud means your build farm is hosted on virtual machines. If you need more capacity, you only need to set it up – procurement, installation, and management of physical hardware are no longer things you have to handle.

This offloading frees up your team to focus on optimizing your pipeline processes and keeping them secure. As cost is a factor of both processing power and time, it’s worth taking the time to parallelize tasks where possible – you’ll get results to your developers quicker than if fewer machines are used over a longer period.

Keep your release path open and ready

A CI/CD process is a critical asset for any software development team. It is the mechanism for releasing software updates to your users. Hosting that process in the cloud reduces the likelihood of the path to release becoming unavailable due to an unexpected outage. While this level of resilience may seem like a luxury on a normal day, it quickly becomes a requirement when a critical bug is discovered, and an urgent fix must be deployed.

A cloud-hosted CI/CD process can also make it easier to adopt a blue/green deployment strategy, thanks to the scalability of cloud resources. With a blue/green approach, you can quickly divert traffic to the previous version if an issue comes up in production. This process means you can maintain your service while you work on a fix.

Considérations relatives à l'hébergement de la CI dans le cloud

While cloud CI/CD can offer significant benefits in terms of infrastructure cost, scalability, and reliability, there are some potential drawbacks and pitfalls to consider.

Architecture du système

If your product is architected around containers, cloud-hosted CI/CD means you can use that to streamline deployment to your testing environments. However, if you’re working with a monolithic architecture, packaging your software into containers can be challenging.

Of course, containers aren’t essential for cloud hosting. You can still use virtual machines on a cloud provider’s infrastructure to run builds and provide consistent pre-production environments for testing. That said, VMs consume more resources than containers, and environments must be configured separately.

Connaissances et compétences

If you don’t already have expertise in infrastructure-as-code (IaC), your team members will need time to upskill, or you’ll need to consider bringing that knowledge in.

However, experience working with cloud technologies is a desirable skill. Giving your teams the opportunity to develop those skills and use the latest technology can benefit staff retention and hiring.

Coût

In the cloud, time is money – you don’t want to pay for computing resources to sit idle. For cloud hosting to be cost-effective, you need to use it efficiently. Il faut donc exploiter pleinement les outils qui surveillent l'utilisation et libérent les instances inactives après un délai d'inactivité, ou mettre en place cette logique vous-même. Cette dernière option peut nécessiter des compétences que votre entreprise n'a pas encore, il vaut donc la peine d'étudier et de comparer les différentes options.

Sécurité

La sécurité a toujours été une préoccupation lorsqu'il s'agit d'héberger des données et des services dans le Cloud. Pour certaines entreprises, le simple fait qu'un logiciel sensible se trouve sur le kit d'un tiers est un obstacle. Nevertheless, many organizations now use public clouds to host both their live services and deployment pipelines, from source control repositories to CI servers and test environments.

Identifying potential attack vectors, building protections into your CI/CD process, and implementing access control are all essential to mitigate risks posed by malicious actors.

Approches hybrides

While infrastructure-as-code (IaC), containers, and container orchestration are rooted in cloud technology, they can also be integrated into CI/CD setups using private clouds or a hybrid of on-premises and cloud-hosted infrastructure.

For instance, you might choose to use cloud-hosted infrastructure for a part of your process – such as running performance tests – while keeping the rest on-site.

This hybrid approach offers several advantages:

  • If your organization is planning to transition to cloud-hosted infrastructure in the future, adopting cloud-native tools will allow you to build expertise in advance and ease the transition.
  • With IaC, refreshing environments between test runs is much quicker, as you just need to run a script.
  • La codification de la création d'environnements assure également la consistance, ce qui vous permet d'assurer la parité entre votre configuration de production et les environnements de pré-production, que ce soit pour la sécurité, les performances ou les tests d'interface utilisateur, ou les sandboxes pour les équipes de support et de vente.
  • By keeping infrastructure configuration files in source control, the team has an audit trail of what changes were introduced and when – this can simplify debugging environmental issues.

Comment TeamCity peut vous aider

With TeamCity, you can choose exactly how much of your CI/CD process you want to run in the cloud.

TeamCity On-Premises gives you the flexibility to host both your CI server and your build agents on-site or in the cloud. Whether you want to host all your build, test, and deployment tasks in the cloud or expand your build farm automatically when demand increases, TeamCity’s native integrations with leading cloud providers provide all the functionality you might need.

TeamCity Cloud offers a managed CI server, so you can focus on streamlining your build, test, and deployment process without any infrastructure to maintain. The option to use both JetBrains-hosted build agents and your own cloud-hosted or on-site build machines gives you the freedom to create a build farm that suits you.

TeamCity Pipelines is designed to make CI/CD even more efficient with a flexible, cloud-native approach. You can easily create, manage, and optimize your pipelines using a visual drag-and-drop editor or YAML, whichever suits your workflow best. With support for both cloud-hosted and self-hosted agents, TeamCity Pipelines allows you to scale as needed, ensuring that your build, test, and deployment processes are as seamless and automated as possible.