You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by ho...@apache.org on 2022/04/20 15:15:00 UTC

[solr] branch branch_9x updated: SOLR-15321: Docker official process for release wizard (#809)

This is an automated email from the ASF dual-hosted git repository.

houston pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/branch_9x by this push:
     new 9b8a990c23f SOLR-15321: Docker official process for release wizard (#809)
9b8a990c23f is described below

commit 9b8a990c23f67397ec33564cd7022b1e977a7d67
Author: Houston Putman <ho...@apache.org>
AuthorDate: Wed Apr 20 11:10:35 2022 -0400

    SOLR-15321: Docker official process for release wizard (#809)
    
    * Fix official dockerfile header
    
    * Remove last sks-keyservers.net url
    
    Co-authored-by: Jan Høydahl <ja...@users.noreply.github.com>
    (cherry picked from commit 8efa2bea7aa6f8596fa78f04184259fac379864d)
---
 dev-tools/scripts/releaseWizard.py                 |  5 ++
 dev-tools/scripts/releaseWizard.yaml               | 54 +++++++++++++++++++++-
 .../templates/Dockerfile.official.header.template  |  9 ++--
 3 files changed, 62 insertions(+), 6 deletions(-)

diff --git a/dev-tools/scripts/releaseWizard.py b/dev-tools/scripts/releaseWizard.py
index c3ec10694de..889ad1d6b10 100755
--- a/dev-tools/scripts/releaseWizard.py
+++ b/dev-tools/scripts/releaseWizard.py
@@ -88,6 +88,7 @@ def expand_jinja(text, vars=None):
         'git_checkout_folder': state.get_git_checkout_folder(),
         'ref_guide_svn_folder': state.get_ref_guide_svn_folder(),
         'git_website_folder': state.get_website_git_folder(),
+        'git_solr_docker_folder': state.get_solr_docker_git_folder(),
         'dist_url_base': 'https://dist.apache.org/repos/dist/dev/solr',
         'm2_repository_url': 'https://repository.apache.org/service/local/staging/deploy/maven2',
         'dist_file_path': state.get_dist_folder(),
@@ -573,6 +574,10 @@ class ReleaseState:
         folder = os.path.join(self.get_release_folder(), "solr-site")
         return folder
 
+    def get_solr_docker_git_folder(self):
+        folder = os.path.join(self.get_release_folder(), "solr-docker")
+        return folder
+
     def get_minor_branch_name(self):
         latest = state.get_latest_version()
         if latest is not None:
diff --git a/dev-tools/scripts/releaseWizard.yaml b/dev-tools/scripts/releaseWizard.yaml
index 1f4da7c7dc6..43020f8520b 100644
--- a/dev-tools/scripts/releaseWizard.yaml
+++ b/dev-tools/scripts/releaseWizard.yaml
@@ -932,6 +932,7 @@ groups:
   - !Todo
     id: mv_to_release
     title: Move release artifacts to release repo
+    depends: rm_staged_mvn
     vars:
       dist_folder: solr-{{ release_version }}-RC{{ rc_number }}-rev-{{ build_rc.git_rev | default("<git_rev>", True) }}
       dist_stage_url: '{{ dist_url_base }}/{{ dist_folder}}'
@@ -950,7 +951,58 @@ groups:
         logfile: svn_rm_containing.log
         comment: Clean up containing folder on the staging repo
         tee: true
-    post_description: 'Note at this point you will see the Jenkins job "Solr-SmokeRelease-main" begin to fail, until you run the "Generate Backcompat Indexes" '
+  - !Todo
+    id: docker-publish
+    title: Publish the Official Solr Dockerfile
+    depends: mv_to_release
+    description: |
+      For every release, we publish the official dockerfile for solr via the methods required by Docker.
+      
+      This will start the process, and will ultimately create a PR in https://github.com/docker-library/official-images.
+      This PR creation is automated, you do not need to do more work beyond these steps.
+      
+      When that PR is approved and merged, the Official image for this Solr version will be built and available for use.
+    vars:
+      docker_version: '{{ release_version_major }}.{{ release_version_minor }}'
+      dist_folder: solr-{{ release_version }}-RC{{ rc_number }}-rev-{{ build_rc.git_rev | default("<git_rev>", True) }}
+    commands: !Commands
+      root_folder: '{{ release_folder }}'
+      commands_text: Make sure that each command is successful. This is very imperative.
+      confirm_each_command: true
+      remove_files:
+        - '{{ git_solr_docker_folder }}'
+      commands:
+        - !Command
+          cmd: git clone --progress https://gitbox.apache.org/repos/asf/solr-docker.git solr-docker
+          comment: Run this command to clone the solr-docker git repo
+          logfile: solr_docker_git_clone.log
+        - !Command
+          cmd: git checkout main && git pull --ff-only
+          cwd: solr-docker
+          comment: Checkout the most recent main version
+          logfile: solr_docker_git_checkout.log
+        - !Command
+          cmd: "mkdir -p {{ docker_version }} && cp {{ [dist_file_path, dist_folder, 'solr', 'docker', 'Dockerfile.official'] | path_join }} {{ docker_version }}/Dockerfile"
+          cwd: solr-docker
+          comment: Add the new Dockerfile to the repo
+          logfile: solr_docker_add_dockerfile.log
+        - !Command
+          cmd: 'git add {{ docker_version }}/Dockerfile && git commit -m "Apache Solr release {{ release_version }}"'
+          cwd: solr-docker
+          comment: Commit the new Dockerfile
+          logfile: solr_docker_commit.log
+        - !Command
+          cmd: git show HEAD
+          cwd: solr-docker
+          comment: Check that the commit look correct. Only one Dockerfile should be added or updated.
+          logfile: solr_docker_check_commit.log
+          tee: true
+        - !Command
+          cmd: git push
+          cwd: solr-docker
+          comment: Push the commit
+          logfile: solr_docker_git_push.log
+          tee: true
   - !Todo
     id: stage_maven
     title: Stage the maven artifacts for publishing
diff --git a/solr/docker/templates/Dockerfile.official.header.template b/solr/docker/templates/Dockerfile.official.header.template
index d0d13301979..4715907baad 100644
--- a/solr/docker/templates/Dockerfile.official.header.template
+++ b/solr/docker/templates/Dockerfile.official.header.template
@@ -38,7 +38,7 @@ ARG SOLR_DOWNLOAD_URL
 ARG SOLR_DOWNLOAD_SERVER
 
 # These should never be overridden except for the purposes of testing the Dockerfile before release
-ARG SOLR_CLOSER_URL="http://www.apache.org/dyn/closer.lua/solr/solr/$SOLR_VERSION/solr-$SOLR_VERSION.tgz?action=download"
+ARG SOLR_CLOSER_URL="http://www.apache.org/dyn/closer.lua?action=download&filename=/solr/solr/$SOLR_VERSION/solr-$SOLR_VERSION.tgz"
 ARG SOLR_DIST_URL="https://www.apache.org/dist/solr/solr/$SOLR_VERSION/solr-$SOLR_VERSION.tgz"
 ARG SOLR_ARCHIVE_URL="https://archive.apache.org/dist/solr/solr/$SOLR_VERSION/solr-$SOLR_VERSION.tgz"
 
@@ -53,10 +53,9 @@ RUN set -ex; \
   for key in $SOLR_KEYS; do \
     found=''; \
     for server in \
-      ha.pool.sks-keyservers.net \
-      hkp://keyserver.ubuntu.com:80 \
-      hkp://p80.pool.sks-keyservers.net:80 \
       pgp.mit.edu \
+      keyserver.ubuntu.com \
+      hkp://keyserver.ubuntu.com:80 \
     ; do \
       echo "  trying $server for $key"; \
       gpg --batch --keyserver "$server" --keyserver-options timeout=10 --recv-keys "$key" && found=yes && break; \
@@ -64,7 +63,7 @@ RUN set -ex; \
     done; \
     test -z "$found" && echo >&2 "error: failed to fetch $key from several disparate servers -- network issues?" && exit 1; \
   done; \
-  MAX_REDIRECTS=1; \
+  MAX_REDIRECTS=2; \
   if [ -n "$SOLR_DOWNLOAD_URL" ]; then \
     # If a custom URL is defined, we download from non-ASF mirror URL and allow more redirects and skip GPG step
     # This takes effect only if the SOLR_DOWNLOAD_URL build-arg is specified, typically in downstream Dockerfiles