-
Notifications
You must be signed in to change notification settings - Fork 150
89 lines (75 loc) · 3.28 KB
/
ci_timing.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# This workflow uses GitHub CLI to get timings of last 50 runs of Concrete-ML main CI
# and send it to slack and add it as an artifact on the workflow
name: CML build time
on:
workflow_dispatch:
schedule:
# * is a special character in YAML so you have to quote this string
# At 22:00 on Sunday
# Timezone is UTC, so Paris time is +2 during the summer and +1 during winter
- cron: '0 22 * * 0'
env:
ACTION_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
AGENT_TOOLSDIRECTORY: /opt/hostedtoolcache
RUNNER_TOOL_CACHE: /opt/hostedtoolcache
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
publish-timings:
# Using the regular Ubuntu 20.04 version recently started to raise related to grub-efi-amd64-signed
# More info : https://github.com/orgs/community/discussions/47863
runs-on: ubuntu-22.04
steps:
- name: Add masks
run: |
echo "::add-mask::${{ secrets.INTERNAL_PYPI_URL_FOR_MASK }}"
echo "::add-mask::${{ secrets.INTERNAL_REPO_URL_FOR_MASK }}"
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b
id: setup-python
with:
python-version: 3.8
- name: Install dependencies
env:
SYSTEM_VERSION_COMPAT: 0
run: |
sudo apt update
# We need to freeze docker.io because its update requires user input
sudo apt-mark hold docker.io
sudo ./script/make_utils/setup_os_deps.sh
make setup_env
- name: Generate figure
run: |
poetry run python ./script/actions_utils/monitor.py
- name: Archive figure
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882
with:
name: cml_ci_time_evolution.png
path: cml_ci_time_evolution.png
- name: Archive raw data
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882
with:
name: github_ci_data.json
path: github_ci_data.json
- name: Archive data used for figure
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882
with:
name: github_ci_data.csv
path: github_ci_data.csv
- name: Slack Notification
if: ${{ success() }}
continue-on-error: true
uses: rtCamp/action-slack-notify@c33737706dea87cd7784c687dadc9adf1be59990
env:
SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }}
SLACK_ICON: https://pbs.twimg.com/profile_images/1274014582265298945/OjBKP9kn_400x400.png
SLACK_COLOR: ${{ job.status }}
SLACK_MESSAGE: "CML-CI timings over last 4 weeks available at: (${{ env.ACTION_RUN_URL }})"
SLACK_USERNAME: ${{ secrets.BOT_USERNAME }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
- name: Upload figure to Slack
run: |
curl -F file=@cml_ci_time_evolution.png -F "initial_comment=CML CI time evolution (over last 4 weeks)" -F channels=${{ secrets.CML_INTERNAL_UPDATE_SLACK_CHANNEL_ID }} -H "Authorization: Bearer ${{ secrets.SLACK_CI_MONITORING_BOT_TOKEN }}" https://slack.com/api/files.upload