cars 1.0.0rc1__cp313-cp313-musllinux_1_2_i686.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of cars might be problematic. Click here for more details.
- cars/__init__.py +74 -0
- cars/applications/__init__.py +37 -0
- cars/applications/application.py +117 -0
- cars/applications/application_constants.py +29 -0
- cars/applications/application_template.py +146 -0
- cars/applications/auxiliary_filling/__init__.py +29 -0
- cars/applications/auxiliary_filling/abstract_auxiliary_filling_app.py +104 -0
- cars/applications/auxiliary_filling/auxiliary_filling_algo.py +475 -0
- cars/applications/auxiliary_filling/auxiliary_filling_from_sensors_app.py +630 -0
- cars/applications/auxiliary_filling/auxiliary_filling_wrappers.py +90 -0
- cars/applications/dem_generation/__init__.py +30 -0
- cars/applications/dem_generation/abstract_dem_generation_app.py +116 -0
- cars/applications/dem_generation/bulldozer_config/base_config.yaml +42 -0
- cars/applications/dem_generation/bulldozer_dem_app.py +655 -0
- cars/applications/dem_generation/bulldozer_memory.py +55 -0
- cars/applications/dem_generation/dem_generation_algo.py +107 -0
- cars/applications/dem_generation/dem_generation_constants.py +32 -0
- cars/applications/dem_generation/dem_generation_wrappers.py +323 -0
- cars/applications/dense_match_filling/__init__.py +30 -0
- cars/applications/dense_match_filling/abstract_dense_match_filling_app.py +242 -0
- cars/applications/dense_match_filling/fill_disp_algo.py +113 -0
- cars/applications/dense_match_filling/fill_disp_constants.py +39 -0
- cars/applications/dense_match_filling/fill_disp_wrappers.py +83 -0
- cars/applications/dense_match_filling/zero_padding_app.py +302 -0
- cars/applications/dense_matching/__init__.py +30 -0
- cars/applications/dense_matching/abstract_dense_matching_app.py +261 -0
- cars/applications/dense_matching/census_mccnn_sgm_app.py +1460 -0
- cars/applications/dense_matching/cpp/__init__.py +0 -0
- cars/applications/dense_matching/cpp/dense_matching_cpp.cpython-313-i386-linux-musl.so +0 -0
- cars/applications/dense_matching/cpp/dense_matching_cpp.py +94 -0
- cars/applications/dense_matching/cpp/includes/dense_matching.hpp +58 -0
- cars/applications/dense_matching/cpp/meson.build +9 -0
- cars/applications/dense_matching/cpp/src/bindings.cpp +13 -0
- cars/applications/dense_matching/cpp/src/dense_matching.cpp +207 -0
- cars/applications/dense_matching/dense_matching_algo.py +401 -0
- cars/applications/dense_matching/dense_matching_constants.py +89 -0
- cars/applications/dense_matching/dense_matching_wrappers.py +951 -0
- cars/applications/dense_matching/disparity_grid_algo.py +588 -0
- cars/applications/dense_matching/loaders/__init__.py +23 -0
- cars/applications/dense_matching/loaders/config_census_sgm_default.json +31 -0
- cars/applications/dense_matching/loaders/config_census_sgm_homogeneous.json +30 -0
- cars/applications/dense_matching/loaders/config_census_sgm_mountain_and_vegetation.json +30 -0
- cars/applications/dense_matching/loaders/config_census_sgm_shadow.json +30 -0
- cars/applications/dense_matching/loaders/config_census_sgm_sparse.json +36 -0
- cars/applications/dense_matching/loaders/config_census_sgm_urban.json +30 -0
- cars/applications/dense_matching/loaders/config_mapping.json +13 -0
- cars/applications/dense_matching/loaders/config_mccnn.json +28 -0
- cars/applications/dense_matching/loaders/global_land_cover_map.tif +0 -0
- cars/applications/dense_matching/loaders/pandora_loader.py +593 -0
- cars/applications/dsm_filling/__init__.py +32 -0
- cars/applications/dsm_filling/abstract_dsm_filling_app.py +101 -0
- cars/applications/dsm_filling/border_interpolation_app.py +270 -0
- cars/applications/dsm_filling/bulldozer_config/base_config.yaml +44 -0
- cars/applications/dsm_filling/bulldozer_filling_app.py +279 -0
- cars/applications/dsm_filling/exogenous_filling_app.py +333 -0
- cars/applications/grid_generation/__init__.py +30 -0
- cars/applications/grid_generation/abstract_grid_generation_app.py +142 -0
- cars/applications/grid_generation/epipolar_grid_generation_app.py +327 -0
- cars/applications/grid_generation/grid_correction_app.py +496 -0
- cars/applications/grid_generation/grid_generation_algo.py +388 -0
- cars/applications/grid_generation/grid_generation_constants.py +46 -0
- cars/applications/grid_generation/transform_grid.py +88 -0
- cars/applications/ground_truth_reprojection/__init__.py +30 -0
- cars/applications/ground_truth_reprojection/abstract_ground_truth_reprojection_app.py +137 -0
- cars/applications/ground_truth_reprojection/direct_localization_app.py +629 -0
- cars/applications/ground_truth_reprojection/ground_truth_reprojection_algo.py +275 -0
- cars/applications/point_cloud_outlier_removal/__init__.py +30 -0
- cars/applications/point_cloud_outlier_removal/abstract_outlier_removal_app.py +385 -0
- cars/applications/point_cloud_outlier_removal/outlier_removal_algo.py +392 -0
- cars/applications/point_cloud_outlier_removal/outlier_removal_constants.py +43 -0
- cars/applications/point_cloud_outlier_removal/small_components_app.py +527 -0
- cars/applications/point_cloud_outlier_removal/statistical_app.py +531 -0
- cars/applications/rasterization/__init__.py +30 -0
- cars/applications/rasterization/abstract_pc_rasterization_app.py +183 -0
- cars/applications/rasterization/rasterization_algo.py +534 -0
- cars/applications/rasterization/rasterization_constants.py +38 -0
- cars/applications/rasterization/rasterization_wrappers.py +634 -0
- cars/applications/rasterization/simple_gaussian_app.py +1152 -0
- cars/applications/resampling/__init__.py +28 -0
- cars/applications/resampling/abstract_resampling_app.py +187 -0
- cars/applications/resampling/bicubic_resampling_app.py +762 -0
- cars/applications/resampling/resampling_algo.py +614 -0
- cars/applications/resampling/resampling_constants.py +36 -0
- cars/applications/resampling/resampling_wrappers.py +309 -0
- cars/applications/sparse_matching/__init__.py +30 -0
- cars/applications/sparse_matching/abstract_sparse_matching_app.py +498 -0
- cars/applications/sparse_matching/sift_app.py +735 -0
- cars/applications/sparse_matching/sparse_matching_algo.py +360 -0
- cars/applications/sparse_matching/sparse_matching_constants.py +68 -0
- cars/applications/sparse_matching/sparse_matching_wrappers.py +238 -0
- cars/applications/triangulation/__init__.py +32 -0
- cars/applications/triangulation/abstract_triangulation_app.py +227 -0
- cars/applications/triangulation/line_of_sight_intersection_app.py +1243 -0
- cars/applications/triangulation/pc_transform.py +552 -0
- cars/applications/triangulation/triangulation_algo.py +371 -0
- cars/applications/triangulation/triangulation_constants.py +38 -0
- cars/applications/triangulation/triangulation_wrappers.py +259 -0
- cars/bundleadjustment.py +757 -0
- cars/cars.py +177 -0
- cars/conf/__init__.py +23 -0
- cars/conf/geoid/egm96.grd +0 -0
- cars/conf/geoid/egm96.grd.hdr +15 -0
- cars/conf/input_parameters.py +156 -0
- cars/conf/mask_cst.py +35 -0
- cars/core/__init__.py +23 -0
- cars/core/cars_logging.py +402 -0
- cars/core/constants.py +191 -0
- cars/core/constants_disparity.py +50 -0
- cars/core/datasets.py +140 -0
- cars/core/geometry/__init__.py +27 -0
- cars/core/geometry/abstract_geometry.py +1119 -0
- cars/core/geometry/shareloc_geometry.py +598 -0
- cars/core/inputs.py +568 -0
- cars/core/outputs.py +176 -0
- cars/core/preprocessing.py +722 -0
- cars/core/projection.py +843 -0
- cars/core/roi_tools.py +215 -0
- cars/core/tiling.py +774 -0
- cars/core/utils.py +164 -0
- cars/data_structures/__init__.py +23 -0
- cars/data_structures/cars_dataset.py +1541 -0
- cars/data_structures/cars_dict.py +74 -0
- cars/data_structures/corresponding_tiles_tools.py +186 -0
- cars/data_structures/dataframe_converter.py +185 -0
- cars/data_structures/format_transformation.py +297 -0
- cars/devibrate.py +689 -0
- cars/extractroi.py +264 -0
- cars/orchestrator/__init__.py +23 -0
- cars/orchestrator/achievement_tracker.py +125 -0
- cars/orchestrator/cluster/__init__.py +37 -0
- cars/orchestrator/cluster/abstract_cluster.py +244 -0
- cars/orchestrator/cluster/abstract_dask_cluster.py +375 -0
- cars/orchestrator/cluster/dask_cluster_tools.py +103 -0
- cars/orchestrator/cluster/dask_config/README.md +94 -0
- cars/orchestrator/cluster/dask_config/dask.yaml +21 -0
- cars/orchestrator/cluster/dask_config/distributed.yaml +70 -0
- cars/orchestrator/cluster/dask_config/jobqueue.yaml +26 -0
- cars/orchestrator/cluster/dask_config/reference_confs/dask-schema.yaml +137 -0
- cars/orchestrator/cluster/dask_config/reference_confs/dask.yaml +26 -0
- cars/orchestrator/cluster/dask_config/reference_confs/distributed-schema.yaml +1009 -0
- cars/orchestrator/cluster/dask_config/reference_confs/distributed.yaml +273 -0
- cars/orchestrator/cluster/dask_config/reference_confs/jobqueue.yaml +212 -0
- cars/orchestrator/cluster/dask_jobqueue_utils.py +204 -0
- cars/orchestrator/cluster/local_dask_cluster.py +116 -0
- cars/orchestrator/cluster/log_wrapper.py +1075 -0
- cars/orchestrator/cluster/mp_cluster/__init__.py +27 -0
- cars/orchestrator/cluster/mp_cluster/mp_factorizer.py +212 -0
- cars/orchestrator/cluster/mp_cluster/mp_objects.py +535 -0
- cars/orchestrator/cluster/mp_cluster/mp_tools.py +93 -0
- cars/orchestrator/cluster/mp_cluster/mp_wrapper.py +505 -0
- cars/orchestrator/cluster/mp_cluster/multiprocessing_cluster.py +873 -0
- cars/orchestrator/cluster/mp_cluster/multiprocessing_profiler.py +399 -0
- cars/orchestrator/cluster/pbs_dask_cluster.py +207 -0
- cars/orchestrator/cluster/sequential_cluster.py +139 -0
- cars/orchestrator/cluster/slurm_dask_cluster.py +234 -0
- cars/orchestrator/orchestrator.py +905 -0
- cars/orchestrator/orchestrator_constants.py +29 -0
- cars/orchestrator/registry/__init__.py +23 -0
- cars/orchestrator/registry/abstract_registry.py +143 -0
- cars/orchestrator/registry/compute_registry.py +106 -0
- cars/orchestrator/registry/id_generator.py +116 -0
- cars/orchestrator/registry/replacer_registry.py +213 -0
- cars/orchestrator/registry/saver_registry.py +363 -0
- cars/orchestrator/registry/unseen_registry.py +118 -0
- cars/orchestrator/tiles_profiler.py +279 -0
- cars/pipelines/__init__.py +26 -0
- cars/pipelines/conf_resolution/conf_final_resolution.yaml +5 -0
- cars/pipelines/conf_resolution/conf_first_resolution.yaml +2 -0
- cars/pipelines/conf_resolution/conf_intermediate_resolution.yaml +2 -0
- cars/pipelines/default/__init__.py +26 -0
- cars/pipelines/default/default_pipeline.py +786 -0
- cars/pipelines/parameters/__init__.py +0 -0
- cars/pipelines/parameters/advanced_parameters.py +417 -0
- cars/pipelines/parameters/advanced_parameters_constants.py +69 -0
- cars/pipelines/parameters/application_parameters.py +71 -0
- cars/pipelines/parameters/depth_map_inputs.py +0 -0
- cars/pipelines/parameters/dsm_inputs.py +918 -0
- cars/pipelines/parameters/dsm_inputs_constants.py +25 -0
- cars/pipelines/parameters/output_constants.py +52 -0
- cars/pipelines/parameters/output_parameters.py +454 -0
- cars/pipelines/parameters/sensor_inputs.py +842 -0
- cars/pipelines/parameters/sensor_inputs_constants.py +49 -0
- cars/pipelines/parameters/sensor_loaders/__init__.py +29 -0
- cars/pipelines/parameters/sensor_loaders/basic_classif_loader.py +86 -0
- cars/pipelines/parameters/sensor_loaders/basic_image_loader.py +98 -0
- cars/pipelines/parameters/sensor_loaders/pivot_classif_loader.py +90 -0
- cars/pipelines/parameters/sensor_loaders/pivot_image_loader.py +105 -0
- cars/pipelines/parameters/sensor_loaders/sensor_loader.py +93 -0
- cars/pipelines/parameters/sensor_loaders/sensor_loader_template.py +71 -0
- cars/pipelines/parameters/sensor_loaders/slurp_classif_loader.py +86 -0
- cars/pipelines/pipeline.py +119 -0
- cars/pipelines/pipeline_constants.py +31 -0
- cars/pipelines/pipeline_template.py +139 -0
- cars/pipelines/unit/__init__.py +26 -0
- cars/pipelines/unit/unit_pipeline.py +2850 -0
- cars/starter.py +167 -0
- cars-1.0.0rc1.dist-info/METADATA +292 -0
- cars-1.0.0rc1.dist-info/RECORD +202 -0
- cars-1.0.0rc1.dist-info/WHEEL +5 -0
- cars-1.0.0rc1.dist-info/entry_points.txt +8 -0
- cars.libs/libgcc_s-1257a076.so.1 +0 -0
- cars.libs/libstdc++-0530927c.so.6.0.32 +0 -0
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
distributed:
|
|
2
|
+
version: 2
|
|
3
|
+
# logging:
|
|
4
|
+
# distributed: info
|
|
5
|
+
# distributed.client: warning
|
|
6
|
+
# bokeh: critical
|
|
7
|
+
# # http://stackoverflow.com/questions/21234772/python-tornado-disable-logging-to-stderr
|
|
8
|
+
# tornado: critical
|
|
9
|
+
# tornado.application: error
|
|
10
|
+
|
|
11
|
+
scheduler:
|
|
12
|
+
allowed-failures: 3 # number of retries before a task is considered bad
|
|
13
|
+
bandwidth: 100000000 # 100 MB/s estimated worker-worker bandwidth
|
|
14
|
+
blocked-handlers: []
|
|
15
|
+
default-data-size: 1kiB
|
|
16
|
+
# Number of seconds to wait until workers or clients are removed from the events log
|
|
17
|
+
# after they have been removed from the scheduler
|
|
18
|
+
events-cleanup-delay: 1h
|
|
19
|
+
idle-timeout: null # Shut down after this duration, like "1h" or "30 minutes"
|
|
20
|
+
transition-log-length: 100000
|
|
21
|
+
events-log-length: 100000
|
|
22
|
+
work-stealing: True # workers should steal tasks from each other
|
|
23
|
+
work-stealing-interval: 100ms # Callback time for work stealing
|
|
24
|
+
worker-ttl: null # like '60s'. Time to live for workers. They must heartbeat faster than this
|
|
25
|
+
pickle: True # Is the scheduler allowed to deserialize arbitrary bytestrings
|
|
26
|
+
preload: [] # Run custom modules with Scheduler
|
|
27
|
+
preload-argv: [] # See https://docs.dask.org/en/latest/setup/custom-startup.html
|
|
28
|
+
unknown-task-duration: 500ms # Default duration for all tasks with unknown durations ("15m", "2h")
|
|
29
|
+
default-task-durations: # How long we expect function names to run ("1h", "1s") (helps for long tasks)
|
|
30
|
+
rechunk-split: 1us
|
|
31
|
+
split-shuffle: 1us
|
|
32
|
+
validate: False # Check scheduler state at every step for debugging
|
|
33
|
+
dashboard:
|
|
34
|
+
status:
|
|
35
|
+
task-stream-length: 1000
|
|
36
|
+
tasks:
|
|
37
|
+
task-stream-length: 100000
|
|
38
|
+
tls:
|
|
39
|
+
ca-file: null
|
|
40
|
+
key: null
|
|
41
|
+
cert: null
|
|
42
|
+
bokeh-application: # keywords to pass to BokehTornado application
|
|
43
|
+
allow_websocket_origin: ["*"]
|
|
44
|
+
keep_alive_milliseconds: 500
|
|
45
|
+
check_unused_sessions_milliseconds: 500
|
|
46
|
+
locks:
|
|
47
|
+
lease-validation-interval: 10s # The interval in which the scheduler validates staleness of all acquired leases. Must always be smaller than the lease-timeout itself.
|
|
48
|
+
lease-timeout: 30s # Maximum interval to wait for a Client refresh before a lease is invalidated and released.
|
|
49
|
+
|
|
50
|
+
http:
|
|
51
|
+
routes:
|
|
52
|
+
- distributed.http.scheduler.prometheus
|
|
53
|
+
- distributed.http.scheduler.info
|
|
54
|
+
- distributed.http.scheduler.json
|
|
55
|
+
- distributed.http.health
|
|
56
|
+
- distributed.http.proxy
|
|
57
|
+
- distributed.http.statics
|
|
58
|
+
|
|
59
|
+
allowed-imports:
|
|
60
|
+
- dask
|
|
61
|
+
- distributed
|
|
62
|
+
|
|
63
|
+
active-memory-manager:
|
|
64
|
+
# Set to true to auto-start the Active Memory Manager on Scheduler start; if false
|
|
65
|
+
# you'll have to either manually start it with client.amm.start() or run it once
|
|
66
|
+
# with client.amm.run_once().
|
|
67
|
+
start: false
|
|
68
|
+
# Once started, run the AMM cycle every <interval>
|
|
69
|
+
interval: 2s
|
|
70
|
+
policies:
|
|
71
|
+
# Policies that should be executed at every cycle. Any additional keys in each
|
|
72
|
+
# object are passed as keyword arguments to the policy constructor.
|
|
73
|
+
- class: distributed.active_memory_manager.ReduceReplicas
|
|
74
|
+
|
|
75
|
+
worker:
|
|
76
|
+
blocked-handlers: []
|
|
77
|
+
multiprocessing-method: spawn
|
|
78
|
+
use-file-locking: True
|
|
79
|
+
connections: # Maximum concurrent connections for data
|
|
80
|
+
outgoing: 50 # This helps to control network saturation
|
|
81
|
+
incoming: 10
|
|
82
|
+
preload: [] # Run custom modules with Worker
|
|
83
|
+
preload-argv: [] # See https://docs.dask.org/en/latest/setup/custom-startup.html
|
|
84
|
+
daemon: True
|
|
85
|
+
validate: False # Check worker state at every step for debugging
|
|
86
|
+
resources: {} # Key: value pairs specifying worker resources.
|
|
87
|
+
lifetime:
|
|
88
|
+
duration: null # Time after which to gracefully shutdown the worker
|
|
89
|
+
stagger: 0 seconds # Random amount by which to stagger lifetimes
|
|
90
|
+
restart: False # Do we ressurrect the worker after the lifetime deadline?
|
|
91
|
+
|
|
92
|
+
profile:
|
|
93
|
+
interval: 10ms # Time between statistical profiling queries
|
|
94
|
+
cycle: 1000ms # Time between starting new profile
|
|
95
|
+
low-level: False # Whether or not to include low-level functions
|
|
96
|
+
# Requires https://github.com/numba/stacktrace
|
|
97
|
+
|
|
98
|
+
memory:
|
|
99
|
+
# When there is an increase in process memory (as observed by the operating
|
|
100
|
+
# system) that is not accounted for by the dask keys stored on the worker, ignore
|
|
101
|
+
# it for this long before considering it in non-critical memory measures.
|
|
102
|
+
# This should be set to be longer than the duration of most dask tasks.
|
|
103
|
+
recent-to-old-time: 30s
|
|
104
|
+
|
|
105
|
+
rebalance:
|
|
106
|
+
# Memory measure to rebalance upon. Possible choices are:
|
|
107
|
+
# process
|
|
108
|
+
# Total process memory, as measured by the OS.
|
|
109
|
+
# optimistic
|
|
110
|
+
# Managed by dask (instantaneous) + unmanaged (without any increases
|
|
111
|
+
# happened in the last <distributed.worker.memory.recent-to-old-time>).
|
|
112
|
+
# Recommended for use on CPython with large (2MiB+) numpy-based data chunks.
|
|
113
|
+
# managed_in_memory
|
|
114
|
+
# Only consider the data allocated by dask in RAM. Recommended if RAM is not
|
|
115
|
+
# released in a timely fashion back to the OS after the Python objects are
|
|
116
|
+
# dereferenced, but remains available for reuse by PyMalloc.
|
|
117
|
+
#
|
|
118
|
+
# If this is your problem on Linux, you should alternatively consider
|
|
119
|
+
# setting the MALLOC_TRIM_THRESHOLD_ environment variable (note the final
|
|
120
|
+
# underscore) to a low value; refer to the mallopt man page and to the
|
|
121
|
+
# comments about M_TRIM_THRESHOLD on
|
|
122
|
+
# https://sourceware.org/git/?p=glibc.git;a=blob;f=malloc/malloc.c
|
|
123
|
+
# managed
|
|
124
|
+
# Only consider data allocated by dask, including that spilled to disk.
|
|
125
|
+
# Recommended if disk occupation of the spill file is an issue.
|
|
126
|
+
measure: optimistic
|
|
127
|
+
# Fraction of worker process memory at which we start potentially sending
|
|
128
|
+
# data to other workers. Ignored when max_memory is not set.
|
|
129
|
+
sender-min: 0.30
|
|
130
|
+
# Fraction of worker process memory at which we stop potentially accepting
|
|
131
|
+
# data from other workers. Ignored when max_memory is not set.
|
|
132
|
+
recipient-max: 0.60
|
|
133
|
+
# Fraction of worker process memory, around the cluster mean, where a worker is
|
|
134
|
+
# neither a sender nor a recipient of data during a rebalance operation. E.g. if
|
|
135
|
+
# the mean cluster occupation is 50%, sender-recipient-gap=0.10 means that only
|
|
136
|
+
# nodes above 55% will donate data and only nodes below 45% will receive them.
|
|
137
|
+
# This helps avoid data from bouncing around the cluster repeatedly.
|
|
138
|
+
# Ignored when max_memory is not set.
|
|
139
|
+
sender-recipient-gap: 0.10
|
|
140
|
+
|
|
141
|
+
# Fractions of worker process memory at which we take action to avoid memory
|
|
142
|
+
# blowup. Set any of the values to False to turn off the behavior entirely.
|
|
143
|
+
target: 0.60 # target fraction to stay below
|
|
144
|
+
spill: 0.70 # fraction at which we spill to disk
|
|
145
|
+
pause: 0.80 # fraction at which we pause worker threads
|
|
146
|
+
terminate: 0.95 # fraction at which we terminate the worker
|
|
147
|
+
|
|
148
|
+
http:
|
|
149
|
+
routes:
|
|
150
|
+
- distributed.http.worker.prometheus
|
|
151
|
+
- distributed.http.health
|
|
152
|
+
- distributed.http.statics
|
|
153
|
+
|
|
154
|
+
nanny:
|
|
155
|
+
preload: [] # Run custom modules with Nanny
|
|
156
|
+
preload-argv: [] # See https://docs.dask.org/en/latest/setup/custom-startup.html
|
|
157
|
+
environ:
|
|
158
|
+
MALLOC_TRIM_THRESHOLD_: 0
|
|
159
|
+
OMP_NUM_THREADS: 1
|
|
160
|
+
MKL_NUM_THREADS: 1
|
|
161
|
+
|
|
162
|
+
client:
|
|
163
|
+
heartbeat: 5s # Interval between client heartbeats
|
|
164
|
+
scheduler-info-interval: 2s # Interval between scheduler-info updates
|
|
165
|
+
|
|
166
|
+
deploy:
|
|
167
|
+
lost-worker-timeout: 15s # Interval after which to hard-close a lost worker job
|
|
168
|
+
cluster-repr-interval: 500ms # Interval between calls to update cluster-repr for the widget
|
|
169
|
+
|
|
170
|
+
adaptive:
|
|
171
|
+
interval: 1s # Interval between scaling evaluations
|
|
172
|
+
target-duration: 5s # Time an entire graph calculation is desired to take ("1m", "30m")
|
|
173
|
+
minimum: 0 # Minimum number of workers
|
|
174
|
+
maximum: .inf # Maximum number of workers
|
|
175
|
+
wait-count: 3 # Number of times a worker should be suggested for removal before removing it
|
|
176
|
+
|
|
177
|
+
comm:
|
|
178
|
+
retry: # some operations (such as gathering data) are subject to re-tries with the below parameters
|
|
179
|
+
count: 0 # the maximum retry attempts. 0 disables re-trying.
|
|
180
|
+
delay:
|
|
181
|
+
min: 1s # the first non-zero delay between re-tries
|
|
182
|
+
max: 20s # the maximum delay between re-tries
|
|
183
|
+
compression: auto
|
|
184
|
+
shard: 64MiB
|
|
185
|
+
offload: 10MiB # Size after which we choose to offload serialization to another thread
|
|
186
|
+
default-scheme: tcp
|
|
187
|
+
socket-backlog: 2048
|
|
188
|
+
recent-messages-log-length: 0 # number of messages to keep for debugging
|
|
189
|
+
ucx:
|
|
190
|
+
cuda-copy: null # enable cuda-copy
|
|
191
|
+
tcp: null # enable tcp
|
|
192
|
+
nvlink: null # enable cuda_ipc
|
|
193
|
+
infiniband: null # enable Infiniband
|
|
194
|
+
rdmacm: null # enable RDMACM
|
|
195
|
+
net-devices: null # define what interface to use for UCX comm
|
|
196
|
+
reuse-endpoints: null # enable endpoint reuse
|
|
197
|
+
create-cuda-context: null # create CUDA context before UCX initialization
|
|
198
|
+
|
|
199
|
+
zstd:
|
|
200
|
+
level: 3 # Compression level, between 1 and 22.
|
|
201
|
+
threads: 0 # Threads to use. 0 for single-threaded, -1 to infer from cpu count.
|
|
202
|
+
|
|
203
|
+
timeouts:
|
|
204
|
+
connect: 30s # time before connecting fails
|
|
205
|
+
tcp: 30s # time before calling an unresponsive connection dead
|
|
206
|
+
|
|
207
|
+
require-encryption: null # Whether to require encryption on non-local comms
|
|
208
|
+
|
|
209
|
+
tls:
|
|
210
|
+
ciphers: null # Allowed ciphers, specified as an OpenSSL cipher string.
|
|
211
|
+
min-version: 1.2 # The minimum TLS version supported.
|
|
212
|
+
max-version: null # The maximum TLS version supported.
|
|
213
|
+
ca-file: null # Path to a CA file, in pem format, optional
|
|
214
|
+
scheduler:
|
|
215
|
+
cert: null # Path to certificate file for scheduler.
|
|
216
|
+
key: null # Path to key file for scheduler. Alternatively, the key
|
|
217
|
+
# can be appended to the cert file above, and this field
|
|
218
|
+
# left blank.
|
|
219
|
+
worker:
|
|
220
|
+
key: null
|
|
221
|
+
cert: null
|
|
222
|
+
client:
|
|
223
|
+
key: null
|
|
224
|
+
cert: null
|
|
225
|
+
|
|
226
|
+
tcp:
|
|
227
|
+
backend: tornado # The backend to use for TCP, one of {tornado, asyncio}
|
|
228
|
+
|
|
229
|
+
websockets:
|
|
230
|
+
shard: 8MiB
|
|
231
|
+
|
|
232
|
+
diagnostics:
|
|
233
|
+
nvml: True
|
|
234
|
+
computations:
|
|
235
|
+
max-history: 100
|
|
236
|
+
ignore-modules:
|
|
237
|
+
- distributed
|
|
238
|
+
- dask
|
|
239
|
+
- xarray
|
|
240
|
+
- cudf
|
|
241
|
+
- cuml
|
|
242
|
+
- prefect
|
|
243
|
+
- xgboost
|
|
244
|
+
|
|
245
|
+
###################
|
|
246
|
+
# Bokeh dashboard #
|
|
247
|
+
###################
|
|
248
|
+
|
|
249
|
+
dashboard:
|
|
250
|
+
link: "{scheme}://{host}:{port}/status"
|
|
251
|
+
export-tool: False
|
|
252
|
+
graph-max-items: 5000 # maximum number of tasks to try to plot in graph view
|
|
253
|
+
prometheus:
|
|
254
|
+
namespace: "dask"
|
|
255
|
+
|
|
256
|
+
##################
|
|
257
|
+
# Administrative #
|
|
258
|
+
##################
|
|
259
|
+
|
|
260
|
+
admin:
|
|
261
|
+
tick:
|
|
262
|
+
interval: 20ms # time between event loop health checks
|
|
263
|
+
limit: 3s # time allowed before triggering a warning
|
|
264
|
+
|
|
265
|
+
max-error-length: 10000 # Maximum size traceback after error to return
|
|
266
|
+
log-length: 10000 # default length of logs to keep in memory
|
|
267
|
+
log-format: '%(name)s - %(levelname)s - %(message)s'
|
|
268
|
+
pdb-on-err: False # enter debug mode on scheduling error
|
|
269
|
+
system-monitor:
|
|
270
|
+
interval: 500ms
|
|
271
|
+
event-loop: tornado
|
|
272
|
+
rmm:
|
|
273
|
+
pool-size: null
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
jobqueue:
|
|
2
|
+
oar:
|
|
3
|
+
name: dask-worker
|
|
4
|
+
|
|
5
|
+
# Dask worker options
|
|
6
|
+
cores: null # Total number of cores per job
|
|
7
|
+
memory: null # Total amount of memory per job
|
|
8
|
+
processes: null # Number of Python processes per job
|
|
9
|
+
|
|
10
|
+
interface: null # Network interface to use like eth0 or ib0
|
|
11
|
+
death-timeout: 60 # Number of seconds to wait if a worker can not find a scheduler
|
|
12
|
+
local-directory: null # Location of fast local storage like /scratch or $TMPDIR
|
|
13
|
+
shared-temp-directory: null # Shared directory currently used to dump temporary security objects for workers
|
|
14
|
+
extra: []
|
|
15
|
+
|
|
16
|
+
# OAR resource manager options
|
|
17
|
+
shebang: "#!/usr/bin/env bash"
|
|
18
|
+
queue: null
|
|
19
|
+
project: null
|
|
20
|
+
walltime: '00:30:00'
|
|
21
|
+
env-extra: []
|
|
22
|
+
resource-spec: null
|
|
23
|
+
job-extra: []
|
|
24
|
+
log-directory: null
|
|
25
|
+
|
|
26
|
+
# Scheduler options
|
|
27
|
+
scheduler-options: {}
|
|
28
|
+
|
|
29
|
+
pbs:
|
|
30
|
+
name: dask-worker
|
|
31
|
+
|
|
32
|
+
# Dask worker options
|
|
33
|
+
cores: null # Total number of cores per job
|
|
34
|
+
memory: null # Total amount of memory per job
|
|
35
|
+
processes: null # Number of Python processes per job
|
|
36
|
+
|
|
37
|
+
interface: null # Network interface to use like eth0 or ib0
|
|
38
|
+
death-timeout: 60 # Number of seconds to wait if a worker can not find a scheduler
|
|
39
|
+
local-directory: null # Location of fast local storage like /scratch or $TMPDIR
|
|
40
|
+
shared-temp-directory: null # Shared directory currently used to dump temporary security objects for workers
|
|
41
|
+
extra: []
|
|
42
|
+
|
|
43
|
+
# PBS resource manager options
|
|
44
|
+
shebang: "#!/usr/bin/env bash"
|
|
45
|
+
queue: null
|
|
46
|
+
project: null
|
|
47
|
+
walltime: '00:30:00'
|
|
48
|
+
env-extra: []
|
|
49
|
+
resource-spec: null
|
|
50
|
+
job-extra: []
|
|
51
|
+
log-directory: null
|
|
52
|
+
|
|
53
|
+
# Scheduler options
|
|
54
|
+
scheduler-options: {}
|
|
55
|
+
|
|
56
|
+
sge:
|
|
57
|
+
name: dask-worker
|
|
58
|
+
|
|
59
|
+
# Dask worker options
|
|
60
|
+
cores: null # Total number of cores per job
|
|
61
|
+
memory: null # Total amount of memory per job
|
|
62
|
+
processes: null # Number of Python processes per job
|
|
63
|
+
|
|
64
|
+
interface: null # Network interface to use like eth0 or ib0
|
|
65
|
+
death-timeout: 60 # Number of seconds to wait if a worker can not find a scheduler
|
|
66
|
+
local-directory: null # Location of fast local storage like /scratch or $TMPDIR
|
|
67
|
+
shared-temp-directory: null # Shared directory currently used to dump temporary security objects for workers
|
|
68
|
+
extra: []
|
|
69
|
+
|
|
70
|
+
# SGE resource manager options
|
|
71
|
+
shebang: "#!/usr/bin/env bash"
|
|
72
|
+
queue: null
|
|
73
|
+
project: null
|
|
74
|
+
walltime: '00:30:00'
|
|
75
|
+
env-extra: []
|
|
76
|
+
job-extra: []
|
|
77
|
+
log-directory: null
|
|
78
|
+
resource-spec: null
|
|
79
|
+
|
|
80
|
+
# Scheduler options
|
|
81
|
+
scheduler-options: {}
|
|
82
|
+
|
|
83
|
+
slurm:
|
|
84
|
+
name: dask-worker
|
|
85
|
+
|
|
86
|
+
# Dask worker options
|
|
87
|
+
cores: null # Total number of cores per job
|
|
88
|
+
memory: null # Total amount of memory per job
|
|
89
|
+
processes: null # Number of Python processes per job
|
|
90
|
+
|
|
91
|
+
interface: null # Network interface to use like eth0 or ib0
|
|
92
|
+
death-timeout: 60 # Number of seconds to wait if a worker can not find a scheduler
|
|
93
|
+
local-directory: null # Location of fast local storage like /scratch or $TMPDIR
|
|
94
|
+
shared-temp-directory: null # Shared directory currently used to dump temporary security objects for workers
|
|
95
|
+
extra: []
|
|
96
|
+
|
|
97
|
+
# SLURM resource manager options
|
|
98
|
+
shebang: "#!/usr/bin/env bash"
|
|
99
|
+
queue: null
|
|
100
|
+
project: null
|
|
101
|
+
walltime: '00:30:00'
|
|
102
|
+
env-extra: []
|
|
103
|
+
job-cpu: null
|
|
104
|
+
job-mem: null
|
|
105
|
+
job-extra: []
|
|
106
|
+
log-directory: null
|
|
107
|
+
|
|
108
|
+
# Scheduler options
|
|
109
|
+
scheduler-options: {}
|
|
110
|
+
|
|
111
|
+
moab:
|
|
112
|
+
name: dask-worker
|
|
113
|
+
|
|
114
|
+
# Dask worker options
|
|
115
|
+
cores: null # Total number of cores per job
|
|
116
|
+
memory: null # Total amount of memory per job
|
|
117
|
+
processes: null # Number of Python processes per job
|
|
118
|
+
|
|
119
|
+
interface: null # Network interface to use like eth0 or ib0
|
|
120
|
+
death-timeout: 60 # Number of seconds to wait if a worker can not find a scheduler
|
|
121
|
+
local-directory: null # Location of fast local storage like /scratch or $TMPDIR
|
|
122
|
+
shared-temp-directory: null # Shared directory currently used to dump temporary security objects for workers
|
|
123
|
+
extra: []
|
|
124
|
+
|
|
125
|
+
# PBS resource manager options
|
|
126
|
+
shebang: "#!/usr/bin/env bash"
|
|
127
|
+
queue: null
|
|
128
|
+
project: null
|
|
129
|
+
walltime: '00:30:00'
|
|
130
|
+
env-extra: []
|
|
131
|
+
resource-spec: null
|
|
132
|
+
job-extra: []
|
|
133
|
+
log-directory: null
|
|
134
|
+
|
|
135
|
+
# Scheduler options
|
|
136
|
+
scheduler-options: {}
|
|
137
|
+
|
|
138
|
+
lsf:
|
|
139
|
+
name: dask-worker
|
|
140
|
+
|
|
141
|
+
# Dask worker options
|
|
142
|
+
cores: null # Total number of cores per job
|
|
143
|
+
memory: null # Total amount of memory per job
|
|
144
|
+
processes: null # Number of Python processes per job
|
|
145
|
+
|
|
146
|
+
interface: null # Network interface to use like eth0 or ib0
|
|
147
|
+
death-timeout: 60 # Number of seconds to wait if a worker can not find a scheduler
|
|
148
|
+
local-directory: null # Location of fast local storage like /scratch or $TMPDIR
|
|
149
|
+
shared-temp-directory: null # Shared directory currently used to dump temporary security objects for workers
|
|
150
|
+
extra: []
|
|
151
|
+
|
|
152
|
+
# LSF resource manager options
|
|
153
|
+
shebang: "#!/usr/bin/env bash"
|
|
154
|
+
queue: null
|
|
155
|
+
project: null
|
|
156
|
+
walltime: '00:30'
|
|
157
|
+
env-extra: []
|
|
158
|
+
ncpus: null
|
|
159
|
+
mem: null
|
|
160
|
+
job-extra: []
|
|
161
|
+
log-directory: null
|
|
162
|
+
lsf-units: null
|
|
163
|
+
use-stdin: True # (bool) How jobs are launched, i.e. 'bsub jobscript.sh' or 'bsub < jobscript.sh'
|
|
164
|
+
|
|
165
|
+
# Scheduler options
|
|
166
|
+
scheduler-options: {}
|
|
167
|
+
|
|
168
|
+
htcondor:
|
|
169
|
+
name: dask-worker
|
|
170
|
+
|
|
171
|
+
# Dask worker options
|
|
172
|
+
cores: null # Total number of cores per job
|
|
173
|
+
memory: null # Total amount of memory per job
|
|
174
|
+
processes: null # Number of Python processes per job
|
|
175
|
+
|
|
176
|
+
interface: null # Network interface to use like eth0 or ib0
|
|
177
|
+
death-timeout: 60 # Number of seconds to wait if a worker can not find a scheduler
|
|
178
|
+
local-directory: null # Location of fast local storage like /scratch or $TMPDIR
|
|
179
|
+
shared-temp-directory: null # Shared directory currently used to dump temporary security objects for workers
|
|
180
|
+
extra: []
|
|
181
|
+
|
|
182
|
+
# HTCondor Resource Manager options
|
|
183
|
+
disk: null # Total amount of disk per job
|
|
184
|
+
env-extra: []
|
|
185
|
+
job-extra: {} # Extra submit attributes
|
|
186
|
+
submit-command-extra: [] # Extra condor_submit arguments
|
|
187
|
+
cancel-command-extra: [] # Extra condor_rm arguments
|
|
188
|
+
log-directory: null
|
|
189
|
+
shebang: "#!/usr/bin/env condor_submit"
|
|
190
|
+
|
|
191
|
+
# Scheduler options
|
|
192
|
+
scheduler-options: {}
|
|
193
|
+
|
|
194
|
+
local:
|
|
195
|
+
name: dask-worker
|
|
196
|
+
# Dask worker options
|
|
197
|
+
cores: null # Total number of cores per job
|
|
198
|
+
memory: null # Total amount of memory per job
|
|
199
|
+
processes: null # Number of Python processes per job
|
|
200
|
+
|
|
201
|
+
interface: null # Network interface to use like eth0 or ib0
|
|
202
|
+
death-timeout: 60 # Number of seconds to wait if a worker can not find a scheduler
|
|
203
|
+
local-directory: null # Location of fast local storage like /scratch or $TMPDIR
|
|
204
|
+
shared-temp-directory: null # Shared directory currently used to dump temporary security objects for workers
|
|
205
|
+
extra: []
|
|
206
|
+
|
|
207
|
+
env-extra: []
|
|
208
|
+
job-extra: []
|
|
209
|
+
log-directory: null
|
|
210
|
+
|
|
211
|
+
# Scheduler options
|
|
212
|
+
scheduler-options: {}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
# coding: utf8
|
|
3
|
+
#
|
|
4
|
+
# Copyright (c) 2020 Centre National d'Etudes Spatiales (CNES).
|
|
5
|
+
#
|
|
6
|
+
# This file is part of CARS
|
|
7
|
+
# (see https://github.com/CNES/cars).
|
|
8
|
+
#
|
|
9
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
10
|
+
# you may not use this file except in compliance with the License.
|
|
11
|
+
# You may obtain a copy of the License at
|
|
12
|
+
#
|
|
13
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
+
#
|
|
15
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
16
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
17
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18
|
+
# See the License for the specific language governing permissions and
|
|
19
|
+
# limitations under the License.
|
|
20
|
+
#
|
|
21
|
+
"""
|
|
22
|
+
Contains functions for dask jobqueue cluster (PBS, SLURM)
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
import logging
|
|
26
|
+
import math
|
|
27
|
+
import os
|
|
28
|
+
import sys
|
|
29
|
+
import warnings
|
|
30
|
+
from datetime import timedelta
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def init_cluster_variables( # pylint: disable=too-many-positional-arguments
|
|
34
|
+
nb_workers,
|
|
35
|
+
walltime,
|
|
36
|
+
out_dir,
|
|
37
|
+
activate_dashboard,
|
|
38
|
+
python,
|
|
39
|
+
core_memory,
|
|
40
|
+
cluster_name,
|
|
41
|
+
):
|
|
42
|
+
"""
|
|
43
|
+
Initialize global cluster variables
|
|
44
|
+
:param nb_workers: number of workers
|
|
45
|
+
:param walltime: workers walltime
|
|
46
|
+
:param out_dir: ouput result directory
|
|
47
|
+
:param activate_dashboard: option to activate dashboard mode
|
|
48
|
+
:param python: target python used by workers (retrun system python if None)
|
|
49
|
+
:param core_memory: cluster node memory (Mo)
|
|
50
|
+
:param cluster_name: PBS or SLURM
|
|
51
|
+
:return: all cluster parameters (python,
|
|
52
|
+
nb_workers_per_job,
|
|
53
|
+
memory,
|
|
54
|
+
nb_cpus,
|
|
55
|
+
stagger,
|
|
56
|
+
lifetime_with_margin,
|
|
57
|
+
scheduler_options,
|
|
58
|
+
envs,
|
|
59
|
+
log_directory,
|
|
60
|
+
local_directory)
|
|
61
|
+
"""
|
|
62
|
+
|
|
63
|
+
if python is None:
|
|
64
|
+
python = sys.executable
|
|
65
|
+
|
|
66
|
+
# Configure worker distribution.
|
|
67
|
+
# Workers are mostly running single-threaded, GIL-holding functions, so we
|
|
68
|
+
# dedicate a single thread for each worker to maximize CPU utilization.
|
|
69
|
+
nb_threads_per_worker = 1
|
|
70
|
+
|
|
71
|
+
# Network latency is not the bottleneck, so we dedicate a single worker for
|
|
72
|
+
# each job in order to minimize the requested resources, which reduces our
|
|
73
|
+
# scheduling delay.
|
|
74
|
+
nb_workers_per_job = 1
|
|
75
|
+
|
|
76
|
+
# Total number of CPUs is multi-threading factor times size of batch
|
|
77
|
+
# (number of workers per job)
|
|
78
|
+
nb_cpus = nb_threads_per_worker * nb_workers_per_job
|
|
79
|
+
nb_jobs = int(math.ceil(nb_workers / nb_workers_per_job))
|
|
80
|
+
# Cluster nodes have core_memory Mo per core
|
|
81
|
+
memory = nb_cpus * core_memory
|
|
82
|
+
|
|
83
|
+
# Configure worker lifetime for adaptative scaling.
|
|
84
|
+
# See https://jobqueue.dask.org/en/latest/advanced-tips-and-tricks.html
|
|
85
|
+
hours, minutes, seconds = map(int, walltime.split(":"))
|
|
86
|
+
lifetime = timedelta(seconds=3600 * hours + 60 * minutes + seconds)
|
|
87
|
+
# Use hardcoded stagger of 3 minutes. The actual lifetime will be selected
|
|
88
|
+
# uniformly at random between lifetime +/- stagger.
|
|
89
|
+
stagger = timedelta(minutes=3)
|
|
90
|
+
# Add some margin to not get killed by scheduler during worker shutdown.
|
|
91
|
+
shutdown_margin = timedelta(minutes=2)
|
|
92
|
+
min_walltime = stagger + shutdown_margin
|
|
93
|
+
lifetime_with_margin = lifetime - min_walltime
|
|
94
|
+
if lifetime_with_margin.total_seconds() < 0:
|
|
95
|
+
min_walltime_minutes = min_walltime.total_seconds() / 60
|
|
96
|
+
logging.warning(
|
|
97
|
+
"Could not add worker lifetime margin because specified walltime "
|
|
98
|
+
"is too short. Workers might get killed by {} before they can "
|
|
99
|
+
"cleanly exit, which might break adaptative scaling. Please "
|
|
100
|
+
"specify a lifetime greater than {} minutes.".format(
|
|
101
|
+
cluster_name, min_walltime_minutes
|
|
102
|
+
)
|
|
103
|
+
)
|
|
104
|
+
lifetime_with_margin = lifetime
|
|
105
|
+
|
|
106
|
+
logging.info(
|
|
107
|
+
"Starting Dask {0} cluster with {1} workers "
|
|
108
|
+
"({2} workers with {3} cores each per {0} job)".format(
|
|
109
|
+
cluster_name,
|
|
110
|
+
nb_workers,
|
|
111
|
+
nb_workers_per_job,
|
|
112
|
+
nb_threads_per_worker,
|
|
113
|
+
)
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
logging.info(
|
|
117
|
+
"Submitting {} {} jobs "
|
|
118
|
+
"with configuration cpu={}, mem={}, walltime={}".format(
|
|
119
|
+
nb_jobs, cluster_name, nb_cpus, memory, walltime
|
|
120
|
+
)
|
|
121
|
+
)
|
|
122
|
+
|
|
123
|
+
if activate_dashboard:
|
|
124
|
+
scheduler_options = None
|
|
125
|
+
else:
|
|
126
|
+
scheduler_options = {"dashboard": None, "dashboard_address": None}
|
|
127
|
+
|
|
128
|
+
names = [
|
|
129
|
+
"PATH",
|
|
130
|
+
"PYTHONPATH",
|
|
131
|
+
"CARS_STATIC_CONFIGURATION",
|
|
132
|
+
"LD_LIBRARY_PATH",
|
|
133
|
+
"OTB_APPLICATION_PATH",
|
|
134
|
+
"OTB_MAX_RAM_HINT",
|
|
135
|
+
"OMP_NUM_THREADS",
|
|
136
|
+
"OPJ_NUM_THREADS",
|
|
137
|
+
"GDAL_NUM_THREADS",
|
|
138
|
+
"VIRTUAL_ENV",
|
|
139
|
+
"ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS",
|
|
140
|
+
"GDAL_CACHEMAX",
|
|
141
|
+
"DASK_CONFIG",
|
|
142
|
+
"NUMBA_THREADING_LAYER",
|
|
143
|
+
]
|
|
144
|
+
names = [name for name in names if os.environ.get(name)]
|
|
145
|
+
envs = ["export {}={}".format(name, os.environ[name]) for name in names]
|
|
146
|
+
log_directory = os.path.join(os.path.abspath(out_dir), "dask_log")
|
|
147
|
+
local_directory = "$TMPDIR"
|
|
148
|
+
return (
|
|
149
|
+
python,
|
|
150
|
+
nb_workers_per_job,
|
|
151
|
+
memory,
|
|
152
|
+
nb_cpus,
|
|
153
|
+
stagger,
|
|
154
|
+
lifetime_with_margin,
|
|
155
|
+
scheduler_options,
|
|
156
|
+
envs,
|
|
157
|
+
log_directory,
|
|
158
|
+
local_directory,
|
|
159
|
+
)
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
def get_dashboard_link(cluster):
|
|
163
|
+
"""
|
|
164
|
+
This function returns the dashboard address.
|
|
165
|
+
|
|
166
|
+
:param cluster: Dask cluster
|
|
167
|
+
:type cluster: dask_jobqueue.PBSCluster
|
|
168
|
+
:return: Link to the dashboard
|
|
169
|
+
:rtype: string
|
|
170
|
+
"""
|
|
171
|
+
template = "http://{host}:{port}/status"
|
|
172
|
+
host = cluster.scheduler.address.split("://")[1].split(":")[0]
|
|
173
|
+
port = cluster.scheduler.services["dashboard"].port
|
|
174
|
+
return template.format(host=host, port=port)
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
def stop_cluster(cluster, client):
|
|
178
|
+
"""
|
|
179
|
+
This function stops a dask cluster.
|
|
180
|
+
|
|
181
|
+
:param cluster: Dask cluster
|
|
182
|
+
:type cluster: dask_jobqueue.PBSCluster
|
|
183
|
+
:param client: Dask client
|
|
184
|
+
:type client: dask.distributed.Client
|
|
185
|
+
"""
|
|
186
|
+
client.close()
|
|
187
|
+
# Bug distributed on close cluster : Fail with AssertionError still running
|
|
188
|
+
try:
|
|
189
|
+
with warnings.catch_warnings():
|
|
190
|
+
# Ignore internal dask_jobqueue warnings to be corrected in:
|
|
191
|
+
# https://github.com/dask/dask-jobqueue/pull/506
|
|
192
|
+
warnings.filterwarnings(
|
|
193
|
+
"ignore",
|
|
194
|
+
category=FutureWarning,
|
|
195
|
+
message=".*ignoring was deprecated in version 2021.06.1.*",
|
|
196
|
+
)
|
|
197
|
+
cluster.close()
|
|
198
|
+
except AssertionError as assert_error:
|
|
199
|
+
logging.warning(
|
|
200
|
+
"Dask cluster failed " "to stop properly: {}".format(assert_error)
|
|
201
|
+
)
|
|
202
|
+
# not raising to not fail tests
|
|
203
|
+
|
|
204
|
+
logging.info("Dask cluster correctly stopped")
|