[Git][ghc/ghc][wip/explicit-perf-baseline] gitlab-ci: Use MR base commit as performance baseline

Ben Gamari gitlab at gitlab.haskell.org
Tue Jul 28 09:10:44 UTC 2020



Ben Gamari pushed to branch wip/explicit-perf-baseline at Glasgow Haskell Compiler / GHC


Commits:
df50f2f7 by Ben Gamari at 2020-07-28T05:10:40-04:00
gitlab-ci: Use MR base commit as performance baseline

- - - - -


3 changed files:

- .gitlab-ci.yml
- hadrian/src/Settings/Builders/RunTest.hs
- testsuite/mk/test.mk


Changes:

=====================================
.gitlab-ci.yml
=====================================
@@ -16,6 +16,9 @@ variables:
 
   GIT_SUBMODULE_STRATEGY: "recursive"
 
+  # Commit used by testsuite driver as performance baseline.
+  PERF_BASELINE_COMMIT: "$CI_MERGE_REQUEST_TARGET_BRANCH_SHA"
+
 stages:
   - lint        # Source linting
   - quick-build # A very quick smoke-test to weed out broken commits
@@ -26,12 +29,26 @@ stages:
   - testing     # head.hackage correctness and compiler performance testing
   - deploy      # push documentation
 
+# Note [The CI Story]
+# ~~~~~~~~~~~~~~~~~~~
+#
+# There are roughly three different types of pipelines:
+#
+#  - marge-bot merges to `master`. Here we perform an exhaustive validation
+#    across all of the platforms which we support. In addition, we push
+#    performance metric notes upstream, providing a persistant record of the
+#    performance characteristics of the compiler.
+#
+#  - merge requests. Here we perform a slightly less exhaustive battery of
+#    testing. Namely we omit some configurations (e.g. the unregisterised job).
+
+
 workflow:
-  # N.B.Don't run on wip/ branches, instead on run on merge requests.
+  # N.B. Don't run on wip/ branches, instead on run on merge requests.
   rules:
     - if: $CI_MERGE_REQUEST_ID
     - if: $CI_COMMIT_TAG
-    - if: '$CI_COMMIT_BRANCH == "master"'
+    - if: '$CI_COMMIT_BRANCH == "wip/marge_bot_batch_merge_job"'
     - if: '$CI_COMMIT_BRANCH =~ /ghc-[0.9]+\.[0-9]+/'
     - if: '$CI_PIPELINE_SOURCE == "web"'
 


=====================================
hadrian/src/Settings/Builders/RunTest.hs
=====================================
@@ -78,6 +78,7 @@ runTestBuilderArgs = builder RunTest ? do
             <*> (maybe False (=="YES") <$> lookupEnv "OS")
     (testEnv, testMetricsFile) <- expr . liftIO $
         (,) <$> lookupEnv "TEST_ENV" <*> lookupEnv "METRICS_FILE"
+    perfBaseline <- expr . liftIO $ lookupEnv "PERF_BASELINE_COMMIT"
 
     threads     <- shakeThreads <$> expr getShakeOptions
     os          <- getTestSetting TestHostOS
@@ -141,6 +142,9 @@ runTestBuilderArgs = builder RunTest ? do
             , arg "--config", arg $ "timeout_prog=" ++ show (top -/- timeoutProg)
             , arg "--config", arg $ "stats_files_dir=" ++ statsFilesDir
             , arg $ "--threads=" ++ show threads
+            , case perfBaseline of
+                Just commit | not (null commit) -> arg ("--perf-baseline=" ++ show commit)
+                _ -> mempty
             , emitWhenSet testEnv $ \env -> arg ("--test-env=" ++ show env)
             , emitWhenSet testMetricsFile $ \file -> arg ("--metrics-file=" ++ file)
             , getTestArgs -- User-provided arguments from command line.


=====================================
testsuite/mk/test.mk
=====================================
@@ -232,6 +232,10 @@ ifneq "$(VERBOSE)" ""
 RUNTEST_OPTS += --verbose=$(VERBOSE)
 endif
 
+ifneq "$(PERF_TEST_BASELINE_COMMIT)" ""
+RUNTEST_OPTS += --perf-baseline=$(PERF_TEST_BASELINE_COMMIT)
+endif
+
 ifeq "$(SKIP_PERF_TESTS)" "YES"
 RUNTEST_OPTS += --skip-perf-tests
 endif



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/df50f2f7cfffeff6d3be7e45151dc82013c0db66

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/df50f2f7cfffeff6d3be7e45151dc82013c0db66
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200728/b3c35b66/attachment-0001.html>


More information about the ghc-commits mailing list