Microsoft Open technologies, Inc. recently released a new tool that enables developers and IT Pros to automatically provision and de-provision Azure virtual machines as Slaves to a Hudson Master. This tool, called the Azure Slave Plugin, is available from Hudson, and has also been open sourced on GitHub.
Earlier this year, we made deployment of artifacts to Azure easier with the Azure Storage Plugin for Hudson. This (recently updated) tool enables Azure’s Storage service to be used as a repository of build artifacts, and to download artifacts as part of a Build action.
Getting Started
For those of you who are new to Hudson, we recommend you review this GitHub documentation on setting up the Azure Slave Plugin. For more information on how Hudson Masters and Slaves work, see this documentation on the Hudson site.
Create Templates for Azure Slave Deployments
To get started with Hudson Slaves on Azure, you will first need to configure a Cloud Profile for your Azure subscription, and then create at least one Hudson Slave Template.
Azure Cloud Profile Configuration
The Azure Cloud Profile defines which Azure subscription to deploy and manage Azure Slaves.
Within the Hudson dashboard, select Manage Hudson --> Configure System --> then scroll to the bottom of the page. Click on the "Add new cloud", dropdown and select "Microsoft Azure" as shown here:
Following these steps will create a new cloud profile for Azure, based on your Azure subscription. Enter the Azure subscription ID and the management certificate from your Azure Publish Settings file. To find out how to obtain these, click on the help button and follow the directions to download the Publish Settings file.
TIP: Helpful documentation of each field/profile is available inside Hudson; just click on the blue question mark to the right to get detailed information and instructions for a specific field.
Click on “Verify Configuration” to confirm that your Microsoft Azure Profile Configuration is accurate. Don’t forget to press Save before leaving the page!
Azure Slave Template Configuration
The Azure Slave Template Configuration creates a Windows or Linux Azure Slave Template that will tell Azure what type of Azure Slave to deploy to your subscription.
Click on the "Add" button under your new cloud profile to add a Slave Template:
You can create as many Azure Slave Templates as needed. Each template will create an Azure cloud service, if one does not already exist, with same name that will be used when Hudson initiates Slave Provisioning. You can specify Azure regions, VM configurations, idle retention time labels for job configuration and your preferred launch method (currently SSH or Java Network Launch Protocol (JNLP). Have a look at the GitHub documentation or the help icon to the right of each template field for a full description of the template configuration options, as well as how to configure Hudson endpoints.
Deploy Azure Slaves When Needed
Hudson can trigger the provisioning of Linux Slave VMs via SSH, or Windows Slave VMs via JNLP or SSH. There are specific steps to be taken to manage security and access between a Hudson Master and Hudson Slaves for Windows slaves, so refer to the Template Configuration section within the GitHub documentation for full details.
De-provision Idle Azure Slaves
Idle Hudson Slaves can be de-provisioned automatically to save usage costs. Retention time for idle Hudson slaves on Azure can be set by specifying the retention time in minutes in the template configuration settings. Specify zero (0) if you want to preserve an idle Hudson slave indefinitely.
Add the Azure Storage Plugin to promote flexibility in your Hudson builds
To deploy build artifacts to cloud storage and/or include build artifacts from cloud storage in your deployments, use our Azure Storage plugin for Hudson. The plugin is also open source, and available on GitHub.
Setting up a Hudson Continuous Integration Server on Azure
The plugin works with any Hudson CI installation and any Azure Subscription. It’s also easy to set up a cloud-based Hudson CI solution on an Azure Virtual Machine. Here are some great resources to get started.
Once you’ve followed the steps in the tutorial to have an Azure Storage account designated as a code repository and configure Hudson, you can also publish build artifacts to Azure Storage. To enable this, just select the storage account from the drop-down in the Post-Build action of your jobs:
Specify a container to use (it will be created if it doesn’t exist). Refer to the tutorial for a full description of options.
Next Steps
We’re excited to be participating in the Hudson ecosystem, and as always, we’re looking for ways to make it easier to interact with Azure services in any way we can. If you have a suggestion as to how we may improve interoperability between Hudson and Azure, please share your feedback below or via GitHub.
Pingback: Top DevOps Links – Week 41 - DevOps Blog - Site Home - TechNet Blogs