RLEC Charm Submission

Bug #1551133 reported by Redis Labs
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juju Charms Collection
In Progress
Undecided
Unassigned

Bug Description

Please list the RLEC charm in the Charm Store.

Thanks!

Revision history for this message
Marco Ceppi (marcoceppi) wrote :

Thanks for the submission, sorry for the delay we're experiencing higher than normal volume of charms in our review system. I'm taking a look at this now and will report back soon with my review!

Revision history for this message
Redis Labs (redislabs-team) wrote :

Thank you Marco, please keep us updated.
Additionally, there are currently 2 'rlec' charms in the Community charms catalog- one by 's-matan' and one by 'redislabs'. It seems that it happened because I changed the account name to 'redislabs' so the charm will be presented by redislabs.

The bottom line is that the redundant rlec charm by 's-matan' should be removed- would you be able to assist with this?
Thanks!

Revision history for this message
Cory Johns (johnsca) wrote :

Matan,

Thank you for your submission to the charm ecosystem! It looks like a great start, but I do have some issues that need to be addressed.

When downloading the RLEC payload from S3, you're not doing any checksum verification to ensure that the file you get is the file you expect. Because we consider this very important for security and data integrity reasons, we have some helpers available in the charmhelpers.fetch package to make this easy. You can use either the high level install_remote [1] function, or the lower-level ArchiveUrlFetchHandler.download_and_validate [2] method (I would recommend the former).

[1]: https://pythonhosted.org/charmhelpers/api/charmhelpers.fetch.html#charmhelpers.fetch.install_remote
[2]: https://pythonhosted.org/charmhelpers/api/charmhelpers.fetch.html#charmhelpers.fetch.archiveurl.ArchiveUrlFetchHandler.download_and_validate

You only handle the "is_leader" case in the install hook, but it is possible that the leader can change. For instance, if the original leader dies or is removed using remove-unit, a new leader will need to be elected to take its place. It would be better if you moved that bit of code from the install hook to the leader-elected hook. Note that that will only be called on the newly elected leader, and is guaranteed to be called at least once.

Your node-relation-departed hook posts to a web service to remove the departing node, but I don't see anywhere that you post to register the node. Is that something that happens implicitly? I do notice that your node-relation-changed hook has the leader put all of the peers in to the leadership settings, but then that setting is never used. I wonder if that was intended to be the registration step?

Your config-change hook seems to be left-over boilerplate from the `charm create` template. It doesn't seem to do anything to update the service configuration based on the new config values, meaning the charm will not respond to the user changing those values after deployment (something we call "immutable config"). It seems that it should update the config file and possibly restart the service. Also, because of the boilerplate, it is currently generating a "dummy" Upstart job, which is not something you want, so I'd also recommend removing the templates directory and the hooks/services.py file.

Finally, your charm doesn't have any relations to enable it to connect to other services. I would recommend that you add support to your charm for the "redis" interface so that it can provide this service to all of the other existing charms that require Redis [3]. It looks like all you would need to provide on that relation is the master_node_ip, port, and password.

[3]: https://jujucharms.com/requires/redis

Again, thank you for this contribution. I look forward to seeing your updates to address these items!

Marco Ceppi (marcoceppi)
Changed in charms:
status: New → Incomplete
Revision history for this message
Review Queue (review-queue) wrote : AWS Test Results: RLEC Charm Submission

This item has failed automated testing! Results available here http://juju-ci.vapour.ws:8080/job/charm-bundle-test-aws/3211/

Revision history for this message
Redis Labs (redislabs-team) wrote :

Hi Cory,

Thanks for your feedback and sorry for the delayed response, we have a lot on our plate currently.

1. I added a checksum verification to the install hook, using the ArchiveUrlFetchHandler.install method. It seems that the high level install_remote method has some issues running on trusty.

2. I added a leader-elected hook. It sets the elected leader's master_node_ip in the leader_set context, which is moved from the install hook.
As bootstrapping the node in a 'create_cluster' mode (which is done in the install hook) should be done only once on the first unit installation, i think it makes sense to do it in the install hook and not in the leader-elected hook (which will be called again whenever a new leader is elected).

3. A new node is registered to the cluster in the node-relation-joined hook- It bootstraps the new node in a 'join_cluster' node. the bootstrapping (of both 'create_cluster' and 'join_cluster' modes) is triggered by writing a specific json file to a specific directory.
The node-relation-changed hook is indeed setting the private address of each unit in the leader_set context, which is then being used in the node-relation-departed hook context:
- The leader will POST a nodes/<id>/remove request to the cluster, which should consist of the RLEC node id that should be departed.
- The departed RLEC node id is retrieved by its private address, from the leader_get context.

