[commit: ghc] wip/gitlab-ci-perf-notes_2: Setup GitLab CI to push performance metrics as git notes to the "GHC Performance Notes" repository. (d1a2c4d)

git at git.haskell.org git at git.haskell.org
Tue Jan 15 17:43:46 UTC 2019


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/gitlab-ci-perf-notes_2
Link       : http://ghc.haskell.org/trac/ghc/changeset/d1a2c4dd3c4f0c634e4c4439ce1a66f4a9bc549b/ghc

>---------------------------------------------------------------

commit d1a2c4dd3c4f0c634e4c4439ce1a66f4a9bc549b
Author: David Eichmann <EichmannD at gmail.com>
Date:   Fri Jan 11 16:13:21 2019 -0700

    Setup GitLab CI to push performance metrics as git notes to the "GHC Performance Notes" repository.


>---------------------------------------------------------------

d1a2c4dd3c4f0c634e4c4439ce1a66f4a9bc549b
 .gitlab-ci.yml               | 23 ++++++++++++------
 .gitlab/push-test-metrics.sh | 56 +++++++++++++++++---------------------------
 testsuite/driver/runtests.py |  5 ++--
 3 files changed, 41 insertions(+), 43 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 674fcc8..a192c89 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -88,14 +88,24 @@ validate-x86_64-linux-deb8-hadrian:
   before_script:
     - git clean -xdf && git submodule foreach git clean -xdf
   script:
-    - ./boot
-    - ./configure $CONFIGURE_ARGS
+#    - ./boot
+#    - ./configure $CONFIGURE_ARGS
     - |
       THREADS=`mk/detect-cpu-count.sh`
-      make V=0 -j$THREADS
+      
+      
+      
+      
+      
+      #make V=0 -j$THREADS
     - |
-      make binary-dist TAR_COMP_OPTS="-1"
-      mv ghc-*.tar.xz ghc.tar.xz
+      # make binary-dist TAR_COMP_OPTS="-1"
+      # mv ghc-*.tar.xz ghc.tar.xz
+
+
+
+
+      
     - |
       # Prepare to push git notes.
       METRICS_FILE=$(mktemp)
@@ -112,7 +122,6 @@ validate-x86_64-linux-deb8-hadrian:
       THREADS=`mk/detect-cpu-count.sh`
       #make $TEST_TYPE THREADS=$THREADS JUNIT_FILE=../../junit.xml METRICS_FILE=$METRICS_FILE
 
-
       echo "test" > $METRICS_FILE
 
 
@@ -122,7 +131,7 @@ validate-x86_64-linux-deb8-hadrian:
 
     - |
       # Push git notes.
-      .gitlab/push-test-metrics.sh
+      METRICS_FILE=$METRICS_FILE .gitlab/push-test-metrics.sh
   artifacts:
     reports:
       junit: junit.xml
diff --git a/.gitlab/push-test-metrics.sh b/.gitlab/push-test-metrics.sh
index f934083..9005665 100755
--- a/.gitlab/push-test-metrics.sh
+++ b/.gitlab/push-test-metrics.sh
@@ -2,22 +2,17 @@
 # vim: sw=2 et
 set -euo pipefail
 
+GHC_ORIGIN="git at gitlab.haskell.org:ghc/ghc-performance-notes.git"
+REF="perf"
+
 fail() {
   echo "ERROR: $*" >&2
   exit 1
 }
 
-GHC_ORIGIN="git at gitlab.haskell.org:ghc/ghc.git"
-
-# Only push git notes when on the official gitlab ghc repo.
-if [ "$CI_REPOSITORY_URL" != "$GHC_ORIGIN" ]; then
-  echo "Not pushing performance git notes: expected repo $GHC_ORIGIN but on repo $CI_REPOSITORY_URL"
-  exit 0
-fi
-
 # Check that private key is available (Set on all GitLab protected branches).
 if [ "$PERF_NOTE_KEY" = "" ]; then
-  echo "Not pushing performance git notes: PERF_NOTE_KEY not set."
+  echo "Not pushing performance git notes: PERF_NOTE_KEY is not set."
   exit 0
 fi
 
@@ -26,43 +21,36 @@ if [ "$TEST_ENV" = "" ]; then
   fail "Not pushing performance git notes: TEST_ENV must be set."
 fi
 
-# Setup ssh keys.
-echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC94vDmRcDXPTuZktLvMFXHD2X6H2GEdnP+7VO0QbwNje9jsPLpofQRHJKXG/9sm0a6NT9qXt9eccRNklP0AkW36LcNRni7ji8NxlrE9ASuXGqa4TTk83pOLFCzWmdcdVIxz3bxPfa/ECmyRmTxp3+mTW0eJrUEdVwprAieNoTH+ZLyDmq+IfAD5239ea+gAZzfCy5WcTbsSXOOJEAZKqqfzyog18agptzAWu/tCfzvyiGlkoQj+PE1MMEfnmWQC8d2bOhC6kQZZtPrGNhFU75JifYGT7y0e1EVa5bhqcZZ9cdGSli1S8T9MpSimVII6iZOFdho3+shbUX3ObagUl09 ben at ben-laptop" > ~/.ssh/perf_rsa.pub
-echo $PERF_NOTE_KEY > ~/.ssh/perf_rsa
-ssh-add ~/.ssh/perf_rsa
-
-# Check that git notes don't already exist.
-# This is a percausion as we reset refs/notes/perf and we want to avoid data loss.
-
-
-
-
-
-# TODO CHANGE ME BEFORE MERGE
-REF="perf_tmp"
-
-
-
-
-
-
-if [ $(git notes --ref=$REF list | wc -l) -ne 0 ]
+# Assert that the METRICS_FILE exists and can be read.
+if [ "$METRICS_FILE" = "" ]
 then
