SilverStreamingApplication 1.9__tar.gz → 1.10__tar.gz
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.
- {silverstreamingapplication-1.9 → silverstreamingapplication-1.10}/PKG-INFO +3 -2
- {silverstreamingapplication-1.9 → silverstreamingapplication-1.10}/com/phida/main/WorkflowBuilder.py +42 -20
- {silverstreamingapplication-1.9 → silverstreamingapplication-1.10}/setup.py +1 -1
- {silverstreamingapplication-1.9 → silverstreamingapplication-1.10}/silverstreamingapplication.egg-info/PKG-INFO +3 -2
- {silverstreamingapplication-1.9 → silverstreamingapplication-1.10}/com/phida/main/Maintenance.py +0 -0
- {silverstreamingapplication-1.9 → silverstreamingapplication-1.10}/com/phida/main/Operations.py +0 -0
- {silverstreamingapplication-1.9 → silverstreamingapplication-1.10}/com/phida/main/PartitionAnalyzer.py +0 -0
- {silverstreamingapplication-1.9 → silverstreamingapplication-1.10}/com/phida/main/PerfAnalyzer.py +0 -0
- {silverstreamingapplication-1.9 → silverstreamingapplication-1.10}/com/phida/main/SilverMerge.py +0 -0
- {silverstreamingapplication-1.9 → silverstreamingapplication-1.10}/com/phida/main/__init__.py +0 -0
- {silverstreamingapplication-1.9 → silverstreamingapplication-1.10}/com/phida/main/logging.py +0 -0
- {silverstreamingapplication-1.9 → silverstreamingapplication-1.10}/com/phida/main/sparksession.py +0 -0
- {silverstreamingapplication-1.9 → silverstreamingapplication-1.10}/com/phida/main/utils.py +0 -0
- {silverstreamingapplication-1.9 → silverstreamingapplication-1.10}/com/phida/main/utilsDatabricksAPI.py +0 -0
- {silverstreamingapplication-1.9 → silverstreamingapplication-1.10}/com/phida/tests/OperationsTest.py +0 -0
- {silverstreamingapplication-1.9 → silverstreamingapplication-1.10}/com/phida/tests/__init__.py +0 -0
- {silverstreamingapplication-1.9 → silverstreamingapplication-1.10}/com/phida/tests/main_test.py +0 -0
- {silverstreamingapplication-1.9 → silverstreamingapplication-1.10}/com/phida/tests/utils_test.py +0 -0
- {silverstreamingapplication-1.9 → silverstreamingapplication-1.10}/setup.cfg +0 -0
- {silverstreamingapplication-1.9 → silverstreamingapplication-1.10}/silverstreamingapplication.egg-info/SOURCES.txt +0 -0
- {silverstreamingapplication-1.9 → silverstreamingapplication-1.10}/silverstreamingapplication.egg-info/dependency_links.txt +0 -0
- {silverstreamingapplication-1.9 → silverstreamingapplication-1.10}/silverstreamingapplication.egg-info/top_level.txt +0 -0
{silverstreamingapplication-1.9 → silverstreamingapplication-1.10}/com/phida/main/WorkflowBuilder.py
RENAMED
|
@@ -60,7 +60,9 @@ class WorkflowBuilder:
|
|
|
60
60
|
('dbr_version', ['10.4.x-scala2.12', '10.4.x-scala2.12']),
|
|
61
61
|
('driver_type', ['Standard_E8ds_v4', 'Standard_E8ds_v4']),
|
|
62
62
|
('worker_type', ['Standard_E8ds_v4', 'Standard_E8ds_v4']),
|
|
63
|
-
('num_workers', ['4', '4'])])
|
|
63
|
+
# ('num_workers', ['4', '4'])])
|
|
64
|
+
('min_workers', ['1', '1']),
|
|
65
|
+
('max_workers', ['4', '4'])])
|
|
64
66
|
# example of library argument: "SilverStreamingApplication==1.0"
|
|
65
67
|
|
|
66
68
|
|
|
@@ -160,7 +162,7 @@ class WorkflowBuilder:
|
|
|
160
162
|
return taskDict
|
|
161
163
|
|
|
162
164
|
@staticmethod
|
|
163
|
-
def createJobCluster(jobClusterKey, DBRVersion, clusterPolicyId,
|
|
165
|
+
def createJobCluster(jobClusterKey, DBRVersion, clusterPolicyId, autoscaleFlag, minWorkers, maxWorkers):
|
|
164
166
|
"""
|
|
165
167
|
desc:
|
|
166
168
|
A method for creating the reusable job cluster
|
|
@@ -169,7 +171,9 @@ class WorkflowBuilder:
|
|
|
169
171
|
jobClusterKey - a key for uniquely identifying a job cluster
|
|
170
172
|
DBRVersion - the version of the databricks release to be used
|
|
171
173
|
clusterPolicyId - Define the Id for the cluster policy for which table will be created in JSON
|
|
172
|
-
|
|
174
|
+
autoscaleFlag - 'Y' for an autoscaling cluster, 'N' for a fixed size cluster
|
|
175
|
+
minWorkers - Minimum workers when autoscaling (ignored when autoscaleFlag is N)
|
|
176
|
+
maxWorkers - Maximum workers when autoscaling, or the fixed worker count when autoscaleFlag is N
|
|
173
177
|
|
|
174
178
|
|
|
175
179
|
return:
|
|
@@ -179,20 +183,34 @@ class WorkflowBuilder:
|
|
|
179
183
|
createTask("task1", "job_cluster_1", "/users/usr/notebook", "/opt/db","<source database name>", "<target database name>", "vbuk")
|
|
180
184
|
|
|
181
185
|
tip:
|
|
182
|
-
|
|
183
|
-
Either, enter numWorkers or autoScale as Y. Do no enter both
|
|
184
|
-
When autoScale is Y, make sure that minWorkers and maxWorkers are present too
|
|
186
|
+
Autoscaling requires both minWorkers and maxWorkers.
|
|
185
187
|
Either enter workerType and driverType or driverInstancePoolId and instancePoolId.
|
|
186
188
|
Do not enter values for all 4 parameters mentioned above.
|
|
187
189
|
"""
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
"
|
|
193
|
-
"
|
|
190
|
+
|
|
191
|
+
if str(autoscaleFlag).strip().upper() == "N":
|
|
192
|
+
numWorkers = int(maxWorkers)
|
|
193
|
+
jobClusterDict = {
|
|
194
|
+
"job_cluster_key": jobClusterKey,
|
|
195
|
+
"new_cluster": {
|
|
196
|
+
"spark_version": DBRVersion,
|
|
197
|
+
"policy_id": clusterPolicyId,
|
|
198
|
+
"num_workers": numWorkers
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
else:
|
|
202
|
+
minWorkers = int(minWorkers or 1)
|
|
203
|
+
maxWorkers = int(maxWorkers)
|
|
204
|
+
if minWorkers > maxWorkers:
|
|
205
|
+
raise ValueError(f"{jobClusterKey}: min_workers cannot be greater than max_workers")
|
|
206
|
+
jobClusterDict = {
|
|
207
|
+
"job_cluster_key": jobClusterKey,
|
|
208
|
+
"new_cluster": {
|
|
209
|
+
"spark_version": DBRVersion,
|
|
210
|
+
"policy_id": clusterPolicyId,
|
|
211
|
+
"autoscale": {"min_workers": minWorkers, "max_workers": maxWorkers}
|
|
212
|
+
}
|
|
194
213
|
}
|
|
195
|
-
}
|
|
196
214
|
|
|
197
215
|
return jobClusterDict
|
|
198
216
|
|
|
@@ -293,17 +311,21 @@ class WorkflowBuilder:
|
|
|
293
311
|
for jobCluster in jobClusterList:
|
|
294
312
|
jobClusterKey = jobCluster['job_cluster_key']
|
|
295
313
|
DBRVersion = jobCluster['dbr_version']
|
|
296
|
-
try:
|
|
297
|
-
numWorkers = jobCluster['num_workers']
|
|
298
|
-
except:
|
|
299
|
-
numWorkers = None
|
|
300
|
-
|
|
301
314
|
try:
|
|
302
315
|
clusterPolicyId = jobCluster['policy_id']
|
|
303
316
|
except:
|
|
304
317
|
clusterPolicyId = None
|
|
305
|
-
|
|
306
|
-
|
|
318
|
+
autoscaleFlag = jobCluster.get('autoscaleFlag', jobCluster.get('autoscale_flag'))
|
|
319
|
+
minWorkers = jobCluster['min_workers']
|
|
320
|
+
maxWorkers = jobCluster['max_workers']
|
|
321
|
+
jobClusterTemp = self.createJobCluster(
|
|
322
|
+
jobClusterKey,
|
|
323
|
+
DBRVersion,
|
|
324
|
+
clusterPolicyId,
|
|
325
|
+
autoscaleFlag,
|
|
326
|
+
minWorkers,
|
|
327
|
+
maxWorkers
|
|
328
|
+
)
|
|
307
329
|
|
|
308
330
|
jobClusters.append(jobClusterTemp)
|
|
309
331
|
|
{silverstreamingapplication-1.9 → silverstreamingapplication-1.10}/com/phida/main/Maintenance.py
RENAMED
|
File without changes
|
{silverstreamingapplication-1.9 → silverstreamingapplication-1.10}/com/phida/main/Operations.py
RENAMED
|
File without changes
|
|
File without changes
|
{silverstreamingapplication-1.9 → silverstreamingapplication-1.10}/com/phida/main/PerfAnalyzer.py
RENAMED
|
File without changes
|
{silverstreamingapplication-1.9 → silverstreamingapplication-1.10}/com/phida/main/SilverMerge.py
RENAMED
|
File without changes
|
{silverstreamingapplication-1.9 → silverstreamingapplication-1.10}/com/phida/main/__init__.py
RENAMED
|
File without changes
|
{silverstreamingapplication-1.9 → silverstreamingapplication-1.10}/com/phida/main/logging.py
RENAMED
|
File without changes
|
{silverstreamingapplication-1.9 → silverstreamingapplication-1.10}/com/phida/main/sparksession.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{silverstreamingapplication-1.9 → silverstreamingapplication-1.10}/com/phida/tests/OperationsTest.py
RENAMED
|
File without changes
|
{silverstreamingapplication-1.9 → silverstreamingapplication-1.10}/com/phida/tests/__init__.py
RENAMED
|
File without changes
|
{silverstreamingapplication-1.9 → silverstreamingapplication-1.10}/com/phida/tests/main_test.py
RENAMED
|
File without changes
|
{silverstreamingapplication-1.9 → silverstreamingapplication-1.10}/com/phida/tests/utils_test.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|