Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update python code from 2 to 3, update pywikbot API and use venv not locally hosted pywikibot core #3

Merged
merged 2 commits into from
Nov 2, 2021

Conversation

eatcha-wikimedia
Copy link
Contributor

No description provided.

@eatcha-wikimedia
Copy link
Contributor Author

eatcha-wikimedia commented Nov 2, 2021

Copy link
Member

@dschwen dschwen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update.

@dschwen dschwen merged commit 5bc50d3 into Commonists:master Nov 2, 2021
@dschwen
Copy link
Member

dschwen commented Nov 2, 2021

I'll deploy this shortly

@dschwen
Copy link
Member

dschwen commented Nov 2, 2021

Ok, I see you removed the hash bang and added the requirements.txt file. I assume I need to launch the bot differently now? Currently it is run through a cronjob that calls a small script

#!/bin/bash
cd /data/project/qic/qic_bot
python qic2.py

python is a 2.7 python, and I don't see how the venv would be set up.

@dschwen
Copy link
Member

dschwen commented Nov 2, 2021

I'll try following https://wikitech.wikimedia.org/wiki/Help:Toolforge/Python and manually create a venv.

@eatcha-wikimedia
Copy link
Contributor Author

I assume that /data/project/qic/qic_bot/ is the repo working dir.

Pull the changes if you have not already.

To create the venv and install the requirements, run the following:

cd /data/project/qic/
python3 -m venv qic_venv
source qic_venv/bin/activate
pip install -r /data/project/qic/qic_bot/requirements.txt

Currently it is run through a cronjob that calls a small script

Change the script to the following two lines.

#!/bin/bash
/data/project/qic/qic_venv/bin/python3 /data/project/qic/qic_bot/qic2.py

@eatcha-wikimedia
Copy link
Contributor Author

https://commons.wikimedia.org/w/index.php?title=Commons_talk:Quality_images_candidates&diff=605159386&oldid=605157969

Yikes, I'm suddenly seeing a lot of
...
requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='commons.wikimedia.org', port=443): Read timed out. (read timeout=45)

Are the errors still persistent? Did you run it around 6:30 AM to 9:30 AM (Idaho time)? It's known that API requests fail at this time frame see https://phabricator.wikimedia.org/T249035.

More maintainers would be nice for sure.

If you have no problem, feel free to add me to the tool. (ldap/username : eatcha)

@dschwen
Copy link
Member

dschwen commented Nov 5, 2021

I added you! I'm also making the logs available at https://tools-static.wmflabs.org/qic/

You can see that as long as the bot is persistent and keeps trying it seems to work eventually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants