59

I've just started with Azure DevOps pipelines and just created a very simple pipeline with a Maven task. For now I don't care for parallelism and I'm not sure in which way I've added it to my pipeline. Is there any way to use the Maven task on the free tier without parallelism?

This is my pipeline:

 trigger:
 - master
    
 pool:
   vmImage: ubuntu-latest
    
 steps:
 - task: Maven@3

My thought was that tasks are always parallel? Other than that I cannot see where's the parallel step.

1

6 Answers 6

59

First - tasks are always executed sequentially. And 1 sequential pipeline is documented as "1 parallel agent", yes naming could be better. Due to the changes laid out below new accounts now get zero parallel agents, and a manual request must be made to get the previous default of 1 parallel pipeline and the free build minutes.

See this:

We have temporarily disabled the free grant of parallel jobs for public projects and for certain private projects in new organizations. However, you can request this grant by submitting a request. Existing organizations and projects are not affected. Please note that it takes us 2-3 business days to respond to your free tier requests.

More background information on why these limitations are in play:

TLDR; People were using automation to spin up 1000's of Azure DevOps organizations, adding a pipeline and using the service to send spam, mine bitcoin or for other nefarious purposes. The fact that they could do so free, quick and without any human intervention was a burden on the team. Automatic detection of nefarious behavior proved hard and turned into an endless cat-and-mouse game. The manual step a necessary evil that has put a stop to this abuse and is in no way meant as a step towards further monetization of the service. It's actually to ensure a free tier remains something that can be offered to real peopjle like you and me,

11
  • 6
    This answer is easier to understand when you realise that every job, including the first (free and included by default under DevOps plans until recently as the documentation mentions) is called a "parallel job", even though having only one allows only one pipeline to run at a time. All the tasks in a pipeline run sequentially however many parallel jobs you have.
    – Tom W
    Jul 16, 2021 at 16:52
  • 7
    @TomW so essentially there is no way to use the pipelines on the free tier without filling the form? I just wanted to test them before using them more thorough.
    – Apollo
    Jul 16, 2021 at 18:48
  • 2
    @ctwx the restriction mentioned in this answer is new to me and every devops tenant I have used has had the included free job. You could also self-host an agent
    – Tom W
    Jul 17, 2021 at 8:42
  • 4
    This really looks like a precursor to removing the free tier. Disappointing. I certainly won't be using or recommending Azure Pipelines to any open-source projects if MS is making moves to monetize their free tier.
    – bleater
    Aug 4, 2021 at 20:33
  • 5
    I agree, this is pretty terrible. I set up a brand new repo for a flat website and the release is just a file copy to a blob container. It's failing saying it requires parallelism increase. Totally ridiculous. Sep 13, 2021 at 14:49
33

This is absurd. 'Free-tier' is not entirely free unless you request again!

Best Option: Use self-hosted pool. It can be your laptop where you would like to run tests.

MS azure doc here

enter image description here

and use above pool in YAML file

pool: MyPool

Alternatively

Request access to MS:

Folks, you can request here. Typically it get approved in a day or two.

##[error]No hosted parallelism has been purchased or granted. To request a free parallelism grant, please fill out the following form https://aka.ms/azpipelines-parallelism-request
8

If you're using a recent version of MacOS with Gatekeeper, this "security enhancement" is a serious PITA for the unaware as you get 100s of errors where each denied assembly has to be manually allowed in Security.

Don't do that.

After downloading the agent file from DevOps and BEFORE you unzip the file, run this command on it. This will remove the attribute that triggers the errors and will allow you to continue uninterrupted.

xattr -c vsts-agent-osx-x64-V.v.v.tar.gz  ## replace V.v.v with the version in the filename downloaded.

# then unpack the gzip tar file normally:

tar xvfz vsts-agent-osx-x64-V.v.v.tar.gz

Here are all the steps you need to run, including the above, so that you can move past the "hosted parallelism" issue and continue testing immediately, either while you are waiting for authorization or to skip it entirely.

  1. Go to Project settings -> Agent pools

  2. Create new Agent pool, call it "local" (Call it whatever you want, or you can also do this in the Default agent pool)

  3. Add a new Agent and follow the instructions which will include downloading the Agent for your OS (MacOS here).

  4. Run xattr -c vsts-agent-osx-x64-V.v.v.tar.gz on the downloaded file to remove the Gatekeeper security issues.

  5. Unzip the archive with tar xvfz vsts-agent-osx-x64-V.v.v.tar.gz

  6. cd into the archive directory and type ./config.sh Here the most important configuration option is Server URL which will be https://dev.azure.com/{organization name} Defaults are fine for the rest. Continue until you are back at the command prompt. At this point, if you were to look inside DevOps either in your new agent pool or Default (depending on where you put it) You'll see your new agent as "offline" so run:

  7. ./run.sh which will bring your agent online. Your agent is now running and listening for you to start your job. Note this will tie up your terminal window.

  8. Finally, in your pipeline YAML file configure your job to use your local agent by specifying the name of the agent pool where the self-hosted agent resides, like so:

    trigger:
    - main
    
    pool:
      name: local
    #pool:
    #  vmImage: ubuntu-latest
