Skip to content

Commit

Permalink
[toil] Try to figure out what's wrong with sourcehut build
Browse files Browse the repository at this point in the history
This is where xtrace would come in handy.

Unrelated:

- benchmarks: Starting another mycpp report in R
- Make note of R instsallation problem:

I get:

package ‘dplyr’ is not available (for R version 3.2.3)

on Ubuntu Xenial.

Gah!!!  This is the problem I encountered circa 2012... In January 2021,
dplyr was updated to require R 3.3.
  • Loading branch information
Andy Chu committed Aug 5, 2020
1 parent b7eae00 commit 988cf93
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 3 deletions.
43 changes: 43 additions & 0 deletions benchmarks/report.R
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,46 @@ MyCppReport = function(in_dir, out_dir) {
writeTsv(details, file.path(out_dir, 'details'))
}

MyCppReport2 = function(in_dir, out_dir) {
# TSV file, not CSV
times = read.table(file.path(in_dir, 'times.tsv'), header=T)
print(times)

times %>% filter(status != 0) -> failed
if (nrow(failed) != 0) {
print(failed)
stop('Some mycpp tasks failed')
}

# Don't care about elapsed and system
times %>% select(-c(status, elapsed_secs, sys_secs)) %>%
mutate(example_name_HREF = mycppUrl(example_name),
user_ms = user_secs * 1000,
max_rss_MB = max_rss_KiB * 1024 / 1e6) %>%
select(-c(user_secs, max_rss_KiB)) ->
details

details %>% select(-c(max_rss_MB)) %>%
spread(key = language, value = user_ms) %>%
mutate(`C++ : Python` = `C++` / Python) %>%
arrange(`C++ : Python`) ->
user_time

details %>% select(-c(user_ms)) %>%
spread(key = language, value = max_rss_MB) %>%
mutate(`C++ : Python` = `C++` / Python) %>%
arrange(`C++ : Python`) ->
max_rss

# Sometimes it speeds up by more than 10x
precision3 = ColumnPrecision(list(`C++ : Python` = 3))
precision2 = ColumnPrecision(list(`C++ : Python` = 2))

writeTsv(user_time, file.path(out_dir, 'user_time'), precision3)
writeTsv(max_rss, file.path(out_dir, 'max_rss'), precision2)
writeTsv(details, file.path(out_dir, 'details'))
}

main = function(argv) {
action = argv[[1]]
in_dir = argv[[2]]
Expand All @@ -687,6 +727,9 @@ main = function(argv) {
} else if (action == 'mycpp') {
MyCppReport(in_dir, out_dir)

} else if (action == 'mycpp2') {
MyCppReport2(in_dir, out_dir)

} else if (action == 'oheap') {
OheapReport(in_dir, out_dir)

Expand Down
9 changes: 8 additions & 1 deletion benchmarks/report.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,19 @@ compute() {
mycpp-examples() {
# ./run.sh benchmark-all in the mycpp/ dir produces this
local base_dir=${1:-_tmp/mycpp-examples}
local in_tsv=_ninja/benchmark-table.tsv

pushd mycpp
ninja $in_tsv
popd

mkdir -p $base_dir
cp -v mycpp/$in_tsv $base_dir

local dir2=$base_dir/stage2
mkdir -p $dir2

R_LIBS_USER=$R_PATH benchmarks/report.R mycpp $base_dir/raw $dir2
R_LIBS_USER=$R_PATH benchmarks/report.R mycpp2 $base_dir/raw $dir2

stage3 $base_dir mycpp
}
Expand Down
5 changes: 4 additions & 1 deletion build/dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ r-packages() {
# Install to a directory that doesn't require root. This requires setting
# R_LIBS_USER. Or library(dplyr, lib.loc = "~/R", but the former is preferable.
mkdir -p ~/R
INSTALL_DEST=$R_PATH Rscript -e 'install.packages(c("dplyr", "tidyr", "stringr"), lib=Sys.getenv("INSTALL_DEST"), repos="http://cran.us.r-project.org")'

# TODO: All of these fail on Xenial, e.g. as of dplyr 1.0.3 in January 2021!
# Not hermetic!
INSTALL_DEST=$R_PATH Rscript -e 'install.packages(c("dplyr", "tidyr", "stringr"), lib=Sys.getenv("INSTALL_DEST"), repos="https://cloud.r-project.org")'
}

test-r-packages() {
Expand Down
2 changes: 1 addition & 1 deletion services/toil-web.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ rewrite-jobs-index() {

local dir=~/travis-ci.oilshell.org/${prefix}jobs/

log "toil-web: Rewriting jobs/index.html"
log "toil-web: Rewriting ${prefix}jobs/index.html"

local tmp=/tmp/$$.index.html

Expand Down
1 change: 1 addition & 0 deletions services/toil_web.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ def main(argv):
print(JOB_ROW_TEMPLATE % job)

print(INDEX_BOTTOM)
log('srht-index done')

elif action == 'travis-index':

Expand Down

0 comments on commit 988cf93

Please sign in to comment.