#release-engineering - November 2018

November 2018
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)about 8 years ago
@dustinvb just joined! he dreams in pipelines
dustinvb
dustinvbabout 8 years ago
Ah bah, no :superfresh: emoji.
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)about 8 years ago
haha
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)about 8 years ago
we can add that 😃
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)about 8 years ago(edited)
for those that don’t know dustin, he is an awesome support engineer at Codefresh, which is what we use for all of our CI/CD
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)about 8 years ago
hey @dustinvb
dustinvb
dustinvbabout 8 years ago
Hi Andriy.
dustinvb
dustinvbabout 8 years ago
Happy to help out in anyway I can.
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)about 8 years ago
thanks
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)about 8 years ago
we all love Codefresh 🙂
dustinvb
dustinvbabout 8 years ago
I do as well. Was a customer for a year before joining.
Gonzalo Peci
Gonzalo Pecialmost 8 years ago
Howdy releasers
Gonzalo Peci
Gonzalo Pecialmost 8 years ago
I wanted to discuss one topic that is spinning in my head for a while:
- Reusing docker or other artifacts from PRs or not

Basically, so speed up the build/release cycle, I was thinking on reusing the tested/built artifact in a PR when we deploy to the QA environment and ofcourse subsequently
Gonzalo Peci
Gonzalo Pecialmost 8 years ago
Now, this is not an easy challenge as its "hard" to identify the built artifact
Gonzalo Peci
Gonzalo Pecialmost 8 years ago(edited)
since we enforce "up to date branches" im testing using git rev-parse --short HEAD^2 on the merge|commit job to identify the artifact by the tag (we tag with the commit) of the branch that did the PR that was merged and created that commit.
Gonzalo Peci
Gonzalo Pecialmost 8 years ago
*   2341145 (HEAD -> master, tag: 0.2.1, origin/master, workingset) Merge pull request #15 from thithat/staging
|\  
| *   d1bd417 Merge pull request #14 from thithat/feature/this-that
| |\  
| | * 43ba953 (feature/this-that) Test Version Flow release
* | |   16c043a Merge pull request #13 from thithat/staging
Gonzalo Peci
Gonzalo Pecialmost 8 years ago(edited)

❯ git rev-parse --short HEAD^2
d1bd417

❯ git rev-parse --short HEAD^1
16c043a
Gonzalo Peci
Gonzalo Pecialmost 8 years ago
thoughts? ideas?
what is your current CI workflow? What do you build on PR and on merge?
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
so our workflow is slightly different
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
we have “unlimited staging environments” which correspond to PRs - one per PR; those just build images pinned to 0.0.0-gitsha
Gonzalo Peci
Gonzalo Pecialmost 8 years ago
entire environments or just images?
Gonzalo Peci
Gonzalo Pecialmost 8 years ago
In a similar tone to my previous question, anyone has a working workflow for using terraform plan from PR build or similar?
Because while its the recommended way for terraform, I have yet to see a working workflow for it
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 8 years ago
@Gonzalo Peci if you are asking about how to trigger terraform plan/apply from an open PR, we recently used atlantis for a GitOps workflow. See #atlantis channel. Also @Erik Osterman (Cloud Posse) recently held a meetup during #connectweek in Pasadena (CA) where he gave a live demo using Atlantis with Terraform to provision AWS user accounts using only Pull Requests
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 8 years ago
Gonzalo Peci
Gonzalo Pecialmost 8 years ago
No, not exactly like that, im not a big fan of what atlantis does
Gonzalo Peci
Gonzalo Pecialmost 8 years ago
It applies before merge, to me that is anti-pattern
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
Except for terraform plans are poor
Gonzalo Peci
Gonzalo Pecialmost 8 years ago
I was thinking appling the plan generated on PR, on the merge
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
They are optimistic at best
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
So if you merge and apply now what is in git is not deployed
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
If others are developing against it, they are just as blocked
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
So what we’ve reconciled is auto merge on successful apply
Gonzalo Peci
Gonzalo Pecialmost 8 years ago
Well, but that is the same case for a CD container release
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
But for container releases it’s more stable
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
You have more under your control
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
Less value based errors
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
Most terraform failures in my experience are due to bad values
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
Containers get their values at runtime
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
Not at compile time (not generally but ideally)
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
You can achieve what you want easily with Codefresh.
Gonzalo Peci
Gonzalo Pecialmost 8 years ago
Yeah, that is true, and a fair point, but not this one:
So if you merge and apply now what is in git is not deployed

If others are developing against it, they are just as blocked
Gonzalo Peci
Gonzalo Pecialmost 8 years ago
In theory in the container you have the same "posibility" of failure
Gonzalo Peci
Gonzalo Pecialmost 8 years ago
but I agree, is not as likely, as easiert to caught on test
Gonzalo Peci
Gonzalo Pecialmost 8 years ago
TF has a lot of sideeffect failure scenarios, that plan does not catch
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
To me atlantis is a practical approach
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
Not the theoretical ideal
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
So rather than clutter the master commit history with a bunch of patch releases, rather get it in clean. We preserve a full transcript in the git comments so we have a record of what is deployed.
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
Even if the PR is closed but half applied, there’s a record of that’s
Gonzalo Peci
Gonzalo Pecialmost 8 years ago
Yeah, its not a bad approach and im not saying Atlantis sucks, much the contrary, even Hashi bought them
Gonzalo Peci
Gonzalo Pecialmost 8 years ago
I just feel that is a "hack" around a bigger issue
Gonzalo Peci
Gonzalo Pecialmost 8 years ago
a great hack, but a hack anyway
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
Agreed
Gonzalo Peci
Gonzalo Pecialmost 8 years ago
In my previous company we had a rake looper to get around TF Modules not having count, it worked, and it saved us a lot of time, but in "terraform" it was a hack
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
I just don’t see a way around it that’s practical to solve (unless your HashiCorp and have 100mil in fresh green)
Gonzalo Peci
Gonzalo Pecialmost 8 years ago
😄
Gonzalo Peci
Gonzalo Pecialmost 8 years ago
Yeah true
Gonzalo Peci
Gonzalo Pecialmost 8 years ago
I might give it 2nd chance, at least it will avoid those fix PRs for a stupid terraform value problem
Gonzalo Peci
Gonzalo Pecialmost 8 years ago
BTW, its great to have a place to ping-pong this ideas
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
Yea totally!! That what this place is for
Gonzalo Peci
Gonzalo Pecialmost 8 years ago
Yep, thanks 🤘 !
joshmyers
joshmyersalmost 8 years ago(edited)
Run a plan, push an artefact, namely the plan output. Run an apply of said build artefact number. This could be a gitsha, PR number, Jenkins build number. I don't see a huge advantage of Atlantis... although I caveat with not having used so opinions maybe wrong. Have been doing CI/CD of terraform plan + apply for a long time in Jenkins. Not a massive fan of having output in the PR for history. Your git history lives forever, github PRs may not. Running pre merge isnt ideal for team scenario's. Have seen a lot of failed apply due to vars, state, lots of TF bugs, race conditions...
joshmyers
joshmyersalmost 8 years ago
Things like tflint can help with some of these
joshmyers
joshmyersalmost 8 years ago
E.g. checking a type of AMI is even available in a region
joshmyers
joshmyersalmost 8 years ago
Won't catch bugs though.
joshmyers
joshmyersalmost 8 years ago
Is Atlantis just like serverless Jenkins ci/cd for terraform with output posted back to the PR?
joshmyers
joshmyersalmost 8 years ago
Sounds nice if you don't already have a CI/CD solution/don't need one for other things?
yurchenko
yurchenkoalmost 8 years ago
ok
Gabe
Gabealmost 8 years ago
anyone here use github actions yet? do you know if there is a way to cache dependencies between builds?
Gabe
Gabealmost 8 years ago
haven’t seen anything in the docs
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
no one @cloudposse has been invited to the beta
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
i reached out to some peeps at GitHub but we don't have the klout =0
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
@Gabe are you in the beta?
Gabe
Gabealmost 8 years ago
yeah we just got accepted in
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
just checked my inbox
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
nothing yet
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
😢
Gabe
Gabealmost 8 years ago
i don’t think i got an email… just saw the new actions button on our repo
Gabe
Gabealmost 8 years ago
erik
erikalmost 8 years ago
Gabe
Gabealmost 8 years ago
hmm yeah… it looks pretty cool so far but a few things i’ve noticed is not being able to cache dependencies between builds, no control over the size of the machine it runs on (1 cpu 3.75 gb), and only two concurrent workflows running at one time per repo
Gabe
Gabealmost 8 years ago
pros are that it seems simpler than circle/jenkins and you can create actions that take environment variables so it’s easier to reuse/share actions between repos
Gabe
Gabealmost 8 years ago
… and we just got the email saying they have enabled it for us 😆
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 8 years ago
i just got the same email a few minutes ago, and Actions on my personal GitHub account 🙂
erik
erikalmost 8 years ago
Steven
Stevenalmost 8 years ago
I'm not so lucky. Still waiting
davidvasandani
davidvasandanialmost 8 years ago
@Andriy Knysh (Cloud Posse) this screenshot from https://github.com/cloudposse/github-status-updater how do you release to a namespace?
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 8 years ago
every PR is a new k8s namespace. It’s how we do unlimited staging environments
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 8 years ago
see @Erik Osterman (Cloud Posse) presentation https://cloudposse.com/devops/unlimited-staging-environments/
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 8 years ago
@davidvasandani if you have questions or need more info, we can provide it
davidvasandani
davidvasandanialmost 8 years ago
@Andriy Knysh (Cloud Posse) do you happen to have an example where all these pieces are glued together?
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 8 years ago
give me a few minutes
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 8 years ago
re: Self-hosted Helm Chart Registry - Codefresh added Managed Helm Repositories after the presentation, so we use it now instead of deploying our own chart museum
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 8 years ago
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 8 years ago
@davidvasandani ^