From b050a242f3fce28fb00f32585bf7bdffbc0b61a0 Mon Sep 17 00:00:00 2001 From: "Kamil Mankowski (kam193)" Date: Wed, 3 Apr 2024 22:35:29 +0200 Subject: [PATCH] Fix RAM limit, fix exporting empty results --- network-information/VERSION | 2 +- network-information/service/al_run.py | 4 ++-- network-information/service/mmdb.py | 5 ----- network-information/service_manifest.yml | 4 ++-- 4 files changed, 5 insertions(+), 10 deletions(-) delete mode 100644 network-information/service/mmdb.py diff --git a/network-information/VERSION b/network-information/VERSION index d00491f..0cfbf08 100644 --- a/network-information/VERSION +++ b/network-information/VERSION @@ -1 +1 @@ -1 +2 diff --git a/network-information/service/al_run.py b/network-information/service/al_run.py index 9df401e..5fc6a6d 100644 --- a/network-information/service/al_run.py +++ b/network-information/service/al_run.py @@ -62,11 +62,11 @@ def _handle_ip(self, ip_address: str) -> ResultTableSection: section = ResultTableSection(f"IP: {ip_address}") for source_name, data in ip_info.items(): if data: - subsection = ResultTableSection(f"Data from {source_name}") + subsection = ResultTableSection(f"[MMDB] Data from {source_name}") for key, value in data.items(): subsection.add_row(TableRow({"Information": key.title(), "Value": value})) section.add_subsection(subsection) - return section + return section if section.subsections else None def _handle_ips(self, request: ServiceRequest) -> ResultSection | None: # TODO: optional static diff --git a/network-information/service/mmdb.py b/network-information/service/mmdb.py deleted file mode 100644 index 6db8b68..0000000 --- a/network-information/service/mmdb.py +++ /dev/null @@ -1,5 +0,0 @@ -import subprocess - -# Simple wrapper over https://github.com/ipinfo/mmdbctl -class MMDBReader: - pass diff --git a/network-information/service_manifest.yml b/network-information/service_manifest.yml index 4a5fb8b..d37b5a0 100644 --- a/network-information/service_manifest.yml +++ b/network-information/service_manifest.yml @@ -5,7 +5,7 @@ enabled: true accepts: .* # All files rejects: empty -stage: REVIEW +stage: POST category: Networking uses_tags: true uses_temp_submission_data: true @@ -55,7 +55,7 @@ update_config: dependencies: updates: container: - ram_mb: 256 + ram_mb: 512 allow_internet_access: true command: ["python", "-m", "service.updater"] image: ${REGISTRY}ghcr.io/kam193/assemblyline-service-network-information:$SERVICE_TAG