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

On cluster s2i build for Go (alternative version) #2471

Merged
merged 7 commits into from
Sep 3, 2024

Conversation

matejvasek
Copy link
Contributor

@matejvasek matejvasek commented Aug 27, 2024

Changes

  • 🎁 Enabled on-cluster s2i build for Go by adding scaffolding task into the tekton pipeline.

This is alternative version where the util image is rootfull. Since git and buildpack are already rootfull I don't see any issue with this. In addition this does not require FSGroup setting which makes it easier to port it in midstream. For OCP we would have to remove the FSGroup part in midstream patching process.

/kind enhancement

Fixes #2443

feat: enabled on-cluster s2i build for Go

As of now func-util image has only one command of our own -- "deploy".
This commits prepares grounds for one additional command named "scaffolding".
The commands will be implemented in one binary and dispatched over
argv[0] using symlinks. Kinda like busybox does.

Signed-off-by: Matej Vašek <[email protected]>
Added new build step in tekton pipeline that scaffolds main() for Go
porject when using s2i builder.

Signed-off-by: Matej Vašek <[email protected]>
This will cache dependencies between docker builds.

Signed-off-by: Matej Vašek <[email protected]>
Signed-off-by: Matej Vašek <[email protected]>
Signed-off-by: Matej Vašek <[email protected]>
Signed-off-by: Matej Vašek <[email protected]>
Copy link

knative-prow bot commented Aug 27, 2024

@matejvasek: The label(s) kind/<kind> cannot be applied, because the repository doesn't have them.

In response to this:

Changes

/kind

Fixes #

Release Note


Docs


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-sigs/prow repository.

Copy link

knative-prow bot commented Aug 27, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@knative-prow knative-prow bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 27, 2024
@knative-prow knative-prow bot requested review from nainaz and vyasgun August 27, 2024 21:07
@knative-prow knative-prow bot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 27, 2024
@matejvasek matejvasek changed the title [TEST ONLY] ALT On cluster s2i build for Go Aug 27, 2024
@matejvasek matejvasek requested review from matzew, gauron99 and lkingland and removed request for nainaz and vyasgun August 27, 2024 21:14
Copy link

codecov bot commented Aug 27, 2024

Codecov Report

Attention: Patch coverage is 44.82759% with 32 lines in your changes missing coverage. Please review.

Project coverage is 66.60%. Comparing base (4775ad9) to head (b6f84fe).
Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
cmd/func-util/main.go 0.00% 31 Missing ⚠️
pkg/pipelines/tekton/tasks.go 96.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2471      +/-   ##
==========================================
+ Coverage   61.22%   66.60%   +5.38%     
==========================================
  Files         130      130              
  Lines       15354    11995    -3359     
==========================================
- Hits         9400     7989    -1411     
+ Misses       5029     3043    -1986     
- Partials      925      963      +38     
Flag Coverage Δ
e2e-test 36.69% <0.00%> (-0.09%) ⬇️
e2e-test-oncluster 33.52% <92.59%> (+0.20%) ⬆️
e2e-test-oncluster-runtime 29.46% <92.59%> (?)
e2e-test-runtime-go 26.71% <0.00%> (?)
e2e-test-runtime-node 26.09% <0.00%> (?)
e2e-test-runtime-python 26.09% <0.00%> (?)
e2e-test-runtime-quarkus 26.19% <0.00%> (?)
e2e-test-runtime-rust 25.21% <0.00%> (?)
e2e-test-runtime-springboot 25.27% <0.00%> (?)
e2e-test-runtime-typescript 26.18% <0.00%> (?)
integration-tests 52.73% <44.82%> (+2.32%) ⬆️
unit-tests 50.91% <43.10%> (?)
unit-tests-macos-latest ?
unit-tests-ubuntu-latest ?
unit-tests-windows-latest ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@matejvasek matejvasek changed the title ALT On cluster s2i build for Go On cluster s2i build for Go (alternative version) Aug 27, 2024
@matejvasek
Copy link
Contributor Author

/hold

@knative-prow knative-prow bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 28, 2024
@matejvasek matejvasek marked this pull request as ready for review September 2, 2024 13:47
@knative-prow knative-prow bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 2, 2024
@matejvasek
Copy link
Contributor Author

PTAL @lkingland @matzew @gauron99

@matejvasek matejvasek removed the request for review from maximilien September 2, 2024 13:50
@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Sep 3, 2024
Copy link

knative-prow bot commented Sep 3, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lkingland, matejvasek

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:
  • OWNERS [lkingland,matejvasek]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@matejvasek
Copy link
Contributor Author

/unhold

@knative-prow knative-prow bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 3, 2024
@knative-prow knative-prow bot merged commit 2e4d157 into knative:main Sep 3, 2024
39 checks passed
matejvasek added a commit to matejvasek/faas that referenced this pull request Sep 4, 2024
* Prepare util image to accomodate multiple cmds

