Skip to content

Commit d00a6b3

Browse files
authored
Merge branch 'main' into person/aivanov/contrib
2 parents 2d1892c + b27d7dd commit d00a6b3

8 files changed

Lines changed: 56 additions & 15 deletions

File tree

projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/DataJobTerminationStatusIT.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,9 @@ public void testDataJobTerminationStatus(String jobName, String teamName, String
150150
System.out.println(match.get().trim());
151151
assertTrue(
152152
match.get().trim().endsWith("0.0"),
153-
"The value of the taurus_datajob_termination_status metrics does not match");
153+
"The value of the taurus_datajob_termination_status metrics does not match. It was actually"
154+
+ " "
155+
+ match.get());
154156

155157
// Check the data job execution status
156158
checkDataJobExecutionStatus(

projects/control-service/projects/pipelines_control_service/src/main/java/com/vmware/taurus/service/KubernetesService.java

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ public void createNamespace(String namespaceName) throws ApiException {
422422
.withMetadata(new V1ObjectMetaBuilder().withName(namespaceName).build())
423423
.build();
424424

425-
new CoreV1Api(client).createNamespace(namespaceBody, null, null, null);
425+
new CoreV1Api(client).createNamespace(namespaceBody, null, null, null, null);
426426
}
427427

428428
public void deleteNamespace(String namespaceName) throws ApiException {
@@ -923,7 +923,8 @@ public void createV1beta1CronJob(
923923
jobLabels,
924924
imagePullSecrets);
925925
V1beta1CronJob nsJob =
926-
new BatchV1beta1Api(client).createNamespacedCronJob(namespace, cronJob, null, null, null);
926+
new BatchV1beta1Api(client)
927+
.createNamespacedCronJob(namespace, cronJob, null, null, null, null);
927928
log.debug("Created k8s cron job: {}", nsJob);
928929
log.debug(
929930
"Created k8s cron job name: {}, uid:{}, link:{}",
@@ -967,7 +968,7 @@ public void createV1CronJob(
967968
jobLabels,
968969
imagePullSecrets);
969970
V1CronJob nsJob =
970-
new BatchV1Api(client).createNamespacedCronJob(namespace, cronJob, null, null, null);
971+
new BatchV1Api(client).createNamespacedCronJob(namespace, cronJob, null, null, null, null);
971972
log.debug("Created k8s cron job: {}", nsJob);
972973
log.debug(
973974
"Created k8s cron job name: {}, uid:{}, link:{}",
@@ -1119,7 +1120,7 @@ public void updateV1beta1CronJob(
11191120
imagePullSecrets);
11201121
V1beta1CronJob nsJob =
11211122
new BatchV1beta1Api(client)
1122-
.replaceNamespacedCronJob(name, namespace, cronJob, null, null, null);
1123+
.replaceNamespacedCronJob(name, namespace, cronJob, null, null, null, null);
11231124
log.debug(
11241125
"Updated k8s cron job status for name:{}, image:{}, uid:{}, link:{}",
11251126
name,
@@ -1160,7 +1161,8 @@ public void updateV1CronJob(
11601161
jobLabels,
11611162
imagePullSecrets);
11621163
V1CronJob nsJob =
1163-
new BatchV1Api(client).replaceNamespacedCronJob(name, namespace, cronJob, null, null, null);
1164+
new BatchV1Api(client)
1165+
.replaceNamespacedCronJob(name, namespace, cronJob, null, null, null, null);
11641166
log.debug(
11651167
"Updated k8s cron job status for name:{}, image:{}, uid:{}, link:{}",
11661168
name,
@@ -1258,7 +1260,8 @@ void createNewJob(
12581260
.withSpec(spec)
12591261
.build();
12601262

1261-
V1Job nsJob = new BatchV1Api(client).createNamespacedJob(namespace, job, null, null, null);
1263+
V1Job nsJob =
1264+
new BatchV1Api(client).createNamespacedJob(namespace, job, null, null, null, null);
12621265
log.debug("Created k8s job: {}", nsJob);
12631266
log.debug(
12641267
"Created k8s job name: {}, uid:{}, link:{}",
@@ -2314,12 +2317,12 @@ public void saveSecretData(String name, Map<String, byte[]> data) throws ApiExce
23142317

23152318
V1Secret nsSecret;
23162319
try {
2317-
nsSecret = api.replaceNamespacedSecret(name, this.namespace, secret, null, null, null);
2320+
nsSecret = api.replaceNamespacedSecret(name, this.namespace, secret, null, null, null, null);
23182321
} catch (ApiException e) {
23192322
log.warn("Error while trying to save K8S secret", e);
23202323
if (e.getCode() == 404) {
23212324
log.debug("Secret {} does not exist. Creating ...", name);
2322-
nsSecret = api.createNamespacedSecret(this.namespace, secret, null, null, null);
2325+
nsSecret = api.createNamespacedSecret(this.namespace, secret, null, null, null, null);
23232326
} else {
23242327
log.error("Failed to save k8s secret: {}", name);
23252328
throw e;

projects/control-service/projects/versions-of-external-dependencies.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ project.ext {
2828
'org.zeroturnaround:zt-exec' : 'org.zeroturnaround:zt-exec:1.12',
2929
'javax.mail:mail' : 'javax.mail:mail:1.4.7',
3030
'org.ini4j:ini4j' : 'org.ini4j:ini4j:0.5.4',
31-
'io.kubernetes:client-java' : 'io.kubernetes:client-java:14.0.1',
32-
'io.kubernetes:client-java-api-fluent' : 'io.kubernetes:client-java-api-fluent:14.0.1',
31+
'io.kubernetes:client-java' : 'io.kubernetes:client-java:16.0.0',
32+
'io.kubernetes:client-java-api-fluent' : 'io.kubernetes:client-java-api-fluent:16.0.0',
3333
'com.graphql-java:graphql-java-spring-boot-starter-webmvc' : 'com.graphql-java:graphql-java-spring-boot-starter-webmvc:2.0',
3434
'com.cronutils:cron-utils' : 'com.cronutils:cron-utils:9.1.5',
3535
'net.lingala.zip4j:zip4j' : 'net.lingala.zip4j:zip4j:2.9.0',

projects/vdk-plugins/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pip install -U cookiecutter
3232
Generate a VDK Plugin package project:
3333

3434
```
35-
cookiecutter https://github.com/tozkata/cookiecutter-vdk-plugin.git
35+
cookiecutter https://github.com/tozka/cookiecutter-vdk-plugin.git
3636
```
3737

3838
Then

projects/vdk-plugins/vdk-impala/src/vdk/plugin/impala/impala_lineage_plugin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,11 @@ def _parse_inputs_outputs(query_profile: str) -> Tuple[list, str]:
145145
inputs = []
146146
output = None
147147
for line in query_profile.splitlines():
148-
match = re.search(r"(?<=SCAN HDFS \[)\S*(?=,)", line)
148+
match = re.search(r"(?<=SCAN HDFS \[)[\w\.]*", line)
149149
if match:
150150
inputs.append(match.group(0))
151151
else:
152-
match = re.search(r"(?<=WRITE TO HDFS \[)\S*(?=,)", line)
152+
match = re.search(r"(?<=WRITE TO HDFS \[)[\w\.]*", line)
153153
if match:
154154
output = match.group(0)
155155
return list(set(inputs)), output

projects/vdk-plugins/vdk-impala/tests/impala_lineage_plugin_test.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,19 @@ def test_is_query_have_lineage(self):
7373
)
7474
)
7575

76+
def test_parsing_query_profile(self):
77+
inputs = {"database_a.table1", "database_b.table2"}
78+
output = "database_c.table1"
79+
result = ImpalaLineagePlugin._parse_inputs_outputs(
80+
"""
81+
00:SCAN HDFS [database_a.table1, RANDOM]
82+
01:SCAN HDFS [database_b.table2 w, RANDOM]
83+
03: WRITE TO HDFS [database_c.table1, OVERWRITE=true]
84+
"""
85+
)
86+
self.assertEqual(set(result[0]), inputs)
87+
self.assertEqual(result[1], output)
88+
7689

7790
if __name__ == "__main__":
7891
unittest.main()

projects/vdk-plugins/vdk-ingest-http/src/vdk/plugin/ingest_http/ingest_http_plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def vdk_configure(config_builder: ConfigurationBuilder) -> None:
5858
)
5959
config_builder.add(
6060
key="INGEST_OVER_HTTP_RETRY_BACKOFF_FACTOR",
61-
default_value=0,
61+
default_value=0.0,
6262
description="A backoff factor to apply between attempts after the second try "
6363
"(most errors are resolved immediately by a second try without a "
6464
"delay). urllib3 will sleep for:: "

projects/vdk-plugins/vdk-ingest-http/tests/functional/test_http_ingest.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,26 @@ def test_http_ingestion(httpserver: PluginHTTPServer):
3838

3939
# a single record/row is 100 bytes with 100 records would result is 10 batches of 1000 bytes
4040
assert len(httpserver.log) == 10
41+
42+
43+
def test_ingestion_retry(httpserver: PluginHTTPServer):
44+
httpserver.expect_request(uri="/ingest").respond_with_response(Response(status=502))
45+
46+
with mock.patch.dict(
47+
os.environ,
48+
{
49+
"VDK_INGEST_METHOD_DEFAULT": "http",
50+
"VDK_INGEST_TARGET_DEFAULT": httpserver.url_for("/ingest"),
51+
"VDK_INGEST_OVER_HTTP_RETRY_TOTAL": "3",
52+
"VDK_INGEST_OVER_HTTP_RETRY_BACKOFF_FACTOR": "0.01", # very short retry backoff interval
53+
"VDK_INGEST_OVER_HTTP_RETRY_STATUS_FORCELIST": "502",
54+
"VDK_INGESTER_PAYLOAD_SIZE_BYTES_THRESHOLD": "20000",
55+
},
56+
):
57+
runner = CliEntryBasedTestRunner(ingest_http_plugin)
58+
59+
result: Result = runner.invoke(["run", job_path("ingest-job")])
60+
cli_assert_equal(1, result)
61+
62+
# one "regular" request + 3 retries
63+
assert len(httpserver.log) == 4

0 commit comments

Comments
 (0)