Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ modules =
azul.plugins.metadata.hca.service.filter,
azul.service.storage_service,
azul.service.source_service,
azul.filters,
azul.service,
azul.service.source_controller,
azul.service.query_controller,
Expand All @@ -71,6 +72,7 @@ modules =
azul.service.manifest_service,
azul.field_type,
azul.source,
scripts.kibana_proxy,


packages =
Expand Down
19 changes: 13 additions & 6 deletions scripts/kibana_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,11 @@
import sys
import tarfile
import time
from typing import (
Callable,
)

import docker
import docker.client
import docker.errors
from docker.models.containers import (
Container,
Expand All @@ -56,6 +59,9 @@
from azul.lib import (
cached_property,
)
from azul.lib.types import (
not_none,
)
from azul.logging import (
configure_script_logging,
)
Expand All @@ -67,7 +73,7 @@ class KibanaProxy:

def __init__(self, options) -> None:
self.options = options
self.docker = docker.from_env()
self.docker = docker.client.from_env()

def create_container(self, image: str, *args, **kwargs) -> Container:
try:
Expand All @@ -80,7 +86,8 @@ def create_container(self, image: str, *args, **kwargs) -> Container:

def run(self):
# aws-signing-proxy doesn't support credentials
creds = aws.boto3_session.get_credentials().get_frozen_credentials()
creds = not_none(aws.boto3_session.get_credentials())
creds = creds.get_frozen_credentials()
kibana_port = self.options.kibana_port
cerebro_port = self.options.cerebro_port or kibana_port + 1
proxy_port = self.options.proxy_port or kibana_port + 2
Expand Down Expand Up @@ -155,10 +162,10 @@ def print_instructions():
'http://127.0.0.1:%i/#!/overview?host=http://localhost:%i/',
kibana_port, cerebro_port, es_port)

tasks = [
tasks: list[Callable[[], None]] = [
start_containers,
print_instructions,
*((partial(handle_container, c)) for c in containers)
*map(partial(partial, handle_container), containers)
]
with ThreadPoolExecutor(max_workers=len(tasks)) as tpe:
futures = list(map(tpe.submit, tasks))
Expand All @@ -185,7 +192,7 @@ def add_file(self,
def opensearch_endpoint(self):
log.info('Getting domain endpoint')
client = aws.opensearch
domain = client.describe_elasticsearch_domain(DomainName=self.options.domain)
domain = client.describe_domain(DomainName=self.options.domain)
return 'https://' + domain['DomainStatus']['Endpoints']['vpc']


Expand Down
Loading
Loading