Skip to content

Commit

Permalink
make gen/lint and unnecessary sleep removal
Browse files Browse the repository at this point in the history
  • Loading branch information
briansonnenberg committed Dec 12, 2023
1 parent 47c6058 commit 2dd8684
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions isotope/runner/istio.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def set_up(entrypoint_service_name: str, entrypoint_service_namespace: str,
extracted_istio_path = _extract(archive_path, extracted_dir_path)

istioctl_path = os.path.join(extracted_istio_path, 'bin',
'istioctl')
'istioctl')

chart_path = os.path.join(extracted_istio_path, 'install',
'kubernetes', 'helm', 'istio')
Expand Down Expand Up @@ -112,7 +112,7 @@ def _install_istio(istioctl_path) -> None:
logging.info('Running istioctl install')
install = sh.run([istioctl_path,
'install',
'--set',
'--set',
'profile=default',
'--skip-confirmation'])

Expand Down
9 changes: 5 additions & 4 deletions isotope/runner/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@
os.path.dirname(os.path.dirname(__file__)))
_MAIN_GO_PATH = os.path.join(_REPO_ROOT, 'convert', 'main.go')


def _parse_namespace_from_topology_line(line: str) -> str:
pattern = r"\s*namespace: (.+)"
match = re.search(pattern, line)
if match:
return match.group(1)
return None


def _kubectl_create_namespaces(namespaces: list[str]) -> bool:
for ns in namespaces:
gen = sh.run(
Expand All @@ -45,6 +47,7 @@ def _kubectl_create_namespaces(namespaces: list[str]) -> bool:
],
check=False)


def run(topology_path: str, env: mesh.Environment, service_image: str,
client_image: str, istio_archive_url: str, test_qps: Optional[int],
test_duration: str, test_num_concurrent_connections: int,
Expand Down Expand Up @@ -80,7 +83,7 @@ def run(topology_path: str, env: mesh.Environment, service_image: str,
service_graph_namespaces.append(namespace)
logging.info('topology file contains the following service-graph namespaces: "%s"', service_graph_namespaces)

#TODO: this should not be necessary, but the namespaces are not part of convert output.
# TODO: this should not be necessary, but the namespaces are not part of convert output.
_kubectl_create_namespaces(service_graph_namespaces)

topology_name = _get_basename_no_ext(topology_path)
Expand Down Expand Up @@ -109,6 +112,7 @@ def _get_basename_no_ext(path: str) -> str:
basename = os.path.basename(path)
return os.path.splitext(basename)[0]


def _gen_yaml(topology_path: str, service_image: str,
max_idle_connections_per_host: int, client_image: str,
env_name: str) -> str:
Expand Down Expand Up @@ -158,9 +162,6 @@ def _test_service_graph(yaml_path: str, test_result_output_path: str,
# TODO: extract to env.context, with entrypoint hostname as the ingress URL
with kubectl.manifest(yaml_path):
wait.until_service_graph_is_ready(service_graph_namespaces)
# TODO: Why is this extra buffer necessary?
logging.debug('sleeping for 60 seconds as an extra buffer')
time.sleep(60)

_run_load_test(test_result_output_path, test_target_url, test_qps,
test_duration, test_num_concurrent_connections)
Expand Down

0 comments on commit 2dd8684

Please sign in to comment.