Skip to content

Commit

Permalink
remove cluster info from /introspect
Browse files Browse the repository at this point in the history
  • Loading branch information
javitonino committed Jan 21, 2025
1 parent 96c4302 commit 42770ee
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 30 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ jobs:
fail-on-cache-miss: true

- name: Build docker images for nidx
run: mv nidx/target/release/nidx builds && docker build -t nidx -f Dockerfile.nidx_prebuilt .
run: mkdir builds && mv nidx/target/release/nidx builds && docker build -t nidx -f Dockerfile.nidx_prebuilt .

- name: Run tests
run: source .venv/bin/activate && make -C nucliadb test-cov-search
Expand Down
24 changes: 0 additions & 24 deletions nucliadb/src/nucliadb/standalone/introspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ async def stream_tar(app: FastAPI) -> AsyncGenerator[bytes, None]:
with tarfile.open(tar_file, mode="w:gz") as tar:
await add_system_info(temp_dir, tar)
await add_dependencies(temp_dir, tar)
await add_cluster_info(temp_dir, tar)
settings: Settings = app.settings.copy() # type: ignore
await add_settings(temp_dir, tar, settings)
if settings.log_output_type == LogOutputType.FILE:
Expand Down Expand Up @@ -145,29 +144,6 @@ def _add_dependencies_to_tar(temp_dir: str, tar: tarfile.TarFile):
tar.add(dependendies_file, arcname="dependencies.txt")


async def add_cluster_info(temp_dir: str, tar: tarfile.TarFile):
loop = asyncio.get_event_loop()
await loop.run_in_executor(None, _add_cluster_info_to_tar, temp_dir, tar)


def _add_cluster_info_to_tar(temp_dir: str, tar: tarfile.TarFile):
cluster_info = ClusterInfo(
nodes=[
NodeInfo(
id=node.id,
address=node.address,
shard_count=node.shard_count,
primary_id=node.primary_id,
)
for node in cluster_manager.get_index_nodes()
]
)
cluster_info_file = os.path.join(temp_dir, "cluster_info.txt")
with open(cluster_info_file, "w") as f:
f.write(cluster_info.model_dump_json(indent=4))
tar.add(cluster_info_file, arcname="cluster_info.txt")


async def add_settings(temp_dir: str, tar: tarfile.TarFile, settings: Settings):
loop = asyncio.get_event_loop()
await loop.run_in_executor(None, _add_settings_to_tar, temp_dir, tar, settings)
Expand Down
5 changes: 0 additions & 5 deletions nucliadb/tests/standalone/integration/test_introspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,6 @@ async def test_introspect_endpoint(nucliadb_writer_manager: AsyncClient) -> None
assert "nucliadb" in dependencies
assert "nucliadb-models" in dependencies

# Check cluster info
assert os.path.exists(os.path.join(extracted_tar, "cluster_info.txt"))
cluster_info = ClusterInfo.parse_file(os.path.join(extracted_tar, "cluster_info.txt"))
assert len(cluster_info.nodes) > 0

# Check settings
assert os.path.exists(os.path.join(extracted_tar, "settings.json"))
introspect_settings = Settings.parse_file(os.path.join(extracted_tar, "settings.json"))
Expand Down

0 comments on commit 42770ee

Please sign in to comment.