-
Notifications
You must be signed in to change notification settings - Fork 0
/
parslconfig.py
60 lines (52 loc) · 2.25 KB
/
parslconfig.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
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
from parsl.config import Config
from parsl.executors import HighThroughputExecutor
from parsl.providers import KubernetesProvider
from parsl.addresses import address_by_route
def config_parsl_cluster(
max_blocks=2,
min_blocks=1,
init_blocks=2,
max_workers=1,
cores_per_worker=1,
image='ghcr.io/mbjones/k8sparsl:0.3',
namespace='pdgrun'):
htex_kube = Config(
executors=[
HighThroughputExecutor(
label='kube-htex',
cores_per_worker=cores_per_worker,
max_workers=max_workers,
worker_logdir_root='/',
# Address for the pod worker to connect back
address=address_by_route(),
#address='192.168.0.103',
#address_probe_timeout=3600,
worker_debug=True,
provider=KubernetesProvider(
# Namespace in K8S to use for the run
namespace=namespace,
# Docker image url to use for pods
image=image,
# Command to be run upon pod start, such as:
# 'module load Anaconda; source activate parsl_env'.
# or 'pip install parsl'
#worker_init='echo "Worker started..."; lf=`find . -name \'manager.log\'` tail -n+1 -f ${lf}',
worker_init='echo "Worker started..."',
# The secret key to download the image
#secret="YOUR_KUBE_SECRET",
# Should follow the Kubernetes naming rules
pod_name='parsl-worker',
nodes_per_block=1,
init_blocks=init_blocks,
min_blocks=min_blocks,
# Maximum number of pods to scale up
max_blocks=max_blocks,
# persistent_volumes (list[(str, str)]) – List of tuples
# describing persistent volumes to be mounted in the pod.
# The tuples consist of (PVC Name, Mount Directory).
# persistent_volumes=[('mypvc','/var/data')]
),
),
]
)
return(htex_kube)