curation workflow automation and coordination
- find RRIDs in articles
- look them up in the SciCrunch resolver
- create Hypothesis annotations that anchor to the RRIDs and display lookup results
- Create a Hypothesis account which will post the annotations.
- Generate an api token at https://hypothes.is/profile/developer (must be logged in to see page).
- Create a group to store the annotations at https://hypothes.is/groups/new (must be logged in to see page).
- See Setup on amazon
Visit https://HOST:PORT/bookmarklet and follow the instructions.
Visit an article that contains RRIDs, click the bookmarklet
The found RRIDs are logged to the JavaScript console
The found RRIDs are logged to timestamped files, along with the text and html of the article that was scanned for RRIDs
As root.
layman -a tgbugs-overlay
emerge scibot
rc-config add scibot-bookmarklet default
vim /etc/conf.d/scibot-bookmarklet # set username, group, api key, etc.
/etc/init.d/scibot-bookmarklet startSet export PATH=~/.local/bin:${PATH} in ~/.bashrc
sudo apt-get install build-essential python3-dev libxml2-dev libxslt1-devpip3 install --user pip pipenvgit clone https://github.com/SciCrunch/scibot.gitcd scibot && pipenv install --skip-lockpipenv shellto get an environment with acess to all the required libraries.- Inside the pipenv shell (after following steps 6-10 below) you should
be able to run commands like
python scibot/export.py.
Building the rpm
pushd resources/rpmbuild
rpmbuild --nodeps --define "_topdir `pwd`" -ba SPECS/scibot.spec
popd
Once this is done scp the rpm to the host.
Also scp the ssl certs over, or use letsencrypt to obtain a cert.
If you are using using a cert from another registrar you may need to
bundle your certs cat my-cert.crt existing-bundle.crt > scicrunch.io.crt
(see https://gist.github.com/bradmontgomery/6487319 for details)
See nginx.conf
for details on where to put the certs after scping them over.
Install steps run as root or via sudo.
amazon-linux-extras install nginx1.12
yum install scibot-9999-0.noarch.rpm # update with yum reinstall
pip3 install pipenv wheel
vim /etc/systemd/system/scibot-bookmarklet.service.d/env.conf # set api keys etcInstall scibot codebase as the scibot user
git clone https://github.com/SciCrunch/scibot.git
pushd scibot
pipenv install --skip-lockHopefully this step will become simpler once we start pushing releases.
pipenv install scibot or alternately it may also be possible to package
everything we need in the rpm and only install that. With none of the other
steps needed at all.
Start services as root
systemctl start nginx scibot-bookmarklet-sync scibot-bookmarkletOn the scibot host
sudo su scibot -
pushd scibot
echo "$(date -Is) $(git rev-parse HEAD)" >> ~/previous-scibot-hashes
git pull
mv Pipfile.lock "Pipefile.lock.$(date -Is)"
~/.local/bin/pipenv install --skip-lockRestart as root
systemctl restart scibot-bookmarklet-sync scibot-bookmarkletInstall steps 0. ssh in to the host that will serve the script
sudo yum install gcc libxml2 libxml2-devel libxslt libxslt-devel python36 python36-devel python36-pipsudo alternatives --set python /usr/bin/python3.6sudo pip install pipenvgit clone https://github.com/SciCrunch/scibot.gitcd scibot && python3.6 setup.py wheel && pipenv install dist/*.whlexport SCIBOT_USERNAME=someusernameexport SCIBOT_GROUP=somegroupnameunset HISTFILEexport SCIBOT_API_TOKEN=sometokenexport SCIBOT_SYNC=somerandomnumber(e.g. runhead -c 100 /dev/urandom | tr -dc 'a-zA-Z0-9'every time)- create a screen session
- in the screen session run
pipenv run scibot-serveryou should create a link to the log files folder in ~/scibot/ - get letsencrypt certs using certbot, follow directions here (prefer standalone)
To set up scibot for development (for example if you want to run manual releases)
0. Install python3 and pip for your os (e.g. on macos use brew)
- From your git folder run
git clone https://github.com/tgbugs/scibot.git pushd scibotpip3 install --user -e .will install requirements and register the scibot folder that is under version control with python as the scibot module.popd
You should change lol to something less guessable even if it is only
running on localhost.
Run the following blocks in two separate terminals and connect to
https://localhost:4443/bookmarklet. If you try http you will get
a connection error.
You will need to generate the self signed certs using openssl as
described in the comments in bookmarklet.py::main().
Alternately comment out the ssl wrapping of the socket and use http.
SCIBOT_SYNC=lol python -m scibot.syncSCIBOT_USERNAME=scibot \
SCIBOT_GROUP=dev-group \
SCIBOT_GROUP2=dev-group \
SCIBOT_GROUP_STAGING=__world__ \
SCIBOT_API_TOKEN=hypothesis-api-key \
SCIBOT_SYNC=lol \
python -m scibot.bookmarkletMake sure you have >=python3.6 and pip installed. Clone the repo and
run python setup.py develop --user.
SciBot adheres to the Contributor Covenant: https://www.contributor-covenant.org/