-
Notifications
You must be signed in to change notification settings - Fork 0
/
launch.py
31 lines (27 loc) · 1.16 KB
/
launch.py
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
import csv
import os
from domino import Domino
project = str(os.environ['DOMINO_PROJECT_OWNER'] + "/" + os.environ['DOMINO_PROJECT_NAME'])
# Tell Domino which project to start the jobs in in the format "<username>/<project_name>"
# https://docs.dominodatalab.com/en/latest/api_guide/c5ef26/the-python-domino-library/#_example
domino = Domino(project)
with open("./job_hardware_tiers.csv", 'r') as f:
hardware_tiers_csv = csv.reader(f)
for row in hardware_tiers_csv:
job_number = str(row[0])
# python-domino uses the hardware tier's display name
hardware_tier = str(row[1]).strip()
job_title = str("Parallel R " + job_number)
command = str("aio.R " + job_number)
# Use python-domino's job_start function
# https://docs.dominodatalab.com/en/latest/api_guide/c5ef26/the-python-domino-library/#_jobs
domino.job_start(
command,
hardware_tier_name=hardware_tier,
title=job_title,
#commit_id=None,
#environment_id=None,
#on_demand_spark_cluster_properties=None,
#compute_cluster_properties=None,
#external_volume_mounts=None
)