From cb7dfb4642e25b2249ee2e4c8ebe2e463bf014b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Sat, 6 Nov 2021 12:08:35 +0100 Subject: [PATCH] Tweak comments and todos --- README.md | 10 +++++----- src/runboat/k8s.py | 5 ++++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 50a551b..7e7fc6d 100644 --- a/README.md +++ b/README.md @@ -131,22 +131,22 @@ Prototype (min required to open the project): MVP: -- deployment and more load testing - build/log and build/init-log api endpoints -- secure github webhooks - better error handling in API (return 400 on user errors) - more tests -- publish runboat container image - look at other TODO in code to see if anything important remains - basic UI (single page with a combo box to select repo and show builds by branch/pr, with start/stop buttons) +- better target_url in GitHub status: instead of providing the link to the ingress, + provide a link to the build, which redirects to the ingress if the build is started, + or to a build details page with action buttons (start, stop, view log, etc) +- secure github webhooks +- deployment and more load testing More: - shiny UI - websocket stream of build changes, for a dynamic UI -- better target_url in GitHub status: instead of providing the link to the ingress, - provide a link to the build, which redirects to the ingress if the build is started - handle PR close (delete all builds for PR) - handle branch delete (delete all builds for branch) - create builds for all supported repos on startup (goes with sticky branches) diff --git a/src/runboat/k8s.py b/src/runboat/k8s.py index d507c31..912887b 100644 --- a/src/runboat/k8s.py +++ b/src/runboat/k8s.py @@ -182,7 +182,7 @@ def _render_kubefiles(deployment_vars: DeploymentVars) -> Generator[Path, None, __package__, "kubefiles" ) as kubefiles_path, tempfile.TemporaryDirectory() as tmp_dir: tmp_path = Path(tmp_dir) - # TODO async copytree + # TODO async copytree, or make this whole _runder_kubefiles run_in_executor shutil.copytree(kubefiles_path, tmp_path, dirs_exist_ok=True) template = Template((tmp_path / "kustomization.yaml.jinja").read_text()) (tmp_path / "kustomization.yaml").write_text( @@ -202,6 +202,9 @@ async def _kubectl(args: list[str]) -> None: async def deploy(deployment_vars: DeploymentVars) -> None: with _render_kubefiles(deployment_vars) as tmp_path: + # Dry-run first to avoid creaing some resources when the creation of the + # deployment fails. In such cases, we would have resource leak as the existence + # of deployment is how the controller knows it has something to manage. await _kubectl( [ "apply",