🥅 include client log in error handling

This commit is contained in:
Felix Lohmeier 2021-02-23 17:22:27 +01:00
parent 6789554c60
commit 7ada831c3f
5 changed files with 23 additions and 9 deletions

View File

@ -127,7 +127,6 @@ Please file an [issue](https://github.com/opencultureconsulting/openrefine-task-
## To do
- [ ] Codacy badge (needs to be public)
- [ ] add client log messages to openrefine.log (tee -a)
- [ ] differentiate examples
- [ ] example for loading multiple input files by providing a zip archive
- [ ] example for download "fresh" input data as a dependent task and generating archives/diffs

View File

@ -50,11 +50,11 @@ tasks:
if [ ! -f "../openrefine/refine" ]; then
echo 1>&2 "OpenRefine missing; try task install"; exit 1
fi
rm -rf ./*.project* workspace.json
rm -rf ./*.project* workspace.json openrefine.log
- > # launch OpenRefine with specific data directory and redirect its output to a log file
../openrefine/refine -v warn -p {{.PORT}} -m {{.RAM}}
-d ../{{.PROJECT}}
> openrefine.log 2>&1 &
>> openrefine.log 2>&1 &
- | # wait until OpenRefine API is available
timeout 30s bash -c "until
wget -q -O - http://localhost:{{.PORT}} | cat | grep -q -o OpenRefine

View File

@ -23,17 +23,22 @@ tasks:
../openrefine/client -P {{.PORT}}
--create "$(readlink -m input/doaj-article-sample.csv)"
--projectName {{.PROJECT}}
> >(tee -a openrefine.log) 2>&1
- > # apply transformation rules
../openrefine/client -P {{.PORT}} {{.PROJECT}}
--apply config/doaj-openrefine.json
> >(tee -a openrefine.log) 2>&1
- > # export to file
mkdir -p output &&
../openrefine/client -P {{.PORT}} {{.PROJECT}}
--output "$(readlink -m output/doaj-results.tsv)"
> >(tee -a openrefine.log) 2>&1
- | # print allocated system resources
PID="$(lsof -t -i:{{.PORT}})"
echo "used $(($(ps --no-headers -o rss -p "$PID") / 1024)) MB RAM"
echo "used $(ps --no-headers -o cputime -p "$PID") CPU time"
echo "used $(($(ps --no-headers -o rss -p "$PID") / 1024)) MB RAM" \
> >(tee -a openrefine.log)
echo "used $(ps --no-headers -o cputime -p "$PID") CPU time" \
> >(tee -a openrefine.log)
- task: :stop # shut down OpenRefine and archive the OpenRefine project
vars: {PROJECT: '{{.PROJECT}}', PORT: '{{.PORT}}'}
sources:

View File

@ -22,17 +22,22 @@ tasks:
--create "$(readlink -m input/duplicates.csv)"
--encoding UTF-8
--projectName {{.PROJECT}}
> >(tee -a openrefine.log) 2>&1
- > # apply transformation rules
../openrefine/client -P {{.PORT}} {{.PROJECT}}
--apply config/duplicates-deletion.json
> >(tee -a openrefine.log) 2>&1
- > # export to file
mkdir -p output &&
../openrefine/client -P {{.PORT}} {{.PROJECT}}
--output "$(readlink -m output/deduped.xls)"
> >(tee -a openrefine.log) 2>&1
- | # print allocated system resources
PID="$(lsof -t -i:{{.PORT}})"
echo "used $(($(ps --no-headers -o rss -p "$PID") / 1024)) MB RAM"
echo "used $(ps --no-headers -o cputime -p "$PID") CPU time"
echo "used $(($(ps --no-headers -o rss -p "$PID") / 1024)) MB RAM" \
> >(tee -a openrefine.log)
echo "used $(ps --no-headers -o cputime -p "$PID") CPU time" \
> >(tee -a openrefine.log)
- task: :stop # shut down OpenRefine and archive the OpenRefine project
vars: {PROJECT: '{{.PROJECT}}', PORT: '{{.PORT}}'}
sources:

View File

@ -25,17 +25,22 @@ tasks:
--processQuotes false
--guessCellValueTypes true
--projectName {{.PROJECT}}
> >(tee -a openrefine.log) 2>&1
- > # apply transformation rules
../openrefine/client -P {{.PORT}} {{.PROJECT}}
--apply config/phm-transform.json
> >(tee -a openrefine.log) 2>&1
- > # export to file
mkdir -p output &&
../openrefine/client -P {{.PORT}} {{.PROJECT}}
--output "$(readlink -m output/phm-results.tsv)"
> >(tee -a openrefine.log) 2>&1
- | # print allocated system resources
PID="$(lsof -t -i:{{.PORT}})"
echo "used $(($(ps --no-headers -o rss -p "$PID") / 1024)) MB RAM"
echo "used $(ps --no-headers -o cputime -p "$PID") CPU time"
echo "used $(($(ps --no-headers -o rss -p "$PID") / 1024)) MB RAM" \
> >(tee -a openrefine.log)
echo "used $(ps --no-headers -o cputime -p "$PID") CPU time" \
> >(tee -a openrefine.log)
- task: :stop # shut down OpenRefine and archive the OpenRefine project
vars: {PROJECT: '{{.PROJECT}}', PORT: '{{.PORT}}'}
sources: