-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_job.py
28 lines (21 loc) · 805 Bytes
/
run_job.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
"""
This script demonstrates how to install software and conda evnironment on a TPU
pod. You can run this setup with the following tpc command:
tpc upload+launch run_job.py
"""
# Defines the bash script that will be executed on the TPU instance to set up
# the environment.
launch_script = r"""#! /bin/bash
source ~/miniforge3/bin/activate mintext
python /path/to/my/python/job.py
read # This will pause the script so tmux session will not close immediately
"""
# Specify all the parameters to TPC via the configure_tpc function
# Change these acchording to your project and zone and TPU pod name
configure_tpc( # type: ignore
project='my-gcp-project',
zone='europe-west4-b',
name='my-tpu-pod',
upload_path='/path/to/my/data:/path/to/remote/data',
launch_script=launch_script,
)