Closed Bug 511321 Opened 15 years ago Closed 15 years ago

[AMO] Add new cron jobs to preview.amo

Categories

(mozilla.org Graveyard :: Server Operations, task)

All
Other
task
Not set
blocker

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: clouserw, Assigned: justdave)

Details

There are three new cron jobs for AMO:

1) This is a maintenance.php job, "share_count_totals".  It takes around 56s to run and I think it can go every 15 minutes.

2) /bin/build-recommendations.py.  This takes no arguments and could take around a minute to run.  Running every 30 minutes would be fine.  This requires python 2.6 and mysql connectivity.

3) /bin/recommend.py.  This also takes no arguements and close to no time to run.    Every 30 minutes should be good here too and this also requires python 2.6 with mysql.

Bug 510051 is fixed which should put the python we need on preview and production, but it only mentions it being on khan.  If it's not on preview we should reopen that bug and make this dependent on it.
(In reply to comment #0)
> There are three new cron jobs for AMO:

Just 2, actually: `php maintenance.php share_count_totals` and `python build-recommendations.py`

> 3) /bin/recommend.py.  This also takes no arguements and close to no time to
> run.    Every 30 minutes should be good here too and this also requires python
> 2.6 with mysql.

This is not a script, it's a supporting library.
(In reply to comment #0)

> Bug 510051 is fixed which should put the python we need on preview and
> production, but it only mentions it being on khan.  If it's not on preview we
> should reopen that bug and make this dependent on it.

Nah, leave that bug alone! ;) (unless you really want to track using that...)

I'm working on getting the python you need into puppet so when preview.amo is updated, it'll get pulled in. I'll comment here when done, I'm using this to track that.
> 1) This is a maintenance.php job, "share_count_totals".  It takes around 56s to
> run and I think it can go every 15 minutes.

This is not dependent on python.  Can we get this added?

Also, please rename the current tag_totals maintenance job to category_totals.  Thanks.
As a side note, I'm no longer working on the python bits since Dave and Jeremy felt an RPM would be best.

CC'ing Dave, he was working on the RPM.
Assignee: server-ops → justdave
(In reply to comment #3)
> > 1) This is a maintenance.php job, "share_count_totals".  It takes around 56s to
> > run and I think it can go every 15 minutes.
> 
> This is not dependent on python.  Can we get this added?
> 
> Also, please rename the current tag_totals maintenance job to category_totals. 
> Thanks.

Neither of these depend on python.  Can we get them added please?  I didn't know this bug was going to turn into a python tracking bug but if we get those two out of the way we can focus on the python part.

Regarding the python part, we are code freezing today and expecting to launch on production next Thursday.  What's the status of the python?
blocking QA, ->critical
Severity: normal → critical
So far I've added:
*/15 * * * * root cd /data/amo/www/addons.mozilla.org-preview/bin; php -f maintenance.php share_count_totals
We are planning to launch the features that require this in production this Thursday night and only have a few days left of QA time. Is there any status update?
(In reply to comment #5)
> (In reply to comment #3)
> > Also, please rename the current tag_totals maintenance job to category_totals. 

This still hasn't been done.  

Also, can you please add another maintenance.php job that runs every 8 minutes (it takes less than a second right now, but it will grow rapidly):  collection_stats
(In reply to comment #8)
> Is there any status update?

Please?
Severity: critical → blocker
(In reply to comment #9)
> (In reply to comment #5)
> > (In reply to comment #3)
> > > Also, please rename the current tag_totals maintenance job to category_totals. 
> 
> This still hasn't been done.  
> 
> Also, can you please add another maintenance.php job that runs every 8 minutes
> (it takes less than a second right now, but it will grow rapidly): 
> collection_stats

So we don't clutter up this bug more, this is now bug 512494.  This bug is now only about the python script:

2) /bin/build-recommendations.py.  This takes no arguments and could take
around a minute to run.  Running every 30 minutes would be fine.  This requires
python 2.6 and mysql connectivity.
chizu found and fixed the problem we were having with the RPM of Python 2.6.2 we were trying to use before, so I'm going to go ahead and deploy that.  Working on setup right now and should hopefully have this on the preview site within the next hour, and barring any issues showing up there, can probably push it to the rest of the production servers later tonight.
oremj wasn't here to ask, and I had trouble getting into the load balancer to look it up myself, so I just now found the server this is on (pm-app-amo24).  Unfortunately I'm out of time because I have a meeting to attend.  I should be back in about 2.5 hours and will resume then.  If someone else wants to try before I get back, the RPMs are all staged in mrepo/5Server-i386/RPMS.mozilla, just need to add that repo on that machine, then

yum install python26 MySQL-python26

Then try out the jobs listed above and make sure they work.  If that all checks out then we'll configure puppet to push it to the entire cluster later tonight.
After tonight preview will be deployed against all the app nodes again. If you need we can continue to run it off one machine.
This is blocking QA and we're launching tomorrow.  How can we help get this done ASAP?
-bash-3.2$ python26 bin/build-recommendations.py 
/usr/lib/python2.6/site-packages/MySQLdb/__init__.py:34: DeprecationWarning: the sets module is deprecated
  from sets import ImmutableSet
Could not open input file: connection.php
Traceback (most recent call last):
  File "bin/build-recommendations.py", line 64, in <module>
    main()
  File "bin/build-recommendations.py", line 42, in main
    for s in ('read', 'write')]
  File "/usr/lib/python2.6/json/__init__.py", line 307, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.6/json/decoder.py", line 319, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.6/json/decoder.py", line 338, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
aha, need to actually be in the bin directory.

ok, it's in cron every 30 minutes on pm-amo-app24.

The machine where the cron jobs usually run is x86_64, still working on building that version.
This is spewing email to my inbox - anyone need that output?  Can it be dumped to /dev/null ?
(In reply to comment #18)
> This is spewing email to my inbox - anyone need that output?  Can it be dumped
> to /dev/null ?

Is it errors?  Can you forward one of them to me?
You can redirect the output for now.

Once this is in place on the x86_64 box the output should go to amo-developers with the rest of the cron jobs.

Thanks
We're planning on doing the live push shortly - what is the status of this?
got python deployed on mradm02 which is where the production cron jobs will run.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Product: mozilla.org → mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.