-
Notifications
You must be signed in to change notification settings - Fork 83
Always build all binaries and migrations, simplify deployment #419
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sethvargo The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/assign @mikehelmick |
BuildID string = "unknown" | ||
|
||
// BuildTag is the git tag from which this build was created. | ||
BuildTag string = "unknown" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it possible to also get the commit sha for when a build is done from head
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does go tool buildid
work for your use case???
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
git describe --dirty
(which I'm using) does what I think you want, some examples:
v0.1.1
v0.1.1-ab28ced
v0.1.1-ab28ced-dirty
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jeremyfaller we explicitly want the Cloud Build Build ID here (it's a UUID).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks reasonable.
I personally prefer to be more explicit (by just having a Dockerfile per service), at the cost of speed, so that we could just setup cloud build to automatically build every commit, and then just deploy and promote when we want. But given this is optimizing for the local workflow, it seem solid.
I'll let Mike give the final review. Also note you have a merge commit as the e2e service now exists.
cloudbuild.yaml
Outdated
@@ -1,115 +0,0 @@ | |||
timeout: 40m |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any way to keep this file? If we have this setup, then we'd at least have continuous builds. Maybe we could simplify it to just call the build script?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can point Cloud Build at the build.yaml file (which was my plan here).
m["title"] = config.ServerName | ||
} | ||
m["server"] = config.ServerName | ||
m["title"] = config.ServerName |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't you not want to overwrite this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's actually not possible to overwrite them since we've moved this into the middleware. This is an artifact from whenever they were lazy-added, but now we force-add these attributes very early in the middleware.
# adminapi | ||
# | ||
- id: 'deploy-adminapi' | ||
name: 'gcr.io/google.com/cloudsdktool/cloud-sdk:307.0.0-alpine' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eh, two things:
-
I've been bitten by subtle changes in gcloud and would prefer to make deploys as reproducible as possible by reducing variables.
-
Cloud Build is going to cache the container image. So "latest" isn't actually latest anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough. I always prefer latest if possible because folks always forget to update, and the larger the diff on upgrade, the higher the chance of bug.
Faster and more reliable builds and migrations
@icco I don't think this precludes or eliminates that possibility. In fact, I want to set this up to auto-build on each commit to HEAD, then we just deploy, maybe migrate, and promote. |
06f8279
to
7c4e9d6
Compare
I talked with Seth and reread and I don't think I truly understood what this is doing. The details that was missing for me is that |
/lgtm |
No, I'm all good. If you want a LG, LMK. |
In preparation for me documenting this, I wanted to do a refactor of our build/deploy/migrate/promote lifecycle. This PR:
/go/pkg
directory to make builds beyond the first much fasterFixes GH-411
Release Note