-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (79 loc) · 2.5 KB
/
process-special-event.yml
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
88
89
90
91
name: Process Special Event
on:
workflow_dispatch:
inputs:
event-details-json-string:
description: "Event details (see EventIngestionModel in cdp-backend) in JSON string form. The string must be free of any newline or tab characters."
required: true
permissions:
id-token: write
contents: write
pull-requests: write
jobs:
deploy-runner-on-gcp:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup CML
uses: iterative/setup-cml@v1
- name: Create Runner
env:
REPO_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
GOOGLE_APPLICATION_CREDENTIALS_DATA: ${{ secrets.GOOGLE_CREDENTIALS }}
run: |
cml runner \
--single \
--labels=gcp-cdp-runner \
--cloud=gcp \
--cloud-region=us-central1-f \
--cloud-type=n1-standard-4 \
--cloud-gpu=nvidia-tesla-t4 \
--cloud-hdd-size=30 \
--idle-timeout=600
process-events:
needs: [deploy-runner-on-gcp]
runs-on: [self-hosted, gcp-cdp-runner]
container:
image: ghcr.io/iterative/cml:0-dvc2-base1-gpu
options: --gpus all
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Check GPU Drivers
run: |
nvidia-smi
- name: Install Packages
run: |
sudo apt update
sudo apt-get install -y --no-install-recommends \
libsndfile1 \
ffmpeg
- name: Install Python Dependencies
run: |
cd python/
pip install --upgrade pip
pip install .
- name: Setup gcloud
uses: google-github-actions/setup-gcloud@v0
with:
project_id: cdp-milwaukee-9f60e352
service_account_key: ${{ secrets.GOOGLE_CREDENTIALS }}
export_default_credentials: true
- name: Dump Credentials to JSON
uses: jsdaniell/[email protected]
with:
name: "google-creds.json"
json: ${{ secrets.GOOGLE_CREDENTIALS }}
dir: "python/"
- name: Dump Event Details to JSON
run: |
echo ${{ github.event.inputs.event-details-json-string }} > python/event-details.json
- name: Process special events into event gather pipeline
if: ${{ github.event_name == 'workflow_dispatch' }}
run: |
cd python/
process_special_event \
--event_details_file event-details.json \
--event_gather_config_file event-gather-config.json