feldera 0.119.0__tar.gz → 0.121.0__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.
Potentially problematic release.
This version of feldera might be problematic. Click here for more details.
- {feldera-0.119.0 → feldera-0.121.0}/PKG-INFO +1 -1
- {feldera-0.119.0 → feldera-0.121.0}/feldera/pipeline.py +31 -0
- {feldera-0.119.0 → feldera-0.121.0}/feldera/rest/feldera_client.py +25 -0
- {feldera-0.119.0 → feldera-0.121.0}/feldera.egg-info/PKG-INFO +1 -1
- {feldera-0.119.0 → feldera-0.121.0}/pyproject.toml +1 -1
- {feldera-0.119.0 → feldera-0.121.0}/tests/test_shared_pipeline.py +38 -0
- {feldera-0.119.0 → feldera-0.121.0}/README.md +0 -0
- {feldera-0.119.0 → feldera-0.121.0}/feldera/__init__.py +0 -0
- {feldera-0.119.0 → feldera-0.121.0}/feldera/_callback_runner.py +0 -0
- {feldera-0.119.0 → feldera-0.121.0}/feldera/_helpers.py +0 -0
- {feldera-0.119.0 → feldera-0.121.0}/feldera/enums.py +0 -0
- {feldera-0.119.0 → feldera-0.121.0}/feldera/output_handler.py +0 -0
- {feldera-0.119.0 → feldera-0.121.0}/feldera/pipeline_builder.py +0 -0
- {feldera-0.119.0 → feldera-0.121.0}/feldera/rest/__init__.py +0 -0
- {feldera-0.119.0 → feldera-0.121.0}/feldera/rest/_helpers.py +0 -0
- {feldera-0.119.0 → feldera-0.121.0}/feldera/rest/_httprequests.py +0 -0
- {feldera-0.119.0 → feldera-0.121.0}/feldera/rest/config.py +0 -0
- {feldera-0.119.0 → feldera-0.121.0}/feldera/rest/errors.py +0 -0
- {feldera-0.119.0 → feldera-0.121.0}/feldera/rest/feldera_config.py +0 -0
- {feldera-0.119.0 → feldera-0.121.0}/feldera/rest/pipeline.py +0 -0
- {feldera-0.119.0 → feldera-0.121.0}/feldera/rest/sql_table.py +0 -0
- {feldera-0.119.0 → feldera-0.121.0}/feldera/rest/sql_view.py +0 -0
- {feldera-0.119.0 → feldera-0.121.0}/feldera/runtime_config.py +0 -0
- {feldera-0.119.0 → feldera-0.121.0}/feldera/stats.py +0 -0
- {feldera-0.119.0 → feldera-0.121.0}/feldera.egg-info/SOURCES.txt +0 -0
- {feldera-0.119.0 → feldera-0.121.0}/feldera.egg-info/dependency_links.txt +0 -0
- {feldera-0.119.0 → feldera-0.121.0}/feldera.egg-info/requires.txt +0 -0
- {feldera-0.119.0 → feldera-0.121.0}/feldera.egg-info/top_level.txt +0 -0
- {feldera-0.119.0 → feldera-0.121.0}/setup.cfg +0 -0
- {feldera-0.119.0 → feldera-0.121.0}/tests/test_checkpoint_sync.py +0 -0
- {feldera-0.119.0 → feldera-0.121.0}/tests/test_pipeline_builder.py +0 -0
- {feldera-0.119.0 → feldera-0.121.0}/tests/test_shared_pipeline_stress.py +0 -0
- {feldera-0.119.0 → feldera-0.121.0}/tests/test_udf.py +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
import time
|
|
3
3
|
from datetime import datetime
|
|
4
|
+
import pathlib
|
|
4
5
|
|
|
5
6
|
import pandas
|
|
6
7
|
from uuid import UUID
|
|
@@ -1059,3 +1060,33 @@ pipeline '{self.name}' to sync checkpoint '{uuid}'"""
|
|
|
1059
1060
|
if derr:
|
|
1060
1061
|
errors.append(derr)
|
|
1061
1062
|
return errors
|
|
1063
|
+
|
|
1064
|
+
def support_bundle(self, output_path: Optional[str] = None) -> bytes:
|
|
1065
|
+
"""
|
|
1066
|
+
Generate a support bundle containing diagnostic information from this pipeline.
|
|
1067
|
+
|
|
1068
|
+
This method collects various diagnostic data from the pipeline including
|
|
1069
|
+
circuit profile, heap profile, metrics, logs, stats, and connector statistics,
|
|
1070
|
+
and packages them into a single ZIP file for support purposes.
|
|
1071
|
+
|
|
1072
|
+
:param output_path: Optional path to save the support bundle file. If None,
|
|
1073
|
+
the support bundle is only returned as bytes.
|
|
1074
|
+
:return: The support bundle as bytes (ZIP archive)
|
|
1075
|
+
:raises FelderaAPIError: If the pipeline does not exist or if there's an error
|
|
1076
|
+
"""
|
|
1077
|
+
|
|
1078
|
+
support_bundle_bytes = self.client.get_pipeline_support_bundle(self.name)
|
|
1079
|
+
|
|
1080
|
+
if output_path is not None:
|
|
1081
|
+
path = pathlib.Path(output_path)
|
|
1082
|
+
|
|
1083
|
+
# Ensure the file has .zip extension
|
|
1084
|
+
if path.suffix != ".zip":
|
|
1085
|
+
path = path.with_suffix(".zip")
|
|
1086
|
+
|
|
1087
|
+
with open(path, "wb") as f:
|
|
1088
|
+
f.write(support_bundle_bytes)
|
|
1089
|
+
|
|
1090
|
+
print(f"Support bundle written to {path}")
|
|
1091
|
+
|
|
1092
|
+
return support_bundle_bytes
|
|
@@ -951,3 +951,28 @@ Reason: The pipeline is in a STOPPED state due to the following error:
|
|
|
951
951
|
resp = self.http.get(path="/config")
|
|
952
952
|
|
|
953
953
|
return FelderaConfig(resp)
|
|
954
|
+
|
|
955
|
+
def get_pipeline_support_bundle(self, pipeline_name: str) -> bytes:
|
|
956
|
+
"""
|
|
957
|
+
Generate a support bundle containing diagnostic information from a pipeline.
|
|
958
|
+
|
|
959
|
+
This endpoint collects various diagnostic data from the pipeline including
|
|
960
|
+
circuit profile, heap profile, metrics, logs, stats, and connector statistics,
|
|
961
|
+
and packages them into a single ZIP file for support purposes.
|
|
962
|
+
|
|
963
|
+
:param pipeline_name: The name of the pipeline
|
|
964
|
+
:return: The support bundle as bytes (ZIP file)
|
|
965
|
+
:raises FelderaAPIError: If the pipeline does not exist or if there's an error
|
|
966
|
+
"""
|
|
967
|
+
|
|
968
|
+
resp = self.http.get(
|
|
969
|
+
path=f"/pipelines/{pipeline_name}/support_bundle",
|
|
970
|
+
stream=True,
|
|
971
|
+
)
|
|
972
|
+
|
|
973
|
+
buffer = b""
|
|
974
|
+
for chunk in resp.iter_content(chunk_size=1024):
|
|
975
|
+
if chunk:
|
|
976
|
+
buffer += chunk
|
|
977
|
+
|
|
978
|
+
return buffer
|
|
@@ -3,6 +3,9 @@ import pathlib
|
|
|
3
3
|
import pandas as pd
|
|
4
4
|
import time
|
|
5
5
|
import unittest
|
|
6
|
+
import io
|
|
7
|
+
import tempfile
|
|
8
|
+
import zipfile
|
|
6
9
|
|
|
7
10
|
from tests.shared_test_pipeline import SharedTestPipeline
|
|
8
11
|
from tests import TEST_CLIENT, enterprise_only
|
|
@@ -549,6 +552,41 @@ class TestPipeline(SharedTestPipeline):
|
|
|
549
552
|
got = TEST_CLIENT.get_pipeline(self.pipeline.name).runtime_config["resources"]
|
|
550
553
|
assert got == config
|
|
551
554
|
|
|
555
|
+
def test_support_bundle(self):
|
|
556
|
+
self.pipeline.start()
|
|
557
|
+
|
|
558
|
+
# Test getting support bundle as bytes
|
|
559
|
+
support_bundle_bytes = self.pipeline.support_bundle()
|
|
560
|
+
assert isinstance(support_bundle_bytes, bytes)
|
|
561
|
+
assert len(support_bundle_bytes) > 0
|
|
562
|
+
|
|
563
|
+
# Test that it's a valid ZIP file
|
|
564
|
+
try:
|
|
565
|
+
with zipfile.ZipFile(io.BytesIO(support_bundle_bytes), "r") as zip_file:
|
|
566
|
+
# Check that the ZIP file contains some files
|
|
567
|
+
file_list = zip_file.namelist()
|
|
568
|
+
assert len(file_list) > 0
|
|
569
|
+
except zipfile.BadZipFile:
|
|
570
|
+
self.fail("Support bundle is not a valid ZIP file")
|
|
571
|
+
|
|
572
|
+
# Test saving to file
|
|
573
|
+
with tempfile.NamedTemporaryFile(suffix=".zip", delete=False) as temp_file:
|
|
574
|
+
temp_path = temp_file.name
|
|
575
|
+
|
|
576
|
+
try:
|
|
577
|
+
# Test saving with explicit path
|
|
578
|
+
self.pipeline.support_bundle(output_path=temp_path)
|
|
579
|
+
|
|
580
|
+
# Verify the file was created and is a valid ZIP
|
|
581
|
+
assert os.path.exists(temp_path)
|
|
582
|
+
with zipfile.ZipFile(temp_path, "r") as zip_file:
|
|
583
|
+
file_list = zip_file.namelist()
|
|
584
|
+
assert len(file_list) > 0
|
|
585
|
+
finally:
|
|
586
|
+
# Clean up
|
|
587
|
+
if os.path.exists(temp_path):
|
|
588
|
+
os.unlink(temp_path)
|
|
589
|
+
|
|
552
590
|
|
|
553
591
|
if __name__ == "__main__":
|
|
554
592
|
unittest.main()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|