-
Notifications
You must be signed in to change notification settings - Fork 139
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
allowing on cluster build for go runtime #1445
Conversation
|
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #1445 +/- ##
==========================================
+ Coverage 62.02% 62.61% +0.59%
==========================================
Files 107 106 -1
Lines 13733 13817 +84
==========================================
+ Hits 8518 8652 +134
+ Misses 4375 4278 -97
- Partials 840 887 +47
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
@Shashankft9 does this depend on #984 ? |
thanks @matejvasek for linking that issue, seems like a better solution specially since i got to know yesterday that this boson go builder is not maintained anymore, |
pipelines/tekton/validate.go
Outdated
@@ -30,7 +30,7 @@ func validatePipeline(f fn.Function) error { | |||
return ErrRuntimeRequired | |||
} | |||
|
|||
if f.Runtime == "go" || f.Runtime == "rust" { | |||
if f.Runtime == "rust" { |
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.
Maybe we could remove this if
completely since following if
check if there are additional buildpacks.
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.
I think it might be better to keep it here, to explicitly tell user about not supported runtime.
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.
But the issue with Go and Rust is that they use custom buildpacks.
That problem is detected in following if
.
What this if
does is it prevents users from building Go and Rust apps even if user provides custom builder that would work all right.
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.
@zroubalik @Shashankft9 what about just printing warning here "Go/Rust default builder do not support in cluster build" instead of returning an error? Could we accept that?
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.
@zroubalik @Shashankft9 what about just printing warning here "Go/Rust default builder do not support in cluster build" instead of returning an error? Could we accept that?
@Shashankft9 Can you add a simple warning here that Go and Rust default builders do not support in-cluster builds?
# builderImages: # optional, needed only if the runtime is golang | ||
# pack: ghcr.io/boson-project/go-function-builder:tip | ||
buildpacks: [] | ||
builder: "" |
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.
Builder should be "pack"
.
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.
but empty string probably would work 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.
If these two items are intended as hints, commenting them would probably be best.
The idea here is that the code has static defaults. Anything placed in the config file is specifically requesting that exact value, so while the first value, []buildpacks
is innocuous, the second, builder=""
is, if literally translated, requesting the system to build without a builder. In this case we do set the default if the value comes in empty like this, because building without a builder is nonsensical, but I presume this exists to give a hint to the user how to choose a builder and buildpacks, so a commented entry is the right tool for the job.
@Shashankft9 unittests are failing. |
@zroubalik PTAL |
@Shashankft9 Go build issue might be fixed by #1451 . |
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.
we should wait with this until go is supported with on cluster builds.
Or am I missing anything?
The thing is we are disabling |
This Pull Request is stale because it has been open for 90 days with |
FYI I am using this as an important reference/ starting point for the solution discussed in #1589 |
hey, a gentle ping: I did an update on the go builder here: https://github.com/boson-project/packs with the latest pack full cnb and go-dist BP. And then the same changes in this PR are making my on cluster build work for go functions. I did the update of the builder because it was failing for my functions which were using latest k8s imports. I am aware that the plan for goruntime's oncluster build is much broader, but I am just checking back again if there is scope to still allow a customer builder like this one, following @matejvasek comment
|
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 looks mostly good to me, but we could probably use a warning, as suggested, and of course a rebase to resolve the conflicts.
# builderImages: # optional, needed only if the runtime is golang | ||
# pack: ghcr.io/boson-project/go-function-builder:tip | ||
buildpacks: [] | ||
builder: "" |
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.
If these two items are intended as hints, commenting them would probably be best.
The idea here is that the code has static defaults. Anything placed in the config file is specifically requesting that exact value, so while the first value, []buildpacks
is innocuous, the second, builder=""
is, if literally translated, requesting the system to build without a builder. In this case we do set the default if the value comes in empty like this, because building without a builder is nonsensical, but I presume this exists to give a hint to the user how to choose a builder and buildpacks, so a commented entry is the right tool for the job.
pipelines/tekton/validate.go
Outdated
@@ -30,7 +30,7 @@ func validatePipeline(f fn.Function) error { | |||
return ErrRuntimeRequired | |||
} | |||
|
|||
if f.Runtime == "go" || f.Runtime == "rust" { | |||
if f.Runtime == "rust" { |
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.
@zroubalik @Shashankft9 what about just printing warning here "Go/Rust default builder do not support in cluster build" instead of returning an error? Could we accept that?
@Shashankft9 Can you add a simple warning here that Go and Rust default builders do not support in-cluster builds?
just signed the CLA again. @lkingland and others - hey, apologies for the delay on this, got caught up in other work. This is just a quick fix, let me know if it looks alright, I'll add some more tests |
|
360cfef
to
2469823
Compare
PTAL @lance |
@Shashankft9 I pushed on fixup. |
I think this is the symlink issue on windows that we have been dealing with lately. @matejvasek please lmk if I am mistaken.
/override "Unit Test (1.20.2, 17, windows-latest)" |
@lance: Overrode contexts on behalf of lance: Unit Test (1.20.2, 17, windows-latest) In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: matejvasek, Shashankft9 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 |
@matejvasek would be amazing if you can take a look at this too: boson-project/packs#10 |
@Shashankft9 does this work now? I am afraid #1774 is breaking it. |
Well it is probably not breaking on-cluster-build, but it breaks local build. |
* allowing on cluster build for go runtime * warning message added for go and rust builder * gofmt * fixups Signed-off-by: Matej Vasek <mvasek@redhat.com> --------- Signed-off-by: Matej Vasek <mvasek@redhat.com> Co-authored-by: Matej Vasek <mvasek@redhat.com>
* chore: use tkn tasks from PR branch in CI (#1914) Signed-off-by: Matej Vasek <mvasek@redhat.com> * chore: released binaries refer correct task yamls (#1916) Signed-off-by: Matej Vasek <mvasek@redhat.com> * chore: refer correct tkn yaml in prow test (#1918) Without this change prow test will refer tkn yamls from the main branch not from the PR head branch. Signed-off-by: Matej Vasek <mvasek@redhat.com> * chore: update release generation (#1924) * Minimize release binary size. * Release latest version of buildpack tekton task. Signed-off-by: Matej Vasek <mvasek@redhat.com> * test: update github ref used on e2e oncluster tests (#1917) * test: Split of GH oncluster tests by builder. Added FUNC_BUILDER env var for e2e oncluter tests (#1963) * Use our own s2i image (#1971) Our image is much more recent and it is multiarch. Signed-off-by: Matej Vasek <mvasek@redhat.com> * chore: update buildah image ref (#1960) Signed-off-by: Matej Vasek <mvasek@redhat.com> * chore: update CA certs (#1944) Signed-off-by: Matej Vasek <mvasek@redhat.com> * chore: update Quarkus platform version to 3.4.1 (#1989) Co-authored-by: Knative Automation <automation@knative.team> Signed-off-by: Matej Vasek <mvasek@redhat.com> * chore: update mvn wrapper in Quarkus template (#1987) Signed-off-by: Matej Vasek <mvasek@redhat.com> * chore: use ./mvnw not mvn in tests (#1988) Signed-off-by: Matej Vasek <mvasek@redhat.com> * chore: update Springboot platform version Signed-off-by: Matej Vasek <mvasek@redhat.com> * fix: docker registry/repository parsing (#1929) * fix: docker registry/repository parsing Use go-containerregistry to do parsing. Signed-off-by: Matej Vasek <mvasek@redhat.com> * fix: use kebab-case instead of camelCase Signed-off-by: Matej Vasek <mvasek@redhat.com> * fix: use kebab-case instead of camelCase Signed-off-by: Matej Vasek <mvasek@redhat.com> --------- Signed-off-by: Matej Vasek <mvasek@redhat.com> * Fix failing concurrent test on Windows (#1890) * src: better debugging Signed-off-by: Matej Vasek <mvasek@redhat.com> * fix: wait for both builds Signed-off-by: Matej Vasek <mvasek@redhat.com> * fixup Signed-off-by: Matej Vasek <mvasek@redhat.com> * fixup Signed-off-by: Matej Vasek <mvasek@redhat.com> * fixup Signed-off-by: Matej Vasek <mvasek@redhat.com> * fix: detection of process liveness on Windows Signed-off-by: Matej Vasek <mvasek@redhat.com> * fix: make symlink relative Signed-off-by: Matej Vasek <mvasek@redhat.com> * fixup: cleanup Signed-off-by: Matej Vasek <mvasek@redhat.com> --------- Signed-off-by: Matej Vasek <mvasek@redhat.com> * allowing on cluster build for go runtime (#1445) * allowing on cluster build for go runtime * warning message added for go and rust builder * gofmt * fixups Signed-off-by: Matej Vasek <mvasek@redhat.com> --------- Signed-off-by: Matej Vasek <mvasek@redhat.com> Co-authored-by: Matej Vasek <mvasek@redhat.com> * Use custom jammy paketo builder (#1911) * chore: use custom jammy paketo builder Use our own modified jammy builder with additional buildpacks for GoFunc and Rust. This enables on cluster build for Go and Rust functions. Where possible (Go, Java) we use "tiny" variant, other runtimes use "base" variant. The updated task is new file instead of modifying existing task this is done for sake of keeping compatiblility. Signed-off-by: Matej Vasek <mvasek@redhat.com> * fixup: remove unnecessary code per review request Signed-off-by: Matej Vasek <mvasek@redhat.com> * fixup Signed-off-by: Matej Vasek <mvasek@redhat.com> * fixup: podman test refers correct tkn task yamls Signed-off-by: Matej Vasek <mvasek@redhat.com> --------- Signed-off-by: Matej Vasek <mvasek@redhat.com> * doc: Go and Rust on cluster build is supported (#1923) * doc: Go and Rust on cluster build is supported Signed-off-by: Matej Vasek <mvasek@redhat.com> * doc: build envvars Signed-off-by: Matej Vasek <mvasek@redhat.com> --------- Signed-off-by: Matej Vasek <mvasek@redhat.com> * fix: direct upload ppc64le, x390x (#1958) Signed-off-by: Matej Vasek <mvasek@redhat.com> * fix: report correct error when task doesn't exist (#1915) Signed-off-by: Matej Vasek <mvasek@redhat.com> * feat: tekton task urls in the env sub-cmd output (#1925) Signed-off-by: Matej Vasek <mvasek@redhat.com> --------- Signed-off-by: Matej Vasek <mvasek@redhat.com> Co-authored-by: Jefferson Ramos <jeramos@redhat.com> Co-authored-by: Knative Automation <automation@knative.team> Co-authored-by: Shashank Sharma <48708039+Shashankft9@users.noreply.github.com>
Changes
/kind cleanup
Fixes #809
Release Note
Docs