2
  • 1
    This is a 10/10 answer. Don't pass by without giving a thumbs up. Thanks man.
    – DOZBORNE
    Jan 21 at 3:52
  • Absolutely fantastic answer. This got me unblocked while I wait for parallel execution approval from Microsoft. Thank you!
    – pards
    Aug 11 at 19:12
5

The simplest solution is to change the project from public to private so that you can use the free pool. Private projects have a free pool by default.

Consider using a self hosted pool on your machine as suggested otherwise.

Here's the billing page. enter image description here

2
  • 2
    I don't believe this is working for everyone anymore. It seems to be disabled
    – DOZBORNE
    Jan 21 at 3:20
  • 1
    As of Oct 2022 and maybe earlier they disabled the free usage of ANY Azure provided runners without filling out the form.
    – dragon788
    Jun 3 at 16:14
3

Expanding on @Digital_Reality answer.

Free grant discontinuation

Microsoft disabled the free grant of parallel jobs for public projects and for certain private projects in new organizations. Because users abused (e.g. crypto mining) the free computational resources. 1

You can solve the problem in two ways:

  1. Request the free grant by submitting the https://aka.ms/azpipelines-parallelism-request form.
  2. Create a Self-hosted agent.

Requesting the free grant usually takes two or three days. If you do not want to wait for the request approval, you can create your own self-hosted agent.

Create a Self-hosted Agent

In order to create a self-hosted agent, go to Project Settings and select the Agent pools option under the Pipelines section. Press the Add pool button and configure the agent:

  • Select the Pool type as Self-hosted
  • Add a descriptive pool Name (in this example my-personal-computer)
  • Check the Pipeline permissions box so you do not need to grant permission manually
  • Click on the Create button

enter image description here

Now, navigate to the freshly created agent. On the top-right corner, press the New Agent button. You can create Windows, macOS, and Linux agents. Based on your computer select the appropriate OS then follow the instructions:

  1. Extract the archive: Download the agent then extract it to a folder

  2. Configure the agent: Run the config scripts and select the default settings:

    • Server URL: Copy and paste the organization URL which looks like the following https://dev.azure.com/<my-organization-name>
    • Personal Access Token (PAT): Go to the Personal Access Tokens option under the User Settings icon. Make sure that you generate a PAT which has Read & manage access to the Agent pools enter image description here
    • Agent pool name: The newly created pool which is the my-personal-computer in our case
    • Agent Name: Give a meaningful name (e.g Windows-Agent) or stay with the default
    • Work folder: Press enter for the default
    • Agent as Service: Press enter for the default
  3. Run the agent: Execute the run script

Once it is done, you can see that the Agent is up and running under the Agents panel.

enter image description here

The self-hosted agent is connected to Azure DevOps and listens for new jobs.

Note: If you create a service during the agent configuration then you do not need to run the agent manually.

Configure the Pipeline

The last step is to update the Pipeline to use the recently created agent. Go to the Pipelines and select your pipeline. Click on Edit and add the pool: <my-selfhosted-agent> section to the config file. Here is an azure-pipeline.yml file example:

trigger:
- main

pool: my-personal-computer
strategy:
  matrix:
    Python36:
      python.version: '3.6'
    Python37:
      python.version: '3.7'

steps:
- task: UsePythonVersion@0
  inputs:
    versionSpec: '$(python.version)'
  displayName: 'Use Python $(python.version)'

- script: |
    python -m pip install --upgrade pip
    pip install -r requirements.txt
  displayName: 'Install dependencies'

- script: |
    pip install pytest pytest-azurepipelines
    pytest
  displayName: 'pytest'

It will go to the pool and select an available agent. We have only one agent so it selects it and run the various jobs on it. You can go inside your self-hosted agent folder and get the logs from the _work directory. You can also view the output of the jobs on Azure DevOps.

0

I faced the same issue. I changes the project visibility from Public to Private and then it worked. No requirement to fill a form or to purchase anything.

Not the answer you're looking for? Browse other questions tagged or ask your own question.