GithubHelp home page GithubHelp logo

apa's Introduction

Azure Pipelines Container Agents (Self-Hosted) for Azure DevOps

Pipeline Build Status
PipelineAgents Build Status

Overview

The following explains how to easily build, setup and run self-hosted docker container agents using Azure Pipelines in Azure DevOps (ADO). The pipeline does the following for you:

  1. Creates an Azure Container Registry (ACR).
  2. Builds Docker Container Image for self-hosted Azure Pipelines Agent within that ACR.
  3. Starts Docker Container as Azure Container Instances (ACI).
  4. Connects ACIs to your Azure DevOps Agent Pool (Self-Hosted).

Requirements

Setup

  1. Create an Azure DevOps Agent pool within your Azure DevOps organization.

  2. Generate a Personal Access Token (PAT) for your Azure DevOps Organization. When generating the (PAT), assign the following scopes:

    • Agent Pools - Read & Manage
    • Deployment Groups - Read & Manage
  3. Create a new repository and clone/fork this repo into it.

  4. In Pipelines/Library add a variable group named vg.PipelineAgents, with the following variable to avoid exposing keys & secrets in code

    agentPoolToken      = <agentPoolToken>      # personal acces token for agent pool
    
  5. In parameters.yml adjust following variables

    acrName             = <acrName>                             # Azure Container Registry Name (needs to be unique)
    adoUrl              = https://dev.azure.com/<organization>  # Azure DevOps Organization URL
    agentPool           = <agentPool>                           # agent-pool name
    location            = <location>                            # where your resources will be created
    resourceGroupName   = <resourceGroupName>                   # where your agents will be placed
    serviceConnection   = <serviceConnection>                   # arm service connection name
    
  6. Create a new pipeline using the pipeline.yaml and run it.

Helpers

Instead using an Azure Pipeline you can also run also these tasks locally using your local machine as agent. For that you can find a Helper file here. If you're not familiar with Docker at all I recommend the Docker Quickstart.

Docker Container image contents

The docker container images are based on the official Azure Pipelines VM images for Microsoft-hosted CI/CD.

Ubuntu / Debian

  • Azure CLI (latest)
  • Git (latest)
  • PowerShell Core (latest)
  • .NET SDK (2.1)
  • Docker (18.06).3-ce
  • Kubectl (1.14.4)
  • Terraform (0.12.6)

Windows Server Core (ltsc2019)

  • Chocolatey (latest)
  • Azure CLI (latest)
  • Git (latest)
  • PowerShell Core (latest)
  • Docker (in porgress)
  • Kubectl (in porgress)
  • Terraform (in porgress)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.