Page MenuHomePhabricator

Upgrade 'phabsearchemail' to toolforge-jobs from stretch gridengine
Closed, ResolvedPublic

Description

The stretch grid-engine still runs the main cron for the phabsearchemail tool.

This needs to be moved by May 21st

We should upgrade the python venv at the same time.

Event Timeline

Mentioned in SAL (#wikimedia-cloud) [2022-04-04T08:25:56Z] <RhinosF1> create toolforge-jobs venv for T305290

Mentioned in SAL (#wikimedia-cloud) [2022-04-04T08:39:33Z] <RhinosF1> toolforge-jobs run pseweekly --command "pyvenv39/bin/python3 /data/project/phabsearchemail/phabsearchemail/script.py /data/project/phabsearchemail/weekly.csv" --image tf-python39 --schedule '0 14 * * 1' (T305290)

Mentioned in SAL (#wikimedia-cloud) [2022-04-04T08:40:54Z] <RhinosF1> toolforge-jobs run psemonthly --command "pyvenv39/bin/python3 /data/project/phabsearchemail/phabsearchemail/script.py /data/project/phabsearchemail/monthly.csv" --image tf-python39 --schedule '0 9 1 * *' (T305290)

tools.phabsearchemail@tools-sgebastion-10:~$ toolforge-jobs list
Job name:    Command:                                                                                                                Job type:             Container:    File log:    Emails:    Resources:    Status:
-----------  ----------------------------------------------------------------------------------------------------------------------  --------------------  ------------  -----------  ---------  ------------  ---------------------------
psemonthly   pyvenv39/bin/python3 /data/project/phabsearchemail/phabsearchemail/script.py /data/project/phabsearchemail/monthly.csv  schedule: 0 9 1 * *   tf-python39   yes          none       default       Last schedule time: unknown
pseweekly    pyvenv39/bin/python3 /data/project/phabsearchemail/phabsearchemail/script.py /data/project/phabsearchemail/weekly.csv   schedule: 0 14 * * 1  tf-python39   yes          none       default       Last schedule time: unknown
tools.phabsearchemail@tools-sgebastion-10:~$

instead of

tools.phabsearchemail@tools-sgebastion-10:~$ crontab -l
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').
#
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# Wikimedia Toolforge specific note:
#   Please be aware that *only* jsub and jstart are acceptable
#   commands to schedule via cron.  Any command specified here will
#   be modified to be invoked through jsub unless it is one of
#   the two.
#
# m	h	dom	mon	dow	command
0 14 * * 1 /usr/bin/jsub -N cron-29 -once -quiet python3 /data/project/phabsearchemail/phabsearchemail/script.py /data/project/phabsearchemail/weekly.csv
0	9	1	*	* /usr/bin/jsub -N cron-30 -once -quiet python3 /data/project/phabsearchemail/phabsearchemail/script.py /data/project/phabsearchemail/monthly.csv