[00:04] anastasiamac, can I get a review of http://reviews.vapour.ws/r/3385/diff/# ? [00:05] sorry, wrong channel [00:50] marcoceppi, i think string is fine. just wondering if it'll be weird for people wanting to enter an int for the same field [00:57] cmars: looking [00:58] cmars: lgtm \o/ [04:07] does anyone have any thoughts on the best way to manage state in between hook runs? (other than updating the juju config)? [04:13] or alternatively, is there any way to introspect which hooks have run, assuming juju maintains that state? [14:42] blr are you using the traditional charming method or are you working with reactive? [14:44] lazypower: we should just start calling it "Classic Charming" [14:44] hmm, ok [15:38] marcoceppi: bruzer and I are talking about the path forward with k8's. We've reached feature parity with our existing charms, and are thinking about deprecating. The thing is, the older charm shares less than 10% of what the current charms do.. so we cant really deprecate any existing deployed systems [15:39] are we forced into waiting for a series change to promote the new charms? [15:39] its in a namespace, so we can be shifty if required [15:40] marcoceppi: The old charms are only in a personal namespace so I believe we can deprecate the old charms and replace them with the new k8s charm [15:41] deprecate away, it's personal namespace [15:41] welp [15:41] here goes something :) === JoshStrobl is now known as JoshStrobl|Nap === ddellav_ is now known as ddellav [16:29] mbruzek: I'm in a meeting right now so I haven't had time to really go in-depth yet... but the commit looks really good from what I've read so far! [16:29] cfx: Thanks! I am working on event cycle now [16:29] awesome. :) [16:30] I hope to get through the next section -- and review today's changes -- later on this evening. My Juju work is primarily outside of office hours for now. [16:31] cfx thanks again for the feedback and the detailed review [16:31] my pleasure sir [16:44] axw_ : storage hooks run before install, correct? [16:55] thedac, requesting a cross-review if you will ... see my final comment @ https://code.launchpad.net/~pjdc/charms/trusty/rabbitmq-server/no-more-guest-user/+merge/276831 [16:55] beisner: I'll take a look shortly [16:56] thedac, much thanks. actually last 2 comments. i shifted my position slightly. [17:00] Hello Team, I am writing ibm java sdk layer charm, Reactive deployable charm contains auto generated config-changed hook which is written on python. It has some pre-written code as well… So to make use of the EULA value getting from config.yaml file in the decorated pattern, I will have get value from config.yaml file in the config-changed hooks. [17:00] I will have to include the below code in the config-changed hook….can anyone please help me how to insert the below line of codes in the link.. http://paste.ubuntu.com/14006238/ [17:01] @hook('config-changed') [17:01] def config(): [17:01] accepted = hook.config().get('accept-ibm-javasdk-license') if accepted = False: set_state("license.accepted') else: set_state("license.not.accepted') [17:08] hey Prabakaran, in the reactive model, you no longer have to worry about writing individual hooks. the 'charm build' process will create the correct hook for you. you should instead focus on the state of the charm to do your logic. [17:09] so in your case, in your ./reactive/ file, you probably want: [17:09] @when 'java.connected' [17:09] @when_not 'java.installed' [17:09] function do_something() { [17:09] if check_eula() == good; install() [17:09] } [17:10] you can get an idea of the install procedure with the openjdk reactive charm: [17:10] https://github.com/juju-solutions/layer-openjdk/blob/master/reactive/openjdk.sh#L18 [17:10] i would start with that source and simple add the eula check just before the actual install. [17:12] Hi kwmonroe, Good Morning... How to have a check for the value getting from the config.yaml file in the decorated pattern. Like i am facing a scenario wherein i will have to get EULA value from the user as True or False. If EULA value which I am getting it from config.yaml file is true i will have to install IBM java SDK else it will uninstall the product. So I have used something like that, it was not working. Can you please suggest [17:12] javasdk_license_accepted=`config-get accept-ibm-javasdk-license` @when 'java.connected' 'java.installed' '$javasdk_license_accepted== 'False' [17:13] Prabakaran: see the config check for 'install-type' on the openjdk charm: https://github.com/juju-solutions/layer-openjdk/blob/master/reactive/openjdk.sh#L21 [17:13] you would do the same, but instead of 'install-type', make it 'accept-ibm-javajdk-license' [17:14] then see the conditional for openjdk: https://github.com/juju-solutions/layer-openjdk/blob/master/reactive/openjdk.sh#L29 [17:14] do something similar, if accept-ibm-license == True, apt-get install ibm-java; else, apt-get remove ibm-java. [17:15] i have impletmented in that same way but.. If EULA value which I am getting it from config.yaml file is true i will have to install IBM java SDK else it will uninstall the product. [17:16] ok cool - that sounds right [17:16] Hello Prabakaran welcome back. When you say it was not working can you explain ? [17:16] Prabakaran: perhaps a link to your reactive source so we can take a look? [17:18] i was just explaining the scenario what i am facing to kevin... As discussed with u .. i was tryin to get EULA value from config.yaml file in the config-changed hook [17:18] like that [17:18] but Reactive deployable charm contains auto generated config-changed hook which is written on python. It has some pre-written code as well… So to make use of the EULA value getting from config.yaml file in the decorated pattern, I will have get value from config.yaml file in the config-changed hooks. [17:19] @hook('config-changed') def config(): accepted = hook.config().get('accept-ibm-javasdk-license') if accepted = False: set_state("license.accepted') else: set_state("license.not.accepted') [17:20] my actual config-changed hooks is http://paste.ubuntu.com/14006238/ [17:20] so i will have to set_state in here.. [17:21] Prabakaran: OK what you have in the paste bin is a generic python charm hook that allows the system to run the reactive code. [17:22] Prabakaran: you should not edit the config-changed file in this case. You can decorate a config-changed hook. Or as kevin pointed out, the charm code can react to different states and check the configuration value at those times. [17:23] k .. thn so i will have to include this in reactive/install.sh file? [17:23] Prabakaran: so this pastebin was config-changed, but what does your reactive/install.sh look like? [17:23] http://paste.ubuntu.com/14005951/ [17:25] let me ask you Prabakaran is it a requirement to uninstall the java if they decline the license? I know this is a time-honored convention for IBM charms, but is this a requirement? [17:26] Prabakaran: If it is not a requirement to uninstall, we could simply this code to only install when/if they accept the license, after that the user can not change their mind, and reject the license [17:27] ya we need to uninstall the product if the EULA is FALSE [17:28] Prabakaran: OK understood. [17:28] beisner: A few things. One, this MP needs to be against next. Two, after NotImplementedError we cannot assume no clustering for juju < 1.23. Three, +1 to needing tests although that may fall to you to implement :). Do you want these comments on the MP? [17:28] Outside of decorated pattern.. i have written like that.. [17:28] if [ $javasdk_license_accepted == "True" ]; then set_state 'license.accepted' else set_state 'license.not.accepted' fi [17:29] Prabakaran: OK what is not working then? [17:30] thedac, thx, i've got it. i just got so excited to have tests complete! [17:30] ha [17:31] As discussed with u.. i thought i will have to get config values from config-changed hook... that is where i confused..now i am clear ... [17:32] i will deploy and test my code... and come back if i have any doubts... thank u all for ur help... [17:33] Prabakaran: You showed me the generated config-changed hook, but you can implement a bash layer of the config-changed hook in your install.sh file if you need to [17:34] the reactive.main() method will invoke functions with @hook 'config-changed' at the appropriate times [17:34] when configuration changes [17:34] Prabakaran: let me or kwmonroe know if you have any further questions after testing. [17:34] thedac, ps fyi, following the cdo-qa sprint, this guy right here will be taking a strong stance on tests-should-accompany-changes-or-additions. ;-) as much as i do enjoy that part, i can easily get sucked into writing test coverage for features that others land (or more likely/dangerous: not add test coverage for a feature that someone has landed). [17:35] +1. I'll back you up on that. [17:36] thedac, so i understand the other thing raised on that mp ... so the concern is that this assumes LE? [17:36] jhobbs: the django layer has a bit of support for python3, it was made to support this: https://code.launchpad.net/~ubucon-site-developers/ubucon-site/ubucon-layer so there's room to grow it [17:36] cory_fu, lazypower: hey - so what do you find your 'final layer' charm source repo is looking like? [17:37] beisner: Right. Which I go back and forth on whether that is acceptable. [17:37] our first versions as not the charm per say, but the bits to make the charm [17:37] thedac, err nvm. i grok. [17:38] beisner: and in this case we cannot use the legacy is_newer() because that assumes it is in a relation hook. [17:38] marcoceppi: oops, was talking in other room [17:38] marcoceppi: ok, i'll go with mine for now just to get everything working and then come back and look into yours more [17:39] ya sure [17:39] jhobbs: no worries, this just does gunicorn and django. It calls pip isntall for gunicorn and the pip should be determined by what the user put int he parent layer [17:39] jhobbs: IE, pip: '/usr/bin/php3' would get you a python3 gunicorn [17:40] lazypower: this is a 'classic' charm (not one I've written) unfortunately. [17:40] marcoceppi: how's that work? You're calling 'pip' directly from the OS [17:40] jhobbs: it's a bug [17:40] * lazypower reads backscroll - sorry blr i lost context 1 sec [17:41] blr ah! [17:41] lazypower: throwing the state in juju config would certainly work, it just seems a bit ugly. [17:41] so if you need to manage local state in a classic charm, use the charmhelpers.unitdata.kv storage helper [17:41] jhobbs: line 49 should be doing what;s in this line: https://github.com/marcoceppi/layer-django/blob/master/reactive/django.py#L143 [17:41] this charm isn't even using charmhelpers :( [17:41] * marcoceppi patches [17:41] its specific to the unit, and gives you a consistent interface to store data. [17:41] blr: thats a simple import away though :) [17:42] * marcoceppi writes an email to the list to announce the layer so it has more visibility [17:42] cool, well i'm glad i know about it now; i checked on the site when i started this but that was more than two weeks ago [17:42] thedac, thx, re-commented. reviewed as re-submit. [17:42] thanks for the heads up [17:42] lazypower: true, it is just going to make our eventual diff for upstream require more explanation, but that's okay. [17:42] blr: which charm? [17:42] lazypower: thanks, that kv store sounds perfect [17:42] lazypower: squid-forwardproxy [17:42] aahhh ok. [17:43] it really should be rewritten [17:43] layers are a thing :) [17:43] right [17:43] having a squid-common layer, then a layer for the different proxy types would be stellar [17:43] it would! [17:45] it would certainly ease your maintenance burden... might be worth the effort if you have the project scope to do it blr [18:33] Hi , Unfortunately uninstallation part was not getting called while setting EULA value to False. [18:33] First I deployed my charm and set EULA value to true. Installation was successful. [18:34] I have written codes for install and uninstall decorated method in this link http://paste.ubuntu.com/14031988/ .. please correct me if I am wrong… [18:42] jamespage: Sorry, was on a call. I'm not sure I understand your question? [18:45] Prabakaran: Your "else" condition should instead be this: [18:45] remove_state 'license.accepted' [18:46] Instead of: set_state 'license.not.accepted' [18:48] k .. let me change my code and try with this [18:59] cory_fu: Prabakaran wants to have a license.not.accepted because he wants to tack action to uninstall in that case [19:00] mbruzek: I understand he wants to install when the license is "unaccepted" but what that really means is that "if installed and not license-accepted" do the install. So, in reactive, that's: @when('java.installed') + @when_not('license.accepted') [19:01] mbruzek: So, then, instead of adding a new state for "unaccepted" you would just react to the accepted state no longer being there. But, then, you have to remove the accepted state instead of adding a new state [19:02] cory_fu: Yes I have some pseudo-code here [19:02] http://paste.ubuntu.com/14032853/ [19:02] mbruzek: Did I explain that clearly? [19:02] Prabakaran: something like that. [19:02] mbruzek: The problem with your code is that you could end up in a situation where *both* states are set [19:03] mbruzek: Prabakaran's pastebin was actually closer to correct, save for my one suggested fix [19:05] mbruzek: With your code, if the user accepts the license, then ibm.javasdk.license.accepted gets set, and the java installed. But if they then unaccept the license, then ibm.javasdk.license.declined gets set (but ibm.javasdk.license.accepted is *still* set!) and now both blocks will run! [19:05] cory_fu: it was just pseudo-code to show Prabakaran how to decorate a config-changed hook [19:06] mbruzek: Yes, but the thing you called out (having a "declined" state) is wrong. :) [19:06] I wrote it while working on something else, so the logic may be off [19:06] cory_fu: thanks for pointing that out. [19:06] finally.. got worked out .. my code is running successfully.. Thank u all for the ur help and ur kind support... [19:07] Prabakaran: I defer to cory_fu on the reactive logic [19:07] mbruzek: Also, while the @hook 'config-changed' wrapper does make it more clear what is triggering that code, it's technically unnecessary. Without any @something wrapper, the code will *always* execute, which is actually ok for that particular block. [19:07] Thank u so much , [19:07] Prabakaran: Glad to hear it. :) [19:07] And no problem [19:08] cory_fu: that technical detail though, is probably not somethign we want ot promote [19:08] "dont decorate anything, and it runs" [19:08] i would rather advcoate for having highly detailed charms with decorators as to when something should run [19:08] lazypower: I tend to agree, yes [19:09] should i remove @hook 'config-changed' decorator [19:10] Prabakaran: It would be better to include it, because it makes your code more self-documenting [19:10] k thanks === JoshStrobl|Nap is now known as JoshStrobl === natefinch is now known as natefinch-afk [22:12] lazypower: I made more tests on juju bootstrapping [22:12] seems the problem was on networks, but still can't solve how to setup correctly === icezimm1 is now known as icezimm [22:39] lazypower: on juju bootstrap it allocate a machine on MAAS, my private network has internet access because I did these procedures ( http://askubuntu.com/a/499311 ) but containers do not get a public/private ip address according to this gist https://gist.github.com/fernandes/b9196da2d09059f60bdd#file-juju_error-log-L221-L239