Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

example: pull from upstream repos directly, use fixed revisions #72

Merged
merged 1 commit into from
Nov 8, 2018

Conversation

pohly
Copy link
Collaborator

@pohly pohly commented Nov 6, 2018

Maintaining local copies of all the necessary files is unnecessary, we
might as well tell kubectl to pull directly from the individual
repos. But to ensure that this really pulls the right revision of each
file, we have to specify the revision hashes instead of the "master"
branch.

Updating those hashes manually can be cumbersome. The new
hack/update-example.sh script automates that step. The remaining local
.yaml files are the ones that have no corresponding upstream file. It
might be worth pushing them upstream in the future, because then
everything will be in one place (hostpath deployment + examples)
and/or easier to update (first update in upstream repo, then update
docs with the hashes).

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Nov 6, 2018
@pohly
Copy link
Collaborator Author

pohly commented Nov 6, 2018

/cc @msau42
/hold

kubernetes-csi/external-snapshotter#53 must be merged first, then the Example.md needs to be updated an the HTML files re-generated. But some early feedback would be welcome before I invest more time into this, and I wanted to have this PR open as explanation why that other PR is useful.

@k8s-ci-robot k8s-ci-robot requested a review from msau42 November 6, 2018 12:10
@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 6, 2018
@pohly pohly closed this Nov 6, 2018
@pohly pohly reopened this Nov 6, 2018
@pohly
Copy link
Collaborator Author

pohly commented Nov 6, 2018

FWIW, I tested this on a 1.13 pre-release of Kubernetes (current master, basically). Would it make sense to mention at the top of the Example.md that the instructions work for both 1.12 and 1.13?

@pohly pohly force-pushed the upstream-yaml branch 2 times, most recently from b59af7d to 69d1220 Compare November 6, 2018 17:26
@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 6, 2018
@pohly
Copy link
Collaborator Author

pohly commented Nov 6, 2018

/hold cancel

PR was merged, all upstream files expected by this PR are now available.

/assign @msau42

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 6, 2018
@pohly pohly changed the title example: pull from upstream repos directly, used fixed revisions example: pull from upstream repos directly, use fixed revisions Nov 6, 2018
Copy link

@j-griffith j-griffith left a comment

Choose a reason for hiding this comment

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

@pohly Thanks for this, I just noticed the URLs were outdated and saw your PR. I'm not completely sure about using the versioned manifest, although your update-example.sh script is slick! IIUC that means we introduce another dependency on another repo which means, something will change and we'll forget again :)

Other than that, I'd love to see the fixes you have to the URLs and the clipboard issues merged. One other thing is maybe fix the "feature-dates" in the same Example.md file while you're cleaning up the rest of it?

for url in $(grep 'kubectl create -f.*https://raw.githubusercontent.com/' $example | sed -e 's;.*\(https://raw.githubusercontent.com[^ (]*\).*;\1;'); do
# split URL into pieces
eval $(echo $url | sed -e 's/\]$//' -e 's;https://raw.githubusercontent.com/\([^/]*/[^/]*\)/\([^/]*\)/\(.*\);repo=\1 rev=\2 file=\3;')
git fetch https://github.com/$repo refs/heads/master:refs/remotes/$repo/master
Copy link
Collaborator

Choose a reason for hiding this comment

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

Instead of latest, would it make more sense to pull specific tags from released versions?

Choose a reason for hiding this comment

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

@msau42 That makes more sense in a lot of ways, my concern though would be making sure we remember to update things like the docs repo. That being said, it would be easy to just set a version file and update it with each CSI release and update that way. Could even potentially automate it at some point?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, we could setup some fancy CI that automates a lot of this. In the meantime, it will have to be one of those things to remember to do with every release.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I had considered a parameter to pull from a branch, but then didn't add that because I wasn't sure whether we would ever need it. If needed and easier than manually updating the Example.md, it can still be added at that time.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Long term it would be nice if the release process of the sidecar containers could also include publishing of the .yaml files for that container at the same location as the container, i.e. quay.io. Not sure whether that is possible, though. The result (hopefully) would be URLs for the .yaml files that then match the container image name and thus would be easier to review.

Maintaining local copies of all the necessary files is unnecessary, we
might as well tell kubectl to pull directly from the individual
repos. But to ensure that this really pulls the right revision of each
file, we have to specify the revision hashes instead of the "master"
branch.

The markup was changed for these reasons:
- the "copy to clipboard" feature wasn't very useful for the commands
  because it copied the entire command and its output
- the long commands weren't wrapped and the clipboard icon was shown
  on top of them
- inlining the yaml file source into the html version isn't easy
  anymore (would require mdbook preprocessor?), so instead
  all "kubectl create -f" URLs are links to the non-raw version in
  GitHub (non-raw because then one has easy access to commit logs)
- commands and output are now using a different background, which is
  a bit easier to tell them apart

Updating those hashes manually can be cumbersome. The new
hack/update-example.sh script automates that step. The remaining local
.yaml files are the ones that have no corresponding upstream file. It
might be worth pushing them upstream in the future, because then
everything will be in one place (hostpath deployment + examples)
and/or easier to update (first update in upstream repo, then update
docs with the hashes).
@pohly
Copy link
Collaborator Author

pohly commented Nov 8, 2018

@j-griffith I've updated the deployment section. Besides fixing the feature-dates typo I also wrote a bit more about the upcoming 1.13 release.

Copy link

@j-griffith j-griffith left a comment

Choose a reason for hiding this comment

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

Thanks for all the fix ups @pohly, lgtm and IMO any refinements on versioning etc could be added later.

@pohly pohly mentioned this pull request Nov 8, 2018
@pohly
Copy link
Collaborator Author

pohly commented Nov 8, 2018

/assign @lpabon

@lpabon
Copy link
Member

lpabon commented Nov 8, 2018

let's go with your change for now, and then add a page with "Releases" which has many versions of these pulled yamls

@lpabon
Copy link
Member

lpabon commented Nov 8, 2018

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 8, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lpabon, pohly

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 8, 2018
@k8s-ci-robot k8s-ci-robot merged commit cec7eeb into kubernetes-csi:master Nov 8, 2018
@pohly pohly mentioned this pull request Nov 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants