Skip to content

Conversation

chxchx
Copy link
Contributor

@chxchx chxchx commented Jul 21, 2017

@sebastienvas @yutongz

cron jobs and other relevant setup to invoke this binary will be made in another PR

Design Doc

@istio-testing
Copy link
Collaborator

Jenkins job istio/presubmit passed

@sebastienvas
Copy link
Contributor

sebastienvas commented Jul 22, 2017 via email

Copy link
Contributor

@sebastienvas sebastienvas left a comment

Choose a reason for hiding this comment

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

PTAL

repoInfoStore = make(map[string]repoInfo) // maps repo name to its info
)

func buildDepsGraph() {
Copy link
Contributor

Choose a reason for hiding this comment

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

If you use a file in the repo like stated in the dd, you don't need to hard code those. You can directly get the dependencies from the repos.

if err != nil {
return "", err
}
return fmt.Sprintf("https://%s:%s@github.com/%s/%s.git", acct, token, acct, repo), nil
Copy link
Contributor

Choose a reason for hiding this comment

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

The repo is public, do you really need the user and password here ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We discussed this in person but I shall repeat myself for the record of other contributors. Although cloning a git repo to local requires no authentication, pushing a new branch to the remote does.

url = "https://storage.googleapis.com/istio-build/proxy/envoy-alpha-" + PROXY + ".tar.gz",
)
*/
constant
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we rename this to something meaningful ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As we discussed, we may treat all dependency entries as a constant whose value is a string representing a commit SHA. Doing so also makes WORKSPACE editing much easier. I have made such change in my latest commit.

toolbox/main.go Outdated
if err != nil {
return line, err
}
latestStableCommit, err := util.Shell(
Copy link
Contributor

Choose a reason for hiding this comment

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

Can t you use the github api to figure this out ?
https://developer.github.com/v3/repos/branches/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch!

}

type repoInfo struct {
depFile string // where in the *parent* repo such dependecy isrecorded
Copy link
Contributor

Choose a reason for hiding this comment

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

There could be more than one file. I would move the file up to dependency as there could one file per deps.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Totally Agree.

toolbox/main.go Outdated
for i := 0; i < len(lines); i++ {
for _, dep := range rinfo.deps {
switch dep.depType {
case bazelRule:
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems flaky as the order might change. You can actually change the file such that it is done as a constant. This is why all the other constant are there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is a smart way to update WORKSPACE. Done.

toolbox/main.go Outdated
if err := os.Chdir(repo); err != nil {
return err
}
branch := fmt.Sprintf("autoUpdateDeps%v", time.Now().UnixNano())
Copy link
Contributor

Choose a reason for hiding this comment

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

That s unique, but that does not prevent you from creating twice the same PR. if should be a function of (Parent Repo, Deps Repos, Branch Name, Head of Branch, SHAs to update)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

}

var (
repoInfoStore = make(map[string]repoInfo) // maps repo name to its info
Copy link
Contributor

Choose a reason for hiding this comment

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

should not it be map[string][]repoInfo. In theory a parent has more than one deps.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This might be no longer relevant as we decided that we should put such dependency metadata into a file for each repo.

@ldemailly
Copy link
Member

cc @costinm

@chxchx
Copy link
Contributor Author

chxchx commented Jul 25, 2017

PTAL

There is only one thing left. For reliable editing of WORKSPACE or repositories.bzl, we hope to implement what I called "dependency hoisting"

Example:

	new_git_repository(
		name = "mixerapi_git",
		commit = "ee9769f5b3304d9e01cd7ed6fb1dbb9b08e96210",
		remote = "https://github.com/istio/api.git",
	)

becomes

	MIXERAPI = "ee9769f5b3304d9e01cd7ed6fb1dbb9b08e96210"
	new_git_repository(
		name = "mixerapi_git",
		commit = MIXERAPI,
		remote = "https://github.com/istio/api.git",
	)

I will refactor getDeps() function once the WORKSPACE and other bazel relevant files in all istio repos have conformed to such standard.

@istio-testing
Copy link
Collaborator

Jenkins job istio/presubmit passed

@sebastienvas
Copy link
Contributor

sebastienvas commented Jul 25, 2017 via email

@chxchx
Copy link
Contributor Author

chxchx commented Jul 25, 2017

I have noticed the work @costinm has been doing, which is also an effort to address the evolving dependencies among the istio repos. I like his idea a lot, but before the discussion settles and given the p0 demand for this feature, maybe I should finish this (least intrusive to current architecture) to set in motion the automation of dependency update and together searching and implementing a cleaner solution right after. But do let me know if I should channel my effort elsewhere.

@istio-testing
Copy link
Collaborator

Jenkins job istio/presubmit passed

@istio-testing
Copy link
Collaborator

Jenkins job istio/presubmit passed

@istio-testing
Copy link
Collaborator

@chxchx: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
prow/istio-presubmit.sh 79e7605 link @istio-testing bazel test 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. I understand the commands that are listed here.

@sebastienvas
Copy link
Contributor

sebastienvas commented Jul 26, 2017

I actually noticed that you created this form istio/istio. It should be in istio/test-infra. could you move it there in toolbox as well ? Also, after talking to @yutongz, I realized that there is currently no easy way to extract metrics repos anymore to know how far behing they are. This will be important for the build cop, as they need to know which repos as outdated deps. Start thinking about it such that we can do that in a new PR.

@chxchx chxchx closed this Jul 27, 2017
guptasu pushed a commit to guptasu/istio that referenced this pull request Jun 11, 2018
howardjohn pushed a commit to howardjohn/istio that referenced this pull request Jan 12, 2020
* Use global trust domain

* make gen

* Fix stuff
vikaschoudhary16 pushed a commit to vikaschoudhary16/istio that referenced this pull request Aug 12, 2024
Consider private ip if public ip is not set for NodePort services
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants