You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by GitBox <gi...@apache.org> on 2022/01/05 16:12:16 UTC

[GitHub] [solr] HoustonPutman commented on a change in pull request #491: SOLR-15867 Bring in build stuff from lucene

HoustonPutman commented on a change in pull request #491:
URL: https://github.com/apache/solr/pull/491#discussion_r778947767



##########
File path: solr/distribution/build.gradle
##########
@@ -0,0 +1,141 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.lucene.gradle.Checksum
+
+import java.nio.charset.StandardCharsets
+import java.nio.file.Files
+
+plugins {
+  id 'signing'
+}
+
+// This project puts together the Solr "distribution", assembling bits and pieces
+// from across the project structure into release artifacts.
+
+ext {
+  releaseDir = file("${buildDir}/release")
+  withSignedArtifacts = { ->
+    def propValue = propertyOrDefault("sign", null)
+    // Allow -Psign to work as a shorthand for -Psign=true
+    return propValue != null && (propValue.isBlank() || Boolean.parseBoolean(propValue))
+  }.call()
+}
+
+// Prepare the "source" distribution artifact.
+apply from: buildscript.sourceFile.toPath().resolveSibling("source-release.gradle")
+
+// Prepare the "binary" distribution artifact.
+apply from: buildscript.sourceFile.toPath().resolveSibling("binary-release.gradle")
+
+// Configure artifact signing.
+apply from: buildscript.sourceFile.toPath().resolveSibling("artifact-signing.gradle")
+
+
+// Set up the HTML-rendered "changes" distribution artifact by linking to documentation's output.
+configurations {
+  changesHtml
+  solrTgz
+  solrTgzSignature
+  docker
+}
+
+artifacts {
+  solrTgz assembleBinaryTgz
+  solrTgzSignature file(assembleBinaryTgz.archiveFileName.get() + ".asc")
+}
+
+dependencies {
+  changesHtml project(path: ":solr:documentation", configuration: "changesHtml")
+  docker project(path: ':solr:docker', configuration: 'packaging')
+}
+
+// Compute checksums for release archives.
+task computeChecksums(type: Checksum) {
+  algorithm = Checksum.Algorithm.SHA512
+
+  files = objects.fileCollection()
+  [
+      tasks.assembleSourceTgz,
+      tasks.assembleBinaryTgz,
+      tasks.assembleBinaryZip,
+  ].each { dep ->
+    dependsOn dep
+    files += dep.outputs.files
+  }
+
+  outputDir = file("${buildDir}/checksums")
+}
+
+
+task prepareGitRev() {
+  dependsOn ":gitStatus"
+
+  ext.outputFile = file("${buildDir}/.gitrev")
+
+  outputs.file(ext.outputFile)
+  inputs.property("gitrev", provider { -> rootProject.ext.gitRev })
+
+  doFirst {
+    Files.writeString(ext.outputFile.toPath(), rootProject.ext.gitRev, StandardCharsets.UTF_8)
+  }
+}
+
+
+// Assemble everything needed in the release folder structure.
+task assembleRelease(type: Sync) {
+  description "Assemble all Solr artifacts for a release."
+  dependsOn rootProject.getTasksByName("mavenToLocalFolder", true)[0]
+
+  from(configurations.changesHtml, {
+    into "changes"
+  })
+
+  from(configurations.docker, {
+    into "docker"

Review comment:
       You don't need a separate folder for the local dockerfile (since as you mention, it's already in the tarball), but I think we should upload the proposed official dockerfile as a part of the release. That way we can build a test "official" image as a part of the smoke tester. Of course, this official dockerfile might change when we submit the PR to the official-images repo. But if we include it in the smoke tester, we have a much better idea that it is safe to release.
   
   We can (and should) test both the `Dockerfile.local` as well as the `Dockerfile.official` as a part of the release IMO. It should be very straightforward and easy, and shouldn't take much time. I agree that we don't need to full suite of docker tests that we do on `gradle dockerTest`, we can just have a simple integration test (and do it for the images created from both dockerfiles).
   
   The local dockerfile should be especially easy to test, because as you mention, it's included in the release TGZ
   
   The official dockerfile should also be easy to test, since we host the release TGZ for others to download during the vote. We can just have the smoke tester build the docker image using a different release server (the one hosting the release candidate).




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org