geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbarr...@apache.org
Subject [geode] branch develop updated: GEODE-6135 - Add benchmark job to CI. (#3041)
Date Thu, 10 Jan 2019 18:40:15 GMT
This is an automated email from the ASF dual-hosted git repository.

jbarrett pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/develop by this push:
     new 65db24c  GEODE-6135 - Add benchmark job to CI. (#3041)
65db24c is described below

commit 65db24ca9e8ec145c198b18e4f134018b76ed475
Author: Nabarun Nag <nabarunnag@users.noreply.github.com>
AuthorDate: Thu Jan 10 10:40:06 2019 -0800

    GEODE-6135 - Add benchmark job to CI. (#3041)
    
    * Add a job to concourse for executing benchmarks
    * Benchmarks run in AWS, results are stored in GCP.
    
    Authored-by: Sean Goller <sgoller@pivotal.io>
    Authored-by: Helena Bales <hbales@pivotal.io>
---
 ci/images/alpine-tools/Dockerfile           |  3 +-
 ci/pipelines/geode-build/jinja.template.yml | 61 ++++++++++++++++++++++-
 ci/pipelines/shared/jinja.variables.yml     |  3 ++
 ci/scripts/cleanup_benchmarks.sh            | 77 +++++++++++++++++++++++++++++
 ci/scripts/run_benchmarks.sh                | 47 ++++++++++++++++++
 5 files changed, 189 insertions(+), 2 deletions(-)

diff --git a/ci/images/alpine-tools/Dockerfile b/ci/images/alpine-tools/Dockerfile
index d2dc728..7d86443 100644
--- a/ci/images/alpine-tools/Dockerfile
+++ b/ci/images/alpine-tools/Dockerfile
@@ -13,7 +13,7 @@
 # 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.
-FROM alpine:latest
+FROM openjdk:8-jdk-alpine
 
 COPY --from=google/cloud-sdk:alpine /google-cloud-sdk /google-cloud-sdk
 COPY --from=hashicorp/packer:latest /bin/packer /usr/local/bin/packer
@@ -41,4 +41,5 @@ RUN apk --no-cache add \
   && rm -rf winrm-cli \
   && gcloud components install -q beta \
   && printf "Host *\n  ServerAliveInterval 60 \n  ServerAliveCountMax 2\n" >>
/etc/ssh/ssh_config \
+  && pip2 install awscli \
   && apk --no-cache del go make
diff --git a/ci/pipelines/geode-build/jinja.template.yml b/ci/pipelines/geode-build/jinja.template.yml
index 170af11..eb1d24a 100644
--- a/ci/pipelines/geode-build/jinja.template.yml
+++ b/ci/pipelines/geode-build/jinja.template.yml
@@ -112,6 +112,7 @@ groups:
   {%- if repository.upstream_fork != "apache" or repository.branch == "develop" %}
   - PublishArtifacts
   {%- endif %}
+  - Benchmark
 - name: linux
   jobs:
   - {{ build_test.name }}
@@ -120,6 +121,7 @@ groups:
   - {{test.name}}Test{{java_test_version.name}}
     {%- endfor -%}
   {%- endfor %}
+  - Benchmark
 - name: windows
   jobs:
   - {{ build_test.name }}
@@ -145,7 +147,6 @@ resources:
   type: git
   source:
     branch: ((geode-build-branch))
-    depth: 1
     ignore_paths:
     - ci/*
     {{ github_access() | indent(4) }}
@@ -158,6 +159,12 @@ resources:
     - ci/pipelines/geode-build/*
     - ci/scripts/*
     {{ github_access() | indent(4) }}
+- name: geode-benchmarks
+  type: git
+  source:
+    branch: develop
+    depth: 1
+    uri: https://github.com/apache/geode-benchmarks.git
 - name: geode-build-version
   type: semver
   source:
@@ -314,6 +321,58 @@ jobs:
       outputs:
       - name: results
 {% endif %}
+- name: Benchmark
+  public: true
+  plan:
+  - get: geode-ci
+  - aggregate:
+    - get: geode
+      passed:
+      {{ all_gating_jobs() | indent(6) }}
+      trigger: true
+    - get: geode-benchmarks
+    - get: geode-build-version
+      params:
+        pre: build
+    - put: concourse-metadata-resource
+  - task: run_benchmarks
+    {{- alpine_tools_config()|indent(4) }}
+      params:
+        AWS_ACCESS_KEY_ID: ((benchmarks-access-key-id))
+        AWS_SECRET_ACCESS_KEY: ((benchmarks-secret-access-key))
+        AWS_DEFAULT_REGION: us-west-2
+        AWS_REGION: us-west-2
+        ARTIFACT_BUCKET: ((artifact-bucket))
+        BASELINE_BRANCH: {{benchmarks.baseline_branch}}
+      run:
+        path: geode-ci/ci/scripts/run_benchmarks.sh
+      inputs:
+      - name: geode
+      - name: geode-ci
+      - name: geode-benchmarks
+      - name: concourse-metadata-resource
+      outputs:
+      - name: results
+    timeout: 1h
+    ensure:
+      do:
+      - task: cleanup_benchmarks
+        {{- alpine_tools_config()|indent(8) }}
+          params:
+            AWS_ACCESS_KEY_ID: ((benchmarks-access-key-id))
+            AWS_SECRET_ACCESS_KEY: ((benchmarks-secret-access-key))
+            AWS_DEFAULT_REGION: us-west-2
+            AWS_REGION: us-west-2
+            ARTIFACT_BUCKET: ((artifact-bucket))
+            BASELINE_BRANCH: {{benchmarks.baseline_branch}}
+          run:
+            path: geode-ci/ci/scripts/cleanup_benchmarks.sh
+          inputs:
+          - name: geode
+          - name: geode-ci
+          - name: geode-benchmarks
+          - name: concourse-metadata-resource
+          - name: results
 {% if repository.upstream_fork != "apache" or repository.branch == "develop" %}
 - name: PublishArtifacts
   public: true
diff --git a/ci/pipelines/shared/jinja.variables.yml b/ci/pipelines/shared/jinja.variables.yml
index 1fbde42..9b89dbd 100644
--- a/ci/pipelines/shared/jinja.variables.yml
+++ b/ci/pipelines/shared/jinja.variables.yml
@@ -56,6 +56,9 @@ java_test_versions:
 - name: OpenJDK11
   version: 11
 
+benchmarks:
+  baseline_branch: "rel/v1.8.0"
+
 java_build_version:
   name: OpenJDK8
   version: 8
diff --git a/ci/scripts/cleanup_benchmarks.sh b/ci/scripts/cleanup_benchmarks.sh
new file mode 100755
index 0000000..df5e047
--- /dev/null
+++ b/ci/scripts/cleanup_benchmarks.sh
@@ -0,0 +1,77 @@
+#!/usr/bin/env bash
+
+#
+# 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.
+
+set -e
+BASE_DIR=$(pwd)
+
+SOURCE="${BASH_SOURCE[0]}"
+while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
+  SCRIPTDIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
+  SOURCE="$(readlink "$SOURCE")"
+  [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink,
we need to resolve it relative to the path where the symlink file was located
+done
+SCRIPTDIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
+
+RESULTS_DIR=$(pwd)/results
+export PAGER=
+pushd geode
+GEODE_SHA=$(git rev-parse --verify HEAD)
+GEODE_SHA_COMMIT_MESSAGE=$(git log -n 1 ${GEODE_SHA})
+popd
+
+source concourse-metadata-resource/concourse_metadata
+CLUSTER_TAG="${BUILD_PIPELINE_NAME}-${BUILD_JOB_NAME}-${BUILD_NAME}-${BUILD_ID}"
+RESULTS_BASE_DIR=$(pwd)/results
+BENCHMARKS_DIR=benchmarks-${CLUSTER_TAG}
+RESULTS_DIR=${RESULTS_BASE_DIR}/benchmarks-${CLUSTER_TAG}
+BENCHMARKS_ARCHIVE_FILENAME=${BENCHMARKS_DIR}.tgz
+BENCHMARKS_ARCHIVE_FILE=${RESULTS_BASE_DIR}/${BENCHMARKS_ARCHIVE_FILENAME}
+BENCHMARKS_ARTIFACTS_DESTINATION="${ARTIFACT_BUCKET}/benchmarks/${BUILD_PIPELINE_NAME}/${GEODE_SHA}"
+
+if [[ "${ARTIFACT_BUCKET}" =~ \. ]]; then
+  ARTIFACT_SCHEME="http"
+else
+  ARTIFACT_SCHEME="gs"
+fi
+
+pushd geode-benchmarks/infrastructure/scripts/aws/
+./destroy_cluster.sh ${CLUSTER_TAG}
+popd
+
+pushd ${RESULTS_BASE_DIR}
+  if [[ -d ${BENCHMARKS_DIR} ]]; then
+    echo "***** Creating benchmarks archive"
+    tar zcf ${BENCHMARKS_ARCHIVE_FILE} ${BENCHMARKS_DIR}
+    echo "***** Copying benchmarks archive to storage"
+    gsutil cp ${BENCHMARKS_ARCHIVE_FILE} gs://${BENCHMARKS_ARTIFACTS_DESTINATION}/${BENCHMARKS_ARCHIVE_FILENAME}
+    printf "\n"
+    printf "\033[92m=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\033[0m\n"
+    printf "\033[92mThis benchmark run is the result of comparing ${GEODE_SHA} with baseline
${BASELINE_BRANCH}\033[0m\n"
+    printf "\033[92m=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Commit Message =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\033[0m\n"
+    echo "${GEODE_SHA_COMMIT_MESSAGE}"
+    printf "\033[92m=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Benchmark Results URI =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\033[0m\n"
+    printf "\033[92m${ARTIFACT_SCHEME}://${BENCHMARKS_ARTIFACTS_DESTINATION}/${BENCHMARKS_ARCHIVE_FILENAME}\033[0m\n"
+    printf "\033[92m=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\033[0m\n"
+    printf "\n"
+  else
+    echo "***************************"
+    echo "No benchmark results found!"
+    echo "***************************"
+  fi
+popd
diff --git a/ci/scripts/run_benchmarks.sh b/ci/scripts/run_benchmarks.sh
new file mode 100755
index 0000000..ae493fb
--- /dev/null
+++ b/ci/scripts/run_benchmarks.sh
@@ -0,0 +1,47 @@
+#!/usr/bin/env bash
+
+#
+# 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.
+
+set -e
+
+BASE_DIR=$(pwd)
+
+SOURCE="${BASH_SOURCE[0]}"
+while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
+  SCRIPTDIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
+  SOURCE="$(readlink "$SOURCE")"
+  [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink,
we need to resolve it relative to the path where the symlink file was located
+done
+SCRIPTDIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
+
+source concourse-metadata-resource/concourse_metadata
+CLUSTER_TAG="${BUILD_PIPELINE_NAME}-${BUILD_JOB_NAME}-${BUILD_NAME}-${BUILD_ID}"
+RESULTS_DIR=$(pwd)/results/benchmarks-${CLUSTER_TAG}
+
+CLUSTER_COUNT=4
+BENCHMARKS_BRANCH=develop
+
+pushd geode
+GEODE_SHA=$(git rev-parse --verify HEAD)
+popd
+
+pushd geode-benchmarks/infrastructure/scripts/aws/
+./launch_cluster.sh ${CLUSTER_TAG} ${CLUSTER_COUNT}
+./run_against_baseline.sh ${CLUSTER_TAG} ${GEODE_SHA} ${BASELINE_BRANCH} ${BENCHMARKS_BRANCH}
${RESULTS_DIR}
+
+popd


Mime
View raw message