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 build without VCS #1298

Merged
merged 8 commits into from
Oct 17, 2022

Conversation

matejvasek
Copy link
Contributor

@matejvasek matejvasek commented Oct 4, 2022

Changes

  • 🎁 Added function for upload to a volume. This might be useful for on cluster build without VCS.
  • 🎁 Added On Cluster Build without VCS (e.g. Git).

/kind enhancement

feat: on cluster build using direct source upload (i.e. git is not needed)

Known issue: Direct upload in not working on OpenShift under privileged account.

resolves #952

@knative-prow knative-prow bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. 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 Oct 4, 2022
@codecov
Copy link

codecov bot commented Oct 4, 2022

Codecov Report

Merging #1298 (b76f286) into main (69659e3) will decrease coverage by 0.60%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main    #1298      +/-   ##
==========================================
- Coverage   47.06%   46.46%   -0.61%     
==========================================
  Files          73       73              
  Lines       10338    10473     +135     
==========================================
  Hits         4866     4866              
- Misses       5049     5184     +135     
  Partials      423      423              
Impacted Files Coverage Δ
k8s/dialer.go 0.00% <0.00%> (ø)
k8s/persistent_volumes.go 0.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@matejvasek matejvasek force-pushed the cluster-build-no-git branch 3 times, most recently from 4d56d8e to 5493684 Compare October 5, 2022 23:45
@matejvasek matejvasek marked this pull request as ready for review October 6, 2022 00:18
@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 Oct 6, 2022
@matejvasek
Copy link
Contributor Author

@lkingland @lance PTAL

@lance
Copy link
Member

lance commented Oct 8, 2022

/easycla

@codecov
Copy link

codecov bot commented Oct 10, 2022

Codecov Report

Base: 59.80% // Head: 60.48% // Increases project coverage by +0.67% 🎉

Coverage data is based on head (46495ba) compared to base (c740b11).
Patch coverage: 72.45% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1298      +/-   ##
==========================================
+ Coverage   59.80%   60.48%   +0.67%     
==========================================
  Files          73       75       +2     
  Lines       10440    10639     +199     
==========================================
+ Hits         6244     6435     +191     
+ Misses       3679     3666      -13     
- Partials      517      538      +21     
Flag Coverage Δ
integration-tests 49.99% <63.98%> (-2.40%) ⬇️
unit-tests ?
unit-tests-macos-latest 52.22% <20.33%> (?)
unit-tests-ubuntu-latest 53.64% <20.33%> (?)
unit-tests-windows-latest 52.21% <20.33%> (?)

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

Impacted Files Coverage Δ
cmd/deploy.go 62.38% <ø> (-0.07%) ⬇️
pipelines/tekton/pipeplines_provider.go 10.29% <48.27%> (+10.29%) ⬆️
k8s/persistent_volumes.go 72.22% <76.37%> (+72.22%) ⬆️
pipelines/tekton/resources.go 41.82% <84.21%> (+1.72%) ⬆️
k8s/dialer.go 72.58% <89.47%> (-1.48%) ⬇️
k8s/security_context.go 100.00% <100.00%> (ø)
pipelines/tekton/tasks.go 100.00% <100.00%> (ø)
docker/docker_client_nonlinux.go 0.00% <0.00%> (ø)
... and 5 more

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.
📢 Do you have feedback about the report comment? Let us know in this issue.

@matejvasek
Copy link
Contributor Author

@zroubalik PTAL

@matejvasek
Copy link
Contributor Author

@salaboy PTAL

@matejvasek matejvasek changed the title Upload to a volume On cluster build without VCS Oct 11, 2022
@matejvasek matejvasek force-pushed the cluster-build-no-git branch 3 times, most recently from 6524cda to 2425081 Compare October 11, 2022 19:18
@matejvasek
Copy link
Contributor Author

@jrangelramos PTAL

@jrangelramos
Copy link
Contributor

jrangelramos commented Oct 11, 2022

I think a nice to have would be perform a check for .gitignore file on local function source code, and possibly honor that during upload. I would be concerned uploading for example build artifacts from a quarkus func for example (target folder).

@matejvasek
Copy link
Contributor Author

I tested this on KinD and OpenShift 4.11 clusters.

On OpenShift 4.11+ it for now only works with non-admin users, because of the seccompprofile thingy.
Will need to apply fix in midstream.

Copy link
Member

@lkingland lkingland left a comment

Choose a reason for hiding this comment

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

This is great!

Added @jrangelramos ' suggestion to evaluate .gitignore as #1298

/lgtm
/hold for optional, very minor suggestions inline

k8s/persistent_volumes.go Outdated Show resolved Hide resolved
k8s/persistent_volumes.go Outdated Show resolved Hide resolved
k8s/persistent_volumes_test.go Show resolved Hide resolved
@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 Oct 12, 2022
@matejvasek
Copy link
Contributor Author

@lkingland I added e2e test, please re-lgtm.

@matejvasek
Copy link
Contributor Author

@zroubalik @lance PTAL

@lkingland
Copy link
Member

lkingland commented Oct 17, 2022

/lgtm
(still holding pending others' potential commentary)

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Oct 17, 2022
hack/binaries.sh Outdated Show resolved Hide resolved
matejvasek and others added 7 commits October 17, 2022 14:02
Signed-off-by: Matej Vasek <mvasek@redhat.com>
Signed-off-by: Matej Vasek <mvasek@redhat.com>
Signed-off-by: Matej Vasek <mvasek@redhat.com>
Signed-off-by: Matej Vasek <mvasek@redhat.com>
Signed-off-by: Matej Vasek <mvasek@redhat.com>
Co-authored-by: Lance Ball <lball@redhat.com>
Signed-off-by: Matej Vasek <mvasek@redhat.com>
@knative-prow knative-prow bot removed the lgtm Indicates that a PR is ready to be merged. label Oct 17, 2022
Signed-off-by: Matej Vasek <mvasek@redhat.com>
@matejvasek
Copy link
Contributor Author

I did a rebase.

Copy link
Contributor

@zroubalik zroubalik left a comment

Choose a reason for hiding this comment

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

/lgtm

great work!

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Oct 17, 2022
@knative-prow
Copy link

knative-prow bot commented Oct 17, 2022

[APPROVALNOTIFIER] This PR is APPROVED

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

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,zroubalik]

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

I think we are good to go @lance .

@jrangelramos
Copy link
Contributor

/lgtm

@lance
Copy link
Member

lance commented Oct 17, 2022

/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 Oct 17, 2022
@knative-prow knative-prow bot merged commit d536b79 into knative:main Oct 17, 2022
@lance lance modified the milestones: 1.9.0 Release, 1.8.0 Release Oct 18, 2022
lance added a commit to lance/func that referenced this pull request Feb 15, 2023
* refactor: attach() and podReady() more general

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* feat: added function for upload to a volume

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* refactor: extract defaultSecurityContext

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* fix: added runtime type check

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* feat: allow on-cluster-build without VCS

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* fix: reword error message

Co-authored-by: Lance Ball <lball@redhat.com>

* fix: runtime type check

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* test: e2e test for direct upload on-cluster-build

Signed-off-by: Matej Vasek <mvasek@redhat.com>

Signed-off-by: Matej Vasek <mvasek@redhat.com>
Co-authored-by: Lance Ball <lball@redhat.com>
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/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

On-cluster build: Direct code upload
5 participants