Merge lp:~jose/charms/precise/owncloud/update-version into lp:charms/owncloud

Proposed by José Antonio Rey
Status: Merged
Merged at revision: 24
Proposed branch: lp:~jose/charms/precise/owncloud/update-version
Merge into: lp:charms/owncloud
Diff against target: 135 lines (+56/-18)
3 files modified
README.md (+17/-4)
hooks/install (+3/-3)
hooks/upgrade-charm (+36/-11)
To merge this branch: bzr merge lp:~jose/charms/precise/owncloud/update-version
Reviewer Review Type Date Requested Status
Charles Butler (community) Approve
charmers Pending
Review via email: mp+214649@code.launchpad.net

Commit message

Updated owncloud version it pulls

Description of the change

Updated owncloud version it pulls

To post a comment you must log in.
Revision history for this message
Charles Butler (lazypower) wrote :

Greetings Jose,

Thanks a million for this submission! This is right on time with the U1 service closure, and a great addition to the charm store since its such a major version upgrade.

I'm going to ask that you document the behavior when deploying, and migrating an existing deployment to scale out usage with MySQL, that the file structure in the database is not preserved so users know its single host or multi-host from the git go until a patch is released to fix this behavior.

Otherwise, everything else is great. It passes all my tests.

Thanks for this submission! once the readme update is applied I'll merge this into the charmstore.

25. By José Antonio Rey

Added note on README

Revision history for this message
José Antonio Rey (jose) wrote :

All ready!

Revision history for this message
Charles Butler (lazypower) wrote :

Hello again Jose,

Prior to merging I wrote this review while I was still actively reviewing a few fringe cases I had not thought of. I did not upgrade from a 4.x to 6.x release, which is an important factor. Presently this will break owncloud for users that have existing deployments.

The upgrade-charm hook has some syntax errors on the find command, -exec blocks need to be terminated with an escaped semicolon like so:

 # Excise old installation data
 find /var/www -mindepth 2 -maxdepth 2 -type d -name 'data'\
  -exec mv {} /var/tmp/ \;

and it should be idempotent. If the upgrade hook fails, and is re run in its current state it will wipe out the backed up data. Since you didn't write this hook I spent a few cycles working over the hook and have some proposed changes, but its not 100%, as the deployment will still break the application in unknown ways.

http://paste.ubuntu.com/7220050/

Could you spend some time looking at upgrading the upgrade-charm hooks as well? This is an area that we need to pay extra special attention to as data integrity of existing deployments must be upheld. Thanks in advance for any cycles you can put into this. If it proves to be too difficult, let me know and i'll build off of the work you have here and attempt the upgrade.

I'm going to mark the review as needs work. When you are ready for another review be sure to click the request another review button and assign charmers. Someone will be along shortly to review your work.

If you have any questions, comments, concerns join us in #juju on irc.freenode.net and/or email the mailing list at <email address hidden>

Thanks again for all the diligent work!

review: Needs Fixing
26. By José Antonio Rey

Fixed various upgrade-charm bugs

Revision history for this message
José Antonio Rey (jose) wrote :

Hello,

The charm now upgrades fine from the current version in Juju.

The only problem presented is that apps do not migrate with the instance, but have to be activated manually.

Revision history for this message
Charles Butler (lazypower) wrote :

Greetings Jose,

Thanks again for your dedication in upgrading the OwnCloud charm. I'm happy to say every upgrade I've tried with this has resulted in a success.

I'm going to +1 this for now, and ask another reviewer take another look in the morning as its pretty late for me. This should go quickly and have your changes acked into the store in no time if no issues are found.

Thanks for being a champion of this effort and producing a great patch to update OwnCloud!

If you have any questions, comments, concerns join us in #juju on irc.freenode.net and/or email the mailing list at <email address hidden>

Thanks again for all the diligent work!

27. By José Antonio Rey

Hardcoded 6.0.2 instead of latest because of bug on -latest md5 hash provided by ownCloud

28. By José Antonio Rey

Removed version number from install as it may vary

Revision history for this message
José Antonio Rey (jose) wrote :

Hello!

Let me explain those last two revisions:

 * (rev 27) I basically hardcoded -latest into -6.0.2. This is something temporary, because the MD5 hash provided by the ownCloud community for the -latest bzip file is not up to date. Once it is, we should be able to change it back to -latest. At this moment, -latest is the same as -6.0.2, so no problems should be found.

 * (rev 28) This is a trivial change, as the install hook mentioned a 4.x version instead of just saying 'Downloading and validating', which is not up to date (even on the current charm on the charm store). Shouldn't affect the performance of the charm at all.

Revision history for this message
Charles Butler (lazypower) wrote :

Jose,

I have merged your changes into the charm store! Thank you so much for this submission, your dedication, and dilligence in creating an improved owncloud experience for our users. This is a welcome addition to the charm store, and again, we thank you!

If you have any questions, comments, concerns join us in #juju on irc.freenode.net and/or email the mailing list at <email address hidden>

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'README.md'
2--- README.md 2014-04-03 15:21:21 +0000
3+++ README.md 2014-04-11 03:48:25 +0000
4@@ -5,9 +5,14 @@
5
6 # Overview
7
8-ownCloud provides universal access to your files via the web, your computer or your mobile devices — wherever you are. It also provides a platform to easily view & sync your contacts, calendars and bookmarks across all your devices and enables basic editing right on the web.
9+ownCloud provides universal access to your files via the web, your computer or
10+your mobile devices — wherever you are. It also provides a platform to easily
11+view & sync your contacts, calendars and bookmarks across all your devices and
12+enables basic editing right on the web.
13
14-This charm installs Apache2, Apache-Mod-PHP5, and configures OwnCloud with sqlite as a standalone server. Provides relationship hooks with NFS file storage, MySQL Databases, and HAProxy reverse proxy charms.
15+This charm installs Apache2, Apache-Mod-PHP5, and configures OwnCloud with
16+sqlite as a standalone server. Provides relationship hooks with NFS file
17+storage, MySQL Databases, and HAProxy reverse proxy charms.
18
19 ## Preparation:
20
21@@ -31,7 +36,8 @@
22
23 #### 3a. Standalone Instance
24
25- Access owncloud service directly, and complete the setup, providing user credentials and initializing sqlite database.
26+ Access C service directly, and complete the setup, providing user
27+ credentials and initializing sqlite database.
28
29 #### 3b. Shared Instances
30
31@@ -43,7 +49,7 @@
32
33 #### 4. Access
34
35-http://$owncloud-machine-addr/. To find out the public address of owncloud,
36+http://$owncloud-machine-addr/. To find out the public address of ownCloud,
37 look for it in the output of the `juju status` command.
38
39
40@@ -58,5 +64,12 @@
41 juju add-unit owncloud
42
43
44+## Known Limitations
45+
46+If you have been using a standalone instance and want to migrate to a shared
47+instance, please note that adding the mysql relation will not preserve the file
48+structure in the database. This means that your file listing will not be
49+available. Make sure to have this in mind when doing the migration.
50+
51 #TODO
52 Genericize shared-fs-relation-* for non-nfs shared-fs providers
53
54=== modified file 'hooks/install'
55--- hooks/install 2013-10-22 00:40:09 +0000
56+++ hooks/install 2014-04-11 03:48:25 +0000
57@@ -10,12 +10,12 @@
58 php5-gd php5-mysql php5-sqlite curl libcurl3 \
59 php5-curl rpcbind nfs-common
60
61-juju-log "Downloading and validating ownCloud 4.5"
62+juju-log "Downloading and validating ownCloud"
63 # Load charm helper and download owncloud
64 . /usr/share/charm-helper/sh/net.sh
65-LURL="http://download.owncloud.org/community/owncloud-5.0.12.tar.bz2"
66+LURL="http://download.owncloud.org/community/owncloud-6.0.2.tar.bz2"
67
68-LHASH="b1aafcba4823c011b19b60353394d81455e2b3e9c169d4e444b27c740695ed7a"
69+LHASH="a5a194ad07fca7cbf158b660cc098c6364590bdd15d086069221faf4386b713f"
70 source_file=`ch_get_file $LURL $LHASH`
71
72 juju-log "Downloaded"
73
74=== modified file 'hooks/upgrade-charm'
75--- hooks/upgrade-charm 2012-07-21 16:31:08 +0000
76+++ hooks/upgrade-charm 2014-04-11 03:48:25 +0000
77@@ -1,22 +1,47 @@
78 #!/bin/bash
79-set -e
80+set -ex
81
82 juju-log "Upgrading ownCloud"
83 # Pause during upgrade
84 hooks/stop
85
86-# Excise old installation data
87-find /var/www -mindepth 2 -maxdepth 2 -type d -name 'data'\
88- -exec mv {} /var/tmp/
89-find /var/www -mindepth 2 -maxdepth 2 -type d -name 'config'\
90- -exec mv {} /var/tmp/
91-
92-# Upgrade
93-hooks/install
94-
95-# Migrate data
96+#we are under active migration, dont do anything more than once
97+if [ ! -f $CHARM_DIR/.migrating ]; then
98+
99+ # Excise old installation data
100+ find /var/www -mindepth 2 -maxdepth 2 -type d -name 'data'\
101+ -exec mv {} /var/tmp/ \;
102+ find /var/www -mindepth 2 -maxdepth 2 -type d -name 'config'\
103+ -exec mv {} /var/tmp/ \;
104+ touch $CHARM_DIR/.migrating
105+
106+fi
107+
108+# Deleting all traces of the old ownCloud install
109+rm -rf /var/www/owncloud/
110+cd /var/www/
111+
112+# Getting new ownCloud version and MD5 checking it
113+wget download.owncloud.org/community/owncloud-6.0.2.tar.bz2
114+wget download.owncloud.org/community/owncloud-6.0.2.tar.bz2.md5
115+
116+while [ `md5sum owncloud-6.0.2.tar.bz2 | awk '{print $1}'` != `cat owncloud-6.0.2.tar.bz2.md5 | awk '{print $1}'` ]; do
117+ rm owncloud-6.0.2.tar.bz2
118+ wget download.owncloud.org/community/owncloud-6.0.2.tar.bz2
119+done
120+
121+tar xfj owncloud-6.0.2.tar.bz2
122+cd $CHARM_DIR
123+
124+# Migrating data
125+mkdir /var/www/owncloud/data
126+rm -rf /var/www/owncloud/config
127+mkdir /var/www/owncloud/config
128 cp -pr /var/tmp/data/* /var/www/owncloud/data/
129 cp -pr /var/tmp/config/* /var/www/owncloud/config/
130+sudo chown -R www-data:www-data /var/www/owncloud
131
132 # Finish upgrade
133 hooks/config-changed
134+
135+rm $CHARM_DIR/.migrating

Subscribers

People subscribed via source and target branches

to all changes:
to status/vote changes: