Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content
This repository has been archived by the owner on Aug 26, 2022. It is now read-only.

makefile target + script for creating demo k8s instances #4127

Merged
merged 5 commits into from
Feb 15, 2017

Conversation

bookshelfdave
Copy link
Contributor

No description provided.

@codecov-io
Copy link

codecov-io commented Feb 9, 2017

Codecov Report

Merging #4127 into master will not change coverage.

@@           Coverage Diff           @@
##           master    #4127   +/-   ##
=======================================
  Coverage   86.21%   86.21%           
=======================================
  Files         144      144           
  Lines        8877     8877           
  Branches     1187     1187           
=======================================
  Hits         7653     7653           
  Misses        990      990           
  Partials      234      234
Impacted Files Coverage Δ
kuma/settings/common.py 95.02% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 302819a...1652c21. Read the comment docs.

@escattone escattone self-requested a review February 9, 2017 20:55
@escattone escattone self-assigned this Feb 9, 2017
Copy link
Contributor

@escattone escattone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if we should change demo.groovy to skip the deploy stage if the branch name doesn't satisfy Deis' app name rules (must only contain numbers, hyphens, and lowercase letters, must start with a lowercase letter, and can't end with a hyphen)?

@bookshelfdave
Copy link
Contributor Author

@escattone that is a fantastic idea, I'll add that to this PR

@escattone
Copy link
Contributor

escattone commented Feb 9, 2017

@metadave

I'm not a Groovy programmer, but could something like this be used for doing that?

env.BRANCH_NAME.matches("^[a-z][a-z0-9-]*[a-z0-9]$")

@bookshelfdave
Copy link
Contributor Author

@escattone yes, that's excellent. We're prepending mdn-demo- to the branch name, so it may not have to be so restrictive.

@escattone
Copy link
Contributor

@metadave The "$" portion of the regex within the Groovy script was causing an exception, but fortunately it turns out we didn't need the boundary "matchers" ("^" and "$") in the regex since the matches method already requires that the regex has to match the entire string (sorry, my bad). I added a commit to remove them, and now the assert does its job.

Jenkins doesn't report (in the curated output) that the failure was due to the assert though, so I'm wondering if we should do something like this instead of the assert?

if (!env.BRANCH_NAME.matches("[a-z0-9-]*[a-z0-9]")) {
    # report the error and fail
}

- if a corresponding k8s namespace -> branch does not exist, offer to:
  - delete the namespace
  - add an annotation to keep the namespace. The next run of this script
    won't offer to delete the namespace, and a command will be displayed
    (but not run) to clear the annotation.
  - ignore the namespace
- if a corresponding k8s namespace -> branch DOES exist, don't do
  anything
@bookshelfdave
Copy link
Contributor Author

bookshelfdave commented Feb 10, 2017

I added one more piece to this PR:

add instance_cleanup.sh for SRE's to remove demo instances

  • if a corresponding k8s namespace -> branch does not exist, offer to:
    • delete the namespace
    • add an annotation to keep the namespace. The next run of this script
      won't offer to delete the namespace, and a command will be displayed
      (but not run) to clear the annotation.
    • ignore the namespace
  • if a corresponding k8s namespace -> branch DOES exist, don't do
    anything

https://asciinema.org/a/9l0rjkifrb4gayase4ywu4wsd

@bookshelfdave
Copy link
Contributor Author

any more thoughts on this?

Copy link
Contributor

@jgmize jgmize left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, nice work as usual @metadave.
@escattone will you please take a final look and merge if you don't find any issues I missed?

Copy link
Contributor

@escattone escattone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice @metadave! This looks good to me!

I decided not to replace the assert in demo.groovy with something that would do the same thing but display more user-friendly output on failure, since we check the branch name when we create the demo.

@escattone escattone merged commit 917c450 into master Feb 15, 2017
@jwhitlock jwhitlock deleted the dp_demo_instances branch September 21, 2017 13:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants