From be2e341657a160d3f6836d0df45bd9a78955ae32 Mon Sep 17 00:00:00 2001 From: Andy C Date: Sun, 25 Aug 2024 14:13:30 -0400 Subject: [PATCH] [soil] Switch to uuu.oilshell.org and use wwup HTTP uploader That wasn't too hard! We still have to replace SSH in these other tasks: - rewriting the jobs index - cleaning up old jobs - status-api - cleaning up old status entries [release] Add missing period --- doc/release-quality.md | 2 +- soil/common.sh | 8 +++++--- soil/web-init.sh | 2 +- soil/web-worker.sh | 35 ++++++++++++++++++++++++----------- 4 files changed, 31 insertions(+), 16 deletions(-) diff --git a/doc/release-quality.md b/doc/release-quality.md index 360d8c5e80..60320d5dfa 100644 --- a/doc/release-quality.md +++ b/doc/release-quality.md @@ -66,7 +66,7 @@ This is a supplement to the [main release page](index.html). - [osh-usage](more-tests.wwz/suite-logs/osh-usage.txt). Misc tests of the `osh` binary. - [tools-deps](more-tests.wwz/suite-logs/tools-deps.txt). Tests for a subcommand in progress. -- [syscall](more-tests.wwz/syscall/-wwz-index) How many syscalls do we make, +- [syscall](more-tests.wwz/syscall/-wwz-index). How many syscalls do we make, and how many processes do we start? - [ysh-ify Tests](more-tests.wwz/suite-logs/ysh-ify.txt). Test OSH to YSH translation. diff --git a/soil/common.sh b/soil/common.sh index c85d39b4c8..872720e066 100644 --- a/soil/common.sh +++ b/soil/common.sh @@ -22,9 +22,9 @@ dump-env() { if true; then readonly SOIL_USER='travis_admin' - readonly SOIL_HOST='travis-ci.oilshell.org' - readonly SOIL_HOST_DIR=~/travis-ci.oilshell.org # used on server - readonly SOIL_REMOTE_DIR=travis-ci.oilshell.org # used on client + readonly SOIL_HOST='uuu.oilshell.org' + readonly SOIL_HOST_DIR=~/uuu.oilshell.org # used on server + readonly SOIL_REMOTE_DIR=uuu.oilshell.org # used on client elif false; then readonly SOIL_USER='oils' readonly SOIL_HOST='mb.oils.pub' @@ -40,6 +40,8 @@ fi readonly SOIL_USER_HOST="$SOIL_USER@$SOIL_HOST" +readonly WWUP_URL="https://$SOIL_HOST/wwup.cgi" + html-head() { # TODO: Shebang line should change too PYTHONPATH=. python3 doctools/html_head.py "$@" diff --git a/soil/web-init.sh b/soil/web-init.sh index 4238d35ba2..4be71ad4ef 100755 --- a/soil/web-init.sh +++ b/soil/web-init.sh @@ -26,7 +26,7 @@ source soil/common.sh # for SOIL_USER and SOIL_HOST home-page() { ### travis-ci.oilshell.org home page - local domain=${1:-'travis-ci.oilshell.org'} + local domain=${1:-$SOIL_HOST} local title="Soil on $domain" soil-html-head "$title" diff --git a/soil/web-worker.sh b/soil/web-worker.sh index d87ce265fa..f54118142e 100755 --- a/soil/web-worker.sh +++ b/soil/web-worker.sh @@ -48,7 +48,7 @@ sshq() { # # This is Bernstein chaining through ssh. - ssh $SOIL_USER@$SOIL_HOST "$(printf '%q ' "$@")" + my-ssh $SOIL_USER_HOST "$(printf '%q ' "$@")" } remote-rewrite-jobs-index() { @@ -252,9 +252,9 @@ test-collect-json() { deploy-job-results() { ### Copy .wwz, .tsv, and .json to a new dir - local prefix=$1 # e.g. example.com/github-jobs/ - local subdir=$2 # e.g. example.com/github-jobs/1234/ # make this dir - local job_name=$3 # e.g. example.com/github-jobs/1234/foo.wwz + local prefix=$1 # e.g. github- for example.com/github-jobs/ + local run_dir=$2 # e.g. 1234 # make this dir + local job_name=$3 # e.g. cpp-small for example.com/github-jobs/1234/cpp-small.wwz shift 2 # rest of args are more env vars @@ -273,17 +273,28 @@ deploy-job-results() { # So we don't have to unzip it cp _tmp/soil/INDEX.tsv $job_name.tsv - local remote_dest_dir="$SOIL_REMOTE_DIR/${prefix}jobs/$subdir" - my-ssh $SOIL_USER_HOST "mkdir -p $remote_dest_dir" - - # Do JSON last because that's what 'list-json' looks for - my-scp $job_name.{wwz,tsv,json} "$SOIL_USER_HOST:$remote_dest_dir" + if false; then + local remote_dest_dir="$SOIL_REMOTE_DIR/${prefix}jobs/$run_dir" + my-ssh $SOIL_USER_HOST "mkdir -p $remote_dest_dir" + + # Do JSON last because that's what 'list-json' looks for + my-scp $job_name.{wwz,tsv,json} "$SOIL_USER_HOST:$remote_dest_dir" + else + curl \ + --verbose \ + --form "payload-type=${prefix}jobs" \ + --form "subdir=$run_dir" \ + --form "file1=@${job_name}.wwz" \ + --form "file2=@${job_name}.tsv" \ + --form "file3=@${job_name}.json" \ + $WWUP_URL + fi log '' log 'View CI results here:' log '' - log "http://$SOIL_HOST/${prefix}jobs/$subdir/" - log "http://$SOIL_HOST/${prefix}jobs/$subdir/$job_name.wwz/" + log "https://$SOIL_HOST/${prefix}jobs/$run_dir/" + log "https://$SOIL_HOST/${prefix}jobs/$run_dir/$job_name.wwz/" log '' } @@ -343,6 +354,8 @@ remote-event-job-done() { log "remote-event-job-done" + #set -x + # Deployed code dir sshq soil-web/soil/web.sh event-job-done "$@" }