Skip to content

Commit

Permalink
#2: update matrix to match azure specs
Browse files Browse the repository at this point in the history
  • Loading branch information
tlamonthezie committed Oct 22, 2024
1 parent f9089ed commit 865d1ba
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 29 deletions.
16 changes: 9 additions & 7 deletions ci/azure/build-and-test-azure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,24 @@ variables:
CI_BRANCH: 2-implement-common-docker-containers # should be master in the future

jobs:
- job: myJob
- job: getMatrix
timeoutInMinutes: 10
pool:
vmImage: 'ubuntu-latest'
steps:
- bash: |
wget https://raw.githubusercontent.com/${{ variables.CI_REPO }}/refs/heads/${{ variables.CI_BRANCH }}/ci/shared/matrix/github.json
matrix=$(cat github.json | jq '.matrix')
echo "##vso[task.setvariable variable=runner]$matrix"
wget https://raw.githubusercontent.com/${{ variables.CI_REPO }}/refs/heads/${{ variables.CI_BRANCH }}/ci/shared/matrix/azure.json
matrix=$(cat azure.json | jq '.matrix')
echo "##vso[task.setvariable variable=runner;isOutput=true]$matrix"
displayName: 'Retrieve Setup matrix'
name: getMatrixStep
- job: b
- job: setup
dependsOn: getMatrix
strategy:
matrix: ${{ variables.runner }}
matrix: $[ dependencies.getMatrix.outputs['getMatrixStep.runner'] | jq ]
pool:
vmImage: $(runs-on)
steps:
- bash: echo 'Hello !'
displayName: 'Matrix environment'
displayName: 'Setup dependencies'
10 changes: 9 additions & 1 deletion ci/build-matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
import copy
import os
import json
import re

from typing import Union
from util import resolve_conf
import yaml

Expand All @@ -22,7 +24,7 @@ def generate(self):
runners = [runner for runner in config.get("runners")
if runner.get("type") == runner_type]

