-
Notifications
You must be signed in to change notification settings - Fork 17
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
Add vendor for obs integration #198
Conversation
5000+ changed files 🙈 |
Can't we trigger a service run on OBS instead ? |
1 MILLION LINES!!! Its gonna take me a bit of time to review the PR...... |
apiVersion: v2 | ||
name: elemental-operator | ||
description: Rancher Elemental Operator | ||
version: 0.0.0 | ||
appVersion: 0.0.0 | ||
version: 0.0.0-noversion |
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 this a valid helm 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.
It is, helm chart requires semver 2 and this is a valid version for semver2. It is a preversion of 0.0.0
😅 Yes I know it is not very nice... in any case having a version 0.0.0
is not much better 😉
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.
Good enough for me, as long as it's a valid version, nothing will break
Oh fuck no. Again with this crap lol, @kkaempf you are the expert in dealing with the go-tpm-tools shenanigans, please advise :P |
I guess building the go-tpm-tools package will now require the proper headers and such? (libssl-dev, libc6-dev) |
yes I know... But this is the nature of golang, included in repos or not, this code is all part of the binaries we ship 😱
Depends if you want automated updates or not, go-modues obs service is not allowed in OBS servers... the alternative is just doing it manually instead of relaying it to some sort of automation. I mean, all this is to allow automatic service trigger on github events. If we assume this is not worth enough we can remove this vendor folder and assume any OBS update for every package will require
Having this job done manually allows having gaps between OBS and github repos (probably not that bad) and the worst part, IMHO, is that maintaining multiple OBS environments (dev, staging, stable) manually is tedious. That said manual updates are also a valid alternative, it would affect: elemental, elemental-toolkit, elemental-operator, elemental-operator-helm and elemental-cli OBS packages The goal was to enable automated builds in OBS (at least it was on rancher/elemental-cli#266), however this can be revisited. I really do not have a very strong opinion, none of the alternatives is fully satisfying to my eyes. I like automated updates and rebuilds in OBS, however I agree having the vendor folder around sucks. |
Yes this is pretty annoying from the Makefile perspective, making it work in my env could be relatively simple, but having some sort of generic approach is tricky. |
That's simple. Add another 5000+ files and 1 Million+ lines with |
Can't we create the vendor tarball in a GH action (on the fly) and upload this ? |
That makes no sense to have in GH if its not used in GH, does it? at least by having the vendor dir in here builds will use that and we can get reproducible builds even and build offline (althougth not much of an issue tbh) |
For this we need an operative and logged in |
Found the issue Between I noted an inconsistency with OBS and github builds, go.mod asks for go-tpm-tools v0.3.2 and in OBS we included v0.3.8 :/ |
We're adding the complete (unpacked) vendor tarball in this PR ... just say'in 😉 |
Sure but that kind of works for github builds as well. But a fat tar.gz is useless in this context :D |
df0ec13
to
e52094c
Compare
Codecov ReportBase: 39.70% // Head: 39.70% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## main #198 +/- ##
=======================================
Coverage 39.70% 39.70%
=======================================
Files 10 10
Lines 889 889
=======================================
Hits 353 353
Misses 510 510
Partials 26 26 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
# SPDX-License-Identifier: Apache-2.0 | ||
#!BuildTag: elemental/elemental-operator:latest | ||
#!BuildTag: elemental/elemental-operator:0.0.0-noversion | ||
#!BuildTag: elemental/elemental-operator:0.0.0-noversion-build%RELEASE% |
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 is needed for OBS to support multiple tags
version: 0.0.0 | ||
appVersion: 0.0.0 | ||
version: 0.0.0-noversion | ||
appVersion: 0.0.0-noversion |
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 change is done because the 0.0.0-noversion
is used a needle in a regex for replacement at build time in OBS, using 0.0.0
alone is not safe as there could be other occurrences of this such a simple string.
.PHONY: vendor | ||
vendor: | ||
go mod vendor | ||
curl -L 'https://github.com/google/go-tpm-tools/archive/refs/tags/$(GO_TPM_TAG).tar.gz' --output go-tpm-tools.tar.gz |
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.
go mod vendor
does not include CGO code, hence we need to get source tarball manually and include it. So in order to properly build a functional vendor
folder make vendor
is required.
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.
How about about having a git submodule for the go-tpm-tools inside the vendor dir? Would that work or does the go mod vendor overwrite it?
I know we can replace the module in the go.mod to point to a local sir, so that would avoid having to download the tar on the makefile which is a bit yuck
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.
Damn, this crap has been going on for 4 years! golang/go#26366
There is a couple of simple fixes but those need to go upstream.. I will check tonigth to see if there is a saner way to get this proper
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.
Damn, this crap has been going on for 4 years! golang/go#26366
lol, I've been there too 😅
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.
🤦🏻♂️
e52094c
to
c3025ac
Compare
Note after merging this PR |
Signed-off-by: David Cassany <[email protected]>
This commit sets repository and version well known values in Chart.yaml and values.yaml files so they can be dynamically replaced by some sort of automation at build time. Signed-off-by: David Cassany <[email protected]>
c3025ac
to
8daa391
Compare
These changes are required to facilitate OBS code updates and builds by simply triggering OBS services. This allows updating code and rebuild in OBS based on github events such as on tag, on merge, on push...
As a side effect the vendors folder had to be included as part of the sources. The same happened in rancher/elemental-cli...
Note there are two commits, one for the vendors folder and another one to slightly adapt the helm chart files so they are properly rendered for OBS.
Part of rancher/elemental#361