charm for python-oops-tools

Bug #918803 reported by Diogo Matsubara
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juju Charms Collection
Fix Released
Medium
Diogo Matsubara

Bug Description

Adds a charm to deploy python-oops-tools. It can deploy oops-tools to ec2 and an opestack cloud

Tags: new-charm
Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Hello Diogo! Thanks for submitting! The charm looks pretty good. I deployed it, related it to postgresql, and exposed it, and it worked!

I think we can import it to the official list with just this one blocker addressed:

-----------------------
Blockers:

[1]
~/charms/oneiric/oops-tools$ charm proof `pwd`
E: no copyright file

You will find the latest 'charm proof' command in charm-tools in the juju ppa, or a bit lagging in the precise repo. Anyway, you need to produce a copyright file so we know who owns the code of the charm itself, and any components from other software that you might include (which is none right now).

----------------------
Non blockers that can be addressed later:

[2]
W: all charms should provide at least one thing

I see that you open up port 80, so you can just add this to metadata.yaml:

provides:
  website:
    interface: http

And then hooks/website-relation-joined can do:

#!/bin/sh
exec relation-set hostname=`unit-get private-address` port=80

[3]
hooks/start - the blanket chmod -R making everything executable does not seem wise, and so at least needs justification. If your intention is just to make the directories 0755.

find /var/www/oops-tools -type d -print0 | xargs -0 chmod 0755

This seems more logical and safer. If there's a good reason to make them all executable, then I digress, and you can ignore this and just add a comment.

[4]
hooks/start

Not sure about setting ServerName to the public-address without doing more. I think setting 'UseCanonicalName Off' would probably be more appropriate for most charms, since they may be behind proxies and such. Really the Host: header that they're given is far more likely to be right than the server's arbitrary ServerName. This is, however, a nit-pick and perhaps just something to open as a Low priority bug once the charm is in the official repo.

[5]
This being a python application with fairly normal requirements, is there any reason its not packaged and in a PPA somewhere? One thing I don't like is that as oops-tools changes, your add-units will change as well, so new servers will have a new revision. Also this makes the charm dependent on launchpad's code hosting for deploying new units.

-----------------------

So, anyway, just provide a copyright file and we can add it to the official list. Nice work!

Changed in charms:
status: New → Incomplete
assignee: nobody → Diogo Matsubara (matsubara)
importance: Undecided → Medium
Revision history for this message
Diogo Matsubara (matsubara) wrote :

Hi Clint, thanks for the review!

I addressed most of your points. Here's the summary:

1) Added a copyright file. I copied the one from postgresql and changed it to be AGPL as that's the license for oops-tools. Let me know if that's ok and if the format is correct.

2) Done

3) Files and dirs need to be world readable so apache can read them and serve through mod_wsgi. I changed how the file permissions are set to make directories world readable and executable and files world readable. Is this ok?

4) I removed the sed edits from the file and will land a change directly on oops-tools trunk to provide an apache virtual host file that doesn't need those changes. See https://pastebin.canonical.com/59088/ for the changes I'm going to propose to oops-tools trunk.

5) We deploy it directly from trunk and never had the need/time to package this properly. I think what you suggest is a good idea, but I'll leave it for another time.

Changed in charms:
status: Incomplete → Confirmed
Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Diogo, thanks thats great! Promulgated, with one additional change:

W: website-relation-joined not executable

You should run 'charm proof' on your charm after changes, as it will find obvious errors like this one.

Anyway, I chmod +x'd that and have promulgated the charm. It is now a part of the official collection, and available at lp:charms/oops-tools

Well done!

For future changes, you should branch that branch, and propose merges against it. If you would like to become a member of the charmers team, just keep on charming, and apply for the team. If you would like to maintain the branch directly, or as a team, thats fine, let us know and we can form a sub-team of charmers to do that.

Changed in charms:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.