HyukjinKwon opened a new pull request #27307: 
[SPARK-30572][SPARK-30534][BUILD][FOLLOW-UP] Add a fallback repository as GCS
URL: https://github.com/apache/spark/pull/27307
 
 
   ### What changes were proposed in this pull request?
   
   This PR proposes to fix three things. Three issues and fixes were a bit 
mixed so this PR sorts it out.
   
   1. Add the google mirror (GCS) as a fallback repository. This will not only 
help development more stable but also in order to make Github Actions build 
stable. We already added this GCS mirror as a default additional remote 
repository at SPARK-29175. 
       
https://github.com/apache/spark/blob/abf759a91e01497586b8bb6b7a314dd28fd6cff1/sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala#L2111-L2118
   
   2. Currently, we have the hard-corded repository in 
[`sbt-pom-reader`](https://github.com/JoshRosen/sbt-pom-reader/blob/v1.0.0-spark/src/main/scala/com/typesafe/sbt/pom/MavenPomResolver.scala#L32)
 and this seems overwriting Maven's existing resolver by the same ID `central` 
when initially the pom file is ported into SBT.
   
       My speculation is that we just need to be able to load plugin and let it 
convert POM to SBT instance with another fallback repo. After that, it _seems_ 
we use `central` properly.
   
       I double checked that we use `https` properly from the SBT build as well:
   
       ```
       [debug] downloading 
https://repo1.maven.org/maven2/com/etsy/sbt-checkstyle-plugin_2.10_0.13/3.1.1/sbt-checkstyle-plugin-3.1.1.pom
 ...
       [debug]  public: downloading 
https://repo1.maven.org/maven2/com/etsy/sbt-checkstyle-plugin_2.10_0.13/3.1.1/sbt-checkstyle-plugin-3.1.1.pom
       [debug]  public: downloading 
https://repo1.maven.org/maven2/com/etsy/sbt-checkstyle-plugin_2.10_0.13/3.1.1/sbt-checkstyle-plugin-3.1.1.pom.sha1
       ```
   
   
   3. While I am here, I fix another issue. Github Action at 
https://github.com/apache/spark/pull/27279 is being failed. The reason seems to 
be scalafmt 1.0.3 is in Maven central but not in GCS. In this PR, simply it 
adds to `pluginRepositories`.
   
       ```
       org.apache.maven.plugin.PluginResolutionException: Plugin 
org.antipathy:mvn-scalafmt_2.12:1.0.3 or one of its dependencies could not be 
resolved: Could not find artifact org.antipathy:mvn-scalafmt_2.12:jar:1.0.3 in 
google-maven-central 
(https://maven-central.storage-download.googleapis.com/repos/central/data/)
           at 
org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve     
(DefaultPluginDependenciesResolver.java:131)
       ``` 
   
      Seems it does not falls back to `central` for some reasons. It exists in 
Maven central:
   
       ```bash
       $ curl 
https://maven-central.storage.googleapis.com/repos/central/data/org/antipathy/mvn-scalafmt_2.12/1.0.3/mvn-scalafmt_2.12-1.0.3.pom
       ```
       ```xml
       <?xml version='1.0' 
encoding='UTF-8'?><Error><Code>NoSuchKey</Code><Message>The specified key does 
not exist.</Message><Details>No such object: 
maven-central/repos/central/data/org/antipathy/mvn-scalafmt_2.12/1.0.3/mvn-scalafmt_2.12-1.0.3.pom</Details></Error>%
       ```
   
       whereas not in GCS mirror:
   
       ```bash
       $ curl 
https://repo.maven.apache.org/maven2/org/antipathy/mvn-scalafmt_2.12/1.0.3/mvn-scalafmt_2.12-1.0.3.pom
       ```
   
       ```xml
       <project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
            xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
           <modelVersion>4.0.0</modelVersion>
           ...
       ```
   
   ### Why are the changes needed?
   
   To make the build and Github Action more stable.
   
   ### Does this PR introduce any user-facing change?
   
   No, dev only change.
   
   ### How was this patch tested?
   
   I roughly checked local and PR against my fork 
(https://github.com/HyukjinKwon/spark/pull/2 and 
https://github.com/HyukjinKwon/spark/pull/3).

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to