=== wolsen_ is now known as wolsen === verterok is now known as verterok-away === JoshStrobl is now known as JoshStrobl|AFK [13:36] hi guys, I'm trying to install openstack using autopilot and when juju is going to install landscape server, I'm with a lot of messages like this 'machine-0: 2015-12-14 13:25:12 WARNING juju.state allwatcher.go:355 getting a private address for unit "landscape-server/0" failed: "private no address"', for private and public address.. if someone could point me on the direction of fixing this, I do really appreciate, thank you :) [13:38] sorry about using guys, hello everybody :) [13:39] icezimm: which version of Juju? 1.25 i assume? [13:48] gnuoy`, I think logging options could push down into the base layer [13:48] they are common across principle and subordinate charms I think [13:49] ack [13:54] lazypower: exactly, 1.25.0-wily-amd64 [13:58] icezimm: interesting, when you provision a node with maas/juju - do you see the same error output that it's unable to find the public/private addressing of the unit? or is it only that one node in maas? [14:04] lazypower: don't know exactly, I'm really new to this… I'm following the instructions here: http://www.ubuntu.com/download/cloud/install-openstack-with-autopilot [14:04] icezimm: try destroying the juju environment `juju destroy-environment maas` and then stand it backup with `juju bootstrap` and try `juju deploy ubuntu` [14:05] icezimm: once you've done juju deploy ubuntu, tail the logs while the unit provisions - `juju debug-log` [14:05] icezimm: i'm also making the assumption you've got nothing else in the environment, so you're free to nuke whats there and start from scratch [14:06] lazypower: I have this config.yaml and running the command on install.sh https://gist.github.com/fernandes/e055827d8ef8c9715a54 [14:06] sure, I'm using these machines as tests… can nuke without any problem [14:07] ERROR cannot read environment info: environment "maas" not found [14:08] ~/.cloud-install/juju/environments/ is empty [14:09] export JUJU_HOME=~/.cloud-install/juju [14:09] and now its bootstrapping [14:16] after bootstrap [14:16] Bootstrap agent installed [14:16] WARNING expected one instance, got 2 [14:16] Waiting for API to become available [14:16] Bootstrap complete [14:16] just this warning, but bootstrap ok [14:17] icezimm: so far so good [14:17] I'm watching the juju/all-machines.log [14:18] lazypower: https://gist.github.com/fernandes/e055827d8ef8c9715a54#file-all-machines-log [14:18] in case can help debugging something [14:19] but juju status show as agent started... [14:20] juju debug-log is the same as ssh logging on all machine and concatenate juju/all-machines.log ? [14:20] yep [14:20] good to know :) [14:20] you can also pass filters to juju debug-log with -i and -x so you can target specific machines [14:20] Added charm "cs:wily/ubuntu-1" to the environment. [14:20] great! [14:20] heheh [14:21] seems juju deploy ubuntu acquired a new machine from my maas ppol [14:21] *pool [14:33] gnuoy`, https://code.launchpad.net/~james-page/charm-helpers/mitaka/+merge/280449 [14:35] jamespage, +1 === verterok-away is now known as verterok [14:52] lazypower: ubuntu seems it was deployed [14:52] icezimm: no errors in the log? Also, did maas chose the same node? :) [14:53] *same node as you were trying to provision for landscape [14:53] hummm actually no [14:53] sudo openstack-install --openstack-release liberty --edit-placement --headless --debug --series wily -c config.yaml was booting machine 1 [14:53] bootstrapping juju [14:53] and then deploying services as containers [14:54] now juju deploy ubuntu got a new bare metal machine and installed on it [14:54] not as a container [15:04] 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 [15:04] this? [15:04] javasdk_license_accepted=`config-get accept-ibm-javasdk-license` @when 'java.connected' 'java.installed' '$javasdk_license_accepted== 'False' [15:04] javasdk_license_accepted=`config-get accept-ibm-javasdk-license` @when 'java.connected' 'java.installed' '$javasdk_license_accepted== 'False' [15:05] Hello Prabakaran. The decorator does not work on configuration options. cory_fu correct me if I am wrong. [15:06] Prabakaran: What I have done is create a method that will be called on "config-changed" such as: [15:06] @hook('config-changed') [15:06] def config(): [15:07] Prabakaran: Then you can check the configuration for accept-ibm-javasdk-license and set a state that your charm could react to. [15:08] accepted = hook.config().get('accept-ibm-javasdk-license') [15:08] [15:08] Now if accepted is true you can set_state("license.accepted') [15:08] And other methods could use: [15:08] @when('license.accepted') [15:09] but kwmonroe may have more experience with this so I defer to him [15:09] Prabakaran: Does that make sense? Do you have any questions? [15:11] mbruzek , @when('license.accepted') here how to get this license.accepted value from config.yaml file? [15:11] Prabakaran: Are you using python or bash? [15:12] here i think we have to change ...accepted = hook.config().get('accept-ibm-javasdk-license') [15:12] bash [15:12] Prabakaran: Oh OK. I gave you an example in bash [15:12] I mean python [15:13] OK so you already listed how to get the value from the config. [15:13] javasdk_license_accepted=`config-get accept-ibm-javasdk-license` [15:13] s [15:14] I don't think you can not use that variable in a @when clause though, cory_fu would know for sure. [15:14] Prabakaran: so you would need to create a hook for config-changed, read the value and then you can set a reactive state when the value is true or set a different state when false. [15:15] Prabakaran: then your methods could react to that state [15:16] if [ $javasdk_license_accepted == "True" ]; then [15:16] set_state 'license.accepted' [15:16] else: [15:16] set_state 'license.not.accepted' [15:16] fi [15:16] Something like that. I have not tested that code. [15:17] after you set the state then you can use that state in a @when or @when_not clause [15:17] k let test this [15:17] k thanks... [15:17] Prabakaran: but do that confg-get in the "config-changed" hook [15:17] let me test it and come back [15:17] OK [15:17] mbruzek: no your suggestions are correct. ou cannot use a @when decorator with config, you would instead check on the hook contest for config-changed, and set/remote a state depending on the value of the config option. [15:17] *context [15:20] before i have implemented something like that.. but while testing when i set EULA value to true it was installing but again i set EULA value to false it was not uninstalling...http://paste.ubuntu.com/14005951/ [15:20] i think i should not have a check for EULA in this http://paste.ubuntu.com/14005951/ [15:21] Prabakaran: you need to have a decorated method to uninstall when the value is false [15:21] Prabakaran: @when_not('license.accepted') def uninstall_ibm_jdk(): # uninstall the jdk [15:22] is it in python? or bash? [15:22] because i am writing in bash [15:22] Prabakaran: the example i just gave was python, but its very similar for bash [15:23] aisrael: siege, cassandra-stress, monogdb, pts, mysql-benchmark - am I missing any? [15:23] Prabakaran: you still need to check configuration parameters in config-changed that is the ONLY hook that is run when configuration changes. [15:24] kwmonroe: feel free to chime in here with some JDK knowledge [15:26] k and .. Thank you so much for this suggessions and explainations..let me implement and test my charm and come back to you if i have any doubts [15:26] Prabakaran: happy to help [15:26] lol [15:26] Prabakaran: I understand the reactive stuff is new, but it is very powerful [15:27] Prabakaran: I have written charms much faster and they are much smaller because I only react to the states that this layer needs [15:27] Prabakaran: I hope you find the same benefit [15:28] i want to read more about this ..can i have any links for the same? [15:29] i googled i have got some links but if u feel something good that can be shared to me .. [15:34] lazypower: was supposed to deploy on a container? or should I try to deploy openstack? [15:34] I am back again with one question .. using charm build command i have generated deployable charm which contains config changed hook in python.. can u please help me in writing code to have a check for EULA ..http://paste.ubuntu.com/14006238/ [15:35] icezimm: i would deploy landscape to a physical unit, and use that to stand up openstack w/ autopilot [15:35] icezimm: but admittedly, i have no experience with our openstack installer you were using [15:36] icezimm: disclaimer - i work in the eco, and i haven't touched every nook and cranny of the openstack suite we have :) [15:37] lazypower: eco you mean? heheh [15:37] no problem, thanks for the help, not I know (at least) juju is being bootstrapped correctly [15:40] icezimm: ah, im a juju charmer, and i work in the broader ecosystem. I've got some experience with openstack - but mostly i look at workload charms. App Container focused charms as it were. [15:41] hummm interesting hehehe [15:41] so a juju question hehehe [15:41] landscape exists only for trusty [15:41] no way to run on wily? [15:41] I mean, deploy [15:41] icezimm: there is a way, but it's not the prettiest [15:42] cool [15:42] because I'm asking openstack installer to use series wily [15:42] icezimm: you need to download the charm to your machine, and use deploy local: [15:42] icezimm: ah, from the openstack installer I don't know/think so [15:42] and I think it's trying to deploy landscape-server to wily [15:45] let me force series trusty [15:52] mbruzek: Sorry I'm late to the discussion, but I think what you suggested was correct. [15:53] kjackal: So, you were asking about https://github.com/juju-solutions/charms.reactive/blob/master/charms/reactive/relations.py#L498 and why remove_state calls set_state... [15:53] kwmonroe, admcleod1: ^ in case you're interested [15:54] kjackal: So, the answer is that it's because a state can be set for multiple conversations. You'll notice that there's a "conversations" list in the state value. That holds all the conversations that the state applies to, not just this one. So remove_state removes the current conversation from the list, and either updates the state with the new, shorter list, or removes it if it was the only one in the list to start with [15:55] So, that really should be "update_state" [15:55] But set and update are the same thing in this case. [15:56] let me digest this [15:57] jamespage, two new layers as discussed http://paste.ubuntu.com/14006647/ [16:00] cory_fu: So in my case the fact the state in not removed is because it was added actually two times, while it gets removed once? [16:00] kjackal: Correct. Which is what the fix in https://github.com/juju-solutions/charms.reactive/pull/41 is intended to rectify [16:00] kjackal: The "conversations" list was originally a set() object but then I found out that doesn't serialize properly. :/ [16:01] I see, that makes sense, because i see the state value increasing instead of decreasing [16:01] cool === JoshStrobl|AFK is now known as JoshStrobl [16:52] cory_fu: i filed a bug against what i pinged about re: charms.reactive all_states here: https://github.com/juju-solutions/charms.reactive/issues/42 [17:19] gnuoy`, took a run through those layers - did a few tweaks and tidied a bit [17:19] specifically [17:19] base_charm -> charm [17:19] dropped tox and test-requirements from higher layer charms [17:19] added metadata.yaml to openstack-api layer so inheriting charms don't have todo interfaces for db, messaging and identity. [17:19] pushed all that back to the repos... [17:22] jamespage, mp for review @ https://code.launchpad.net/~1chb1n/charm-helpers/os-amulet-test-mitaka/+merge/280480 [17:35] mbruzek: ha, looks like I'm not the only one irrationally resistant to layers (but I'm coming around) [18:32] marcoceppi, coreycb: hey whats going on? I am trying to add a wheel to the wheelhouse and have it install alongside the other default wheels in the wheelhouse on bootstrap of the charm. [18:33] marcoceppi, coreycb: Is this an reccomended best practice for installing python packages inside the context of the charm? [18:35] marcoceppi, coreycb: I also see the charmhelpers function from charmhelpers.contrib.python.packages import pip_install [18:36] lazypower: Replied to your ticket. I can't reproduce. :( [18:36] marcoceppi, coreycb: I have had no luck using either method.........might you bestow upon me the knowledge needed to make this happen? [18:37] bdx: what version of charm-tools do you have? `charm version` ? [18:37] charm-tools 1.10.1 [18:39] marcoceppi:^ [18:39] bdx: how are you adding the wheel? [18:40] marcoceppi: git clone https://github.com/locustio/locust.git, cd locust, python setup.py sdist [18:40] bdx: okay, normally wheelhouses are included by defining them in a wheelhouse.txt file [18:41] marcoceppi: cp dist/locustio-0.7.3.tar.gz charmdir/wheelhouse/ [18:41] ok [18:41] cory_fu: would have better guidance, not sure if that works, but I suppose it should [18:43] marcoceppi: Is there yet a standardized "best" way to install python packages from pip? [18:44] cory_fu, coreycb:^ [18:44] bdx, marcoceppi: Yeah, I would recommend adding the requirement line to wheelhouse.txt (you can point it at a git URL just fine) and let the build process manage it for you. You *could* manually put the file into the wheelhouse but you'd want to make sure it was not platform specific. We don't actually use wheels because of this, and instead just include source .tar.gz files [18:44] bdx: define them in the wheelhouse.txt https://github.com/juju-solutions/reactive-base-layer/blob/master/wheelhouse.txt [18:45] And to use a git URL, the format is: -e git+https://github.com/locustio/locust.git#egg=locust [18:45] (The -e, git+, and #egg= are all important) [18:46] You can also include @branch or @sha right before the #egg to use a specific branch or commit [18:46] cory_fu: awesome....it seems some pip packages (locust) have a requirement on python-dev ..... how would this be handled, if at all using wheelhouse? [18:47] python packages* [18:48] errrrr^, how are system level level deps handled* ? [18:48] bdx: Currently, it installs pip with all the recommended packages, so it pulls in python3-dev as well. There was some discussion about making that a layer option so that charms that don't use Python libs with compiled bits could install faster [18:48] cory_fu: ugh :\ [18:49] bdx: What other system-level deps do you mean? [18:49] lazypower, cory_fu, marcoceppi: locust for example only supports python2.7 [18:50] and requires python-dev as a system level deb [18:50] dep [18:50] lazypower: TBH, I don't see how that could possibly happen. all_states doesn't modify anything at all, it just calls get_states and makes an assertion about the result. :/ [18:50] bdx: is locust required for your hooks to run? [18:50] or is it part of the software you're installing? [18:51] marcoceppi: it is the primary software pkg I am *trying* to get installed [18:51] Yeah, what marcoceppi is getting at is that the wheelhouse is only intended for *charm* deps. i.e., libraries that are required for your charm code to run, not the the thing it's deploying [18:51] bdx: You shouldn't use the wheelhouse for that, then. [18:51] ^ [18:51] bdx: in your install decorator, just do subprocess.check_call(['pip', 'install', 'whatever']) Or, git clone/installing [18:52] lazypower, cory_fu, marcoceppi: ok, thats what I was thinking....but it needs python2 [18:52] *python2.7* [18:52] bdx: I'd recommend using charmhelpers.fetch.apt_install [18:52] bdx: yes, pip is python2, pip3 is python3, you can use the charmhelpers.fetch.apt_install to install python-dev [18:53] marcoceppi: does that change w/ xenial? [18:53] cory_fu, marcoceppi: got it, but then I can't install the python2 pkg [18:53] no matter what [18:53] as in, will pip be python3 pip, or is it still py2 pip (which... is no longer a thing i hear?) [18:53] lazypower: no idea [18:53] even if I ssh into the box and install from the box [18:53] apt_install(['python-dev', 'python-pip']) [18:53] subprocess.check_call(['pip2', 'install', 'locustio']) [18:53] lazypower: python2 is still athing [18:53] ok i'll mak eit a point to find out [18:53] lazypower: it's just not installed by default [18:54] there's a difference :) [18:54] i was inferring from stubs comments about py2 deprecation on a system level that we're headed for heartache in xenial [18:54] lazypower, marcoceppi: You can always be explicit and use pip2 [18:54] i may have mis-read into it [18:54] yesh [18:55] bdx: What do you mean you can't install the python2 package? [18:55] using from charmhelpers.contrib.python.packages import pip_install [18:55] or just in the terminal [18:55] when ssh'd into the box [18:56] cory_fu: although, I was running "pip install", not "pip2 install" ..... should "pip2" be the answer then? [18:56] bdx: I don't understand why you think that wouldn't work? [18:56] bdx: I'm pretty sure that even with python3 installed, "pip" is still the same as "pip2" [18:56] cory_fu: let me recreate, and grab you some hard data on this. [18:57] But being explicit isn't a bad thing, either [19:06] cory_fu, marcoceppi, lazypower: so whats up with "from charmhelpers.contrib.python.packages import pip_install" this only works for python3/pip3 pkgs? [19:06] bdx: hooks run as python3, so probably [19:08] marcoceppi: how to you feel about modifying the pip_install function to take an optional bool arg for pip2? [19:08] bdx: sounds fine [19:09] marcoceppi, cory_fu, lazypower: It doesn't look like pip2 is a thing ..... [19:10] bdx: Your reality does not seem to be the same as mine: http://pastebin.ubuntu.com/14011024/ :) [19:10] crazy [19:11] Also, it looks like pip_install only uses subprocess if it's creating a venv, for some reason. It should just always use subprocess: https://bazaar.launchpad.net/~charm-helpers/charm-helpers/devel/view/head:/charmhelpers/contrib/python/packages.py#L67 [19:11] cory_fu: my bad...didn't have python-pip as a dep [19:11] bdx: That'll do it. :) [19:12] marcoceppi, cory_fu, lazypower: I think I'm g2g now. Thank you all!! [19:12] bdx: Glad to help! [20:19] cory_fu, marcoceppi, lazypower: Is charmbenchmark the best way to get stdout from an action? [20:20] cory_fu, marcoceppi, lazypower: Also, if charmbenchmark is used, should it then be added to the wheelhouse? [20:20] bdx: charmbenchmark is a depricated library [20:20] bdx: charms.benchmark is the new library [20:20] bdx: but it doesn't get stdout from an action, it uses action-get and action-set to send and recieve action data [20:21] bdx: it's meant as an easy wrapper for benchmark actions [20:21] bdx: charmhelpers.core.hookenv has an action_get, action_set, and action_fail method [20:22] marcoceppi: gotcha, I see that.... I'm trying to return a few values to the user after the action is ran, what is the way in which I should go about this? [20:22] bdx: action_set('key', value) [20:24] marcoceppi: but action_set and action_get must be called from the action.....right? [20:24] bdx: yes [20:25] marcoceppi: How can I return values to the user executing the action? [20:25] action_set [20:26] bdx: action_get is used to recieve the parameters a use has set for the action, action_set returns data to the user from that action [20:26] both can only be run from an action [20:26] marcoceppi: e.g. I want my users to run "juju action do locust/0 run-tests --params params.yaml" [20:27] marcoceppi: following that command, I want to return a ip:port to the user [20:27] okay, you have to use action_set to send the data, eg: action_set('address', ip:port) [20:28] marcoceppi: I get that....where does that send the data? [20:28] bdx: the user has to run juju action fetch , the UUID will be presented when they do juju action do [20:29] marcoceppi: ok, awesome, thats what I was looking for! Thank you [20:29] bdx: sure, np! [21:12] how can I handle sharing functionality between reactive handlers and action handlers without resorting to weird hacky things like messing with the load path? [21:12] Icey: path :cop: approves of this question ^ [21:13] cory_fu: ^? [21:13] Icey: There is an open issue (https://github.com/juju-solutions/charms.reactive/issues/11) related to this. Currently, there is no built-in support for actions in charm-build nor in reactive. [21:14] I think that we should do it, but charm authors will need to be aware that *all* handlers whose conditions match will be run. So if you don't guard properly, you could have actions doing things like restarting your service because you assume "hook run means something changed" [21:14] cory_fu; wait so build doesn't merge actions.yaml? [21:14] good to know. i had not considered that when building out my layers [21:14] lazypower: No, it doesn't. :( [21:15] At least, I'm pretty certain it doesn't [21:15] I generally think that the actions should NOT share functionality with Hooks, but that Hooks and Actions should both call helper functions to handle their shared functionality ;-) [21:15] that'll change at some point i'm willing to bet [21:15] lazypower: that's more a charm-tools issue, but it's imporant [21:15] marcoceppi: oh i agree, and i said 'build' :) [21:15] * marcoceppi misread [21:16] lazypower: We need an ActionYAML that is a trivial subclass of YAMLTactic in: https://github.com/juju/charm-tools/blob/master/charmtools/build/tactics.py#L622 [21:16] lazypower cory_fu: https://github.com/juju/charm-tools/issues/82 [21:16] But if we want to have proper reactive support, it will also need to build the hooks out [21:16] cory_fu: is that a prompt for me to get un lazy and go contribute? [21:16] i can see merging the actions yaml and including w/e is in actions/* [21:17] i'm undecided on if actions in reactive is a good thing [21:17] i'm already generating a script that matches the definition in actions.yaml, i dont know that generating them with decorators really saves me anything other than creating the file [21:17] it actually limits me in what my action is written in if i'm mixing bash and python actions [21:18] lazypower I'd like actions to be a lot like old school hooks [21:18] you can have bash scripts [21:18] or maybe not even a script at all, maybe i stuff in a binary that ships w/ whatever service and convert the flags to options that it passes to the binary [21:18] you can have an actions.py with links [21:18] or maybe i'm just pulling stuff out of the air now [21:18] I think actions in reactive is the right way forward, tbh [21:18] but I am in the minority [21:19] marcoceppi: to you, whats the benefit of actions in reactive? [21:19] lazypower: I think for now, just having it merge the yaml is enough [21:19] i'm asking more for my education [21:19] as i've noodled this topic for about, 40 seconds. [21:19] clearly i'm an authority [21:20] lazypower: one place to manage my code, the model is all reactive, and I can more easily assert and manage states in actions [21:20] hmm [21:20] thats fair [21:20] lazypower: however [21:20] @when('backup.is_complete') [21:20] I think there's a middle ground [21:20] actually [21:20] whats stopping you from doing that today? [21:20] you can call charms.reactive set_state backup.is_complete and still handle it on your next update-status run [21:20] lazypower: actions are not hooks [21:21] oh, sure, but I also have to mung paths [21:21] the source tree isn't as clean [21:21] path :cop: disapproves of path munging [21:22] lazypower: I think the way forward is, if actions/ exists, leave be, otherwise auto-generate stub and assume it's reactive [21:22] +1 to that marcoceppi [21:23] lazypower Icey however, the second half of that is a bit more complicated to produce, since it requires changes to the reactive framework [21:23] that makes sense [21:24] marcoceppi: Eh, not much. Mostly just adding an @action decorator. I don't think it needs anything else? [21:24] cory_fu: okay, maybe it's not hard [21:24] and yeah i'm 100% for getting the yaml merge first, hten tackling the reactive bits in tandem wl/ the generator(s) [21:24] * marcoceppi was just guessing [21:24] And you could probably use @hook in the meantime [21:24] can I access config inside of an action? [21:24] Icey: you should be able to [21:24] its an anonymous hook context, so sure [21:24] :) [21:24] cory_fu: depends on how "hook name" is determined [21:25] marcoceppi: It uses $0 [21:25] oh, cool [21:25] Technically, it looks for $JUJU_HOOK_NAME and falls back to $0, but JUJU_HOOK_NAME is only set in debug-hooks [21:25] And presumably wouldn't be set for an action even during debug-hooks [21:26] nope [21:26] So @hook should really Just Work, but we need to have an alias so that it's clear that it's intended for actions [21:26] * marcoceppi acks [21:26] Maybe I'll take a stab at that over the holidays [21:27] marcoceppi: If you merge https://github.com/juju/charm-tools/pull/75 it should be pretty trivial [21:29] cory_fu: merged, this also has conflicts now https://github.com/juju/charm-tools/pull/68 [21:29] marcoceppi: Well, I guess it'd need a little refactoring; the DynamicHookBind class would need a prefix option that could be overridden to switch "hooks" for "actions" [21:29] cory_fu: I'll be looking to release 1.11.0 this week [21:29] Nice [21:29] marcoceppi: movin right along man! we've got a nice rel cadence going with c-tools [21:30] hattip @ you and the contributors [21:30] lazypower: the day releases slow down, is the day cory_fu stops making charm build better ;) [21:31] cory_fu: i will bribe you with as much pizza as you can carry [21:31] cory_fu: and scotch [21:31] marcoceppi: Resolved [21:35] marcoceppi: So yeah, if you want to take a stab at adding generated actions now, just look at how it's done now for StorageBind. You'll need a new subclass of DynamicHookBind and a similar method in build/__init__.py:Builder.plan_{interfaces,storage,actions} (maybe those could be refactored) [21:35] cool [21:36] As I said before, DynamicHookBind will need to override the dir prefix, and the HOOKS list for ActionsBind would just be ['{}'] [21:36] (i.e., use the action name as the file name, no suffix) === blahdeblah_ is now known as blahdeblah [22:34] i have a juju action parameter that needs to be any type. Can i just use type: object for that? [23:28] cholcombe: why not string?