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

Initial implementation #1

Merged
merged 17 commits into from
Sep 11, 2020
Merged

Conversation

mook-as
Copy link
Member

@mook-as mook-as commented Aug 21, 2020

This expands upon f0rmiga/initial-impl to work; this has been tested on a KubeCF deployment.

Notable changes:

  • Fixed up the helm chart to actually work. (Unclear why that was a separate chart, but since it was I just kept going.)
  • The docker image is now built without the preexisting binary as a dependency (but builds it from source in a separate container instead). This ensures that we don't end up with things being out of sync (e.g. manually forgetting to rebuild things).
  • GitHub Actions workflow for building docker image + helm chart, publishing to GitHub Pages. Modelled after the pipeline in eirinix-helm-release.
  • Everything is tagged to include the commit hash.

Note that I don't have write access to the repository, hence not just pushing on top of the branch. I also can't seem to request a review…

Thulio Ferraz Assis and others added 10 commits March 5, 2020 15:35
In particular, eirinix has moved from github.com/SUSE to
code.cloudfoundry.org.
This pulls in newer logrus, which fixes issues with the case of the import
path.  Unfortunately, they hadn't make actual releases in forever, so we
have to pick something off `master`; in this case, the version vendored by
docker 19.03.12.
Since eirinix.Manager uses zap anyway, use it for main as well to ensure
any logging we do will be in the same format.
This makes us always rebuild the binary when building the image, all in
docker.  This ensures that we have better control over the inputs for that
build.

The base image is still require for running, as (at least for now) the
resulting binary depends on the dynamic linker.

Also includes support to vendor any dependencies if we have any `replace`
lines in `go.mod`; this is useful if we're using a locally edited version
of those dependencies (the most likely of which is eirinix).
This is useful when developing to ensure the expected binary is in use.
This adds a make target to build the helm chart. Also fixes up the chart to
actually work, including additional role binding (for the webhook
namespace), etc.
This builds the whole thing, publishing docker images and helm charts (the
latter of which goes in GitHub Pages).
While running on every push was good for development, we shouldn't do so
for code that we hope will get merged.
Copy link
Contributor

@viovanov viovanov left a comment

Choose a reason for hiding this comment

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

Can you please make this a go binary + dockerfile, and move the helm part into kubecf.
We shouldn't change the scope of cloudfoundry-incubator/kubecf#1179

Otherwise 👍

Dockerfile Show resolved Hide resolved
Copy link
Member Author

@mook-as mook-as left a comment

Choose a reason for hiding this comment

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

I'll redo the helm part in KubeCF — actually I started that way, but saw that the original branch had a helm chart in there. So it shouldn't be difficult to move back.

Dockerfile Show resolved Hide resolved
.github/workflows/publish-helm-chart.yaml Outdated Show resolved Hide resolved
- Use kubecf-tools to determine the version, instead of `git describe`
  (directly, anyway)
- Drop helm chart handling; assume the user will handle that in some other
  way (i.e. supply their own Kubernetes bits, which is the case for KubeCF)

SUSE#1 (review)
.github/workflows/publish-helm-chart.yaml Outdated Show resolved Hide resolved
.github/workflows/update-helm-index.rb Outdated Show resolved Hide resolved
build/manifest.yaml Show resolved Hide resolved
Copy link
Member Author

@mook-as mook-as left a comment

Choose a reason for hiding this comment

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

Still need to move build/image scripts to kubecf-tools.

.github/workflows/update-helm-index.rb Outdated Show resolved Hide resolved
build/manifest.yaml Show resolved Hide resolved
This is completely unused now.
If we turn off CGO for the binary (which doesn't appear to be needed),
we can get a static binary that then doesn't need the dynamic linker
(and therefore can bse based on an empty image).  Note that we _do_
expect a working /tmp, so we will need to create that in the iamge
first.
The workflow only builds the docker image; rename the workflow file to
match that.
mook-as added a commit to mook-as/kubecf-tools that referenced this pull request Sep 9, 2020
This was spawned out of
SUSE/eirini-dns-aliases#1 to have a script that
builds an arbitary go binary, controlled by a YAML file.

Requested in
SUSE/eirini-dns-aliases#1 (comment)

This also makes the versioning script work better as a library (by not
always parsing the command line options, only when it's run as the top
level script).
mook-as added a commit to mook-as/kubecf-tools that referenced this pull request Sep 9, 2020
This was spawned out of
SUSE/eirini-dns-aliases#1 to have a script that
builds an arbitrary go binary, controlled by a YAML file.

Requested in
SUSE/eirini-dns-aliases#1 (comment)

This also makes the versioning script work better as a library (by not
always parsing the command line options, only when it's run as the top
level script).
mook-as added a commit to mook-as/kubecf-tools that referenced this pull request Sep 9, 2020
This was spawned out of
SUSE/eirini-dns-aliases#1 to have a script that
builds an arbitrary go binary, controlled by a YAML file.

Requested in
SUSE/eirini-dns-aliases#1 (comment)

This also makes the versioning script work better as a library (by not
always parsing the command line options, only when it's run as the top
level script).
@mook-as mook-as marked this pull request as draft September 10, 2020 22:32
@f0rmiga
Copy link

f0rmiga commented Sep 11, 2020

@mook-as I think you may need to adjust this PR to use the new kubecf-apps-dns. It was introduced by cloudfoundry-incubator/kubecf#1313.

@mook-as mook-as marked this pull request as ready for review September 11, 2020 18:52
viovanov
viovanov previously approved these changes Sep 11, 2020
Use the GitHub container registry instead for image destination.
@viovanov viovanov merged commit df4c9f7 into SUSE:master Sep 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants