Merge "Add packer-verify-build jobs" v0.53.0
authorAnil Belur <abelur@linuxfoundation.org>
Tue, 21 Apr 2020 01:44:31 +0000 (01:44 +0000)
committerGerrit Code Review <gerrit@linuxfoundation.org>
Tue, 21 Apr 2020 01:44:31 +0000 (01:44 +0000)
16 files changed:
docs/jjb/lf-release-jobs.rst
jjb/lf-release-jobs.yaml
jjb/lf-rtdv3-jobs.yaml
releasenotes/notes/add-logs-directory-logs-deploy-c4281c9e7893f489.yaml [new file with mode: 0644]
releasenotes/notes/deprecate-niet-release-jobs-64454a3317b7936f.yaml [new file with mode: 0644]
releasenotes/notes/fix-boolean-schema-release-jobs-487bf0b62ba082c7.yaml [new file with mode: 0644]
releasenotes/notes/fix-rtd-verify-7edbef07d90560cf.yaml [new file with mode: 0644]
releasenotes/notes/run-rtdv3-parallel-8086fe4a548a2965.yaml [new file with mode: 0644]
releasenotes/notes/tag-release-optional-2069cca65ed0434b.yaml [new file with mode: 0644]
schema/release-container-schema.yaml
schema/release-packagecloud-schema.yaml
schema/release-pypi-schema.yaml
schema/release-schema.yaml
shell/logs-deploy.sh
shell/release-job.sh
shell/rtd-verify.sh

index d4af19b..02e7312 100644 (file)
@@ -82,6 +82,8 @@ The following parameters must appear in a maven release yaml file.
 
     :git_tag: The tag string to sign and push to the Git repository.
        (default: the semantic version string)
+    :tag_release: Tag Gerrit Repo during the release process.
+       (default: true)
 
 The JSON schema for a maven release file appears below.
 
@@ -132,6 +134,8 @@ The following parameters must appear in a container release yaml file.
 
     :git_tag: The tag string to sign and push to the Git repository.
        (default: the semantic version string)
+    :tag_release: Tag Gerrit Repo during the release process.
+       (default: true)
 
 The JSON schema for a container release file appears below.
 
@@ -179,6 +183,8 @@ packages.
 
     :git_tag: The tag string to sign and push to the Git repository.
        (default: the semantic version string)
+    :tag_release: Tag Gerrit Repo during the release process.
+       (default: true)
 
 The JSON schema for a PyPI release file appears below.
 
@@ -232,6 +238,8 @@ packages.
 
     :git_tag: The tag string to sign and push to the Git repository.
        (default: the semantic version string)
+    :tag_release: Tag Gerrit Repo during the release process.
+       (default: true)
 
 The JSON schema for a PackageCloud release file appears below.
 
index 398a53e..3cc37e9 100644 (file)
           stream: "$GERRIT_BRANCH"
       - lf-build-with-parameters-maven-release:
           use-release-file: "{use-release-file}"
+      - bool:
+          name: TAG_RELEASE
+          default: true
+          description: |
+            Tag Gerrit repo after release.
       - bool:
           name: DRY_RUN
           default: false
           name: USE_RELEASE_FILE
           default: true
           description: "Set to False (unchecked) to build with parameters"
+      - bool:
+          name: TAG_RELEASE
+          default: true
+          description: |
+            Tag Gerrit repo after release.
       - bool:
           name: DRY_RUN
           default: false
           name: DISTRIBUTION_TYPE
           default: "packagecloud"
           description: "The Jenkins release job distribution type."
+      - bool:
+          name: TAG_RELEASE
+          default: true
+          description: |
+            Tag Gerrit repo after release.
       - bool:
           name: DRY_RUN
           default: false
index d78a59b..561c792 100644 (file)
@@ -30,6 +30,7 @@
     #####################
 
     project-type: freestyle
+    concurrent: true
     node: "{build-node}"
 
     properties:
diff --git a/releasenotes/notes/add-logs-directory-logs-deploy-c4281c9e7893f489.yaml b/releasenotes/notes/add-logs-directory-logs-deploy-c4281c9e7893f489.yaml
new file mode 100644 (file)
index 0000000..a953a6a
--- /dev/null
@@ -0,0 +1,8 @@
+---
+features:
+  - |
+    Add "logs" prefix to s3_path("logs/$SILO/$JENKINS_HOSTNAME/$JOB_NAME/
+    $BUILD_NUMBER/"). We are not allowed to have an index.html file at the root
+    level of the S3 bucket. Adding the additional prefix allows us to mirror the
+    directory structure of Nexus where you are able to see both production and
+    sandbox logs when browsing to https://logs.<project>.org/.
diff --git a/releasenotes/notes/deprecate-niet-release-jobs-64454a3317b7936f.yaml b/releasenotes/notes/deprecate-niet-release-jobs-64454a3317b7936f.yaml
new file mode 100644 (file)
index 0000000..1c0fa18
--- /dev/null
@@ -0,0 +1,6 @@
+---
+fixess:
+  - |
+    Standardize yaml parsing tools used across global-jjb.
+    Switch from using niet package to yq for parsing yaml files
+    in release-job.sh.
diff --git a/releasenotes/notes/fix-boolean-schema-release-jobs-487bf0b62ba082c7.yaml b/releasenotes/notes/fix-boolean-schema-release-jobs-487bf0b62ba082c7.yaml
new file mode 100644 (file)
index 0000000..f285000
--- /dev/null
@@ -0,0 +1,4 @@
+---
+fixes:
+  - |
+    Schema type "bool" is not valid. Fix to "boolean"
diff --git a/releasenotes/notes/fix-rtd-verify-7edbef07d90560cf.yaml b/releasenotes/notes/fix-rtd-verify-7edbef07d90560cf.yaml
new file mode 100644 (file)
index 0000000..d986ad1
--- /dev/null
@@ -0,0 +1,13 @@
+---
+fixes:
+  - |
+    Fix the rtd verify script failure. The script attempts to install
+    lftools dev with --user and fails on the error.
+
+    Error:
+
+      [Errno 13] Permission denied: '/usr/local/lib/python3.6'
+
+    This code is actually required when a new commands are added to lftools,
+    the docs verify job needs to run the new command and install dev version
+    lftools version.
diff --git a/releasenotes/notes/run-rtdv3-parallel-8086fe4a548a2965.yaml b/releasenotes/notes/run-rtdv3-parallel-8086fe4a548a2965.yaml
new file mode 100644 (file)
index 0000000..25748b7
--- /dev/null
@@ -0,0 +1,4 @@
+---
+fixes:
+  - |
+    Allow rtdv3 jobs to run in parallel.
diff --git a/releasenotes/notes/tag-release-optional-2069cca65ed0434b.yaml b/releasenotes/notes/tag-release-optional-2069cca65ed0434b.yaml
new file mode 100644 (file)
index 0000000..1229df5
--- /dev/null
@@ -0,0 +1,6 @@
+---
+features:
+  - |
+    Optionally tag repo during release process. Set to true by default.
+    Allow projects to skip repo tag in cases where multiple release
+    types happen whithin the same repo.
index 0b1fe0a..024ee4e 100644 (file)
@@ -41,3 +41,5 @@ properties:
     type: "string"
   ref:
     type: "string"
+  tag_release:
+    type: "boolean"
index 8432f30..40af30d 100644 (file)
@@ -32,5 +32,7 @@ properties:
     type: "string"
   log_dir:
     type: "string"
+  tag_release:
+    type: "boolean"
   version:
     type: "string"
index 20240ed..ab720fe 100644 (file)
@@ -26,5 +26,7 @@ properties:
     type: "string"
   python_version:
     type: "string"
+  tag_release:
+    type: "boolean"
   version:
     type: "string"
index 1c95eb9..cf027ef 100644 (file)
@@ -26,5 +26,7 @@ properties:
     type: "string"
   project:
     type: "string"
+  tag_release:
+    type: "boolean"
   version:
     type: "string"
index f1b5911..2009c32 100644 (file)
@@ -45,7 +45,7 @@ fi
 if [[ -z ${S3_BUCKET:-} ]]; then
     echo "WARNING: S3 logging server not set"
 else
-    s3_path="$SILO/$JENKINS_HOSTNAME/$JOB_NAME/$BUILD_NUMBER/"
+    s3_path="logs/$SILO/$JENKINS_HOSTNAME/$JOB_NAME/$BUILD_NUMBER/"
     echo "INFO: S3 path $s3_path"
 
     echo "INFO: archiving logs to S3"
index b650c13..3a0294e 100644 (file)
@@ -14,7 +14,7 @@ set -eu -o pipefail
 echo "INFO: creating virtual environment"
 virtualenv -p python3 /tmp/venv
 PATH=/tmp/venv/bin:$PATH
-pipup="python -m pip install -q --upgrade pip idna==2.8 lftools jsonschema niet twine yq"
+pipup="python -m pip install -q --upgrade pip idna==2.8 lftools jsonschema twine yq"
 echo "INFO: $pipup"
 $pipup
 # show installed versions
@@ -53,7 +53,7 @@ set_variables_common(){
     # Packagecloud and PyPI jobs set the appropriate value.
     DISTRIBUTION_TYPE="${DISTRIBUTION_TYPE:-None}"
     if [[ $DISTRIBUTION_TYPE == "None" ]]; then
-        if ! DISTRIBUTION_TYPE=$(niet ".distribution_type" "$release_file"); then
+        if ! DISTRIBUTION_TYPE=$(yq -r ".distribution_type" "$release_file"); then
             echo "ERROR: Failed to get distribution_type from $release_file"
             exit 1
         fi
@@ -61,6 +61,15 @@ set_variables_common(){
 
     PATCH_DIR=$(mktemp -d)
 
+    TAG_RELEASE="${TAG_RELEASE:-None}"
+    if [[ $TAG_RELEASE == "None" ]]; then
+        if grep -q "tag_release" $release_file ; then
+            TAG_RELEASE=$(yq -r .tag_release "$release_file")
+        else
+            TAG_RELEASE=true
+        fi
+    fi
+
     # Displaying Release Information (Common variables)
     printf "\t%-30s\n" RELEASE_ENVIRONMENT_INFO:
     printf "\t%-30s %s\n" RELEASE_FILE: "$release_file"
@@ -70,23 +79,24 @@ set_variables_common(){
     printf "\t%-30s %s\n" SILO: "$SILO"
     printf "\t%-30s %s\n" PROJECT: "$PROJECT"
     printf "\t%-30s %s\n" PROJECT-DASHED: "${PROJECT//\//-}"
+    printf "\t%-30s %s\n" TAG_RELEASE: "$TAG_RELEASE"
     printf "\t%-30s %s\n" DISTRIBUTION_TYPE: "$DISTRIBUTION_TYPE"
 }
 
 set_variables_maven(){
     echo "INFO: Setting maven variables"
     if [[ -z ${VERSION:-} ]]; then
-        VERSION=$(niet ".version" "$release_file")
+        VERSION=$(yq -r ".version" "$release_file")
     fi
     if [[ -z ${GIT_TAG:-} ]]; then
         if grep -q "git_tag" "$release_file" ; then
-            GIT_TAG=$(niet ".git_tag" "$release_file")
+            GIT_TAG=$(yq -r ".git_tag" "$release_file")
         else
             GIT_TAG="$VERSION"
         fi
     fi
     if [[ -z ${LOG_DIR:-} ]]; then
-        LOG_DIR=$(niet ".log_dir" "$release_file")
+        LOG_DIR=$(yq -r ".log_dir" "$release_file")
     fi
     LOGS_URL="${LOGS_SERVER}/${NEXUS_PATH}${LOG_DIR}"
     LOGS_URL=${LOGS_URL%/}  # strip any trailing '/'
@@ -102,27 +112,27 @@ set_variables_maven(){
 set_variables_container(){
     echo "INFO: Setting container variables"
     if [[ -z ${VERSION:-} ]]; then
-        VERSION=$(niet ".container_release_tag" "$release_file")
+        VERSION=$(yq -r ".container_release_tag" "$release_file")
     fi
     if [[ -z ${GIT_TAG:-} ]]; then
         if grep -q "git_tag" "$release_file" ; then
-            GIT_TAG=$(niet ".git_tag" "$release_file")
+            GIT_TAG=$(yq -r ".git_tag" "$release_file")
         else
             GIT_TAG="$VERSION"
         fi
    fi
     if grep -q "container_pull_registry" "$release_file" ; then
-        CONTAINER_PULL_REGISTRY=$(niet ".container_pull_registry" "$release_file")
+        CONTAINER_PULL_REGISTRY=$(yq -r ".container_pull_registry" "$release_file")
     fi
     if grep -q "container_push_registry" "$release_file" ; then
-        CONTAINER_PUSH_REGISTRY=$(niet ".container_push_registry" "$release_file")
+        CONTAINER_PUSH_REGISTRY=$(yq -r ".container_push_registry" "$release_file")
     fi
     # Make sure both pull and push registries are defined
     if [ -z ${CONTAINER_PULL_REGISTRY+x} ] || [ -z ${CONTAINER_PUSH_REGISTRY+x} ]; then
         echo "ERROR: CONTAINER_PULL_REGISTRY and CONTAINER_PUSH_REGISTRY need to be defined"
         exit 1
     fi
-    ref=$(niet ".ref" "$release_file")
+    ref=$(yq -r ".ref" "$release_file")
 
     # Continuing displaying Release Information (Container)
     printf "\t%-30s\n" RELEASE_CONTAINER_INFO:
@@ -136,22 +146,22 @@ set_variables_container(){
 set_variables_pypi(){
     echo "INFO: Setting pypi variables"
     if [[ -z ${LOG_DIR:-} ]]; then
-        LOG_DIR=$(niet ".log_dir" "$release_file")
+        LOG_DIR=$(yq -r ".log_dir" "$release_file")
     fi
     LOGS_URL="${LOGS_SERVER}/${NEXUS_PATH}${LOG_DIR}"
     LOGS_URL=${LOGS_URL%/}  # strip any trailing '/'
     if [[ -z ${PYPI_PROJECT:-} ]]; then
-        PYPI_PROJECT=$(niet ".pypi_project" "$release_file")
+        PYPI_PROJECT=$(yq -r ".pypi_project" "$release_file")
     fi
     if [[ -z ${PYTHON_VERSION:-} ]]; then
-        PYTHON_VERSION=$(niet ".python_version" "$release_file")
+        PYTHON_VERSION=$(yq -r ".python_version" "$release_file")
     fi
     if [[ -z ${VERSION:-} ]]; then
-        VERSION=$(niet ".version" "$release_file")
+        VERSION=$(yq -r ".version" "$release_file")
     fi
     if [[ -z ${GIT_TAG:-} ]]; then
         if grep -q "git_tag" "$release_file" ; then
-            GIT_TAG=$(niet ".git_tag" "$release_file")
+            GIT_TAG=$(yq -r ".git_tag" "$release_file")
         else
             GIT_TAG="$VERSION"
         fi
@@ -171,23 +181,23 @@ set_variables_pypi(){
 set_variables_packagecloud(){
      echo "INFO: Setting packagecloud variables"
      if [[ -z ${VERSION:-} ]]; then
-         VERSION=$(niet ".version" "$release_file")
+         VERSION=$(yq -r ".version" "$release_file")
      fi
      if [[ -z ${GIT_TAG:-} ]]; then
          if grep -q "git_tag" $release_file ; then
-             GIT_TAG=$(niet ".git_tag" "$release_file")
+             GIT_TAG=$(yq -r ".git_tag" "$release_file")
          else
              GIT_TAG="$VERSION"
          fi
      fi
      if [[ -z ${LOG_DIR:-} ]]; then
-         LOG_DIR=$(niet ".log_dir" "$release_file")
+         LOG_DIR=$(yq -r ".log_dir" "$release_file")
      fi
      if [[ -z ${REF:-} ]]; then
-         REF=$(niet ".ref" "$release_file")
+         REF=$(yq -r ".ref" "$release_file")
      fi
      if [[ -z ${PACKAGE_NAME:-} ]]; then
-         PACKAGE_NAME=$(niet ".package_name" "$release_file")
+         PACKAGE_NAME=$(yq -r ".package_name" "$release_file")
      fi
      logs_url="${LOGS_SERVER}/${NEXUS_PATH}${LOG_DIR}"
      logs_url=${logs_url%/}  # strip any trailing '/'
@@ -261,6 +271,11 @@ verify_packagecloud_match_release(){
 # sigul is only available on Centos
 # TODO: write tag-github-repo function
 tag-gerrit-repo(){
+    if [[ $TAG_RELEASE == false ]]; then
+       echo "INFO: Skipping gerrit repo tag"
+       return
+    fi
+
     echo "INFO: tag gerrit with $GIT_TAG"
     # Import public signing key
     gpg --import "$SIGNING_PUBKEY"
index 86254a1..a1b1330 100644 (file)
@@ -30,9 +30,14 @@ fi
 git fetch origin "$GERRIT_REFSPEC" && git checkout FETCH_HEAD
 git submodule update
 
+
+# When a new commands are added in lftools, the docs verify job needs to
+# run the new command which requires installing the lftools dev version
 if [[ $JOB_NAME == "lf-infra-lftools-rtd-verify-any" ]]; then
-    # Install patchset lftools
-    python3 -m pip install --user -e .
+    # shellcheck disable=SC1090
+    source ~/lf-env.sh
+    lf-activate-venv pip
+    pip install -e .
 fi
 
 echo "---> Generating docs"