Skip to content

Sweetspot recalibration for qw11q #99

Sweetspot recalibration for qw11q

Sweetspot recalibration for qw11q #99

Workflow file for this run

# CI workflow that runs on self hosted cluster
name: Self-hosted rules
on:
pull_request:
types: [labeled]
workflow_dispatch:
jobs:
prepare:
if: contains(join(github.event.pull_request.labels.*.name), 'run-on')
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Read platforms from labels
id: set-matrix
env:
LABELS: ${{ toJSON(github.event.pull_request.labels.*.name) }}
run: |
echo $LABELS
platforms="["
combined=""
shopt -s lastpipe
jq -c '.[]' <<< "$LABELS" | while read label; do
platform=(${label//-/ })
if [ ${platform[0]} == "\"run" ] && [ ${platform[1]} == "on" ]; then
platforms+="${combined:+,}\"${platform[2]}"
combined=${platforms}
fi
done
platforms+="]"
echo ${platforms}
echo matrix="${platforms}" >> $GITHUB_OUTPUT
tests:
needs: prepare
strategy:
matrix:
platform: ${{ fromJSON(needs.prepare.outputs.matrix) }}
version: ["main"]
fail-fast: false
runs-on: self-hosted
steps:
- name: Cleanup workspace manually
run: |
rm -rf _work/*
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python-version }}
- name: Install and configure poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: false
- name: Install qibo stable
if: ${{ matrix.version == 'stable' }}
run: |
python -m venv testenv
source testenv/bin/activate
python -m pip install qibolab qibocal
- name: Install qibo main
if: ${{ matrix.version == 'main' }}
run: |
python -m venv testenv
source testenv/bin/activate
git clone https://github.com/qiboteam/qibolab
git clone https://github.com/qiboteam/qibocal
cd qibocal
poetry install --no-interaction
cd ../qibolab
poetry install --no-interaction --all-extras
cd ..
- name: Execute on ${{ matrix.platform }}
run: |
queues=`cat queues.json`
platform=${{ matrix.platform }}
source testenv/bin/activate
export QIBOLAB_PLATFORMS=.
partition="$(jq -r -n --argjson data "$queues" '$data.'$platform)"
srun -p $partition python _selfhosted/calibration.py ${{ matrix.platform }}
- name: Notify the Pull Request
uses: thollander/actions-comment-pull-request@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
filePath: message.txt