As of now func-util image has only one command of our own -- "deploy".
This commits prepares grounds for one additional command named "scaffolding".
The commands will be implemented in one binary and dispatched over
argv[0] using symlinks. Kinda like busybox does.

Signed-off-by: Matej Vašek <[email protected]>

* Add scaffolding for on-cluster build

Added new build step in tekton pipeline that scaffolds main() for Go
porject when using s2i builder.

Signed-off-by: Matej Vašek <[email protected]>

* Better docker build caching

This will cache dependencies between docker builds.

Signed-off-by: Matej Vašek <[email protected]>

* fixup: perms

Signed-off-by: Matej Vašek <[email protected]>

* fixup: remove broken check

Signed-off-by: Matej Vašek <[email protected]>

* fixup: remove test because of 'no space left on device'

Signed-off-by: Matej Vašek <[email protected]>

* Make func-util rootfull

Signed-off-by: Matej Vašek <[email protected]>

---------

Signed-off-by: Matej Vašek <[email protected]>
knative-prow bot pushed a commit that referenced this pull request Sep 5, 2024
* test: adding GO s2i to e2e test suite (#2401)

* Remove superfluous equals sign from envvar (#2446)

* Remove superfluous equals sign from envvar

Signed-off-by: Matej Vašek <[email protected]>

* Update rust templates Cargo.lock

Signed-off-by: Matej Vašek <[email protected]>

---------

Signed-off-by: Matej Vašek <[email protected]>

* allow digested images to be 'run' (#2445)

* init fix

Signed-off-by: gauron99 <[email protected]>

* dont override direct deploy tag, more tests

Signed-off-by: gauron99 <[email protected]>

* fix

Signed-off-by: gauron99 <[email protected]>

* dont validate with tagged image, fix comment

Signed-off-by: gauron99 <[email protected]>

* init run fix for --image

Signed-off-by: gauron99 <[email protected]>

* init

Signed-off-by: gauron99 <[email protected]>

* int test, add valid untdigested images to run

Signed-off-by: gauron99 <[email protected]>

* check images passed to runner for func run command

Signed-off-by: gauron99 <[email protected]>

* fix build/deploy image passing bug add test

Signed-off-by: gauron99 <[email protected]>

* fix

Signed-off-by: gauron99 <[email protected]>

* remove extra printing

Signed-off-by: gauron99 <[email protected]>

* merge functions to digested

Signed-off-by: gauron99 <[email protected]>

* misspell

Signed-off-by: gauron99 <[email protected]>

* simplify

Signed-off-by: David Fridrich <[email protected]>

* quick fix

Signed-off-by: David Fridrich <[email protected]>

* remove prints, comment

Signed-off-by: David Fridrich <[email protected]>

---------

Signed-off-by: gauron99 <[email protected]>
Signed-off-by: David Fridrich <[email protected]>

* On cluster s2i build for Go (alternative version) (#2471)

* Prepare util image to accomodate multiple cmds

As of now func-util image has only one command of our own -- "deploy".
This commits prepares grounds for one additional command named "scaffolding".
The commands will be implemented in one binary and dispatched over
argv[0] using symlinks. Kinda like busybox does.

Signed-off-by: Matej Vašek <[email protected]>

* Add scaffolding for on-cluster build

Added new build step in tekton pipeline that scaffolds main() for Go
porject when using s2i builder.

Signed-off-by: Matej Vašek <[email protected]>

* Better docker build caching

This will cache dependencies between docker builds.

Signed-off-by: Matej Vašek <[email protected]>

* fixup: perms

Signed-off-by: Matej Vašek <[email protected]>

* fixup: remove broken check

Signed-off-by: Matej Vašek <[email protected]>

* fixup: remove test because of 'no space left on device'

Signed-off-by: Matej Vašek <[email protected]>

* Make func-util rootfull

Signed-off-by: Matej Vašek <[email protected]>

---------

Signed-off-by: Matej Vašek <[email protected]>

* Incorporate s2i CLI into func-utils image. (#2473)

Signed-off-by: Matej Vašek <[email protected]>

* chore: update Quarkus platform version to 3.14.1 (#2474)

Co-authored-by: Knative Automation <[email protected]>
Signed-off-by: Matej Vašek <[email protected]>

* chore: update Springboot platform version to 3.3.3 (#2465)

Co-authored-by: Knative Automation <[email protected]>
Signed-off-by: Matej Vašek <[email protected]>

---------

Signed-off-by: Matej Vašek <[email protected]>
Signed-off-by: gauron99 <[email protected]>
Signed-off-by: David Fridrich <[email protected]>
Co-authored-by: Jefferson Ramos <[email protected]>
Co-authored-by: David Fridrich <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Knative Automation <[email protected]>
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. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to build a Go function with s2i directly on the cluster
2 participants