Merge lp://staging/~psivaa/uci-engine/image-watcher into lp://staging/uci-engine

Proposed by Para Siva
Status: Merged
Approved by: Para Siva
Approved revision: 931
Merged at revision: 923
Proposed branch: lp://staging/~psivaa/uci-engine/image-watcher
Merge into: lp://staging/uci-engine
Diff against target: 335 lines (+302/-0)
6 files modified
image-watcher/imagewatcher/__init__.py (+15/-0)
image-watcher/imagewatcher/queues.py (+34/-0)
image-watcher/imagewatcher/tests/test_trigger_process.py (+43/-0)
image-watcher/imagewatcher/tests/test_watch_image.py (+58/-0)
image-watcher/imagewatcher/trigger_process.py (+29/-0)
image-watcher/imagewatcher/watch_image.py (+123/-0)
To merge this branch: bzr merge lp://staging/~psivaa/uci-engine/image-watcher
Reviewer Review Type Date Requested Status
Paul Larson Approve
Celso Providelo (community) Approve
Review via email: mp+246552@code.staging.launchpad.net

Commit message

Image watcher to trigger the workflow for when a new image available in http://cloud-images.ubuntu.com/

Description of the change

Image watcher to trigger when there is a new image present in http://cloud-images.ubuntu.com/ubuntu-core/devel. The script checks the content of http://cloud-images.ubuntu.com/ubuntu-core/devel/core/current/build-info.txt to find if there is a new version in the server.

In terms of message passing to a queue, once we find a new image in the server we provide the version, channel and the test branch in the snappy.images queue for the next service to consume.

To post a comment you must log in.
927. By Para Siva

Revert the unneeded amqp_utils change

928. By Para Siva

add a test to make sure the process triggers when started afresh

Revision history for this message
Celso Providelo (cprov) wrote :

Psivaa,

Thanks for working on this script.

I have nothing against monitoring build-info.txt instead of using simplestreams (python-simplestreams), as long as it works, as it seems to be. We can invest time later to rewrite the whole service to benefit of simplestreams goodies (supports the whole procedure from stream to glance).

There are some questions and remarks inline, specially regarding the topology of the new CLIs and how the charm is supposed to deploy them and its implication on configuration.

review: Needs Information
929. By Para Siva

Review comment fixes, do not use specific config, and always use run-python

Revision history for this message
Para Siva (psivaa) wrote :

Thanks cprov for the comments.

I have removed using a special config file and relying on the amqp_utils.get_config() for the config information. For this as you pointed out, amqp-relation hook needs to be implemented in the cron-cmd charm.

Thanks again.

Revision history for this message
Celso Providelo (cprov) wrote :

Psivaa,

Thanks for the cleanup, I have just a minor suggestion about allowing image_watch.main() to be properly tested, but it's not a blocker.

Don't forget to coordinate with Joe for supporting amqp-relation in cron-cmd charm.

review: Approve
Revision history for this message
Paul Larson (pwlars) wrote :

> Psivaa,
>
> Thanks for working on this script.
>
> I have nothing against monitoring build-info.txt instead of using
> simplestreams (python-simplestreams), as long as it works, as it seems to be.
> We can invest time later to rewrite the whole service to benefit of
> simplestreams goodies (supports the whole procedure from stream to glance).
This is actually possible now, we discussed yesterday and I think we all agreed *not* to do that though right?

Revision history for this message
Paul Larson (pwlars) wrote :

Celso mentioned (if I understood correctly) in a MP for me that we should take all of these services for ubuntucore/snappy and organize them under a single directory rather than having an individual directory for each one off the root of our tree. I think this probably makes sense because they are all related to ubuntucore/snappy, rather than, for instance, a generic image watcher that may have to monitor some other type of source and handle things differently.

Some additional comments below

review: Needs Fixing
Revision history for this message
Celso Providelo (cprov) wrote :

Psivaa, Paul,

I retracted my concerns about having one directory per service (CLIs + worker python module), it the right direction.

With that tree organisation we run CLIs locally or via with `run-python.py` and properly configure rabbit-worker. To me, it looks perfectly fine and acceptable and if it needs rework we can deal with it later.

[]

review: Approve
930. By Para Siva

Review comment fix, account for empty version number in the server

931. By Para Siva

Remove pep8 and pyflake testing locally

Revision history for this message
Para Siva (psivaa) wrote :

Thanks,
@plars: I have addressed your comments inline. and fixed where appropriate. About checking the latest against the glance image-list, we need to have a uniquely corresponding image in glance to the image in cloud-image. Pending that, I believe we only could check against a local cache. Please let me know what you think. Thanks

Revision history for this message
Paul Larson (pwlars) wrote :

I'm fine if we sort out that detail later. I believe we can just call the glance image whatever we want though. The image we download (file) will be something like: devel-core-amd64-disk1.img so maybe we could call it something like devel-core-amd64-${imageid} (ex. devel-core-amd64-20150115.1)

In light of the shift of direction though, I think I'd rather see this get merged and we can sort out those details later. It's easy enough to change things once they are in place, and you've done a great job of getting the ball rolling with this. Thanks for working on this!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches