New Charm: IBM DB2

Bug #1477057 reported by Suchitra Venugopal
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juju Charms Collection
Fix Released
Undecided
Unassigned

Bug Description

Hi!

Here is the charm for IBM DB2(Layered) for review.

To test this charm, a license to DB2 is required (you will need to create a repo with the deb packages).
You need to get a DB2 license for at least DB2 version 10.5

Repo : https://code.launchpad.net/~ibmcharmers/charms/trusty/ibm-db2/trunk

And, its source code can be found in the below repository
Repo : https://code.launchpad.net/~ibmcharmers/charms/trusty/layer-ibm-db2/trunk

The charm has been pushed into charm store as well
branch : cs:~ibmcharmers/trusty/ibm-db2-32

Thanks

Matt Bruzek (mbruzek)
Changed in charms:
status: New → In Progress
Revision history for this message
Matt Bruzek (mbruzek) wrote :
Download full text (3.9 KiB)

Thanks for the submission of the DB2 charm! I am excited about having the IBM database as an option in the charm store! Thank you for the work on this charm, here is my review.

The charm passes our proof tool with no messages! Thank you for taking the time to make sure the code passed our tooling. The charm also has tests that do more than deploy the unit! That is excellent work there! The code was clear and easy to read, that takes work and I thank you for that.

# README.md
The markdown does not convert properly to HTML in several areas. There are several Open Source markdown readers available (apt-get install markdown) but you can also look at how the readme renders in the charm store by going to the URL: https://jujucharms.com/u/ibmcharmers/db2/trusty

Some shell commands are only indented 3 spaces when they should be 4. Some shell commands are indented 4 spaces but do not have a blank line before, so they do not render as code blocks. To resolve this add a blank line before the indented commands, or use the alternate method to create code blocks with three back ticks:
```
apt-get install dpkg-dev apache2
```

Also one the db2-knowledgecenter link has too many open brackets “[“ so links to the knowledge center do not work. Please review the github markdown syntax https://help.github.com/articles/markdown-basics/ Review the entire readme so it renders to HTML nicely.

# start
The start hook should not error out if the software is not installed. The error state is more difficult for Juju users to resolve. It would be better to check if the commands exist before calling them so the hook does not error. Perhaps print a message that the command does not exist and exit 0.

Here is an example of the log:
2015-08-07 16:06:47 INFO juju-log IBM DB2: Begin Start hook
2015-08-07 16:06:47 INFO start -su: db2: command not found
2015-08-07 16:06:47 INFO start Usage: grep [OPTION]... PATTERN [FILE]...
2015-08-07 16:06:47 INFO start Try 'grep --help' for more information.
2015-08-07 16:06:47 INFO start -su: db2start: command not found
2015-08-07 16:06:48 ERROR juju.worker.uniter.operation runhook.go:103 hook "start" failed: exit status 127

The db2 command does not exist at this time.

# db2 get dbm cfg|grep -i svce|cut -d"=" -f2
No command 'db2' found, did you mean:
 Command 'dba' from package 'wise' (universe)
 Command 'dbd' from package 'netatalk' (universe)
 Command 'sb2' from package 'scratchbox2' (universe)
 Command 'd52' from package 'd52' (universe)
db2: command not found

# Performance suggestion
With Juju users can request larger instances from the cloud providers. You might want to include what kind of constraints work best for this version of DB2. The default AWS instance has the following constraints root-disk=8192M, and mem=1740M. Does DB2 run well with only 1.7GB of RAM? The install goes on the hard drive, and a full install of db2 charm took the default instance up to 6.5GB Used (according to df -h). That does not leave a lot of extra room for a database. Amazon also has storage available (140GB) on /mnt/. Perhaps you could configure the database or log files to be written to the mnt directory to avoid filling up th...

Read more...

Revision history for this message
Suchitra Venugopal (suchvenu) wrote :

Hi Mat,
 The issues related to start hook is resolved. Also information is added in README on the Performance suggestion you gave. Also through charm we can change the default DB path to any other valid path using the config value 'dftdbpath' which is by default set to /home/db2inst1. The user can set this value as per his choice.

The README is updated with your review comments. Also details of upgrading this charm to DB2 Advanced Enterprise Server Edition with BLU acceleration is added in the README. Anyone who follows the instructions there can upgrade this charm to make use of BLU feature.

Thanks,
 Suchitra Venugopal

Changed in charms:
status: In Progress → Fix Committed
Revision history for this message
Benjamin Saller (bcsaller) wrote :

Thank you for the previous round of improvements. The general form and structure of this charm are shaping up.

In this charm you define a new interface, 'db2'. This is correct and appropriate but in its current form is very limited. It returns the same information to each and every connecting service. This means that if a Juju environment wanted to use this database to host a series of web application backingstores they would share username, password and instance name.

I think it important for an enterprise level database to define an interface which better reflects the capabilities of the underlying service. For examples of how other database interfaces work I'd suggest you look at how postgesql handles this.

For reference https://github.com/bcsaller/juju-relation-pgsql is a 'relation stub', basically a library that emits relation specific events and allows the charm to respond to those rather than simple relation-{joined,changed} hooks. In this context we can see how both the provides and requires sides of the relation are implemented in this library and can be included into charms. The most convenient way to do this is with charm compose out of the charm-tools package. For reference

https://jujucharms.com/docs/devel/authors-charm-composing
http://pythonhosted.org/charms.reactive/

Note that the reactive framework is useable from bash as well and examples are included in the docs.

I'd invite you to think about defining a multi service/multi client aware database interface that situates this charm into the ecosystem as a real database player.

Thanks

Revision history for this message
Suchitra Venugopal (suchvenu) wrote :

Hi Ben,
 Thanks for your feedback and suggestions. I am looking at ways to connect to DB using different usernames instead of the same.
For advanced features like layering and reactive, we would like to look at these for the new charms we would be working on, where ever applicable.

Thanks,
 Suchitra

Changed in charms:
status: Fix Committed → In Progress
description: updated
Changed in charms:
status: In Progress → Fix Committed
description: updated
Revision history for this message
Suchitra Venugopal (suchvenu) wrote :

Hi Ben,
User name , password and instance name are configurable now. Please have a look once.

Regards,
Suchitra

Changed in charms:
status: Fix Committed → In Progress
Changed in charms:
status: In Progress → Fix Committed
status: Fix Committed → In Progress
Changed in charms:
status: In Progress → Fix Committed
Revision history for this message
Review Queue (review-queue) wrote : LXC Test Results: New Charm: IBM DB2

The results (PASS) are in and available here: http://juju-ci.vapour.ws:8080/job/charm-bundle-test-lxc/1446/

Revision history for this message
Review Queue (review-queue) wrote : AWS Test Results: New Charm: IBM DB2

The results (PASS) are in and available here: http://juju-ci.vapour.ws:8080/job/charm-bundle-test-aws/1431/

Changed in charms:
status: Fix Committed → In Progress
Changed in charms:
status: In Progress → Fix Committed
Revision history for this message
Adam Israel (aisrael) wrote :

Hi Suchitra,

I had the chance to review this charm and would like to share some feedback with you.

I was able to successfully deploy the ibm-db2 charm following the instructions in the README.md. There seems to be an issue with idempotency, however. I rebooted the machine where the service was running and the config-changed hook failed. Unfortunately, running juju resolved --retry ibm-db2 did not fix the problem and I was unable to get:

2016-01-08 15:51:03 INFO juju-log IBM DB2: Begin config-change hook
2016-01-08 15:51:03 INFO juju-log IBM DB2: License accepted
2016-01-08 15:51:04 INFO juju-log Checking the package name
2016-01-08 15:51:04 INFO juju-log IBM DB2: Package name is matching for the platform
2016-01-08 15:51:05 INFO juju-log IBM DB2: Changing the password for the user db2usr1 to db2usr123
2016-01-08 15:51:05 INFO juju-log IBM DB2: Changed the password for the user db2usr1 to db2usr123
2016-01-08 15:51:05 INFO juju-log IBM DB2: Services file already updated
2016-01-08 15:51:05 INFO config-changed /var/lib/juju/agents/unit-ibm-db2-0/charm
2016-01-08 15:51:09 INFO config-changed 01/08/2016 15:51:09 0 0 SQL1063N DB2START processing was successful.
2016-01-08 15:51:09 INFO config-changed SQL1063N DB2START processing was successful.
2016-01-08 15:51:09 INFO juju-log After db2start
2016-01-08 15:51:10 INFO config-changed
2016-01-08 15:51:10 INFO config-changed Instance Attachment Information
2016-01-08 15:51:10 INFO config-changed
2016-01-08 15:51:10 INFO config-changed Instance server = DB2/LINUXX8664 10.5.3
2016-01-08 15:51:10 INFO config-changed Authorization ID = DB2USR1
2016-01-08 15:51:10 INFO config-changed Local instance alias = DB2USR1
2016-01-08 15:51:10 INFO config-changed
2016-01-08 15:51:13 INFO config-changed SQL1032N No start database manager command was issued. SQLSTATE=57019
2016-01-08 15:51:13 ERROR juju.worker.uniter.operation runhook.go:107 hook "config-changed" failed: exit status 4

Aside from that, I see you're making very good progress with the charm. I did note the following issues:

$ charm proof
I: db-relation-joined not executable
I: install not executable
I: start not executable
I: stop not executable
I: config-changed not executable

The *I* is merely informational, but it is recommended that you make each hook executable, i.e., `chmod +x hooks/install start stop config-changed`.

I'm going to move the status back to "In Progress". Feel free to move it back when you're ready for another review, and as always, please reach out to us on #juju on irc.freenode.net or on the mailing list <email address hidden> with any questions.

Changed in charms:
status: Fix Committed → In Progress
Revision history for this message
Suchitra Venugopal (suchvenu) wrote :

Hi Adam,
 Thanks for pointing out the issue with Config change hook. I have fixed the same. Kindly have a look.
Also I have given executable permission to all hooks in the hooks directory as suggested. I am changing the status to Fix Committed. Kindly request you to have a look at the charm.

Regards,
Suchitra

Changed in charms:
status: In Progress → Fix Committed
Revision history for this message
Cory Johns (johnsca) wrote :

Suchitra,

Thank you for all of your work on this charm. With your latest changes, there are no longer any complaints from charm proof, and I was able to deploy the service successfully, as well as reboot the instance without issue.

It has now been promulgated into the recommended namespace of the charm store, and should be available at https://jujucharms.com/ibm-db2/ within the hour, at which point it can be deployed with:

    juju deploy cs:trusty/ibm-db2

The promulgated charm can be found at https://code.launchpad.net/~charmers/charms/trusty/ibm-db2/trunk and future changes made to the dev branch (https://code.launchpad.net/~ibmcharmers/charms/trusty/ibm-db2/trunk) can be proposed to the promulgated branch by submitting a Merge Proposal against the promulgated branch.

We, the community, very much appreciate the effort you've put in to adding this charm to the ecosystem, and look forward to your continued development and additions.

Changed in charms:
status: Fix Committed → Fix Released
Revision history for this message
Suchitra Venugopal (suchvenu) wrote :

Hi,
 Kindly request you to have a look at the IBM DB2 Layered charm.

Thanks,
 Suchitra

Changed in charms:
status: Fix Released → Fix Committed
description: updated
description: updated
description: updated
Changed in charms:
status: Fix Committed → Fix Released
description: updated
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.