matrix = []
matrix: Union[dict,list] = []
for runner in runners:
matrix_item = {
"label": runner.get("label"),
Expand All @@ -38,6 +40,7 @@ def generate(self):
if setup is None:
raise RuntimeError(f"Setup not found {runner.get('setup')}")
matrix_item["setup"] = runner.get("setup")
matrix_item["name"] = runner.get("setup")

elif runner.get("image") is not None:
image_name = (runner.get("image", {}).get("repository", "") + ":"
Expand All @@ -56,11 +59,16 @@ def generate(self):
if matrix_item["label"] is None:
matrix_item["label"] = image.get("label")

matrix_item["name"] = image.get("tag").replace('-', '_')

if matrix_item["label"] is None:
matrix_item["label"] = setup.get("label")

matrix.append(matrix_item)

if runner_type == "azure":
matrix = { re.sub('[^0-9a-zA-Z]+', '-', v.get("name")):v for v in matrix }

data = json.dumps({
"_comment": "This file has been generated. Please do not edit",
"matrix": matrix}, indent=2)
Expand Down
6 changes: 5 additions & 1 deletion ci/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,6 @@ images:


runners:

# no docker image
-
type: github
Expand All @@ -415,6 +414,11 @@ runners:
runs-on: ubuntu-latest
image: { repository: *docker-repository, tag: amd64-alpine-clang-13-clang-13-cpp }

-
type: azure
runs-on: ubuntu-latest
image: { repository: *docker-repository, tag: amd64-alpine-clang-13-clang-13-cpp }

# intel
-
type: github
Expand Down
9 changes: 8 additions & 1 deletion ci/shared/matrix/azure.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
{
"_comment": "This file has been generated. Please do not edit",
"matrix": []
"matrix": {
"amd64-alpine-clang-13-clang-13-cpp": {
"label": "alpine-3.16, clang-13, mpich",
"runs-on": "ubuntu-latest",
"image": "lifflander1/vt:amd64-alpine-clang-13-clang-13-cpp",
"name": "amd64_alpine_clang_13_clang_13_cpp"
}
}
}
57 changes: 38 additions & 19 deletions ci/shared/matrix/github.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,97 +4,116 @@
{
"label": "macos-14-arm64, clang-14, mpich",
"runs-on": "macos-14",
"setup": "arm64-macos-14-clang-14-clang-14-cpp"
"setup": "arm64-macos-14-clang-14-clang-14-cpp",
"name": "arm64-macos-14-clang-14-clang-14-cpp"
},
{
"label": "alpine-3.16, clang-13, mpich",
"runs-on": "ubuntu-latest",
"image": "lifflander1/vt:amd64-alpine-clang-13-clang-13-cpp"
"image": "lifflander1/vt:amd64-alpine-clang-13-clang-13-cpp",
"name": "amd64_alpine_clang_13_clang_13_cpp"
},
{
"label": "intel icpc, ubuntu, mpich",
"runs-on": "ubuntu-20.04",
"image": "lifflander1/vt:amd64-ubuntu-20.04-icpc-icpc-cpp"
"image": "lifflander1/vt:amd64-ubuntu-20.04-icpc-icpc-cpp",
"name": "amd64_ubuntu_20.04_icpc_icpc_cpp"
},
{
"label": "intel icpx, ubuntu, mpich",
"runs-on": "ubuntu-20.04",
"image": "lifflander1/vt:amd64-ubuntu-20.04-icpx-icpx-cpp"
"image": "lifflander1/vt:amd64-ubuntu-20.04-icpx-icpx-cpp",
"name": "amd64_ubuntu_20.04_icpx_icpx_cpp"
},
{
"label": "gcc-8, ubuntu, mpich",
"runs-on": "ubuntu-18.04",
"image": "lifflander1/vt:amd64-ubuntu-18.04-gcc-8-gcc-8-cpp"
"image": "lifflander1/vt:amd64-ubuntu-18.04-gcc-8-gcc-8-cpp",
"name": "amd64_ubuntu_18.04_gcc_8_gcc_8_cpp"
},
{
"label": "gcc-9, ubuntu, mpich",
"runs-on": "ubuntu-20.04",
"image": "lifflander1/vt:amd64-ubuntu-20.04-gcc-9-gcc-9-cpp"
"image": "lifflander1/vt:amd64-ubuntu-20.04-gcc-9-gcc-9-cpp",
"name": "amd64_ubuntu_20.04_gcc_9_gcc_9_cpp"
},
{
"label": "gcc-10, ubuntu, openmpi",
"runs-on": "ubuntu-20.04",
"image": "lifflander1/vt:amd64-ubuntu-20.04-gcc-10-gcc-10-openmpi-cpp"
"image": "lifflander1/vt:amd64-ubuntu-20.04-gcc-10-gcc-10-openmpi-cpp",
"name": "amd64_ubuntu_20.04_gcc_10_gcc_10_openmpi_cpp"
},
{
"label": "gcc-11, ubuntu, mpich",
"runs-on": "ubuntu-22.04",
"image": "lifflander1/vt:amd64-ubuntu-22.04-gcc-11-gcc-11-cpp"
"image": "lifflander1/vt:amd64-ubuntu-22.04-gcc-11-gcc-11-cpp",
"name": "amd64_ubuntu_22.04_gcc_11_gcc_11_cpp"
},
{
"label": "gcc-12, ubuntu, mpich",
"runs-on": "ubuntu-22.04",
"image": "lifflander1/vt:amd64-ubuntu-22.04-gcc-12-gcc-12-cpp"
"image": "lifflander1/vt:amd64-ubuntu-22.04-gcc-12-gcc-12-cpp",
"name": "amd64_ubuntu_22.04_gcc_12_gcc_12_cpp"
},
{
"label": "gcc-12, ubuntu, mpich, vtk",
"runs-on": "ubuntu-22.04",
"image": "lifflander1/vt:amd64-ubuntu-22.04-gcc-12-gcc-12-vtk-cpp"
"image": "lifflander1/vt:amd64-ubuntu-22.04-gcc-12-gcc-12-vtk-cpp",
"name": "amd64_ubuntu_22.04_gcc_12_gcc_12_vtk_cpp"
},
{
"label": "nvidia cuda 12.2.0, gcc-9, ubuntu, mpich",
"runs-on": "ubuntu-20.04",
"image": "lifflander1/vt:amd64-ubuntu-20.04-gcc-9-12.2.0-cpp"
"image": "lifflander1/vt:amd64-ubuntu-20.04-gcc-9-12.2.0-cpp",
"name": "amd64_ubuntu_20.04_gcc_9_12.2.0_cpp"
},
{
"label": "nvidia cuda 11.2.0, gcc-9, ubuntu, mpich",
"runs-on": "ubuntu-20.04",
"image": "lifflander1/vt:amd64-ubuntu-20.04-gcc-9-11.2.2-cpp"
"image": "lifflander1/vt:amd64-ubuntu-20.04-gcc-9-11.2.2-cpp",
"name": "amd64_ubuntu_20.04_gcc_9_11.2.2_cpp"
},
{
"label": "clang-9, ubuntu, mpich",
"runs-on": "ubuntu-20.04",
"image": "lifflander1/vt:amd64-ubuntu-20.04-clang-9-clang-9-cpp"
"image": "lifflander1/vt:amd64-ubuntu-20.04-clang-9-clang-9-cpp",
"name": "amd64_ubuntu_20.04_clang_9_clang_9_cpp"
},
{
"label": "clang-10, ubuntu, mpich",
"runs-on": "ubuntu-20.04",
"image": "lifflander1/vt:amd64-ubuntu-20.04-clang-10-clang-10-cpp"
"image": "lifflander1/vt:amd64-ubuntu-20.04-clang-10-clang-10-cpp",
"name": "amd64_ubuntu_20.04_clang_10_clang_10_cpp"
},
{
"label": "clang-11, ubuntu, mpich",
"runs-on": "ubuntu-22.04",
"image": "lifflander1/vt:amd64-ubuntu-22.04-clang-11-clang-11-cpp"
"image": "lifflander1/vt:amd64-ubuntu-22.04-clang-11-clang-11-cpp",
"name": "amd64_ubuntu_22.04_clang_11_clang_11_cpp"
},
{
"label": "clang-12, ubuntu, mpich",
"runs-on": "ubuntu-22.04",
"image": "lifflander1/vt:amd64-ubuntu-22.04-clang-12-clang-12-cpp"
"image": "lifflander1/vt:amd64-ubuntu-22.04-clang-12-clang-12-cpp",
"name": "amd64_ubuntu_22.04_clang_12_clang_12_cpp"
},
{
"label": "clang-13, ubuntu, mpich",
"runs-on": "ubuntu-22.04",
"image": "lifflander1/vt:amd64-ubuntu-22.04-clang-13-clang-13-cpp"
"image": "lifflander1/vt:amd64-ubuntu-22.04-clang-13-clang-13-cpp",
"name": "amd64_ubuntu_22.04_clang_13_clang_13_cpp"
},
{
"label": "clang-14, ubuntu, mpich",
"runs-on": "ubuntu-22.04",
"image": "lifflander1/vt:amd64-ubuntu-22.04-clang-14-clang-14-cpp"
"image": "lifflander1/vt:amd64-ubuntu-22.04-clang-14-clang-14-cpp",
"name": "amd64_ubuntu_22.04_clang_14_clang_14_cpp"
},
{
"label": "clang-16, ubuntu, mpich",
"runs-on": "ubuntu-22.04",
"image": "lifflander1/vt:amd64-ubuntu-24.04-clang-16-clang-16-cpp"
"image": "lifflander1/vt:amd64-ubuntu-24.04-clang-16-clang-16-cpp",
"name": "amd64_ubuntu_24.04_clang_16_clang_16_cpp"
}
]
}

0 comments on commit 865d1ba

Please sign in to comment.