-  fail "Found an existing git note. Expected no git note."
+  fail "\$METRICS_FILE not set."
 fi
-
-# Assert that the METRICS_FILE exists and can be read.
-if [ "$METRICS_FILE" = "" ] || ! [ -r $METRICS_FILE ]
+if ! [ -r $METRICS_FILE ]
 then
   fail "Metrics file not found: $METRICS_FILE"
 fi
 
+# Add gitlab as a known host.
+mkdir -p ~/.ssh
+echo "|1|+AUrMGS1elvPeLNt+NHGa5+c6pU=|4XvfRsQftO1OgZD4c0JJ7oNaii8= ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDXilA5l4kOZPx0nM6xDATF+t4fS6te0eYPDwBI/jLWD9cJVtCnsrwMl5ar+/NfmcD0jnCYztUiVHuXyTaWPJYSQpwltfpTeqpo9/z/0MxkPtSl1uMP2cLbDiqA01OWveChktOXwU6hRQ+7MmO+dNRS/iXrRmYrGv/p1W811QgLBLS9fefEdF25n+0dP71L7Ov7riOawlDmd0C11FraE/R8HX6gs6lbXta1kisdxGyKojYSiCtobUaJxRoatMfUP0a9rwTAyl8tf56LgB+igjMky879VAbL7eQ/AmfHYPrSGJ/YlWP6Jj23Dnos5nOVlWL/rVTs9Y/NakLpPwMs75KTC0Pd74hdf2e3folDdAi2kLrQgO2SI6so7rOYZ+mFkCM751QdDVy4DzjmDvSgSIVf9SV7RQf7e7unE7pSZ/ILupZqz9KhR1MOwVO+ePa5qJMNSdC204PIsRWkIO5KP0QLl507NI9Ri84+aODoHD7gDIWNhU08J2P8/E6r0wcC8uWaxh+HaOjI9BkHjqRYsrgfn54BAuO9kw1cDvyi3c8n7VFlNtvQP15lANwim3gr9upV+r95KEPJCgZMYWJBDPIVtp4GdYxCfXxWj5oMXbA5pf0tNixwNJjAsY7I6RN2htHbuySH36JybOZk+gCj6mQkxpCT/tKaUn14hBJWLq7Q+Q==" >> ~/.ssh/known_hosts
+echo "|1|JZkdAPJmpX6SzGeqhmQLfMWLGQA=|4vTELroOlbFxbCr0WX+PK9EcpD0= ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJknufU+I6A5Nm58lmse4/o11Ai2UzYbYe7782J1+kRk" >> ~/.ssh/known_hosts
+
+# Setup ssh keys.
+eval `ssh-agent`
+echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDJPR1vrZgeGTXmgJw2PsJfMjf22LcDnVVwt3l0rwTZ+8Q2J0bHaYxMRKBco1sON6LGcZepw0Hy76RQ87v057pTz18SXvnfE7U/B6v9qBk0ILJz+4BOX9sEhxu2XmScp/wMxkG9IoyruMlsxXzd1sz09o+rzzx24U2Rp27PRm08vG0oipve6BWLbYEqYrE4/nCufqOJmGd56fju7OTU0lTpEkGDEDWGMxutaX2CbTbDju7qy07Ld8BjSc9aHfvuQaslUbj3ex3EF8EXahURzGpHQn/UFFzVGMokFumiJCAagHQb7cj6jOkKseZLaysbA/mTBQsOzjWiRmkN23bQf1wF ben+ghc-ci at smart-cactus.org" > ~/.ssh/perf_rsa.pub
+touch ~/.ssh/perf_rsa
+chmod 0600 ~/.ssh/perf_rsa
+echo "$PERF_NOTE_KEY" >> ~/.ssh/perf_rsa
+ssh-add ~/.ssh/perf_rsa
+
 # Reset the git notes and append the metrics file to the notes, then push and return the result.
 # This is favoured over a git notes merge as it avoids potential data loss/duplication from the merge strategy.
 function reset_append_note_push {
   git fetch -f $GHC_ORIGIN refs/notes/$REF:refs/notes/$REF || true
   echo "git notes --ref=$REF append -F $METRICS_FILE HEAD"
   git notes --ref=$REF append -F $METRICS_FILE HEAD
+  echo "git push $GHC_ORIGIN refs/notes/$REF"
   git push $GHC_ORIGIN refs/notes/$REF
 }
 
diff --git a/testsuite/driver/runtests.py b/testsuite/driver/runtests.py
index 707f37a..59f6aba 100644
--- a/testsuite/driver/runtests.py
+++ b/testsuite/driver/runtests.py
@@ -383,8 +383,9 @@ else:
                 ' the missing metrics. Alternatively, a baseline may be' + \
                 ' recovered from ci results once fetched (where origin' + \
                 ' is the official ghc git repo):\n\n' + \
-                spacing + 'git fetch origin' + \
-                          ' refs/notes/perf:refs/notes/' + Perf.CiNamespace
+                spacing + 'git fetch ' + \
+                  'https://gitlab.haskell.org/ghc/ghc-performance-notes.git' + \
+                  ' refs/notes/perf:refs/notes/' + Perf.CiNamespace
         else:
             reason = "this is not a git repo so the previous git commit's" + \
                      " metrics cannot be loaded from git notes:"



More information about the ghc-commits mailing list