Bug 635803 - pulp repo sync doesn't seem to be working with --schedules
Summary: pulp repo sync doesn't seem to be working with --schedules
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Pulp
Classification: Retired
Component: z_other
Version: unspecified
Hardware: All
OS: Linux
high
high
Target Milestone: ---
: ---
Assignee: Jay Dobies
QA Contact: Preethi Thomas
URL:
Whiteboard:
Depends On:
Blocks: pulp-verified verified-to-close
TreeView+ depends on / blocked
 
Reported: 2010-09-20 18:33 UTC by Preethi Thomas
Modified: 2011-08-16 12:21 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2011-08-16 12:08:20 UTC
Embargoed:


Attachments (Terms of Use)

Description Preethi Thomas 2010-09-20 18:33:57 UTC
Description of problem:


Automatic sync doesn't seem to be happening when you create a repo with --schedules option

Created repo with the following command

[root@preethi ~]# pulp-admin -u admin -p admin repo create --id=f12_x86_64-new --name=f12 --arch=x86_64 --feed=yum:http://download.devel.redhat.com/released/F-12/GOLD/Fedora/x86_64/os/ --schedule="02 * * * *"


[root@preethi ~]#  pulp-admin -u admin -p admin repo list
+-------------------------------------------+
    List of Available Repositories 
+-------------------------------------------+



Label              	f12_x86_64-new           
Name               	f12                      
Feed               	{u'url': u'http://download.devel.redhat.com/released/F-12/GOLD/Fedora/x86_64/os/', u'type': u'yum', u'supported_types': [u'yum', u'local', u'rhn']}
Arch               	x86_64                   
Sync Schedule      	02 * * * *               
Packages           	2998                     
Files              	8  


But the sync doesn't seem to be happening every 2 minutes as expected.

Comment 1 Jay Dobies 2010-09-24 13:33:55 UTC
commit	b2f0e6136a06efe34387bd7d70477fb7d666293a
tree	1430b04de20800145f481400deba93137100d32b


635803 - Fixed repo sync schedule to use the existing model (for auditing and consumer history reapers) for the cron entries.


src/pulp/server/api/repo.py
src/pulp/server/api/repo_sync.py
test/unit/test_repo_sync_schedule.py

Comment 2 Preethi Thomas 2010-10-11 13:06:34 UTC
Jay,

Could you put in some steps to successfully verify this bug.

Thanks

Comment 3 Jay Dobies 2010-10-11 13:28:30 UTC
For each scheduled repo sync, there will be a separate crontab entry. Since the server is running as the apache user, it will be in that user's crontab. If you can't log in as the apache user, to display it use:

crontab -u apache -l

The entry should refer to the repo.py script, which will be in the /usr/lib/python2.*/site-packages/pulp/server/api directory. It needs to pass in a single parameter, --repoid, which identifies the repo to be syncced.

Once that's all set up, the simplest way to test it is to create a repo with a schedule but not sync it. When the schedule should kick in and do the sync, it'll pull down the repo in its entirety.

Another approach would be to simulate an update by doing a repo sync, changing the contents of the repo, and waiting for the schedule to kick in. Once it does, double check that the new packages are in pulp.

Also make sure to double check that when deleting a repo the schedule entry is removed.

Comment 4 Preethi Thomas 2010-10-11 14:04:26 UTC
verified

[root@preethi ~]# pulp-admin -u admin -p admin repo create --id=f13_test_relative --name=f13_test_relative --arch=x86_64 --feed=yum:http://repos.fedorapeople.org/repos/pulp/pulp/testing/fedora-13/x86_64/ --schedule="*/5 * * * *" --relativepath=/tmp/pulp_schedule_test/
 successfully created repo [ f13_test_relative ]


[root@preethi ~]# crontab -u apache -l
0,30 * * * * python /usr/lib/python2.6/site-packages/pulp/auditing.pyc
0,30 * * * * python /usr/lib/python2.6/site-packages/pulp/server/auditing.pyc
0 1 * * * python /usr/lib/python2.6/site-packages/pulp/server/api/consumer_history.pyc
2 * * * * pulp repo sync f12_i386-3
0,30 8-17 * * 1-5 python /usr/lib/python2.6/site-packages/pulp/server/api/repo.py --repoid=f13_test_schedule
*/5 * * * * python /usr/lib/python2.6/site-packages/pulp/server/api/repo.py --repoid=f13_test_relative
You have new mail in /var/spool/mail/root


[root@preethi ~]# ls /var/lib/pulp/repos/tmp/pulp_schedule_test/
cachecookie
filelists.xml.gz
grinder-0.0.63-1.fc13.noarch.rpm
mongo-1.4.4-0.fc13.x86_64.rpm
mongo-devel-1.4.4-0.fc13.x86_64.rpm
mongo-server-1.4.4-0.fc13.x86_64.rpm
other.xml.gz
packages/
primary.xml.gz
primary.xml.gz.sqlite
pulp-0.0.72-1.fc13.noarch.rpm
pulp-client-0.0.72-1.fc13.noarch.rpm
pulp-common-0.0.72-1.fc13.noarch.rpm
python-pymongo-1.6-5.fc13.x86_64.rpm
python-qpid-0.7.946106-1.fc13.noarch.rpm
python-webpy-0.32-6.fc13.noarch.rpm
repodata/
repomd.xml
[root@preethi ~]# ls /var/lib/pulp/repos/tmp/pulp_schedule_test/
cachecookie
filelists.xml.gz
grinder-0.0.63-1.fc13.noarch.rpm
mongo-1.4.4-0.fc13.x86_64.rpm
mongo-devel-1.4.4-0.fc13.x86_64.rpm
mongo-server-1.4.4-0.fc13.x86_64.rpm
other.xml.gz
packages/
primary.xml.gz
primary.xml.gz.sqlite
pulp-0.0.72-1.fc13.noarch.rpm
pulp-client-0.0.72-1.fc13.noarch.rpm
pulp-common-0.0.72-1.fc13.noarch.rpm
python-pymongo-1.6-5.fc13.x86_64.rpm
python-qpid-0.7.946106-1.fc13.noarch.rpm
python-webpy-0.32-6.fc13.noarch.rpm
repodata/
repomd.xml

Comment 5 Preethi Thomas 2011-08-16 12:08:20 UTC
Closing with Community Release 15

pulp-0.0.223-4.

Comment 6 Preethi Thomas 2011-08-16 12:21:25 UTC
Closing with Community Release 15

pulp-0.0.223-4.


Note You need to log in before you can comment on or make changes to this bug.