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

chore: remove vendor modules from benchmark #1463

Merged
merged 1 commit into from
Sep 22, 2020

Conversation

kushthedude
Copy link
Contributor

@kushthedude kushthedude commented Sep 11, 2020

Signed-off-by: Kush Trivedi kushthedude@gmail.com

What type of PR is this?

/area dependency
What this PR does / why we need it:

  • This PR removes vendor modules for benchmark sub-module.
  • We don't need vendor modules as even go modules dependency management.

Which issue(s) this PR fixes:

Refers #1099

Does this PR introduce a user-facing change?:

NONE

@k8s-ci-robot k8s-ci-robot added area/dependency Issues or PRs related to dependency changes needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 11, 2020
@k8s-ci-robot
Copy link
Contributor

Hi @kushthedude. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Sep 11, 2020
@kushthedude
Copy link
Contributor Author

/assign @wojtek-t

@mm4tt
Copy link
Contributor

mm4tt commented Sep 14, 2020

Sorry, but we do we need the vendor dir? It's obsolete and redundant with the new go mod dep management system. In case of clusterloader2 we needed it for backward compatibility (travis presubmits), but it's not the case here. It's also not the case anymore for cl2, as we got rid of the travis presubmits.

We should also remove the vendor dir from clusterloader2 and other places (e.g. benchmarks)

@wojtek-t
Copy link
Member

Sorry, but we do we need the vendor dir? It's obsolete and redundant with the new go mod dep management system. In case of clusterloader2 we needed it for backward compatibility (travis presubmits), but it's not the case here. It's also not the case anymore for cl2, as we got rid of the travis presubmits.

We should also remove the vendor dir from clusterloader2 and other places (e.g. benchmarks)

@mm4tt - That's not obvious to me - we have vendor/ in k/k repo and we don't have travis there at all.
There were other reasons for having it, and unless you know all of them, let's not remove them.

@mm4tt
Copy link
Contributor

mm4tt commented Sep 14, 2020

Sorry, but we do we need the vendor dir? It's obsolete and redundant with the new go mod dep management system. In case of clusterloader2 we needed it for backward compatibility (travis presubmits), but it's not the case here. It's also not the case anymore for cl2, as we got rid of the travis presubmits.

We should also remove the vendor dir from clusterloader2 and other places (e.g. benchmarks)

Matt Matejczyk - That's not obvious to me - we have vendor/ in k/k repo and we don't have travis there at all.
There were other reasons for having it, and unless you know all of them, let's not remove them.

I don't know what are the reasons for k/k repo. I'd guess it has something to do with the complicated build system we have for kubernetes. e.g. doing the magic for the /staging dir requires all files to be on disk.

But I know that the only reason for k/perf-tests to keep the vendor dir was the travis presubmit. Given that we don't have the travis presubmit anymore, we're free to remove it. And we should do it, as it'll get rid of the redundancy and make some operations easier, e.g. updating the dependencies will be a few line, easy-to-review change instead of a change with 1k+ modified files.

@wojtek-t
Copy link
Member

But I know that the only reason for k/perf-tests to keep the vendor dir was the travis presubmit. Given that we don't have the travis presubmit anymore, we're free to remove it. And we should do it, as it'll get rid of the redundancy and make some operations easier, e.g. updating the dependencies will be a few line, easy-to-review change instead of a change with 1k+ modified files.

I guess I disagree with it. Yes - the PRs are smaller, but it also makes introducing some backdoors (e.g. security vulnerabilities) super easy, because noone will be reviewing this code any more...

@mm4tt
Copy link
Contributor

mm4tt commented Sep 14, 2020

But I know that the only reason for k/perf-tests to keep the vendor dir was the travis presubmit. Given that we don't have the travis presubmit anymore, we're free to remove it. And we should do it, as it'll get rid of the redundancy and make some operations easier, e.g. updating the dependencies will be a few line, easy-to-review change instead of a change with 1k+ modified files.

I guess I disagree with it. Yes - the PRs are smaller, but it also makes introducing some backdoors (e.g. security vulnerabilities) super easy, because noone will be reviewing this code any more...

I think it's quite the opposite. Consider bumping some k8s dep to the next minor, e.g.

k8s.io/apimachinery v0.18.0

to

k8s.io/apimachinery v0.19.0

Then the go mod change will be as above, a one liner. It's impossible to introduce any backdoors there as to do that someone would have to hack the k8s repo and place them there.

On the other hand, with vendor dir, it'll be hundreds of files, and it's super easy to smuggle something there - no one really reviews the thousand of lines "update vendor" changes.

The other argument is that having both vendor and go.mod file creates a huge redundancy in the system. It's easy to imagine a situation where someone updates one, but forget about the other. It can lead to some very hard to debug bugs.

Unless we don't have a strong reason to have both go.mod and vendor dir (and we don't) we shouldn't keep both.

@wojtek-t
Copy link
Member

Then the go mod change will be as above, a one liner. It's impossible to introduce any backdoors there as to do that someone would have to hack the k8s repo and place them there.

We have tens of random dependencies, which I have no reason to believe into by default.

Unless we don't have a strong reason to have both go.mod and vendor dir (and we don't) we shouldn't keep both.

I'm actually on the opposite - until we fully understand why there are both in k/k, let's not remove.

@mm4tt
Copy link
Contributor

mm4tt commented Sep 14, 2020

Then the go mod change will be as above, a one liner. It's impossible to introduce any backdoors there as to do that someone would have to hack the k8s repo and place them there.

We have tens of random dependencies, which I have no reason to believe into by default.

Where do we have "tens of random dependencies"? We have 16 deps in the clusterloader2's go.mod, I don't see a single random one.

github.com/go-errors/errors v1.0.1

Unless we don't have a strong reason to have both go.mod and vendor dir (and we don't) we shouldn't keep both.

I'm actually on the opposite - until we fully understand why there are both in k/k, let's not remove.

I already explained one of the reasons. K/k is not a good example of typical go project when it comes to dependency management, we do a lot of things in our own quirky ways there. It doesn't make sense to look at it as an example.
Looking at the more typical repo, k/test-infra, the vendor dir has been removed there over a year ago - kubernetes/test-infra#14036

@wojtek-t
Copy link
Member

I already explained one of the reasons. K/k is not a good example of typical go project when it comes to dependency management, we do a lot of things in our own quirky ways there. It doesn't make sense to look at it as an example.

One example of reason is not a good explanation - the fact that one reason doesn't work for us, doesn't mean that other reasons will not work.

That said:

Looking at the more typical repo, k/test-infra, the vendor dir has been removed there over a year ago - kubernetes/test-infra#14036

That seems like a much stronger reason to me. Conceptually perf-tests repo is quite similar to test-infra so that looks like a good argument to me.

@kushthedude
Copy link
Contributor Author

kushthedude commented Sep 14, 2020 via email

@mm4tt
Copy link
Contributor

mm4tt commented Sep 15, 2020

Should I amend the PR to move away from vendor modules?

Yes :)

@kushthedude kushthedude changed the title chore: add vendor modules for perfdash sub-module chore: remove vendor modules from clusterloader2 & benchmark Sep 21, 2020
@kushthedude
Copy link
Contributor Author

/cc @mm4tt @wojtek-t

@wojtek-t
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 21, 2020
@wojtek-t wojtek-t assigned mm4tt and unassigned wojtek-t Sep 21, 2020
@kushthedude
Copy link
Contributor Author

/retest

@mm4tt
Copy link
Contributor

mm4tt commented Sep 21, 2020

It's a huge change. Let's do them separately - cl2 & benchmark. It'll be a bit easier.

@kushthedude
Copy link
Contributor Author

kushthedude commented Sep 21, 2020

It's a huge change. Let's do them separately - cl2 & benchmark. It'll be a bit easier.

I agree, removing the commits related to cl2

@kushthedude kushthedude changed the title chore: remove vendor modules from clusterloader2 & benchmark chore: remove vendor modules from benchmark Sep 21, 2020
@kushthedude kushthedude requested a review from mm4tt September 21, 2020 12:07
@kushthedude
Copy link
Contributor Author

@mm4tt I don't guess the test failure is due to the changes are done in the PR, it is unable to fetch a dependency from bitbucket 😕

@mm4tt
Copy link
Contributor

mm4tt commented Sep 21, 2020

Yeah, this is being addressed in #1482 as we speak.
Please wait for that PR to be merged then retest

@mm4tt
Copy link
Contributor

mm4tt commented Sep 21, 2020

/retest

@mm4tt
Copy link
Contributor

mm4tt commented Sep 21, 2020

The PR seems to be touching both cl2 and benchmark files. Please fix

@mm4tt
Copy link
Contributor

mm4tt commented Sep 21, 2020

Please also update the PR description

@kushthedude
Copy link
Contributor Author

kushthedude commented Sep 21, 2020

The PR seems to be touching both cl2 and benchmark files. Please fix

BUILD files are removed from cl2 because they were listed in .gitignore. If the following files are to be committed then should the gitignore be amended?

@wojtek-t
Copy link
Member

BUILD files are removed from cl2 because they were listed in .gitignore. If the following files are to be committed then should the gitignore be amended?

Please don't mix them. It's fine to remove those but in a separate PR.

@kushthedude
Copy link
Contributor Author

kushthedude commented Sep 22, 2020 via email

@kushthedude kushthedude force-pushed the vendor branch 2 times, most recently from 00ca8bd to 6fae693 Compare September 22, 2020 06:41
@kushthedude
Copy link
Contributor Author

Fixed!

@kushthedude
Copy link
Contributor Author

/cc @mm4tt @wojtek-t

Signed-off-by: Kush Trivedi <kushthedude@gmail.com>
@mm4tt
Copy link
Contributor

mm4tt commented Sep 22, 2020

/lgtm
/approve

Thanks!

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 22, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kushthedude, mm4tt

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 22, 2020
@k8s-ci-robot k8s-ci-robot merged commit 100fb51 into kubernetes:master Sep 22, 2020
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. area/dependency Issues or PRs related to dependency changes cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants