weaveworks-experiments / compare-revisions

Experimental thing for comparing what's on k8s clusters
Apache License 2.0
0 stars 0 forks source link

[WIP] Deploy lead times #46

Closed jml closed 6 years ago

jml commented 6 years ago

After reading Accelerate, I was interested in figuring out what the lead times were on our deployments.

That is, how long does it take for something to get rolled out after it has been committed to trunk?

We have all the relevant information in compare-revisions, so it seemed straightforward to add it here.

Unfortunately, the change took way longer than I thought, and has at least one bug (see below). I don't think the code is very clear either. Thus, I'm not proposing we merge this. I don't intend to spend further time on this, but am posting the PR in case someone else wants to, and for posterity.

The bug is that we are not matching the upstream code revision to the deploying revision of service-conf correctly, e.g.

  "https://github.com/weaveworks/kured.git": [
    {
      "source": {
        "subject": "Add warning to Dockerfile re: upgrading kubectl",
        "body": null,
        "author": "Adam Harrison",
        "commit-date": "2018-06-05T17:00:02Z",
        "revision": "5731b98a8aa2780afb03e47d3dabfb385ba58151"
      },
      "deploy": {
        "subject": "Auto-release quay.io/weaveworks/ui-server:master-95151565",
        "body": null,
        "author": "Weave Flux",
        "commit-date": "2018-08-29T10:49:27Z",
        "revision": "1805893815abc4ef4e88af92dda2e993db51e32b"
      }
    }

That deploy did not change the kured version:

commit 1805893815abc4ef4e88af92dda2e993db51e32b
Author: Weave Flux <support@weave.works>
Date:   Wed Aug 29 10:49:27 2018 +0000

    Auto-release quay.io/weaveworks/ui-server:master-95151565

diff --git a/k8s/dev/default/ui-server-dep.yaml b/k8s/dev/default/ui-server-dep.yaml
index f6fdac1..18554d0 100644
--- a/k8s/dev/default/ui-server-dep.yaml
+++ b/k8s/dev/default/ui-server-dep.yaml
@@ -27,6 +27,6 @@ spec:
       - name: quay-secret
       containers:
       - name: ui-server
-        image: quay.io/weaveworks/ui-server:master-dc36b363
+        image: quay.io/weaveworks/ui-server:master-95151565
         ports:
         - containerPort: 80
jml commented 6 years ago

Closing, as I don't intend on merging this.