-
-
Notifications
You must be signed in to change notification settings - Fork 628
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
Remoting/use maven mirror #8638
Closed
Closed
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b1e418e
Point RBE at a mirror of maven central.
jsirois 2c82f20
Set remote-specific options inside tests.
benjyw c0c4187
BUILD file dep on remote ivy settings.
benjyw f88c1e5
Add local and toolchain binhost repos.
benjyw 024cb1b
Really make the ivysettings identical.
benjyw 09b5f83
Simpler change.
benjyw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0"?> | ||
<!-- | ||
Copyright 2019 Pants project contributors (see CONTRIBUTORS.md). | ||
Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
--> | ||
|
||
<ivysettings> | ||
<settings defaultResolver="maven-central-mirror"/> | ||
<resolvers> | ||
<!-- | ||
Identical to ivysettings.xml, except we point remote execution at the RBE maven central mirror | ||
to avoid DDOSing maven central. --> | ||
<chain name="pants-chain-repos" returnFirst="true"> | ||
<ibiblio | ||
name="maven-central-mirror" | ||
m2compatible="true" | ||
descriptor="required" | ||
root="https://maven-central.storage-download.googleapis.com/repos/central/data"/> | ||
|
||
<!-- The mvn standard local filesystem repo/cache --> | ||
<filesystem name="local.m2" m2compatible="true" local="true" checkmodified="true"> | ||
<ivy pattern="${m2.repo.dir}/${m2.repo.pom}"/> | ||
<artifact pattern="${m2.repo.dir}/${m2.repo.artifact}"/> | ||
</filesystem> | ||
|
||
<!-- Custom repo for Kythe jars, as Google don't currently publish them anywhere. --> | ||
<url name="toolchainlabs/binhost"> | ||
<artifact pattern="https://github.com/toolchainlabs/binhost/raw/master/${kythe.artifact}" /> | ||
</url> | ||
</chain> | ||
|
||
</resolvers> | ||
</ivysettings> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,21 @@ def setUp(self): | |
super().setUp() | ||
init_subsystem(JvmResolveSubsystem) | ||
self.set_options_for_scope('resolver', resolver='ivy') | ||
if os.path.isfile('/PANTS_GCP_REMOTE'): | ||
# Use the GCP maven mirrors, so we don't get throttled for DOSing maven central. | ||
# Note that this recapitulates the logic in pants.remote.ini. Unfortunately we | ||
# can't access the real options inside tests, and plumbing these through everywhere | ||
# they're needed is prohibitive. So we repeat the logic here. | ||
maven_central_mirror_root_url = 'https://maven-central.storage-download.googleapis.com/repos/central/data' | ||
maven_central_mirror_ivy_bootstrap_jar_url = f'{maven_central_mirror_root_url}/org/apache/ivy/ivy/2.4.0/ivy-2.4.0.jar' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto |
||
maven_central_mirror_ivy_settings = 'build-support/ivy/remote.ivysettings.xml' | ||
|
||
self.set_options_for_scope('coursier', repos=[maven_central_mirror_root_url]) | ||
for scope in ['ivy', 'ivy.outdated', 'ivy.outdated.ivy']: | ||
self.set_options_for_scope(scope, | ||
bootstrap_jar_url=maven_central_mirror_ivy_bootstrap_jar_url, | ||
bootstrap_ivy_settings=maven_central_mirror_ivy_settings, | ||
ivy_settings=maven_central_mirror_ivy_settings) | ||
|
||
def populate_runtime_classpath(self, context, classpath=None): | ||
""" | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be able to remove the
bootstrap_jar_url
overrides once #8637 lands.