/srv/irclogs.ubuntu.com/2017/04/28/#juju.txt

=== bdx_ is now known as bdx
bdxI'm wondering how python3 can be used as the default python for trusty based *legacy* charms ...00:43
bdxit seems it would have to be installed prior to the running of hooks.py00:43
bdxso, if you can't use the 'install' hook to install python3 (because python3 needed for hooks.py to run)00:45
bdxthen how is it done?00:45
bdxthere must be a way00:45
bdxI'm thinking execd preinstall?00:45
hloeunginstall hook wrapper where the install hook is a shell script that installs python300:46
hloeungand then calls hooks.py's install hook00:46
wgrantRight, install doesn't have to be a symlink.00:46
hloeungbdx: ^00:46
wgrantAll the others usually are, but install can be a script which checks the environment and then calls hooks.py00:46
bdxhloeung: thats great! thank you!00:47
bdxhloeung, wgrant: this is probably why I see 'install.real' files laying around then I'm thinking00:49
bdxahh like this https://github.com/openstack/charm-glance/blob/master/hooks/install00:50
hloeungbdx: yeah, just like that00:51
=== mup_ is now known as mup
kjackalGood morning Juju world!06:57
=== frankban|afk is now known as frankban
erik_lonroth3_Hello! I'm writing  tutorial in how to create a new "layer" in juju. Is the proper start for that by using charm-create <name-of-layer> or how would you recommend that a beginner starts developing layers?09:55
erik_lonroth3_The tutorial will build on the last one I wrote and are now updating also to accomodate for a series of tutorials.09:56
=== fnordahl_ is now known as fnordahl
=== tinwood is now known as tinwood_lunch
tvansteenburgherik_lonroth: yeah, `charm create` is correct12:03
erik_lonroth3_OK. Thanx. Its not clear from the documentation that a layer is the same thing in essence as a charm.12:09
erik_lonroth3_I also would need some help to understand when to place configuration options in the "layers.yaml" vs. config.yaml12:11
magicaltrout config.yaml is for user editable configuration options mostly erik_lonroth3_12:12
magicaltroutlike "i want to make this port configurable"12:12
erik_lonroth3_So, the layer.yaml is for ?12:13
erik_lonroth3_... when do I place configuration in there?12:13
magicaltroutdunno12:13
tvansteenburghit's mainly for configuring the layers below yours, if you need to12:13
magicaltroutlayer.yaml is for the stacking of other layers your charm depends on12:13
magicaltroutmostly12:13
erik_lonroth3_According to the documentation in the base-layer, it seems like those configuration options in the layer.yaml is intended for being over-ridden by layers above.12:14
erik_lonroth3_So, if I create a charm on top of base-layer, I can use those options from within my own charm. Is that right?12:15
tvansteenburghyou can set those options at build time, in your layer.yaml12:16
tvansteenburghthey're not meant to be use at run time like config options from config.yaml12:17
erik_lonroth3_Ah.12:17
erik_lonroth3_So, its build-time configuration.12:18
tvansteenburghyep12:18
tvansteenburgherik_lonroth3_: concrete example from the 'apt' layer: https://git.launchpad.net/layer-apt/tree/README.md#n15812:19
tvansteenburgh(line 158)12:19
tvansteenburghin the example yaml on line 169, options are being set for layer basic and layer apt12:20
erik_lonroth3_tvansteenburgh: Thats a great example!12:22
=== tinwood_lunch is now known as tinwood
=== freyes__ is now known as freyes
=== Guest24728 is now known as zeus
erik_lonroth3_Is it nessecary at all to write 'hooks' (start,stop,install,etc.) if you do charms the 'reactive' way instead ?13:37
jrwrenerik_lonroth3_: no, I think `charm build` creates them for you.13:38
erik_lonroth3_jrwren: I dont follow exactly. What I don't get, is if I need to create files in the "hooks/" dirctory aswell as create the code in the "reactive/" directory.13:49
tvansteenburgherik_lonroth3_: you don't need to create anything in hooks/13:50
tvansteenburgh`charm build` will do that for you13:50
erik_lonroth3_Thats weird since the build-process complain if I don't create them...13:50
tvansteenburgherik_lonroth3_: pastebin a directory listing of your charm, and the error you're seeing13:51
tvansteenburgherik_lonroth3_: did you create an empty hooks/ dir?13:52
tvansteenburgherik_lonroth3_: if so, delete it and rebuild13:53
erik_lonroth3_Hmm, I think your kind of right. https://pastebin.com/uaSvn9c113:55
erik_lonroth3_However, if I follow the 'recommendations' in the "Information" - I end up in a bad situation.13:55
tvansteenburgherik_lonroth3_: are you running `charm proof` before `charm build`?13:56
erik_lonroth3_yeah13:56
tvansteenburghok yeah, that won't work13:56
tvansteenburghright now you have a layer. you have to `charm build` to turn it into a valid charm13:57
tvansteenburgherik_lonroth3_: would you be willing to submit a PR to fix the docs that tripped you up?13:57
tvansteenburghbecause that would be great13:57
erik_lonroth3_I can do that.14:11
erik_lonroth3_Do I also have to do "charm-build" for layers?14:12
erik_lonroth3_... as well as for charms and interfaces ?14:12
tvansteenburgherik_lonroth3_: you only do `charm build` if you are making a charm14:14
tvansteenburghlayers are the building blocks of charms14:15
tvansteenburgh`charm build` combines them together to make a functional charm14:15
erik_lonroth3_not if I'm making a layer?  This is confusing14:16
erik_lonroth3_I understand what you are saying, but I fund the documentation quite difficult to follow and digest... Thanx for answering my questions...14:18
erik_lonroth3_... So, if I understand you right. Layers are not charms?14:19
tvansteenburgherik_lonroth3_: for example, the apt layer is a layer, but it is not built into a charm - it's meant to be used by other charms14:19
tvansteenburgherik_lonroth3_: layers are not charms14:19
erik_lonroth3_I got that. But how about when I build and intend to distribute my "charm" that builds on a "layer". Wouldn't I have to distribute that "layer" also ?14:20
tvansteenburghlayers are like the source code. when you build them (with `charm build`), you get a charm14:20
erik_lonroth3_Ah, good description.14:21
tvansteenburghyou don't have to distribute the layer. the built charm is what juju deploys.14:21
erik_lonroth3_I'm going to "rip" that explanation in my tutorials14:21
tvansteenburghbut, most people do make their layers available on github or something14:22
tvansteenburghand if your layer is meant to be reused, you can register it here http://interfaces.juju.solutions/14:22
erik_lonroth3_Yeah, I guess its kind of key to have those layers accessible if you intend to build on them.14:22
erik_lonroth3_But at what point do I then create a "charm" as opposed to "layer" if there is nothing that in the process of creating them is different?14:25
tvansteenburgherik_lonroth3_: the charm is the "compiled" output of one or more layers14:27
tvansteenburghyou can `charm build` as often as you want14:27
erik_lonroth3_So I decide for my self if a layer should become a charm or not ?14:27
tvansteenburghfor every change you make to your layer source, you could charm build and push the built charm to the charm store14:28
tvansteenburghyes14:28
erik_lonroth3_OK, that also explains more to me.14:28
tvansteenburghare you building something that you're unsure should be a charm or not?14:29
erik_lonroth3_No not really. I'm creating tutorials to help my collegues to get started with this also. I've written a "hello-world" tutorial that produces a very simple charm. I started today working on doing a "layer" tutorial. That has come to a point where I realize that the reactive framework is a "must" and that I need to re-write the tutorial now =D14:32
erik_lonroth3_https://github.com/erik78se/hello-world/wiki14:33
bildzgood morning15:37
bildzis anyone monitoring their juju openstack with elk15:37
bildz?15:37
admcleodbildz: not yet, thinking about it - why do you ask?15:49
salmankhanerik_lonroth3_: (y)15:53
=== frankban is now known as frankban|afk
kwmonroehey marcoceppi - bdx needs a charm-kibana in https://github.com/charms.  will you make that happen (with elastic-ops as an admin)?17:14
bdxkwmonroe: thx17:14
bdxmarcoceppi: thx17:15
kwmonroebdx: just to make sure, you want to commit an old-style charm there, right?  the convention is layer-foo for layered source and charm-foo for the older style (like the elasticsearch charm)17:15
bdxooh17:15
bdxI did not know17:15
bdxthat makes sense17:15
kwmonroeyeah so bdx, do you want charm-kibana or layer-kibana?17:16
bdxboth17:16
kwmonroeha!  for why?17:16
bdxhttps://github.com/jamesbeedy/juju-charm-kibana17:17
kwmonroeok - that's a good looking candidate for layer-kibana.  what would you be committing to charm-kibana (remember we don't need to commit the built charm artifact anymore)17:18
bdxyeah ... I need to fix all my repo names now17:18
bdxlol17:18
bdxyeah, so in that case only a layer-kibana I guess17:19
kwmonroemeh - whatever works for you is cool.  just noting the convention for ./charms and ./juju-solutions github orgs.17:19
bdxtotally17:19
kwmonroeok - so marcoceppi, s/charm-kibana/layer-kibana in the charms org please.17:19
erik_lonrothI'm trying to remove a charm stuck in en error state... I'm trying 'juju remove-application hello-world-reactive' but it wont go away. I'm probably doing something wrong... Can you tell me how you guys debug and remove charms stuck in error state?19:29
hmlerik_lonroth: have you tried removing the unit?19:31
hmlerik_lonroth: sometimes it’s hard to catch the hooks in a good state to do something with the removal request19:31
erik_lonrothnot yet... would "the unit" also destroy my host vm ? I don't want to destroy the vm19:32
hmli’m not sure what your host vm refers to19:33
hmlthe controller? the juju machine the unit is installed on?19:34
erik_lonrothYeah, the "machine" = "host vm"19:34
erik_lonrothI tried "juju remove-unit" now also... no luck19:35
hmlyes, remove-unit also destroys the juju machine that the unit is installed on.  a juju machine can be a lot of different things19:35
tvansteenburgherik_lonroth: use `juju debug-log` to debug19:35
erik_lonrothAh, ok19:35
tvansteenburghyou want to find out what's broken before destroying it19:35
tvansteenburghthen you can fix your charm, rebuild it locally, and then use the `juju upgrade-charm` command to upload your new (fixed) charm over the top of the broken one19:36
tvansteenburghsee `juju debug-log -h` for helpful options, especially --replay and -i <unit>19:38
erik_lonroththanx!!!19:39
hmlthere is also a juju debug-hooks command if the error is in a hook19:39
tvansteenburghalso, with `juju upgrade-charm` you'll want to use the --path arg to upgrade to the freshly built charm on your local filesytem19:39
erik_lonrothI did: "erik@snowflake:~/git/juju/charms$ juju upgrade-charm hello-world-reactive --path ~/charms/trusty/hello-world-reactive" but its still there.19:48
erik_lonroththe debug-log contains some hint perhaps: "juju.worker.uniter awaiting error resolution for "install" hook"19:50
erik_lonrothNow it seems its just adding to the model... Added charm "local:xenial/hello-world-reactive-4" to the model.19:55
erik_lonroth"juju resolved --no-retry hello-world-reactive/0" seemed to remove it.19:59
marcoceppibdx: kwmonroe done20:38
kwmonroethx marcoceppi20:41
bildzadmcleod: setting it up now20:48

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!