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

Enable GOPROXY in default preset #13648

Merged
merged 2 commits into from
Jul 29, 2019

Conversation

cblecker
Copy link
Member

@cblecker cblecker commented Jul 28, 2019

fixes #13645.

Create a preset that adds the GOPROXY=https://proxy.golang.org env var to all jobs on prow.k8s.io.

Summary of benefits:

  • proxy.golang.org is a Google-run service on Borg. Should be highly reliable.
  • As both prow and proxy.golang.org are on the Google network, it should be faster to download.
  • As the cached modules don't require a full version control checkout, the download size should be smaller (read: faster)
  • For any jobs that don't use go modules, this is a noop.

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jul 28, 2019
@k8s-ci-robot k8s-ci-robot added area/prow Issues or PRs related to prow sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. area/config Issues or PRs related to code in /config and removed approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jul 28, 2019
@cblecker cblecker changed the title [WIP] Enabled GOPROXY preset by default Enable GOPROXY preset by default Jul 29, 2019
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 29, 2019
@cblecker cblecker changed the title Enable GOPROXY preset by default Enable GOPROXY in default preset Jul 29, 2019
@cblecker
Copy link
Member Author

/hold
for discussion

/cc @BenTheElder @cjwagner @fejta @stevekuznetsov

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 29, 2019
@cblecker cblecker mentioned this pull request Jul 29, 2019
@@ -635,3 +635,7 @@ presets:
hostPath:
path: /sys/fs/cgroup
type: Directory
# enable GOPROXY by default
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we support a 'default' preset that applies to all jobs implicitly and I'm not sure that we'd want to since that would be pretty opaque to job authors.

func mergePreset(preset Preset, labels map[string]string, containers []v1.Container, volumes *[]v1.Volume) error {
for l, v := range preset.Labels {
if v2, ok := labels[l]; !ok || v2 != v {
return nil

Copy link
Member

Choose a reason for hiding this comment

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

FWIW:

  • presets upstream are meant to be opaque for injecting environment (primarily credential) details
  • this setting only affects jobs that use go modules directly from within the container (not bazel or docker in docker)
  • in many settings this would be configured with a default on the machine (EG a corporate GOPROXY)

Setting this by default across the board makes sense, I did mention in previous discussion that the prow owners may not be OK with that though 🤷‍♂

Copy link
Member Author

Choose a reason for hiding this comment

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

I can confirm that the code as it is today will apply this "default" preset to every job (CI actually errors if this is set in the job spec because it merges and detects the duplicate).

+1 to everything Ben said. I can't think of any job on prow.k8s.io that wouldn't either benefit from this being set, or disregard it as a noop.

Copy link
Member

Choose a reason for hiding this comment

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

I am fine with this, but let's make sure it's documented:

Copy link
Member Author

Choose a reason for hiding this comment

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

Created #13665 for follow up

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 29, 2019
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 29, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cblecker

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 Jul 29, 2019
Copy link
Member

@spiffxp spiffxp left a comment

Choose a reason for hiding this comment

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

this was new behavior to me, I like its use for good, but can we doc it?

@@ -635,3 +635,7 @@ presets:
hostPath:
path: /sys/fs/cgroup
type: Directory
# enable GOPROXY by default
Copy link
Member

Choose a reason for hiding this comment

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

I am fine with this, but let's make sure it's documented:

@spiffxp
Copy link
Member

spiffxp commented Jul 29, 2019

/lgtm

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

LGTM label has been added.

Git tree hash: 35eabee58731807806ba8fb89b2bcec46df40c71

@cblecker cblecker dismissed spiffxp’s stale review July 29, 2019 21:54

subsequent lgtm

@cblecker
Copy link
Member Author

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 29, 2019
@k8s-ci-robot k8s-ci-robot merged commit b84ad08 into kubernetes:master Jul 29, 2019
@k8s-ci-robot
Copy link
Contributor

@cblecker: Updated the following 2 configmaps:

  • job-config configmap in namespace default using the following files:
    • key generated-security-jobs.yaml using file config/jobs/kubernetes-security/generated-security-jobs.yaml
    • key dependencies.yaml using file config/jobs/kubernetes/sig-testing/dependencies.yaml
  • config configmap in namespace default using the following files:
    • key config.yaml using file prow/config.yaml

In response to this:

fixes #13645.

Create a preset that adds the GOPROXY=https://proxy.golang.org env var to all jobs on prow.k8s.io.

Summary of benefits:

  • proxy.golang.org is a Google-run service on Borg. Should be highly reliable.
  • As both prow and proxy.golang.org are on the Google network, it should be faster to download.
  • As the cached modules don't require a full version control checkout, the download size should be smaller (read: faster)
  • For any jobs that don't use go modules, this is a noop.

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 this to the v1.16 milestone Jul 29, 2019
@cblecker cblecker deleted the default-goproxy branch July 29, 2019 22:15
cblecker added a commit to cblecker/test-infra that referenced this pull request Jul 30, 2019
…roxy"

This reverts commit b84ad08, reversing
changes made to 57a4dc6.
k8s-ci-robot added a commit that referenced this pull request Jul 30, 2019
Revert "Merge pull request #13648 from cblecker/default-goproxy"
@spiffxp
Copy link
Member

spiffxp commented Jul 30, 2019

This broke pull-kubernetes-dependencies and was reverted via #13674

We can probably try this again once kubernetes/kubernetes#80732 merges

@cblecker
Copy link
Member Author

PR to re-enable: #13686

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/config Issues or PRs related to code in /config area/prow Issues or PRs related to prow 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. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RFC: go module proxy
5 participants