Skip to content

Commit

Permalink
[soil] Switch to uuu.oilshell.org and use wwup HTTP uploader
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Andy C committed Aug 26, 2024
1 parent b0eafff commit be2e341
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 16 deletions.
2 changes: 1 addition & 1 deletion doc/release-quality.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 5 additions & 3 deletions soil/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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 "$@"
Expand Down
2 changes: 1 addition & 1 deletion soil/web-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
35 changes: 24 additions & 11 deletions soil/web-worker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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

Expand All @@ -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 ''
}

Expand Down Expand Up @@ -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 "$@"
}
Expand Down

0 comments on commit be2e341

Please sign in to comment.