From 07ad3d41e94df3730a3431a157f57ed42843672e Mon Sep 17 00:00:00 2001 From: Randy Stauner Date: Mon, 9 Dec 2024 16:10:57 -0700 Subject: [PATCH 1/2] Remove jenkins pipeline files now that we are back on GitHub actions --- .../gh_tasks/commit_benchmark_data.sh | 2 +- .../jenkins/Jenkinsfile_benchmark_smoke_run | 51 ----- .../jenkins/Jenkinsfile_configurable_run | 191 ------------------ .../Jenkinsfile_data_checkin_and_upload | 70 ------- .../jenkins/Jenkinsfile_full_benchmark_run | 82 -------- .../jenkins/Jenkinsfile_reporting_rebuild | 46 ----- 6 files changed, 1 insertion(+), 441 deletions(-) delete mode 100644 continuous_reporting/jenkins/Jenkinsfile_benchmark_smoke_run delete mode 100644 continuous_reporting/jenkins/Jenkinsfile_configurable_run delete mode 100644 continuous_reporting/jenkins/Jenkinsfile_data_checkin_and_upload delete mode 100644 continuous_reporting/jenkins/Jenkinsfile_full_benchmark_run delete mode 100644 continuous_reporting/jenkins/Jenkinsfile_reporting_rebuild diff --git a/continuous_reporting/gh_tasks/commit_benchmark_data.sh b/continuous_reporting/gh_tasks/commit_benchmark_data.sh index 01be03095..7677b83e9 100755 --- a/continuous_reporting/gh_tasks/commit_benchmark_data.sh +++ b/continuous_reporting/gh_tasks/commit_benchmark_data.sh @@ -10,7 +10,7 @@ cd ~/ym/yjit-metrics bundle -# NOTE: This data dir is not configurable. If we run a smoke test on jenkins +# NOTE: This data dir is not configurable. If we run a smoke test # into a different data dir we explicitly do not want to include that here. # In that case this will run, find no data, and do nothing (which is what we want). ruby continuous_reporting/file_benchmark_data_into_raw.rb -d continuous_reporting/data diff --git a/continuous_reporting/jenkins/Jenkinsfile_benchmark_smoke_run b/continuous_reporting/jenkins/Jenkinsfile_benchmark_smoke_run deleted file mode 100644 index 4fca70a68..000000000 --- a/continuous_reporting/jenkins/Jenkinsfile_benchmark_smoke_run +++ /dev/null @@ -1,51 +0,0 @@ -// Use a Jenkinsfile pipeline to run a single-iter all-benchmarks 'smoke test' across worker servers. - -// See the full-benchmark-run Jenkinsfile for more documentation and commentary. - -pipeline { - agent any - - parameters { - string(name: 'RUBY_VERSION', defaultValue: 'master', description: 'what revision of Ruby to build') - - string(name: 'YJIT_METRICS_VERSION', defaultValue: 'main', description: 'what revision of yjit-metrics to build with') - string(name: 'YJIT_BENCH_VERSION', defaultValue: 'main', description: 'what revision of yjit-bench to build with') - - string(name: 'BENCH_TYPE', defaultValue: 'smoketest', description: 'Benchmark type -- "smoketest" is one iter of all benchmarks, can also give none or full spec') - - string(name: 'SLACK_FAILURE_NOTIFY', defaultValue: '#yjit-benchmark-ci', description: 'What Slack channel(s) and Member ID(s) to notify in case of failure, comma-delimited') - } - - environment { - BUNDLE_DEPLOYMENT = 'true' - SLACK_OAUTH_TOKEN = credentials('684cd699-feae-4ef1-8483-e71440a73fcd') - NOTIFIER_ARGS = "--template smoke_test --channels \"${params.SLACK_FAILURE_NOTIFY}\" --properties \"RUBY=${params.RUBY_VERSION},YJIT_BENCH=${params.YJIT_BENCH_VERSION},YJIT_METRICS=${params.YJIT_METRICS_VERSION}\"" - } - - stages { - stage('run configurable build') { - steps { - build job: 'benchmark_configurable_run', - parameters: [ - string(name: 'RUBY_VERSION', value: params.RUBY_VERSION), - string(name: 'YJIT_METRICS_VERSION', value: params.YJIT_METRICS_VERSION), - string(name: 'YJIT_BENCH_VERSION', value: params.YJIT_BENCH_VERSION), - string(name: 'BENCH_TYPE', value: params.BENCH_TYPE), - string(name: 'DATA_DIR', value: 'continuous_reporting/single_iter_data'), - booleanParam(name: 'DO_FULL_REBUILD', value: false) - ] - } - } - } - - post { - success { - sh "bundle" - sh "ruby continuous_reporting/slack_build_notifier.rb $NOTIFIER_ARGS --properties STATUS=success" - } - failure { - sh "bundle" - sh "ruby continuous_reporting/slack_build_notifier.rb $NOTIFIER_ARGS --properties STATUS=fail" - } - } -} diff --git a/continuous_reporting/jenkins/Jenkinsfile_configurable_run b/continuous_reporting/jenkins/Jenkinsfile_configurable_run deleted file mode 100644 index 558189e98..000000000 --- a/continuous_reporting/jenkins/Jenkinsfile_configurable_run +++ /dev/null @@ -1,191 +0,0 @@ -// This Jenkinsfile is a conversion of the older GitHub Actions workflow for benchmarking. - -// This version allows for a huge number of different parameters - where to build from, whether -// to erase-and-rebuild Ruby and so on. As a result, it's not convenient for day-to-day use. -// Instead, other builds (like the smoke test and full benchmarking run Jenkinsfiles) wrap -// this, in order to provide something with good defaults, where Jenkins can usefully -// estimate the build time, and for which we can give more-specific Slack notifications. - -// The division between gh_tasks/ shellscripts and continuous_reporting/ Ruby files -// is a bit weirder. In theory it's to let the shellscripts juggle the Ruby configuration, -// which would be painful to manage directly from a Jenkinsfile or GitHub Actions workflow, -// but in practice the current version is a mess too. - -// Jenkinsfile documentation: -// -// * Groovy Multiline Strings: https://stackoverflow.com/questions/5079797/whats-wrong-with-groovy-multi-line-string -// * Groovy ternary or coalescing operators: https://www.danvega.dev/blog/2013/08/22/groovy-ternary-operator/ - -// sh function: https://www.jenkins.io/doc/pipeline/steps/workflow-durable-task-step/#sh-shell-script - -// Future improvements: -// -// * It would be really nice to *not* use throttling and SSH to do this with workers. But we'd need to limit the executors -// per Jenkins agent to 1, but only for certain Jenkins agents. Or throttle all builds on a particular agent. I'm not -// sure there's an easy way to do either one. - -// Strings referencing env vars. -// We will interpolate this into the command and the shell will evaluate the env vars. -// Each stage should have `environment { SSH_HOST = credential(...) }` for the appropriate target server. -ssh_args = '-o StrictHostKeyChecking=no -o TCPKeepAlive=yes -o ServerAliveCountMax=20 -o ServerAliveInterval=15 -o "User=$SSH_USER" -i "$SSH_KEYFILE"' -ssh_host = '$SSH_HOST' -def ssh(shell_command, opts = [:]) { - println("ssh: ${shell_command}") - sh([script: "#!/bin/bash -e\nssh $ssh_args $ssh_host bash -e < "'\\$c'" })}' YJIT_METRICS_NAME=${params.YJIT_METRICS_VERSION} YJIT_METRICS_REPO=${params.YJIT_METRICS_REPO} YJIT_BENCH_NAME=${params.YJIT_BENCH_VERSION} YJIT_BENCH_REPO=${params.YJIT_BENCH_REPO} CRUBY_NAME=${params.RUBY_VERSION} CRUBY_REPO=${params.RUBY_REPO} BENCH_DATA_DIR=${params.DATA_DIR} continuous_reporting/gh_tasks/generate_bench_params.sh" - ssh "cat ym/yjit-metrics/bench_params.json" - scp "$ssh_host:~/ym/yjit-metrics/bench_params.json", "." - ssh "rm ym/yjit-metrics/bench_params.json" // Don't leave params sitting around between jobs - } - } - - // docs: https://www.jenkins.io/doc/pipeline/steps/workflow-basic-steps/#stash-stash-some-files-to-be-used-later-in-the-build - stash includes: 'bench_params.json', name: 'bench_params' - } - } - - stage('benchmarking and data upload') { - parallel { - stage('benchmarking and data upload x86_64') { - environment { - SSH_HOST = credentials('2ea5f8cb-6fab-4454-b7cb-46ca2fd3cba7') - } - agent any - steps { - withCredentials([sshUserPrivateKey(credentialsId: 'ssh-key-x86', keyFileVariable: 'SSH_KEYFILE', usernameVariable: 'SSH_USER')]) { - script { - benchmark_and_upload('x86') - - if (params.WITH_X86_TRUFFLE) { - ssh "ym/yjit-metrics/continuous_reporting/gh_tasks/truffle_x86_benchmarks.sh || echo ignoring failure" - } - } - } - } - } - stage('benchmarking and data upload AARCH64') { - agent any - environment { - SSH_HOST = credentials('86e5f9a8-4c3a-4789-92ab-d617fba356e8') - } - steps { - withCredentials([sshUserPrivateKey(credentialsId: 'ssh-key-arm', keyFileVariable: 'SSH_KEYFILE', usernameVariable: 'SSH_USER')]) { - script { - benchmark_and_upload('arm') - } - } - } - } - } - } - - stage('reporting') { - agent any - environment { - SSH_HOST = credentials('2ea5f8cb-6fab-4454-b7cb-46ca2fd3cba7') - } - - steps { - withCredentials([sshUserPrivateKey(credentialsId: 'ssh-key-x86', keyFileVariable: 'SSH_KEYFILE', usernameVariable: 'SSH_USER')]) { - script { - ssh "cd ym/raw-benchmark-data && git pull" - ssh "YJIT_METRICS_REPO=${params.YJIT_METRICS_REPO} YJIT_METRICS_NAME=${params.YJIT_METRICS_VERSION} ym/yjit-metrics/continuous_reporting/gh_tasks/git_update_yjit_metrics_repo.sh" - ssh "ym/yjit-metrics/continuous_reporting/gh_tasks/report_and_upload.sh" - - // The .max() method is not allowed without granting explicit access in jenkins. - if (results.values().sort().reverse().find {e -> e > 0}) { - error("Build failed: ${results}") - } - } - } - } - } - } -} diff --git a/continuous_reporting/jenkins/Jenkinsfile_data_checkin_and_upload b/continuous_reporting/jenkins/Jenkinsfile_data_checkin_and_upload deleted file mode 100644 index 49bb33036..000000000 --- a/continuous_reporting/jenkins/Jenkinsfile_data_checkin_and_upload +++ /dev/null @@ -1,70 +0,0 @@ -// On-demand Jenkins data checkin - -// Strings referencing env vars. -// We will interpolate this into the command and the shell will evaluate the env vars. -// Each stage should have `environment { SSH_HOST = credential(...) }` for the appropriate target server. -ssh_args = '-o StrictHostKeyChecking=no -o TCPKeepAlive=yes -o ServerAliveCountMax=20 -o ServerAliveInterval=15 -o "User=$SSH_USER" -i "$SSH_KEYFILE"' -ssh_host = '$SSH_HOST' -def ssh(shell_command, opts = [:]) { - println("ssh: ${shell_command}") - sh([script: "#!/bin/bash -e\nssh $ssh_args $ssh_host bash -e < Date: Mon, 9 Dec 2024 16:21:59 -0700 Subject: [PATCH 2/2] Remove unused shell scripts --- .../gh_tasks/check_reporting.sh | 16 ------------- .../gh_tasks/check_reporting_minimal.sh | 18 --------------- .../gh_tasks/generate_bench_params.sh | 12 ---------- .../gh_tasks/report_full_rebuild.sh | 23 ------------------- .../gh_tasks/truffle_x86_benchmarks.sh | 19 --------------- 5 files changed, 88 deletions(-) delete mode 100755 continuous_reporting/gh_tasks/check_reporting.sh delete mode 100755 continuous_reporting/gh_tasks/check_reporting_minimal.sh delete mode 100755 continuous_reporting/gh_tasks/generate_bench_params.sh delete mode 100755 continuous_reporting/gh_tasks/report_full_rebuild.sh delete mode 100755 continuous_reporting/gh_tasks/truffle_x86_benchmarks.sh diff --git a/continuous_reporting/gh_tasks/check_reporting.sh b/continuous_reporting/gh_tasks/check_reporting.sh deleted file mode 100755 index 505ce709e..000000000 --- a/continuous_reporting/gh_tasks/check_reporting.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -set -e - -cd ~/ym/yjit-metrics -git pull - -bundle - -# Copy benchmark raw data into destination repo -#ruby continuous_reporting/file_benchmark_data_into_raw.rb -d continuous_reporting/data - -# Copy benchmark raw data into destination repo, generate reports, commit changes to Git. -ruby continuous_reporting/generate_and_upload_reports.rb --no-push - -echo "Reporting check completed successfully." diff --git a/continuous_reporting/gh_tasks/check_reporting_minimal.sh b/continuous_reporting/gh_tasks/check_reporting_minimal.sh deleted file mode 100755 index fb2da5d5f..000000000 --- a/continuous_reporting/gh_tasks/check_reporting_minimal.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -# On older ARM64 chips like Graviton we can't do stats runs. That means no report that uses stats data can -# be completed. However, the blog_timeline report should be able to run with only prod YJIT data. - -set -e - -cd ~/ym/yjit-metrics - -bundle - -# Copy benchmark raw data into destination repo -#ruby continuous_reporting/file_benchmark_data_into_raw.rb -d continuous_reporting/data - -# Generate reports, commit changes to Git. -ruby continuous_reporting/generate_and_upload_reports.rb --no-push --only-reports blog_timeline - -echo "Minimal reporting check completed successfully." diff --git a/continuous_reporting/gh_tasks/generate_bench_params.sh b/continuous_reporting/gh_tasks/generate_bench_params.sh deleted file mode 100755 index 1dabc1f17..000000000 --- a/continuous_reporting/gh_tasks/generate_bench_params.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -set -e - -cd ~/ym/yjit-metrics - -bundle - -# No timestamp given, default to right now -ruby continuous_reporting/create_json_params_file.rb --full-rebuild=$FULL_REBUILD --bench-type="$BENCH_TYPE" --yjit-metrics-name=$YJIT_METRICS_NAME --yjit-metrics-repo=$YJIT_METRICS_REPO --yjit-bench-name=$YJIT_BENCH_NAME --yjit-bench-repo=$YJIT_BENCH_REPO --cruby-name=$CRUBY_NAME --cruby-repo=$CRUBY_REPO --benchmark-data-dir=$BENCH_DATA_DIR - -echo "Generated params successfully." diff --git a/continuous_reporting/gh_tasks/report_full_rebuild.sh b/continuous_reporting/gh_tasks/report_full_rebuild.sh deleted file mode 100755 index 8e009d79d..000000000 --- a/continuous_reporting/gh_tasks/report_full_rebuild.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -# This script assumes that benchmark_prep_task has been run first to clean, rebuild and reinstall. - -set -e - -cd ~/ym/yjit-metrics - -bundle - -# Copy benchmark raw data into destination repo, generate reports, commit changes to Git. -# The --regenerate-reports argument will regenerate ***all*** reports, which can take quite a long time. -ruby continuous_reporting/generate_and_upload_reports.rb --regenerate-reports - -# Now we'll verify that we're not regenerating results when we shouldn't. -# To do that we'll tell generate_and_upload not to do Git checkins, -# and to fail if we try to generate any reports. The previous run -# was *supposed* to generate everything that needed it. -# If this fails, we're probably not reporting deterministically. Output -# should not change run-to-run with the same data. -ruby continuous_reporting/generate_and_upload_reports.rb --no-push --prevent-regenerate - -echo "Reporting and data upload completed successfully." diff --git a/continuous_reporting/gh_tasks/truffle_x86_benchmarks.sh b/continuous_reporting/gh_tasks/truffle_x86_benchmarks.sh deleted file mode 100755 index 9d019271d..000000000 --- a/continuous_reporting/gh_tasks/truffle_x86_benchmarks.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -set -e - -cd ~/ -rm -rf truffleruby-head -curl -L https://github.com/ruby/truffleruby-dev-builder/releases/latest/download/truffleruby-head-ubuntu-20.04.tar.gz | tar xz -export PATH="$PWD/truffleruby-head/bin:$PATH" -$PWD/truffleruby-head/lib/truffle/post_install_hook.sh -unset GEM_HOME GEM_PATH -ruby -v # Should be Truffle - -cd ~/ym/yjit-bench -git checkout main -git checkout . -git pull -MAX_TIME=600 MAD_TARGET=0.005 ./run_benchmarks.rb --harness=harness-warmup --out_path=/home/ubuntu/truffle-data/ - -echo "Completed TruffleRuby benchmarking successfully."