4. I removed the templates dir, services.py and the config-changed hook.
Currently, RLEC allows changing the password only (and not the username or the cluster's name) and it can be done via the UI only. We are planning to expose an api for that in the future, and once we do we'll be able to support it via the config-changed hook.

5. The rlec charm provides a cluster and not a redis resource endpoint, therefore it is not providing any relations.
This was indeed a point I wasn't sure about, and discussed it with the charms team. Our understanding was that the correct charm configuration is using peers. Please let me know if you have any ideas regarding.

Please let me know if you have any comments or further questions.

P.S.: please see my previous comment- there are currently 2 rlec charms exposed, and only the one by 'redislabs' should be available. Could you please look into it?

Thanks!

Revision history for this message
Redis Labs (redislabs-team) wrote :

Hi Cory,

Any update regarding the above?
Also, I made some updates about 24 hrs ago to the README.md file which are still not reflected on the marketplace: https://jujucharms.com/u/redislabs/rlec/trusty/2 . Any idea?

Thanks!

Revision history for this message
Redis Labs (redislabs-team) wrote :

Pinging again re my previous comments- there are currently 2 rlec charms exposed, and only the one by 'redislabs' should be available. Could you please look into it?

thanks!

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

Hello,

I see that there are two branches, one from s-matan and one from redislabs.

Anyone is able to create charms, and they will all end up in the charm store. However, they will remain on the personal namespace. Only recommended charms can be deployed by using only the name service. As an example, `juju deploy rlec` instead of `juju deploy cs:~redislabs/trusty/rlec`. They will always be owned by ~charmers.

If you have any more questions, feel free to ping the juju mailing list at <email address hidden>, or find us on IRC at #juju on freenode. Bugs are not monitored by the entirety of our community so it should be faster to get an answer via one of those two methods.

Marco Ceppi (marcoceppi)
Changed in charms:
status: Incomplete → Fix Committed
Revision history for this message
Marco Ceppi (marcoceppi) wrote :

Hello! Thank you for the update, I've moved tis back into the review queue and it'll be reviewed against with your latest updates within the next 24 hours.

Revision history for this message
Review Queue (review-queue) wrote : LXC Test Results: RLEC Charm Submission

This item has failed automated testing! Results available here http://juju-ci.vapour.ws:8080/job/charm-bundle-test-lxc/3660/

Revision history for this message
Review Queue (review-queue) wrote : AWS Test Results: RLEC Charm Submission

This item has failed automated testing! Results available here http://juju-ci.vapour.ws:8080/job/charm-bundle-test-aws/3709/

Revision history for this message
Review Queue (review-queue) wrote : LXC Test Results: RLEC Charm Submission

This item has failed automated testing! Results available here http://juju-ci.vapour.ws:8080/job/charm-bundle-test-lxc/3678/

Revision history for this message
Review Queue (review-queue) wrote : AWS Test Results: RLEC Charm Submission

This item has failed automated testing! Results available here http://juju-ci.vapour.ws:8080/job/charm-bundle-test-aws/3727/

Revision history for this message
Konstantinos Tsakalozos (kos.tsakalozos) wrote :

Hi,

Thank you for your work and apologies for the long delay.

I went over the deployment process and the code and deployed the charm. The README looks good. There are a few issues that need your attention but they should be easy fixes.

1. Opening ports? I see in the README you expect the user to access a unit through port 8443.
To do this you would need to open the port first as described in [0]. In short some clouds/environments might need firewall and routing configuration to expose a port and this is done by Juju for you. You Just need to let Juju know what ports need opening before exposing the service.

2. The amulet test you have will only fail in case the deployment fails. Instead you should go ahead and check that port 8443 is open. We would like to see tests that test real functionality as the guard from future regressions and improve quality.

3. In the amulet test you are getting a sentry via: cls.deployment.sentry.unit['redislabs/0']
Instead you should do a cls.deployment.sentry.unit['redislabs'][0] to make sure you are getting a redislab sentry.

4. The promulgation process has somewhat changed. As described in [2] you should push the charm you want promulgated into your private namespace in the stable channel. We will grab it from there
and promulgate it as recommended in the Juju store. Please make sure you mention in the ticket the revision you pushed.

5. Finally charm proof produces a number of points that may (or not) need your attention.
Could you make sure that everything reported is intentional.
I: all charms should provide at least one thing
I: missing recommended hook start
I: missing recommended hook stop
I: missing recommended hook config-changed

We appreciate your work.

[0] https://jujucharms.com/docs/master/developer-hook-tools#open-port
[2] https://jujucharms.com/docs/devel/authors-charm-store

Thank you,
Konstantinos

Changed in charms:
status: Fix Committed → In Progress
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.