尽管设置了How to achieve actual parallel execution of jobs on Azure Pipelines on pool of Microsoft-hosted agents?的建议,但是我一直按照顺序运行的蔚蓝管道。我原本希望同时在两个linux / windows中运行:
trigger:
branches:
include:
- 'master'
strategy:
maxParallel: 2
matrix:
windows-stable:
imageName: 'windows-latest'
rustup_toolchain: stable
linux-stable:
imageName: 'ubuntu-latest'
rustup_toolchain: stable
pool:
vmImage: $(imageName)
steps:
- script: |
sudo apt-get update &&
sudo apt-get install wget ca-certificates &&
sudo apt install libncursesw5-dev
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" >> /etc/apt/sources.list.d/pgdg.list'
sudo apt-get update &&
sudo apt-get install libpq-dev postgresql-11 postgresql-contrib-11 postgresql-client-11
echo "host all all 127.0.0.1/32 md5" > sudo tee -a /etc/postgresql/11/main/pg_hba.conf &&
sudo service postgresql restart && sleep 3 &&
sudo -u postgres psql -c "CREATE DATABASE \"BestSeller2\"" &&
sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'pinkycerebro';" &&
sudo service postgresql restart && sleep 3
displayName: Install PG
condition: ne( variables['Agent.OS'], 'Windows_NT' )
- script: |
choco install llvm
refreshenv
displayName: Install CLANG
condition: eq( variables['Agent.OS'], 'Windows_NT' )
- script: cargo test --all
displayName: Cargo test
答案 0 :(得分:1)
Azure DevOps对您可以同时启动的并行作业数量有限制。这取决于您的情况:
因此,我建议您首先检查是否这可能是导致无法并行化的原因 您的管道。如果您在没有任何VS Enterprise订阅的私人项目中,则要获得一定程度的学位,应考虑移至“公共”项目或至少保留两个代理程序池(对于Microsoft托管CI / CD,应保留一个自托管CI / CD)。并行化。
看看https://docs.microsoft.com/en-us/azure/devops/pipelines/licensing/concurrent-jobs?view=azure-devops来查看最新文档。