Skip to content

Instantly share code, notes, and snippets.

@jrgifford
Created December 2, 2011 18:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jrgifford/1424323 to your computer and use it in GitHub Desktop.
Save jrgifford/1424323 to your computer and use it in GitHub Desktop.
charm school for 02/12/2011
10:02 jcastro: Ok, welcome everyone to the first ever #juju charm school
10:02 jcastro: we'll give it another minute for the stragglers to arrive
10:02 niemeyer: rog, mpl: => #juju-tmp
10:03 mpl: niemeyer: ah yes, silly me, your message pointing to that url (with zk) is from september. I had the rename the other way around in my head, sorry.
10:03 ! fmo [c3bcb401@gateway/web/freenode/ip.195.188.180.1] has joined #juju
10:03 ! chmac [~chmac@cpc1-sgyl17-0-0-cust335.sgyl.cable.virginmedia.com] has joined #juju
10:03 niemeyer: TheMue: => #juju-tmp
10:04 ! nijaba [~quassel@unaffiliated/nijaba] has joined #juju
10:05 ! chute [~chute@84.121.89.190.dyn.user.ono.com] has joined #juju
10:05 ! jasox [~jxx@178.239.26.139] has joined #juju
10:06 jcastro: Ok everyone.
10:06 jcastro: Welcome to the first ever virtual charm school!!!
10:06 jcastro: I am your emcee, Jorge Castro
10:06 jcastro: I work on the community team at Canonical on Cloud
10:06 jcastro: I am joined today by ....
10:06 m_3_: Hi all, I'm Mark Mims
10:07 m_3_: I'm here to help answer charm questions
10:07 jcastro: ok
10:07 ! ivoks [~ivoks@ubuntu/member/ivoks] has joined #juju
10:07 jcastro: so first off, we'd like to see who's here to learn, so everyone who is here for charm school, raise your hand and give us a one line description of yourself
10:07 medberry: o/
10:07 ivoks: \o
10:07 ! sidnei [~sidnei@189-10-170-38.cslce701.dsl.brasiltelecom.net.br] has joined #juju
10:08 ! sergio_ [~quassel@130.60.44.74] has joined #juju
10:08 marcoceppi: o/ I love juju
10:08 TheMue: o/
10:08 nijaba: o/ (just a pm having a look)
10:08 chute: o/
10:08 ! sergio_ is now known as Guest31766
10:08 ahs3: o/
10:09 ! Guest31766 [~quassel@130.60.44.74] has quit [Client Quit]
10:09 uksysadmin: o/ interested in learning how to deploy cloud environments in (as well as bare metal provisioning of) OpenStack
10:09 jcastro: oh nice one. :)
10:09 ! sergio__ [~quassel@130.60.44.74] has joined #juju
10:09 ! ademas [~ademas@174.141.63.162.nw.nuvox.net] has joined #juju
10:09 ! sidnei [~sidnei@189-10-170-38.cslce701.dsl.brasiltelecom.net.br] has quit [Client Quit]
10:09 jcastro: ok so first, before we get into details on charms
10:10 ! sidnei [~sidnei@189-10-170-38.cslce701.dsl.brasiltelecom.net.br] has joined #juju
10:10 jcastro: let me arm you with some docs and links, that you can reference
10:10 jcastro: first off, obviously, we have: https://juju.ubuntu.com/ and https://juju.ubuntu.com/docs
10:10 ! ademas [~ademas@174.141.63.162.nw.nuvox.net] has quit [Remote host closed the connection]
10:10 jcastro: which is where we centralize all the information on juju
10:10 jcastro: for news about juju and the latest charms, we put that on http://cloud.ubuntu.com
10:11 jcastro: for example yesterday someone submitted a status.net charm
10:11 jcastro: http://cloud.ubuntu.com/2011/12/deploying-status-net-quickly-with-juju/
10:11 ! ademas [~ademas@174.141.63.162.nw.nuvox.net] has joined #juju
10:11 jcastro: We like to heavily talk about new charms
10:11 ! ademas [~ademas@174.141.63.162.nw.nuvox.net] has quit [Remote host closed the connection]
10:11 jcastro: because while juju is an amazing tool, it's the charms that make it useful
10:11 jcastro: in the same way that you might love apt, but you really love the huge repository that comes along with it
10:11 ! ademas [~ademas@174.141.63.162.nw.nuvox.net] has joined #juju
10:11 ! Mmike [~msplival@cpe-188-129-65-165.dynamic.amis.hr] has joined #juju
10:12 jcastro: so we're running these sessions to help people write charms for things they care about.
10:12 jcastro: So, before we get into the anatomy of a charm
10:12 jcastro: does anyone have any questions so far?
10:12 jcastro: hopefully you understand enough about juju to grasp the concepts.
10:12 jcastro: but if you don't, we can get you started on the right road.
10:13 medberry: how does one charm a package to use mysql when the current package has depends for a locally installed mysql?
10:13 medberry: erm, to use the mysql on another box....
10:13 fmo: Do you consider juju ready for production environments?
10:13 jcastro: medberry: mark is answering yours now
10:13 jcastro: fmo: we consider it a tech preview in 11.10
10:14 m_3_: medberry: so the key here is to write a relation hook for your service
10:14 fmo: Thank you, it's a bit out of scope but is it the same for Orchestra?
10:14 jcastro: fmo: it's at the stage where you would start to look at it for 12.04ish timeframe deployment.
10:14 m_3_: medberry: that relation hook would essentially reconfigure your app to point to the remote mysql instance
10:15 medberry: nod. m_3, thanks. Is there an example charm (off the top of your head) I should refer to that does this?
10:15 m_3_: medberry: it does this by exchanging crediential info for a db with the mysql charm
10:15 jcastro: fmo: Not quite sure on orchestra but I /believe/ it's at the same level, though orchestra bundles some things that are already mature, like squid, etc.
10:15 ivoks: m_3_: but you would still end up with unused mysql-server running on 'app' node, wouldn't it? i think this is a packaging bug
10:15 fmo: thank you :)
10:15 m_3_: lots of charms connect to mysql this way... mediawiki would be a good one
10:16 medberry: fmo, I believe you can consider Orchestra more mature than Juju and ready for deployments. zul may know more.
10:16 medberry: m_3_, thanks, I'll look at it (and others)
10:16 m_3_: ivoks: your relation hook could pass debconf info and dpkg-reconfig the package though
10:16 ivoks: m_3_: right, thanks
10:16 m_3_: ivoks: so what you would do depends on the interface exposed by the package itself
10:17 * medberry was thinking specifically of moodle if someone wants the context.
10:17 jcastro: oh are you working on moodle?
10:17 jcastro: that would be great!
10:17 * m_3_ grins
10:18 jcastro: ok, this brings me to the next quick topic, who has written a charm already? and who is planning on working on one?
10:18 * nijaba plans on doing one for limesurvey
10:18 jcastro: and does anyone have an itch to scratch to work on a certain charm?
10:19 uksysadmin: o/ as far as getting a basic something going (like nginx behind haproxy) to try and understand the concepts
10:19 ivoks: o/ postfix-dovecot
10:19 ivoks: (as soon as i find time :)
10:19 nijaba: (same here)
10:20 marcoceppi: o/ finishing phpmyadmin and steam
10:20 jcastro: (steam in this context is being able to quickly deploy a steam server for game clients to connect)
10:20 medberry: jcastro, yep, and someone has pointed out in O and P moodle only has a recommends on the server bits (not a depends like in Lucid.)
10:21 jcastro: o/ I'm working on an alice IRC charm, which is a self hosted web irc client.
10:21 jcastro: ok, so let's start with looking at the anatomy of a charm
10:21 medberry: marcoceppi, I saw that Aleph One was just released fully open source...
10:22 * marcoceppi nods
10:22 jcastro: but before we start a charm
10:23 jcastro: you need to map out what you want your charm to do
10:23 jcastro: https://juju.ubuntu.com/docs/write-charm.html#have-a-plan
10:23 jcastro: in this document we outline some tips in the things you need to think about when planning out how to write your first charm.
10:23 jcastro: usually I make a quick mindmap of what I need
10:23 jcastro: so for example
10:23 jcastro: status.net
10:24 jcastro: I know I'll need mysql
10:24 mainerror: o/ - I'm a juju fanboy.
10:24 * mainerror is also late
10:24 jcastro: and that the charm would have a relationship with mysql
10:24 ! dannf [~dannf@complete.lackof.org] has joined #juju
10:24 hazmat: /join #juju-tmp
10:24 jcastro: http://charms.kapilt.com/interfaces/mysql
10:24 m_3_: http://pad.ubuntu.com/charmschool-2011-12-02
10:24 jcastro: I can then see what other programs use mysql
10:25 jcastro: this is useful because now I can look at other LAMP projects and use that to build my charm
10:25 jcastro: which is what we want, reuse.
10:25 jcastro: So you can use the charm browser to look for other services that have relationships with services you care about
10:25 jcastro: The guy who wrote the status.net charm just derived it from his last LAMP charm
10:26 jcastro: part time, it was only 2 days from first cut to being accepted into the charm school
10:26 jcastro: and Marco/Clint are working on some convenience tools to make common tasks easier
10:26 ! sergio__ [~quassel@130.60.44.74] has quit [Ping timeout: 244 seconds]
10:26 jcastro: marcoceppi: can you explain about your convenience functions?
10:26 jcastro: (and then we'll go into this: http://pad.ubuntu.com/charmschool-2011-12-02)
10:27 jcastro: wrong URL, I mean this: http://pad.ubuntu.com/charmschool-2011-12-02
10:28 jcastro: ok we can get back to Marco
10:28 marcoceppi: Sure, so I wrote a few functions that I found myself using a lot in bash, primarily ch_get_file which is passed a file url and either a url to it's hash (md5, sha1, etc) or the actual hash itself. From there it'll download/compare file -> hash
10:28 ! rog [~rog@host-92-23-142-121.as13285.net] has quit [Read error: Connection reset by peer]
10:28 ! rog [~rog@host-92-23-142-121.as13285.net] has joined #juju
10:28 marcoceppi: There are a few others, check if a string is a file or a url, check if a string is a valid hash
10:30 marcoceppi: You can find them: http://bazaar.launchpad.net/~charmers/charm-tools/trunk/view/head:/helpers/sh/net.sh to use in a charm make sure you have the juju ppa added, install charm-helper-sh, and source /usr/share/charm-helper/sh/net.sh
10:30 ! chmac [~chmac@cpc1-sgyl17-0-0-cust335.sgyl.cable.virginmedia.com] has quit [Ping timeout: 252 seconds]
10:30 SpamapS: marcoceppi: FYI, there is a PPA just for those helpers, ppa:charmers/charm-helpers
10:30 marcoceppi: I believe the idea is to grow out charm helpers to include helper functions in all the languages
10:30 marcoceppi: <3 SpamapS
10:30 jcastro: and if I make something I think can be reused, do we just submit it to charm tools?
10:30 SpamapS: marcoceppi: otherwise you'll pull in a new version of juju
10:30 ! GNUardo [~GNUardo@38.135.217.87.dynamic.jazztel.es] has quit [Remote host closed the connection]
10:31 m_3_: SpamapS: yay!
10:31 SpamapS: they'll be in the distro for 12.04
10:31 jcastro: Since we're just getting a bunch of charms started, if you're writing a charm and feel that you can improve the charm tools to make it better for the next person, then we certainly encourage you to do that.
10:32 marcoceppi: definitely
10:32 jcastro: ok, any questions on the tools before m_3_ gets into the meat of a charm?
10:34 jcastro: ok, moving on ....
10:34 SpamapS: are the tools webscale?
10:34 SpamapS: ;)
10:34 jcastro: everyone should have this URL open: http://pad.ubuntu.com/charmschool-2011-12-02
10:34 jcastro: and we'll review this charm
10:35 jcastro: Mark will bold the sections of the document he's talking about
10:35 jcastro: and then when he moves on he'll unbold it and then bold the section he'll be reviewing next.
10:35 m_3_: I'll give people a sec to join the pad
10:35 marcoceppi: pad needs syntax highlighting :P
10:37 m_3_: ok, so we'll make sure everyone has juju installed and working in a bit... first of all, let's cover some basic concepts of charms with an example
10:37 m_3_: I pulled a community-contributed charm off the list... just landed yesterday or the day before
10:37 ! TheMue [~fmueller@pC19F673A.dip.t-dialin.net] has quit [Ping timeout: 252 seconds]
10:38 m_3_: so the first section we have is a basic listing of the charm contents
10:38 m_3_: notice there're a couple of yaml files, a copyright, and then a set of scripts in the hooks/ directory
10:39 m_3_: the scripts in the hooks/ directory are all in shell for this example
10:39 m_3_: but juju takes great pains to be language/tool agnostic
10:40 m_3_: you can use your fav toolset.. hooks just have to run and exit with return codes similar to a shell script ( 0 is good )
10:40 m_3_: so before we dig into the contents of the hooks
10:40 m_3_: let's see what this charm is / does
10:40 m_3_: take a look at the metadata
10:41 * m_3_ not a fast etherpad formatter :)
10:41 m_3_: so it looks like the service described by this charm...
10:41 m_3_: consumes a db (mysql in this case)
10:42 m_3_: and presents a website
10:42 m_3_: ok, that's pretty simple... and has a _lot_ in common with other services
10:42 m_3_: so juju uses this metadata specification to stitch together different services
10:43 m_3_: when juju spins a service unit up for this charm
10:43 ! chmac [~chmac@cpc1-sgyl17-0-0-cust335.sgyl.cable.virginmedia.com] has joined #juju
10:43 m_3_: it can 'relate' other services that match up
10:44 m_3_: (does this by your command of course... but we'll get to the juju cli in a bit)
10:44 chmac: Any insight on where adding Rackspace support lies in the priority list for the juju project?
10:44 chmac: We're based in the UK and so UK IPs are a big must at the moment, which means AWS is out as they only have an Irish presence, nothing in the UK itself.
10:45 chmac: Otherwise, I'd be very interested in experimenting with juju, it sounds like an awesome project.
10:45 m_3_: chmac: juju can handle a number of different providers
10:45 m_3_: including openstack
10:45 m_3_: so when juju spins up a service unit for this charm
10:45 m_3_: the first hook it calls is 'install' naturally enough
10:46 m_3_: please take a sec to look at the install hook in the pa
10:46 m_3_: pad
10:46 m_3_: starts off installing ppas and packages
10:47 m_3_: it's worth noting here that juju charms can be used to install services that install from packages
10:47 m_3_: but it can also be used to install other ways as well
10:47 m_3_: you can clone directly from the tip of your source code repo if you'd like
10:47 m_3_: anything goes
10:48 m_3_: for charms contributed back to the community please prefer packages when available
10:48 m_3_: but that's not necessary
10:48 m_3_: so this particular charm adds ppas/and packages
10:49 m_3_: then 'ch_get's a file from status.net
10:49 m_3_: (this is one of marco's tools to download and cryptographically verify payloads in charms)
10:49 m_3_: anyway... rest of the script is pretty clear
10:49 m_3_: note the open-port at the bottom
10:50 m_3_: juju defaults to everything closed off... you have to explicitly open what you want via the 'juju expose' command
10:50 m_3_: so that's install
10:50 m_3_: there're start/stop hooks too... these're usually trivial 'service xxx start'
10:51 medberry: so if you fail the open-port, there are iptables that prevent it? (firewall rules?)
10:51 m_3_: correct
10:51 m_3_: (not exactly iptables always)
10:51 m_3_: depends on the provider
10:51 medberry: ah, aws / openstack port rules, gotcha.
10:51 m_3_: (and still in development iirc on bare-metal provider)
10:52 m_3_: so some charms are for services that just install a service and spin it up
10:52 m_3_: some services don't relate to other services
10:52 m_3_: and we'd be done if that were the case for status.net
10:52 m_3_: here, we need a db
10:52 m_3_: and we could potentially add a reverse-proxy in front of it
10:53 m_3_: etc etc
10:53 m_3_: so before we move on to relations...
10:53 m_3_: any questions so far?
10:53 jcastro: relations are the real meat of charms, so we'll pause here for questions
10:55 m_3_: ok, on to relations!!
10:55 m_3_: now this is the really cool part of juju... ok _a_ really cool part of juju
10:55 m_3_: so when you look at the config for a service
10:56 m_3_: you can often bust it up into "the config specific to installing that node" and "the config specific to relating to another service"
10:56 m_3_: often the relation config info is a nice concise set of info
10:56 m_3_: well juju uses these boundaries to 'install' as a separate step from 'relate'
10:57 m_3_: so the basic story here is to
10:57 m_3_: 1.) spin up status.net
10:57 m_3_: 2.) spin up mysql
10:57 m_3_: 3.) relate the two
10:57 m_3_: 4.) expose status.net to the outside world
10:57 ! lamalex [~alex@ubuntu/member/lamalex] has quit [Remote host closed the connection]
10:58 m_3_: when we relate two services the charm hooks for those services exchange info
10:58 m_3_: take a look at what's bold in the pad
10:58 m_3_: that's an example of the status.net charm getting relation-specific config info from the mysql service
10:58 ! silbs [~jane@nat/canonical/x-qklehjwnrzeqeapi] has joined #juju
10:59 m_3_: the mysql (db-relation-{joined,changed} hooks create a new db and credentials and then pass it to the service joining)
10:59 m_3_: so the status.net charm 'relation-get's the mysql db info that it needs
11:00 m_3_: now we can write this info into the config for status.net... and bam!
11:00 m_3_: take a minute to browse the db-relation-changed hook
11:01 ! chilicuil [~chilicuil@unaffiliated/chilicuil] has joined #juju
11:01 m_3_: BTW all hooks are optional... only implement what you need... events will fire for {joined,changed,departed,broken}
11:01 ! lamalex [~alex@cpe-184-153-176-28.maine.res.rr.com] has joined #juju
11:01 ! lamalex [~alex@cpe-184-153-176-28.maine.res.rr.com] has quit [Changing host]
11:01 ! lamalex [~alex@ubuntu/member/lamalex] has joined #juju
11:01 ! robbiew [~RobbieWil@99-156-84-159.lightspeed.austtx.sbcglobal.net] has joined #juju
11:01 m_3_: does this 'relation-get' exchange of information make sense to everybody?
11:02 m_3_: any questions about this
11:02 m_3_: it's this very separation of config info into 'install' and 'relation'-specific config that allows juju to start handling horizontal scaling quite nicely
11:02 m_3_: butmore on that later :)
11:02 ! zodiak [~stef@cpe-75-84-218-68.socal.res.rr.com] has quit [Ping timeout: 244 seconds]
11:03 ! uksysadmin [~uksysadmi@193.243.130.17] has quit [Quit: Leaving]
11:03 m_3_: ok, take a sec to look at the website-relation-changed hook too
11:03 medberry: m_3_, compare "relation-get" with "config-get" which occurs later.
11:03 medberry: config-get comes from config.yaml?
11:03 m_3_: it's perdy darned simple
11:04 m_3_: was just gonna do config-get next
11:04 medberry: okeydokey
11:04 ! zodiak [~stef@cpe-75-84-218-68.socal.res.rr.com] has joined #juju
11:04 m_3_: so relation-get gives you info from the other side of a relation... another service
11:04 m_3_: config-get gives you info from a couple of different places:
11:04 m_3_: defaults are in config.yaml
11:05 m_3_: I can set them at deploy-time on the command line
11:05 m_3_: ( juju deploy -elocal --repository ~/charms --config ~/my_status_net.yaml local:statusnet status
11:06 m_3_: or I can also set them individually via the command line:
11:06 m_3_: at any time during the life of the service, I can 'juju set statusnet var1=val1 var2=val2'
11:07 m_3_: there's a config-changed hook that can handle these changes in addition to the install or relation config
11:08 m_3_: ok, so one more thing about relations and relation-hooks and then we can move on
11:09 m_3_: when a relation is joined, relation-changed hooks can fire repeatedly
11:09 ! brunopereira81 [9107e014@gateway/web/freenode/ip.145.7.224.20] has joined #juju
11:09 m_3_: they do this as long as either side is calling relation-sets
11:09 ! jrgifford_webcha [6365188e@gateway/web/freenode/ip.99.101.24.142] has joined #juju
11:09 m_3_: what this means is that your code has to be able to be called over and over again without barfing your config
11:10 ! jrgifford_webcha is now known as jrgiffordwebchat
11:10 m_3_: (idempotency for you math geeks out there.... i^2=i)
11:10 m_3_: it's not hard, but it's good practice to make all of your hooks idempotent
11:11 m_3_: alright, I could ramble on all day about scaling service and show you example stacks... but let's get on with charm school!
11:11 m_3_: any questions about the status.net charm before we move on?
11:13 jcastro: no questions so far?
11:13 jcastro: there's no way you guys can be that good. :)
11:14 * m_3_ is just that exciting to watch type :)
11:14 amithkk: jcastro: lol
11:14 mainerror: What do I do if there is no install_cli.php script for configure the site?
11:15 m_3_: mainerror: wow, that's a tough one
11:15 chmac: m_3_: I thought I'd read somewhere that juju only supports EC2 compatible clouds at the moment.
11:15 chmac: m_3_: Does juju support rackspace right now?
11:15 * jrgiffordwebchat has same question as chmac
11:15 amithkk: m_3_: Cant juju be installed on any server?
11:15 m_3_: mainerror: I'd write the install scripts myself and have the charm's install hook call my install scripts
11:16 marcoceppi: mainerror I had a problem like that, in where I just had to re-write the web-based installer into the charm
11:16 m_3_: chmac: yes, during the last ODS we even did the meta thing on openstack...
11:16 mainerror: I see. Thanks. :)
11:16 m_3_: i.e., we had a bare-metal rack
11:16 m_3_: chmac: we used juju to deploy openstack itself on the bare metal rack
11:16 chmac: m_3_: Wow, awesome, so juju can deploy new Rackspace servers just as it deploys new EC2 servers?
11:17 medberry: openstack is not per se the same thing as rackspace.
11:17 chmac: m_3_: Great, I'll get into the documentation in greater detail.
11:17 m_3_: chmac: then we backed out and used another juju environment to spin up a hadoop cluster on that openstack cloud
11:18 m_3_: chmac: note that juju doesn't support the rackspace-api... just the ec2-compatible-api on openstack
11:18 m_3_: medberry: thanks
11:19 chmac: I've read that juju's not production ready, is that really true, or is it more cautionary? :-)
11:19 m_3_: chmac: sorry, I don't know if rackspace has a public-facing openstack cloud yet
11:19 m_3_: chmac: definitely true
11:20 m_3_: chmac: there are components that need to be made highly available before it's totally production ready
11:20 jcastro: chmac: it's a tech preview in 11.10
11:20 chmac: m_3_: Really? It's so tempting to use it in production :-)
11:20 jrgiffordwebchat: so.. it was a tech preview in 11.04/11.10, for 12.04 it'll be production?
11:20 m_3_: chmac: we're shooting for production-ready in 12.04 (long-term-support) version of ubuntu
11:20 m_3_: chmac: I would use it in production
11:20 jcastro: chmac: but certainly we encourage people to run it in dev so that we can get feedback to make it better in 12.04 for an LTS.
11:20 chmac: Makes sense
11:20 jcastro: chmac: this is why we want people banging on it now
11:20 m_3_: but you've got to take some extra precautions atm to insure service/data integrity
11:21 chmac: m_3_: Now that's what I'm talking about, see, I'm usually happy to test earlier than most :-)
11:21 m_3_: it does spin up EBS-rooted instances in ec2 atm for instance just to be on the safer side
11:21 chmac: I'll investigate the openstack api issue with Rackspace, maybe there's an alternative provider in the UK.
11:21 chmac: Thanks for the snappy response, gotta run now, being taken shopping! :-)
11:21 * m_3_ totally ignorant
11:21 jcastro: thanks for coming!
11:21 m_3_: fun fun!
11:22 jcastro: any other questions?
11:22 jcastro: amithkk: I believe you asked if juju can be installed on any server?
11:23 m_3_: amithkk: sorry missed your question
11:23 m_3_: did the above discussion asnwer that?
11:25 mainerror: What is the best practice to create an install script for a service if there is no direct download option?
11:25 m_3_: mainerror: best is to use apt-get install
11:26 m_3_: mainerror: next is to download a payload... binary or tarball
11:26 medberry: .. then git clone?
11:26 m_3_: then install accordingly... cli.sh or ./configure && make && make install
11:26 m_3_: git clone's totally cool... we have several charms that do it already
11:26 m_3_: (safer to 'git clone <url> -b stable_branch_name')
11:27 amithkk: m_3_: yep
11:27 mainerror: What I meant is, what if there is no wget usable direct URL but only a redirect URL?
11:27 m_3_: mainerror: so in the latter case, you'd need the install hook to install 'build-essential'
11:27 ! pindonga [~ricardo@host129.190-231-143.telecom.net.ar] has quit [Ping timeout: 248 seconds]
11:27 amithkk: sorry for the slow responce
11:27 m_3_: or whatever's needed for that build
11:28 m_3_: mainerror: hmmm... not sure I'm following, but perhaps a ppa for that charm would work?
11:28 medberry: I think I know the answer... but clarifying:
11:28 medberry: jcastro, m_3_, if I want to populate some content, does that happen after juju deploy? Assume I'm using public charms--should I mod them or just do the population on the host after the fact?
11:28 mainerror: Ah, right. That would be an option.
11:28 medberry: (ie, load web content, etc.)
11:29 jcastro: I think mainerror means
11:29 m_3_: medberry: sure, you can pull/install during a relation hook even
11:29 jcastro: what if I can't wget a tarball directly?
11:29 jcastro: and it's buried in some website that has redirects, etc.
11:30 mainerror: Indeed but m_3 actually answered it, I think.
11:30 m_3_: so you _could_ just stick a tarball in the charm itself... there're some size limitations to that, but I don't remember them off-hand
11:31 mainerror: As I understood his answer was to create a package for it in a PPA. Maybe I misunderstood.
11:31 medberry: m_3_, but that's no longer really a public charm (if it has my content in it). So I've locally forked the charm?
11:31 m_3_: mainerror: heck, let's go over the specific thing you're trying to do
11:31 ! pindonga [~ricardo@host136.190-138-189.telecom.net.ar] has joined #juju
11:31 m_3_: medberry: yes, exactly
11:31 m_3_: medberry: which is ok... anything goes in charms
11:31 medberry: thanks all.
11:31 m_3_: medberry: your choice to make something harder to maintain, and/or private/proprietary
11:32 mainerror: Uhm, it was more of a general question. Luckily I can wget it directly.
11:32 medberry: mainerror, is there an example--some actual issue you can point us at?
11:32 medberry: ah.
11:32 m_3_: medberry: but contrib back to community set of charms in the 'charm store' is different
11:32 medberry: nod.
11:32 m_3_: they get tagged according to all sorts of different criteria
11:33 jcastro: I wouldn't consider a tarball in a charm best practice
11:33 jcastro: ideally if it was an open project you could get them to fix that
11:33 m_3_: prefer packages if available
11:33 jcastro: or ask them to mirror their tarball releases on launchpad
11:34 jcastro: or package it in a PPA as a contribution to ubuntu and that project
11:34 m_3_: marcoceppi has a 'use_upstream' config option on a charm
11:34 marcoceppi: yeah, it switches between latest stable tarbal and what's in the repos.
11:34 m_3_: true => pull from source, otherwise install the package
11:34 marcoceppi: but it always defaults to the repo, you have to juju set inorder to get the upstream version
11:35 m_3_: which is really a beautiful way to handle that from a user-perspective (as long as default is pkgs :)
11:35 jcastro: but if it's some horrible program that you can't improve and need it for work or something then feel free to get as ugly as you want, but for the public charms in the charm store we're looking for nice clean charms that people can use and adapt.
11:35 jcastro: ok, we've gone through the charm
11:35 jcastro: and this ends the official charm school
11:35 jcastro: however
11:35 jcastro: we certainly encourage you to hang out
11:35 jcastro: smoke if you got em
11:36 ! brunopereira81 [9107e014@gateway/web/freenode/ip.145.7.224.20] has quit [Ping timeout: 265 seconds]
11:36 jcastro: and feel free to ask us questions
11:36 jcastro: or let us know what you're working on
11:36 jcastro: or ask for help or a review
11:36 jcastro: we hold office hours (see topic) or you can always post to the list
11:36 jcastro: but the juju team works a ton, and usually are always in here and love to answer questions from users
11:36 jcastro: so please don't be shy!
11:37 medberry: tx guys.
11:37 amithkk: awesome session!
11:37 mainerror: Thanks for this session!
11:37 jcastro: we'll make the logs handy for everyone
11:38 dannf: thanks guys - is service maintenance within the scope of juju? e.g. keeping mysql up to date w/ security patches?
11:38 marcoceppi: That's a good question actually
11:39 m_3_: dannf: yes, there's an upgrade action called from the command line 'juju upgrade <service-name>'
11:39 ! fwereade_ [~william@46.11.107.193] has quit [Ping timeout: 244 seconds]
11:39 dannf: and that is implemented with a hook, i presume?
11:40 m_3_: that you can customize with a dedicated upgrade hook
11:40 dannf: sweet
11:40 m_3_: usual practice is to make 'install' idempotent and then symlink to the upgrade hool
11:40 m_3_: s/hool/hook/
11:40 dannf: makes sense
11:41 ! chilicuil [~chilicuil@unaffiliated/chilicuil] has quit [Read error: Operation timed out]
11:41 m_3_: dannf: rolling upgrades can be done, but you have to segment the service a bit... i.e., plan for it... this'll improve over time
11:42 m_3_: i.e., if you've got a 20-unit service and only wanna upgrade a few of them at a time
11:42 ! sidnei [~sidnei@189-10-170-38.cslce701.dsl.brasiltelecom.net.br] has quit [Ping timeout: 260 seconds]
11:43 m_3_: scaling in juju is just cool! but that'll be another charm school :)
11:43 jcastro: yes, it's actually unfair to juju not mentioning scaling this time
11:43 jcastro: but when we get to it you'll really start to see the power
11:43 m_3_: it's a kind of magic
11:43 m_3_: sorry, had to
11:43 m_3_: :)
11:44 * m_3_ now has song stuck in head
11:44 * mainerror too
11:49 m_3_: hazmat niemeyer: y'all can have the channel back... thanks!
11:49 mpl: wheee
11:50 mpl: feels good to come out of the dark irc corner
11:54 ! fwereade_ [~william@46.11.107.193] has joined #juju
11:54 ! koolhead17 [~atul@unaffiliated/koolhead17] has joined #juju
11:55 ! sidnei [~sidnei@200-203-78-17.cslce701.dsl.brasiltelecom.net.br] has joined #juju
11:59 niemeyer: Oh, hey.. #juju is back
11:59 niemeyer: rog: Review sent
12:00 ! m_3_ [~mmm@76.77.152.109] has quit [Quit: leaving]
12:00 ! negronjl [~negronjl@pool-108-42-17-37.snfcca.btas.verizon.net] has quit [Remote host closed the connection]
12:00 ! negronjl [~negronjl@pool-108-42-17-37.snfcca.btas.verizon.net] has joined #juju
12:01 ! m_3 [~mmm@76.77.152.109] has joined #juju
12:01 rog: niemeyer: w.r.t. Bootstrap, I said that I would change the test (to test for len(ms)==1) once Bootstrap actually starts a machine, but for the time being i think it's ok.
12:02 ! noodles775 [~michael@canonical/launchpad/noodles775] has quit [Ping timeout: 240 seconds]
12:03 niemeyer: rog: It's not..
12:04 niemeyer: rog: Comment the test out if you can't satisfy it.. a test assertion that asserts something wrong is doing what exactly
12:04 ! silbs [~jane@nat/canonical/x-qklehjwnrzeqeapi] has left #juju []
12:05 niemeyer: rog: Or, maybe better
12:05 niemeyer: rog: Comment Bootstrap out
12:05 rog: that's a better idea
12:05 niemeyer: rog: Then the test is probably correct
12:05 ! jrgiffordwebchat [6365188e@gateway/web/freenode/ip.99.101.24.142] has quit [Quit: Page closed]
12:05 niemeyer: rog: It should not Destroy, though
12:06 rog: niemeyer: why not?
12:06 niemeyer: rog: Because that's the complement of Bootstrap
12:06 niemeyer: rog: Destroy doesn't work in a real deployment without Bootstrap, I think
12:06 niemeyer: fwereade_: Does it?
12:06 rog: niemeyer: currently, Destroy takes down all machines that were started from the current environment
12:07 rog: niemeyer: which seems ok
12:07 fwereade_: niemeyer, reading context
12:07 niemeyer: rog: Hmm.. fair enough.. that sounds like a good behavior, even if we don't do that in Python
12:08 fwereade_: niemeyer, I don't think destroy-environment is actually an *error* if you don't have an environment
12:08 niemeyer: fwereade_: The question is whether it kills all machines, even if we don't find the data about it in e.g. S3
12:09 fwereade_: niemeyer, checking
12:10 fwereade_: niemeyer, it gets ec2 machines by reservation, so it should be safe
12:10 niemeyer: fwereade_: Cool, thanks
12:10 ! Leon_Nardella [~Leon@187.10.251.223] has joined #juju
12:20 rog: niemeyer: i replied with one question about about open vs Open
12:20 niemeyer: rog: and I already replied to it
12:20 ! Furao [~Furao@pc-20-248-30-200.cm.vtr.net] has quit [Ping timeout: 252 seconds]
12:22 ! armandomi [3ec81602@gateway/web/freenode/ip.62.200.22.2] has joined #juju
12:22 rog: niemeyer: i think i'd prefer to wait until the occasion arises, if that's ok
12:22 niemeyer: rog: Sure, no prob
12:22 ! sidnei [~sidnei@200-203-78-17.cslce701.dsl.brasiltelecom.net.br] has quit [Quit: Ex-Chat]
12:23 rog: niemeyer: the previous weekly builds find with all tests passing btw, so it's *something* that's changed recently
12:23 niemeyer: rog: You mean re. http?
12:23 rog: niemeyer: yeah
12:25 ! fmo [c3bcb401@gateway/web/freenode/ip.195.188.180.1] has quit [Quit: Page closed]
12:28 rog: niemeyer: https://codereview.appspot.com/5448085/
12:30 niemeyer: rog: goamz should be entirely fixed, tagged, and shiny already
12:30 rog: niemeyer: i just pulled and it didn't seem to be
12:30 rog: unless...
12:30 rog: ah, rename!
12:31 rog: no
12:32 rog: niemeyer: http://paste.ubuntu.com/757292/
12:32 rog: it still needs fixing, i think
12:32 rog: (that was done just after i'd removed the aws directory, BTW)
12:33 niemeyer: rog: I think I screwed up pushing to ~niemeyer.. let me see
12:33 rog: niemeyer: renames are awkward - it should lazily evaluate aliases i think
12:33 niemeyer: rog: yeah, I'm sorry
12:34 niemeyer: rog: The rename worked fine, but I forgot the --remember
12:34 niemeyer: rog: Which means the fixup and tagging afterwards went to the wrong location
12:35 niemeyer: rog: Ok, I _think_ everything should be fine now, including the more unknown packages (sdb, etc)
12:35 rog: niemeyer: if i push to lp:goamz/aws, it should remember that, even if it's later changed to be an alias for something else, i reckon
12:35 niemeyer: rog: It doesn't
12:35 rog: i know
12:35 niemeyer: rog: Unless you say so with --remember
12:35 niemeyer: rog: Ah, you're expressing a wish, sorry
12:35 rog: yeah
12:35 niemeyer: rog: Yeah, it makes sense to me too
12:36 ! armandomi [3ec81602@gateway/web/freenode/ip.62.200.22.2] has quit [Quit: Page closed]
12:46 rog: niemeyer: PTAL
12:47 niemeyer: rog: e.Destroy has already been mentioned in two other reviews.. please fix it or respond to the point.
12:48 rog: [17:06] <niemeyer> rog: Hmm.. fair enough.. that sounds like a good behavior, even if we don't do that in Python
12:48 niemeyer: rog: That's not the same issue
12:49 niemeyer: rog: We should be able to Open without Destroy
12:49 niemeyer: rog: Or do you think we shouldn't?
12:49 ! avoine_ [~avoine@modemcable135.49-200-24.mc.videotron.ca] has joined #juju
12:50 rog: niemeyer: i think that the destroys will happen at the end
12:50 rog: niemeyer: so it shouldn't matter
12:50 rog: niemeyer: what do you propose as a solution?
12:50 niemeyer: rog: So if I open the same environment 10 times, you think we should destroy it 10 times
12:50 rog: niemeyer: yeah.
12:50 niemeyer: rog: That's silly isn't it?
12:50 rog: niemeyer: probably :-)
12:51 niemeyer: rog: So let's do something else..
12:51 rog: niemeyer: your suggestion was to have suite.Bootstrap, right?
12:52 niemeyer: rog: I suppose each environment only has to be destroyed once, and that we don't really have to do through the same object that created it
12:52 rog: niemeyer: so the environment that got bootstrapped gets destroyed
12:52 niemeyer: rog: Does that make sense?
12:52 fwereade_: happy weekends everybody :)
12:52 niemeyer: fwereade_: thanks, have a great one too
12:52 rog: fwereade_: have a good one
12:52 niemeyer: rog: I don't mind to change the original suggestion.. just want to have some conversation going about the topic
12:53 niemeyer: rog: You say Destroy shouldn't depend on Bootstrap.. that's fine by me too
12:53 rog: niemeyer: i think that if we're wanting to test Bootstrap/Destroy with different opens, we can bypass the suite environment handling
12:54 niemeyer: rog: I don't want to test.. it's the opposite.. I don't want the suite to be doing something that makes no sense all the time
12:54 rog: most tests will be against a single environment, i think
12:56 rog: niemeyer: isn't it worth doing something that makes sense most almost all of the time? hmm, i dunno.
12:56 niemeyer: rog: Sorry, I don't get that point..
12:57 niemeyer: rog: The same environment shouldn't be destroyed twice.. it will fail, and the test will fail because Destroy fails
12:57 rog: anyway, my thought was that we could have a Bootstrap method as well as an Open method. the Bootstrap method marks the env to be destroyed at the end.
12:57 niemeyer: rog: That was my suggestion, that you advocated against by saying Destroy should always be called :-)
12:57 rog: which will happen exactly once for each env created via bootstrap
12:58 niemeyer: rog: Which is fine by me
12:58 rog: niemeyer: that was then :-)
12:58 niemeyer: rog: The only point I'm trying to address is not destroying thing twice
12:58 niemeyer: rog: and it's easy to do that
12:58 rog: niemeyer: yeah, ok i'll do that
12:58 rog: see whether i can do it in 3 minutes!
12:58 niemeyer: rog: Well.. let's do this
12:59 niemeyer: rog: Please merge it as-is..
12:59 niemeyer: rog: We'll sort it out later
12:59 rog: ok
12:59 rog: it's ok as is?
12:59 niemeyer: rog: yeah
13:00 niemeyer: rog: I'm starting to think we should just Destroy it within each test as necessary and be done with it. Let's see how things show up in practice once we have a few additional tests
13:00 rog: niemeyer: the problem with that is that the env is left around if you do a failed Assert
13:00 niemeyer: rog: defer
13:01 rog: ok
13:02 niemeyer: But let's see.. it's bothering a bit knowing this will blow up but I'm probably concerned too soon
13:02 rog: bugger, conflicts
13:03 niemeyer: Huh.. how come?
13:06 ! avandendorpe [u1555@gateway/web/irccloud.com/x-hpogixtieypwyjed] has joined #juju
13:09 rog: niemeyer: all sorted now. jeeze. i *think* i got all the steps right.
13:10 rog: gotta go, i am required to pack for the weekend. see ya monday. thanks for all the reviews, i love 'em really :-)
13:11 niemeyer: rog: Thanks a lot for everything this week, it was awesome
13:11 niemeyer: rog: and you're very welcome
13:11 rog: niemeyer: and if you did manage to have a look at ec2-region before then i'd be very happy indeed...
13:12 niemeyer: rog: Oh, wait
13:12 niemeyer: rog: I've checked it out, but the proposal includes unrelated changes from the previous branch
13:12 niemeyer: rog: I mentioned that in the codereview itself
13:12 rog: fuck
13:12 rog: which changes?
13:14 rog: niemeyer: i can fix it if you let me know right now, otherwise i'll have to leave it
13:15 niemeyer: rog: See the codereview
13:15 niemeyer: rog: I think it had all the ec2-initial changes in
13:15 rog: niemeyer: which file?
13:15 niemeyer: rog: All of them
13:15 niemeyer: rog: Or most, anyway.. checking out
13:15 rog: niemeyer: i thought ec2-initial was approved, bar these changes
13:15 niemeyer: rog: It is!
13:16 niemeyer: rog: and it's merged even, right?
13:16 rog: yeah
13:16 niemeyer: rog: My point is that this: rog: https://codereview.appspot.com/5449065/
13:16 niemeyer: rog: Has a ton of unrelated changes coming from other branches
13:16 rog: ah, sorry, i thought you were referring to the review just done
13:16 rog: one mo
13:19 rog: niemeyer: there, is that better?
13:19 ! sidnei [~sidnei@186.195.16.15] has joined #juju
13:19 rog: niemeyer: it looks like the changes are relevant now
13:19 rog: gotta go
13:20 niemeyer: rog: Superb, thanks!
13:20 niemeyer: rog: Enjoy
13:23 ! bmullan [~bmullan@rrcs-70-63-158-198.midsouth.biz.rr.com] has joined #juju
13:27 ! zodiak [~stef@cpe-75-84-218-68.socal.res.rr.com] has quit [Ping timeout: 244 seconds]
13:28 ! brunopereira81 [d55d356f@gateway/web/freenode/ip.213.93.53.111] has joined #juju
13:31 ! TeTeT [~spindler@95-89-139-243-dynip.superkabel.de] has quit [Quit: Leaving]
13:34 ! Leon_Nardella [~Leon@187.10.251.223] has quit [Ping timeout: 248 seconds]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment