Skip to content

Commit

Permalink
Publish Build Metrics Report (facebookincubator#9805)
Browse files Browse the repository at this point in the history
Summary:
This builds and uploads the build metric report after the nightly job: https://facebookincubator.github.io/velox/bm-report/

Pull Request resolved: facebookincubator#9805

Reviewed By: Yuhta

Differential Revision: D57868005

Pulled By: kgpai

fbshipit-source-id: df268674388fce0f3d017b3d0eadf6673c544212
  • Loading branch information
assignUser authored and Joe-Abraham committed Jun 7, 2024
1 parent 3d0608e commit f2761e1
Show file tree
Hide file tree
Showing 4 changed files with 446 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/build-metrics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,54 @@ jobs:
--pr_number "${{ github.event.number }}" \
--sha "${{ inputs.ref || github.sha }}" \
"/tmp/metrics"
upload-report:
permissions:
contents: write
runs-on: ubuntu-latest
name: Generate and Upload Build Metric Report
needs: metrics
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0

- name: Setup Git User
run: |
git config --global user.email "[email protected]"
git config --global user.name "velox"
- uses: cachix/install-nix-action@8887e596b4ee1134dae06b98d573bd674693f47c # v26
with:
nix_path: nixpkgs=channel:nixos-unstable

- name: Build Environment
run: |
cd scripts/bm-report
nix-build
- name: Build Documentation
env:
CONBENCH_URL: "https://velox-conbench.voltrondata.run/"
CONBENCH_EMAIL: "${{ secrets.CONBENCH_EMAIL }}"
CONBENCH_PASSWORD: "${{ secrets.CONBENCH_PASSWORD }}"
run: |
cd scripts/bm-report
nix-shell --run "quarto render report.qmd"
- name: Push Report
# The report only uses conbench data from 'main'
# so any data generated in a PR won't be included
if: ${{ github.event_name != 'pull_request' && github.repository == 'facebookincubator/velox'}}
run: |
git checkout gh-pages
mkdir -p docs/bm-report
cp -R scripts/bm-report/report.html docs/bm-report/index.html
git add docs
if [ -n "$(git status --porcelain --untracked-files=no)" ]
then
git commit -m "Update build metrics"
git push
fi
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -321,3 +321,4 @@ src/amalgamation/
#docs
velox/docs/sphinx/source/README_generated_*
velox/docs/bindings/python/_generate/*
scripts/bm-report/report.html
61 changes: 61 additions & 0 deletions scripts/bm-report/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# This file was generated by the {rix} R package v0.6.0 on 2024-05-15
# with following call:
# >rix::rix(r_ver = "abd6d48f8c77bea7dc51beb2adfa6ed3950d2585",
# > r_pkgs = c("dplyr",
# > "prettyunits",
# > "ggplot2",
# > "gh",
# > "gt",
# > "hms",
# > "jqr",
# > "jsonlite",
# > "lubridate",
# > "memoise",
# > "plotly",
# > "purrr",
# > "remotes"),
# > system_pkgs = c("quarto"),
# > git_pkgs = list(package_name = "conbenchcoms",
# > repo_url = "https://github.com/conbench/conbenchcoms",
# > branch_name = "main",
# > commit = "55cdb120bbe2c668d3cf8ae543f4922131653645"),
# > ide = "other",
# > project_path = path_default_nix,
# > overwrite = TRUE,
# > print = TRUE)
# It uses nixpkgs' revision abd6d48f8c77bea7dc51beb2adfa6ed3950d2585 for reproducibility purposes
# which will install R version latest
# Report any issues to https://github.com/b-rodrigues/rix
let
pkgs = import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/abd6d48f8c77bea7dc51beb2adfa6ed3950d2585.tar.gz") {};
rpkgs = builtins.attrValues {
inherit (pkgs.rPackages) dplyr prettyunits ggplot2 gh gt hms jqr jsonlite lubridate memoise plotly quarto purrr remotes;
};
git_archive_pkgs = [(pkgs.rPackages.buildRPackage {
name = "conbenchcoms";
src = pkgs.fetchgit {
url = "https://github.com/conbench/conbenchcoms";
branchName = "main";
rev = "55cdb120bbe2c668d3cf8ae543f4922131653645";
sha256 = "sha256-XR5+grCUKyvSxsqiOkKd3gMUsWDJblZDmF4O+Jehq6U=";
};
propagatedBuildInputs = builtins.attrValues {
inherit (pkgs.rPackages) dplyr glue httr2 yaml;
};
}) ];
system_packages = builtins.attrValues {
inherit (pkgs) R glibcLocales nix quartoMinimal;
};
in
pkgs.mkShell {
LOCALE_ARCHIVE = if pkgs.system == "x86_64-linux" then "${pkgs.glibcLocales}/lib/locale/locale-archive" else "";
LANG = "en_US.UTF-8";
LC_ALL = "en_US.UTF-8";
LC_TIME = "en_US.UTF-8";
LC_MONETARY = "en_US.UTF-8";
LC_PAPER = "en_US.UTF-8";
LC_MEASUREMENT = "en_US.UTF-8";

buildInputs = [ git_archive_pkgs rpkgs system_packages ];

}
Loading

0 comments on commit f2761e1

Please sign in to comment.