Build web applications using GitHub Actions on the new Microsoft Azure B-series virtual machines based on Arm architecture
Click the Arm Community above to follow us
Arm is building strong partnerships with the cloud-native software ecosystem to ensure open source projects can bring more native multi-architecture support to developers. In addition, Arm actively collaborates with community members and code contributors to provide them with a seamless software development experience. Developers leverage Arm's mature cloud-native software ecosystem [1] to build applications to achieve cost-effective and energy-efficient advantages. Cloud-native applications vary in their computing requirements. Some require sustained high throughput, while others, such as web servers and development and production environments, do not necessarily require full CPU performance around the clock, and Arm's flexible architecture is enough to support such a wide range of workloads.
Microsoft launches B-series virtual machines
Microsoft has released a public preview version of the new Azure Bpsv2 series of virtual machines [2] , which uses the Ampere Altra processor equipped with Arm Neoverse. B-Series virtual machines deliver high levels of CPU performance on demand and are ideal for workloads that require occasional bursts of high performance but run at lower performance levels most of the time. Because these virtual machines can meet necessary performance requirements without over-provisioning, they are especially suitable for workloads that face unpredictable bursts of demand, such as events or promotions.
Bpsv2 series virtual machines are a new generation of Azure B-series virtual machines equipped with Arm architecture. They not only provide baseline CPU performance, but can also scale to higher burst performance as the workload increases. It's ideal for applications that don't require sustained full CPU performance, such as development and test servers, low-traffic web servers, small databases, microservices, proof-of-concept servers, build servers, and code repositories. B-Series virtual machines accrue credits over time when running tasks at lower performance levels, so that when running applications that require higher CPU performance, the virtual machines can use these credits to provide higher performance explosive demand.
Compared with general-purpose virtual machines, developers pay less to use Azure B-series virtual machines based on Arm architecture, which can save costs. Compared with traditional general-purpose virtual machines, it is not only more cost-effective but also more energy-efficient, making it an ideal choice for CI/CD pipelines in development and test environments. Developers can efficiently manage intermittent demands on additional resources when building and testing cloud-native applications using Arm-based B-series virtual machines. Next, let’s learn how customers can build applications and save costs by using Azure B-series virtual machines based on Arm architecture through the following workload examples of building CI/CD pipelines.
Azure B-series virtual machines and GitHub Actions based on Arm architecture
The CI/CD pipeline of GitHub Actions uses this virtual machine [3] to manage the surge in resource requirements during the build and test process. Generally speaking, GitHub Actions self-hosted runners in CI/CD pipelines only need to build resources occasionally. Therefore, the runner is idle most of the time, while the corresponding Azure virtual machine continues to generate charges. If the runner uses B-series virtual machines, users can not only save costs, but also accumulate credits over time to cover occasional resource needs.
In this example, we demonstrate the CI/CD lifecycle of a web application using GitHub Actions and developed based on Spring Boot. Typically, the resources of the GitHub Actions runner are sufficient to build, test, and run your application's source code. However, in the scenario we simulated, there was a sudden surge in the number of test cases being executed, thus requiring additional resource support. The application scenario is summarized as follows:
The web application's source code is hosted in GitHub, and its CI/CD lifecycle is managed through GitHub Actions.
A GitHub Actions self-hosted runner is configured on an Azure B-series virtual machine based on Arm architecture.
The performance of this virtual machine remains below baseline performance most of the time and supports the build and test process in the CI/CD pipeline.
Virtual machines accumulate credits over time, and when more resources are needed, these credits are used to provide bursts of performance above baseline.
After the build and test process is complete, the virtual machine returns to its baseline performance and begins accruing credits again.
Configuration
prerequisites:
An Azure account with a valid subscription
GitHub account
Log in to your Azure account and refer to the following configuration to create a virtual machine based on Arm architecture. Make sure to select the Arm64 version as the virtual machine's architecture and select the appropriate operating system image, as shown below:
Sign in to your GitHub account and create a copy of this repository [4] . Then, go to the repository settings and register a new GitHub Actions self-hosted runner. Execute the following command on the Azure B-series virtual machine and wait for the runner to enter the "idle" state.
The GitHub Actions runner can now accept tasks. GitHub has a great feature that allows you to use the Visual Studio Code coder directly in the browser. Just click on the library page and the editor will launch instantly. Modify the application source code and commit the changes. The system will automatically trigger the build process in GitHub, and at the same time, it can also be monitored in an Azure virtual machine. After a successful build, access the application using https://localhost:8443 and the following page should open.
Credits accrue over time when B-Series virtual machines run below baseline performance. Its accumulated quota can be viewed on the Azure portal, as shown below:
We have made multiple submissions to the CI/CD pipeline, and we can see that the accumulated quota is used. The following screenshot shows the credit values used for B-series virtual machines:
In summary, if customers want to optimize computing resources in Azure and reduce costs, they can consider choosing Azure Bpsv2 series virtual machines equipped with Arm Neoverse's Ampere Altra processor [5] . These virtual machines can flexibly utilize cloud resources when demand surges. Burstable capabilities provide additional performance when necessary, while baseline performance ensures consistency and reliability.
Author of this article: Pranay Bakre, senior manager and solutions engineer, Arm Infrastructure Group
[1] - [5] The source can be found in the original text, please click to read the original text
Featured Posts