mwoffliner icon indicating copy to clipboard operation
mwoffliner copied to clipboard

Document `clinic doctor` usage

Open benoit74 opened this issue 11 months ago • 0 comments

To investigate https://github.com/openzim/mwoffliner/issues/2137, I've used Clinic Doctor

We should document this tool usage somewhere. Not sure where we should document such generic tools usage, but I feel like it would be a shame to not share this (and at least I do not want to have to remember all details below ^^).

My notes

Start the container

docker run -it --rm --name mwoffliner_test -v $PWD/output:/output local-mwoffliner /bin/bash

Inside the container: start a redis server (for some reason, the automatically started one does not work)

nohup redis-server --save "" --appendonly no --unixsocket /dev/shm/redis.sock --unixsocketperm 744 --port 0 --bind 127.0.0.1 > /dev/shm/redis.log 2>&1&

Inside the container: start clinic once to approve (or not) sending statistics

clinic doctor -- node mwoffliner

From your host: start mwoffliner run with clinic doctor (or any other tool)

docker exec mwoffliner_test clinic doctor -- node /usr/local/lib/node_modules/mwoffliner/lib/cli.js --webp --mwUrl="https://en.wikipedia.org/" --format="novid" --verbose="log" --publisher="openZIM" --adminEmail="[email protected]" --customZimTitle="Test" --outputDirectory="/output" --customZimLanguage="eng" --customZimDescription="Test" --articleList="https://download.openzim.org/wp1/enwiki_2025-01/tops/100.tsv" --optimisationCacheUrl=$OPTIM_URL --redis /dev/shm/redis.sock

From your host: terminate it with Ctrl-C (will not really work to the end)

Inside the container: find process id from within container (choose the node process with biggest TIME value)

ps -a

Inside the container: properly terminate the clinic program from within the container

kill -SIGINT 3187

Wait for clinic analysis to complete with watch ps -a looking for the remaining node process which begins to consume TIME

Copy clinic results

docker cp mwoffliner_test:/.clinic .

benoit74 avatar Jan 30 '25 08:01 benoit74