[00:58] <cesArgOmez> its over for today ?
[02:51] <trick> is there a pc suites for ubuntu?
[02:54] <trick> anyone in here?
[02:54] <jmarsden> !classroom
[02:54] <ubot2> The Ubuntu Classroom is a project which aims to tutor users about Ubuntu, Kubuntu and Xubuntu through biweekly sessions in #ubuntu-classroom - For more information visit https://wiki.ubuntu.com/Classroom
[07:16] <Clordio> Hello?
[11:43] <arunkumar413> where is the class
[12:56] <johnsgruber> the class will be here in about 3 hours from now (the first class of the day about QML. chat and ask questions in #ubuntu-classroom-chat
[15:53] <dholbach> HELLO EVERYBODY! Welcome to Day 4 of Ubuntu Developer Week!
[15:53] <dholbach> How are you all doing?
[15:53] <oSoMoN> hey dholbach, hi everyone
[15:53] <dholbach> We still have 7 minutes left until we start, but I just wanted to bring up a few organisational bits and pieces first:
[15:53] <dholbach>  - If you can't make it to a session or missed one, logs to the sessions that already happened are linked from https://wiki.ubuntu.com/UbuntuDeveloperWeek
[15:54] <dholbach>  - If you want to chat or ask questions, please make sure you also join #ubuntu-classroom-chat
[15:54] <dholbach>  - If you ask questions, please prefix them with QUESTION:
[15:54] <dholbach>   ie: QUESTION: What does oSoMoN stand for?
[15:54] <dholbach> :)
[15:54] <dholbach>  - if you are on twitter/identi.ca or facebook, follow @ubuntudev to get the latest development updates :)
[15:54] <Cyberkilla> ;)
[15:54] <dholbach> that's it from me
[15:55] <dholbach> you still have 5 minutes until oSoMoN will kick off today and talk about QML App development goodness!
[15:55] <dholbach> Have a great day!
[15:55] <Cyberkilla> dholbach, bye
[15:55] <oSoMoN> thanks for the introduction dholbach
[15:56] <oSoMoN> let’s wait for 18:00 sharp and we’ll start
[16:00] <oSoMoN> let’s get this rolling…
[16:00] <ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/07/14/%23ubuntu-classroom.html following the conclusion of the session.
[16:00] <oSoMoN> let’s get this rolling…
[16:01] <oSoMoN> Hi everyone!
[16:01] <oSoMoN> In this session I’m gonna show you how to write a cool application in QML in no time (in Ubuntu of course!)
[16:01] <oSoMoN> I’ll first start with a super quick introduction to QML and pointers to documentation for complete beginners, and then I’ll move on to writing an actual application step by step.
[16:01] <oSoMoN> If you have contextual questions don’t hesitate to ask, myself and others (I hope) will be happy to answer as best as we can.
[16:01] <oSoMoN> If a question is too general, keep it for the end of the session so as not to disrupt the flow too much, we’ll save some time at the end to answer them, and eventually if we go overflow the allocated time we can take the discussions offline.
[16:01] <oSoMoN> So, on to the topic!
[16:01] <oSoMoN> There’s a very good introduction of what QML is at http://doc.qt.nokia.com/qdeclarativeintroduction.html.
[16:01] <oSoMoN> There’s also very good documentation, it’s one of the strong points of Qt in general.
[16:02] <oSoMoN> There are official tutorials as well as plenty of unofficial ones on the interwebs.
[16:02] <oSoMoN> Basic tutorial: http://doc.qt.nokia.com/qml-tutorial.html
[16:02] <oSoMoN> Advanced tutorial: http://doc.qt.nokia.com/qml-advtutorial.html
[16:02] <oSoMoN> Here is a non exhaustive list of advantages that make it a great language to develop applications for Ubuntu:
[16:02] <oSoMoN> very good documentation
[16:02] <oSoMoN> implicit animations
[16:02] <oSoMoN> property bindings
[16:02] <oSoMoN> states
[16:02] <oSoMoN> extensible in C++ or Python (using PySide)
[16:02] <oSoMoN> supports touch input (e.g. kinetic scrolling for lists)
[16:03] <oSoMoN> First let’s install the packages we’re going to need: `sudo apt-get install qtcreator qt4-qmlviewer libqtwebkit-qmlwebkitplugin`
[16:03] <oSoMoN> My purpose with this session is not to teach you QML from the very beginning, there’s plenty of great documentation out there for that.
[16:03] <oSoMoN> The idea is more to show you how to use it to write a real application for Ubuntu, not the typical and useless Hello World.
[16:04] <oSoMoN> For years I’ve been using liferea, a gnome feed reader, to aggregate and read RSS feeds. It does the job, but it’s been getting incredibly slow, to the point it takes more than a minute to start and display its main window, and that’s not even checking for new feeds. Not acceptable, let’s see if we can write a replacement in QML.
[16:04] <oSoMoN> For the sake of the example it’s going to aggregate all feeds from Planet Ubuntu (http://planet.ubuntu.com/).
[16:04] <oSoMoN> The desired layout is basic: a list of all recents entries in a left pane, and a view of the currently selected entry in a right pane.
[16:04] <oSoMoN> I’ll guide you through the code step by step, you can find it in the following bzr branch: lp:~osomon/+junk/qml-feedreader.
[16:05] <oSoMoN> Each revision in the branch corresponds to a step. For convenience, you can browse the revisions and see the diffs between each revision at http://bazaar.launchpad.net/~osomon/+junk/qml-feedreader/changes.
[16:05] <oSoMoN> Let’s fire up Qt Creator, and click on "Create Project".
[16:05] <oSoMoN> Select "Qt Quick Project" > "Qt Quick UI".
[16:05] <oSoMoN> Let’s call it "feedreader" and create it in e.g. "~/dev/qml". Then click "Next" and then "Finish".
[16:05] <oSoMoN> (if I’m pasting too fast, someone please tell me and I’ll slow down)
[16:06] <oSoMoN> Qt Creator created a skeleton application, which we can already run.
[16:06] <oSoMoN> We will replace this code incrementally to implement the functionality of our feed reader.
[16:06] <oSoMoN> Let’s get started.
[16:06] <oSoMoN> http://bazaar.launchpad.net/~osomon/+junk/qml-feedreader/revision/1
[16:06] <oSoMoN> We’re starting by adding to the root element an XmlListModel that will be responsible for fetching the data from the RSS feed and exposing this data in the form of properties for each item in the model, using XPath queries to extract the relevant data.
[16:07] <oSoMoN> Then we’re adding a ListView to display the data from the list model. The delegate is the component responsible for displaying one item in the list, it is automatically instantiated and positioned correctly by the list view.
[16:07] <oSoMoN> At this point we can already run this code, and tada! We get a list of the latest entries for the RSS feed.
[16:07] <oSoMoN> As you can see, you can use the mouse wheel and do kinetic scrolling on the list. All of this comes for free with the ListView element.
[16:07] <oSoMoN> It’s rather ugly and not very readable as no layout is applied to the delegates. We are going to remedy this in the next step.
[16:08] <oSoMoN> http://bazaar.launchpad.net/~osomon/+junk/qml-feedreader/revision/2
[16:08] <oSoMoN> Instead of a simple Text element, we make the delegate a Rectangle containing two rows of text.
[16:08] <oSoMoN> The first line displays the title of the entry, and the second line the publication date. We tweak the font size, add an ellipsis, margins and spacing.
[16:09] <oSoMoN> It is much better already, but we can improve it visually by adding alternating colors to the rows.
[16:10] <oSoMoN> http://bazaar.launchpad.net/~osomon/+junk/qml-feedreader/revision/3
[16:11] <oSoMoN> The SystemPalette element exposes a palette of colors for the current theme, which allows us to give a consistent look’n’feel to our application.
[16:11] <oSoMoN> As you can see, an interesting feature of QML is that we can assign an anonymous function to the value of a property, for non-trivial computations. This of course preserves property binding, meaning that whenever the value of a property used inside the body of this function changes, the property is updated in a transparent manner.
[16:13] <oSoMoN> http://bazaar.launchpad.net/~osomon/+junk/qml-feedreader/revision/4
[16:13] <oSoMoN> QML items are not mouse-aware by default, but it is very easy to fix this: we just add an invisible MouseArea that covers the area of the item, and we can now connect to the various signals it emits when it receives mouse events.
[16:14] <oSoMoN> In this case, clicking an item in the list will make it the current item. It will be highlighted with a different color for visual feedback.
[16:15] <oSoMoN> http://bazaar.launchpad.net/~osomon/+junk/qml-feedreader/revision/5
[16:15] <oSoMoN> We now want to display the contents of the current entry in a pane to the right of the list.
[16:16] <oSoMoN> The contents are stored in the 'description' attribute, so we need to add it to the XmlListModel.
[16:17] <oSoMoN> The contents are HTML, so we are going to display them in a WebView, which is basically a component embedding webkit to render a web page or arbitrary HTML. This requires an extra import.
[16:17] <oSoMoN> As you can see here, property binding is a very powerful feature: unlike in imperative programming, I do not have to set the value of the 'html' property to the contents whenever I change the current entry in the list. All I need to do is bind it, and done!
[16:17] <oSoMoN> http://bazaar.launchpad.net/~osomon/+junk/qml-feedreader/revision/6
[16:18] <oSoMoN> You may have noticed that the web view cannot be scrolled. This can be annoying if the contents don’t fit in the frame. Putting the WebView inside a Flickable element fixes this.
[16:18] <oSoMoN> The contents can now be scrolled vertically by clicking and dragging them. Note that a limitation of the Flickable element it that unfortunately it currently doesn’t handle mouse wheel events (this could be overcome by writing a custom Flickable element in C++, but is not the point of today’s session).
[16:19] <oSoMoN> http://bazaar.launchpad.net/~osomon/+junk/qml-feedreader/revision/7
[16:20] <oSoMoN> We now add a one-pixel separator between the list view and the webview.
[16:20] <oSoMoN> Note how QML stacks sibling elements: the last on top of the others. Which is why we add the separator at the end, after the listview and the flickable.
[16:21] <oSoMoN> http://bazaar.launchpad.net/~osomon/+junk/qml-feedreader/revision/8
[16:21] <oSoMoN> To handle keyboard focus properly, we make the top-level element a focus scope, meaning that when it gets the focus it transfers it to one and only one of its children (in our case, the listview).
[16:22] <oSoMoN> http://bazaar.launchpad.net/~osomon/+junk/qml-feedreader/revision/9
[16:22] <oSoMoN> We now add a fancy animation on the opacity of the webview whenever we click an entry in the list: the web view fades out, then the index is actually changed, then the webview fades in again.
[16:23] <oSoMoN> This is achieved with a sequential animation; by default animations in QML are run in parallel.
[16:24] <oSoMoN> http://bazaar.launchpad.net/~osomon/+junk/qml-feedreader/revision/10
[16:25] <oSoMoN> Our webview can be scrolled, that’s nice, but we don’t have any visual indicator of the position within the document.
[16:25] <oSoMoN> Let’s add a simple scrollbar that will act as a visual clue (it won’t be clickable to actually change the position).
[16:26] <oSoMoN> The scrollbar is made up of two rectangles: the first one is a semi-transparent background, and the second one is the handle of the scrollbar.
[16:26] <oSoMoN> The scrollbar defines custom properties for the position and the pageSize, those are bound the usual way, so whenever the position of the contents inside the flickable is updated, the properties of the scrollbar are updated accordingly.
[16:27] <oSoMoN> http://bazaar.launchpad.net/~osomon/+junk/qml-feedreader/revision/11
[16:28] <oSoMoN> This scrollbar is very nice, how about we extract it to a separate file so as to make it a reusable component?
[16:28] <oSoMoN> QML files representing components in the same directory as the main one are discovered automatically, no need to import anything else.
[16:28] <oSoMoN> We name the file "ScrollBar.qml", and the component can be used under the name 'ScrollBar'. Easy, heh?
[16:29] <oSoMoN> In the external component, we remove all references to the flickable. The properties of the scrollbar will be set wherever it is instantiated. This ensures our component is truly reusable and doesn’t rely on the implicit presence of other components.
[16:30] <oSoMoN> http://bazaar.launchpad.net/~osomon/+junk/qml-feedreader/revision/12
[16:30] <oSoMoN> Now that we’ve done that, it is trivial to add a scrollbar to the listview as well. Almost too easy :)
[16:31] <oSoMoN> http://bazaar.launchpad.net/~osomon/+junk/qml-feedreader/revision/13
[16:32] <oSoMoN> For the final touch, let’s add a header to the right pane, displaying two lines: one with the title of the current entry, and the second one with a link to the original blog entry.
[16:33] <oSoMoN> As a bonus, we can very easily make the link clickable by using a MouseArea and invoking the handy helper function "Qt.openUrlExternally(…)".
[16:34] <oSoMoN> That’s it for the code folks!
[16:34] <oSoMoN> We have written a full-fledged real-word application in about half an hour and under 200 lines of code (158 lines if we exclude copyright and license headers and blank lines).
[16:35] <oSoMoN> real-world
[16:35] <oSoMoN> Here is a screenshot of the application running: http://tilloy.net/olivier/qml/qml-feedreader.png, for those who haven’t tested it.
[16:35] <oSoMoN> This is only a quick example of what QML can help you build, it’s by no means a complete overview of how rich the framework is.
[16:36] <oSoMoN> The following page has lots of very interesting pointers to resources and documentation to take in on from here, including extending QML components with C++: http://doc.qt.nokia.com/qtquick.html
[16:37] <oSoMoN> It looks like I went really fast (maybe too fast?), let’s open the floor for questions
[16:37] <oSoMoN> !q
[16:38] <oSoMoN> any questions? should I go back to one of the steps and explain in more details?
[16:43] <ClassBot> abhinav_singh asked: can you please give some links for including QML components with python
[16:44] <ClassBot> shadeslayer asked: what is the ideal way of communicating with DBus using QML ?
[16:44] <nerochiaro> shadeslayer: normally you create c++ classes that implement the DBUS interface and then you expose them to QML. to expose them you have two possibilities
[16:45] <nerochiaro> shadeslayer: one is to use QDeclarativeContext::setContextProperty (assuming you're not using qmlviewer)
[16:46] <nerochiaro> shadeslayer: the other is to create a plugin which exposes them, and then use the import directive in QML to import that plugin. after that you can use the classes exported by the plugin in QML. there's some good docs for that, let me find them
[16:47] <nerochiaro> shadeslayer: http://doc.qt.nokia.com/4.7-snapshot/qml-extending.html
[16:47] <oSoMoN> one could also probably write a generic DBus QML component that allows connecting to whatever object/interface on a given bus, but that may be overkill for most use-cases
[16:48] <nerochiaro> shadeslayer: QtCreator has also some templates to create these plugins easil
[16:48] <nerochiaro> y
[16:49] <oSoMoN> if we’re done with questions, I’d like to mention two cools projects that use QML
[16:49] <oSoMoN> the first one is unity-2d
[16:50] <oSoMoN> the UI is almost entirely written in QML, and it makes it super easy and fun to prototype new ideas
[16:50] <ClassBot> There are 10 minutes remaining in the current session.
[16:51] <oSoMoN> and the second one is an experiment of mine, a limited clone of the Ubuntu Software Center, written in QML and Python
[16:51] <oSoMoN> this one is more like a playground at the moment
[16:52] <oSoMoN> but you can already get the code form S-C’s trunk (lp:software-center) and play with it by running ./software-center-qml
[16:52] <oSoMoN> that’s all I got for you today, we have 10 minutes left, more questions maybe?
[16:54] <ClassBot> tsimpson asked: have there been any comparisons of the speed of native (C++) apps compared to QML apps?
[16:55] <oSoMoN> tsimpson: I recall reading a blog post about it, let me see if I can find the link for you
[16:55] <ClassBot> There are 5 minutes remaining in the current session.
[16:56] <oSoMoN> tsimpson: http://labs.qt.nokia.com/2011/05/31/qml-scene-graph-in-master/ has some clues about performance, but apparently not compared with native C++ apps
[16:58] <oSoMoN> tsimpson: look at the numbers at the end of the article
[16:59] <oSoMoN> looks like it’s time to wrap up, thanks everyone for following and the interesting questions
[17:01] <ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/07/14/%23ubuntu-classroom.html following the conclusion of the session.
[17:01] <kim0> Good morning, good afternoon and good evening everyone
[17:02] <kim0> I'm here to introduce you to Ensemble → https://ensemble.ubuntu.com/
[17:02] <kim0> Ensemble is a cloud orchestration framework
[17:02] <kim0> I am assuming you know what cloud is, and maybe played around a bit with Amazon ec2
[17:03] <kim0> if you'd like me to provide a quick intro about that as well .. let me know
[17:03] <kim0> just ping me in #ubuntu-classroom-chat or leave a question
[17:03] <kim0> I will be hosting a demo of Ensemble (yay!)
[17:04] <kim0> You can login to this shared screen session → ssh guest@ec2-107-20-18-151.compute-1.amazonaws.com
[17:04] <kim0> password: guest
[17:04] <kim0> or you may view the web UI → https://ec2-107-20-18-151.compute-1.amazonaws.com/
[17:05] <kim0> So .. as a developer, why would Ensemble interest you ?
[17:05] <kim0> - Ensemble enables you to quickly deploy your code to the cloud for testing/qa purposes
[17:05] <kim0> - You're able to easily test various different versions of operating systems
[17:06] <kim0> - And most importantly .. If deployment instructions for your application are not too simple, Ensemble provides an easy and consistent way
[17:06] <kim0> for your users to deploy your application
[17:06] <kim0> It's like having that big red "easy" button to hit, to deploy your code
[17:07] <kim0> As a developer, you're also ensured that users have deployed your application in exactly the way you would recommend
[17:07] <kim0> If there is any questions so far .. shoot
[17:08] <kim0> Let me jump over a couple of ensemble concepts quickly
[17:08] <kim0> then we'll do the demo
[17:08] <kim0> this session should be short and sweet
[17:08] <kim0> - Ensemble concepts
[17:08] <kim0> * The first thing to note, is that since Ensemble was written in the cloud age
[17:09] <kim0> it does not really care about "servers" ..
[17:09] <kim0> rather it focuses on "services"
[17:09] <kim0> services being ..
[17:09] <kim0> mysql : a database service
[17:09] <kim0> memcached : a high performance caching service
[17:09] <kim0> munin : a monitoring service
[17:09] <kim0> and so on and so forth
[17:09] <kim0> You application, of course interacts with many of those services
[17:10] <kim0> * The second important concept is that Ensemble completely "encapsulates" those services
[17:10] <kim0> that is, if you have no idea how to get munin running
[17:10] <kim0> if you ask ensemble to deploy it, you would have it running within minutes
[17:11] <kim0> and you can connect it (read: relate it) to other services
[17:11] <kim0> and it would start graphing performance metrics from all around your infrastructure
[17:11] <kim0> you do not need to know how to control munin, it is encapsulated
[17:12] <kim0> * The third important concept, is that with Ensemble services are "composable"
[17:12] <kim0> that is, services have well defined interfaces
[17:12] <kim0> such that you can connect/relate many services together .. to form a large infrastructure
[17:12] <kim0> you can replace infrastructure components with others .. such as replace mysql with pgsql if you so wish
[17:13] <kim0> and if both of them implement the same interface!
[17:13] <kim0> In the future, Ensemblse would even handle backing up and migrating your data!
[17:13] <kim0> Cool!
[17:13] <kim0> Enough talk .. let's jump to demo land
[17:14] <kim0> If there's any questions pre demo .. shoot
[17:14]  * kim0 waits a minute .. and prepares demo land
[17:17] <kim0> = demo begin =
[17:17] <kim0> Please make sure you're logged into the shared ssh session or web UI
[17:17] <kim0> for instructions, scroll up
[17:17] <kim0> Alright! let's get started
[17:18] <kim0> The very fist step, is as I just did in the shared screen
[17:18] <kim0> ensemble bootstrap
[17:18] <kim0> What this does, is it starts a "management" node for Ensemble
[17:18] <kim0> this is the brains for the deployment
[17:18] <kim0> it is a utility node
[17:19] <kim0> of course ec2 needs some time to create this node ..
[17:19] <kim0> so I need to check it is available and ready before proceeding
[17:19] <kim0> I can do this with
[17:19] <kim0> ensemble status
[17:20] <kim0> The node seems to be bootstrapping
[17:21] <kim0> While the node is bootstrapping
[17:21] <kim0> I would like to introduce "formulas"
[17:22] <kim0> Formulas, are Ensemble's way of codifying the experience of deploying code and orchestrating the full service
[17:22] <kim0> So, if you would like to deploy a mysql service
[17:22] <kim0> You would need a mysql formula
[17:22] <kim0> this is the same for any other service
[17:23] <kim0> and if you as a developer, would like your application to be deployable by Ensemble, you would need to write a formula for it
[17:23] <kim0> the "very cool" part!
[17:23] <kim0> is that formulas are language indepndant
[17:23] <kim0> that is, you do not need to learn yet another programming language
[17:24] <kim0> to write those formulas, formulas can be written in python, bash, php, c++ or whatever!
[17:24] <kim0> Very well .. the bootstrap has of course finish bootstrapping
[17:24] <kim0> I will paste ensemble commands and output here for archiving purposes
[17:24] <kim0> $ ensemble status
[17:24] <kim0> 2011-07-14 17:24:16,265 INFO Connecting to environment.
[17:24] <kim0> machines:
[17:24] <kim0>   0: {dns-name: ec2-50-17-153-3.compute-1.amazonaws.com, instance-id: i-f3c13e92}
[17:25] <kim0> services: {}
[17:25] <kim0> 2011-07-14 17:24:18,137 INFO 'status' command finished successfully
[17:25] <kim0> machine number "0" is our bootstrap node
[17:25] <kim0> let us now quickly deploy a wordpress service and a drupal application
[17:25] <kim0> How hard do you think that is?
[17:26] <kim0> Here it is
[17:26] <kim0> ensemble deploy --repository=. drupal mycms
[17:26] <kim0> This deploys an instance of "drupal" .. calls the instance "mycms"
[17:27] <kim0> $ ensemble deploy --repository=. mysql mydb
[17:27] <kim0> This also deploys mysql, calling it mydb!
[17:27] <kim0> doesn't really get much simpler than that!
[17:27] <kim0> let's check out ensemble status now
[17:27] <kim0> $ ensemble status
[17:27] <kim0> 2011-07-14 17:27:34,085 INFO Connecting to environment.
[17:27] <kim0> machines:
[17:27] <kim0>   0: {dns-name: ec2-50-17-153-3.compute-1.amazonaws.com, instance-id: i-f3c13e92}
[17:27] <kim0>   1: {dns-name: ec2-107-20-30-230.compute-1.amazonaws.com, instance-id: i-0537c864}
[17:27] <kim0>   2: {dns-name: ec2-50-19-190-104.compute-1.amazonaws.com, instance-id: i-e537c884}
[17:27] <kim0> services:
[17:28] <kim0>   mycms:
[17:28] <kim0>     formula: local:drupal-9
[17:28] <kim0>     relations: {}
[17:28] <kim0>     units:
[17:28] <kim0>       mycms/0:
[17:28] <kim0>         machine: 1
[17:28] <kim0>         relations: {}
[17:28] <kim0>         state: null
[17:28] <kim0>   mydb:
[17:28] <kim0>     formula: local:mysql-97
[17:28] <kim0>     relations: {}
[17:28] <kim0>     units:
[17:28] <kim0>       mydb/0:
[17:28] <kim0>         machine: 2
[17:28] <kim0>         relations: {}
[17:28] <kim0>         state: null
[17:28] <kim0> 2011-07-14 17:27:35,995 INFO 'status' command finished successfully
[17:28] <kim0> Let us quickly check out the meaning of this status message
[17:28] <kim0> In the machines section .. we now have 3 machines .. 0 1 and 2
[17:28] <kim0> In the services section, we have two services deployed
[17:28] <kim0> mycms and mydb
[17:29] <kim0> You can see mycms (drupal) is running on machine 1 (from the machines section, it's url is ec2-107-20-30-230.compute-1.amazonaws.com)
[17:29] <kim0> and mydb (mysql) is running on machine 2
[17:30] <kim0> Let me know paste an updated status
[17:30] <kim0> $ ensemble status
[17:30] <kim0> 2011-07-14 17:29:44,206 INFO Connecting to environment.
[17:30] <kim0> machines:
[17:30] <kim0>   0: {dns-name: ec2-50-17-153-3.compute-1.amazonaws.com, instance-id: i-f3c13e92}
[17:30] <kim0>   1: {dns-name: ec2-107-20-30-230.compute-1.amazonaws.com, instance-id: i-0537c864}
[17:30] <kim0>   2: {dns-name: ec2-50-19-190-104.compute-1.amazonaws.com, instance-id: i-e537c884}
[17:30] <kim0> services:
[17:30] <kim0>   mycms:
[17:30] <kim0>     formula: local:drupal-9
[17:30] <kim0>     relations: {}
[17:30] <kim0>     units:
[17:30] <kim0>       mycms/0:
[17:30] <kim0>         machine: 1
[17:30] <kim0>         relations: {}
[17:30] <kim0>         state: started
[17:30] <kim0>   mydb:
[17:30] <kim0>     formula: local:mysql-97
[17:30] <kim0>     relations: {}
[17:30] <kim0>     units:
[17:30] <kim0>       mydb/0:
[17:30] <kim0>         machine: 2
[17:30] <kim0>         relations: {}
[17:30] <kim0>         state: started
[17:30] <kim0> 2011-07-14 17:29:46,435 INFO 'status' command finished successfully
[17:31] <kim0> Now you can the state of both services is "started"
[17:31] <kim0> which means they have been successfully installed and started
[17:31] <kim0> Note however that till now, the two services are deployed "separately"
[17:31] <kim0> that is mysql knows nothing about drupal and vice versa
[17:31] <kim0> The big bang (a ha) moment happens when you connect both services together!
[17:31] <kim0> let's do just that
[17:32] <kim0> Here is how I just did it
[17:32] <kim0> $ ensemble add-relation mycms mydb:db
[17:32] <kim0> 2011-07-14 17:32:03,640 INFO Connecting to environment.
[17:32] <kim0> 2011-07-14 17:32:04,759 INFO Added mysql relation to all service units.
[17:32] <kim0> 2011-07-14 17:32:04,760 INFO 'add_relation' command finished successfully
[17:32] <kim0> I am using add-relation to connect the two services together
[17:32] <kim0> Once the connection happens
[17:33] <kim0> mysql recognizes drupal needs a database service
[17:33] <kim0> mysql creates a new database for drupal
[17:33] <kim0> sends over the connection information (ip, username, password) needed to connect to the newly created database! cool!
[17:33] <kim0> drupal receives this information, configures itself to connect to that service
[17:34] <kim0> the end result .. with that single command
[17:34] <kim0> and with Ensemble in the background
[17:34] <kim0> you have deployed a multi-tier service
[17:35] <kim0> As we just mentioned the url for the mycms machine is http://ec2-107-20-30-230.compute-1.amazonaws.com/ensemble/
[17:35] <kim0> and you can indeed hit that url with your browser right now
[17:35] <kim0> and you should get drupal waiting for you .. hurray
[17:36] <kim0> I'd like to quickly show you as well .. the formula for drupal
[17:36] <kim0> i.e. how simple it is to write such a formula
[17:36] <kim0> I chose to write this formula in bash, however as mentioned, you can use any language you fancy!
[17:38] <kim0> The install hook (what runs to install the service) is now shown in the shared screen
[17:38] <kim0> I am however .. pasting it as well for archiving purposes
[17:38] <kim0> #!/bin/bash
[17:38] <kim0> set -eux # -x for verbose logging to ensemble debug-log
[17:38] <kim0> ensemble-log "Installing drush,apache2,php via apt-get"
[17:38] <kim0> apt-get -y install drush apache2 php5-gd libapache2-mod-php5 php5-cgi mysql-client-core-5.1
[17:38] <kim0> a2enmod php5
[17:38] <kim0> /etc/init.d/apache2 restart
[17:38] <kim0> ensemble-log "Using drush to download latest Drupal"
[17:38] <kim0> cd /var/www && drush dl drupal --drupal-project-rename=ensemble
[17:39] <kim0> As you can see, it simply uses apt-get to install some packages, enables php, restarts apache
[17:39] <kim0> and then uses "drush" the drupal shell, to download a fresh version of drupal
[17:39] <kim0> it's interesting to see that ensemble does NOT force you to only use ubuntu packages
[17:39] <kim0> you can mix and match like I just did
[17:40] <kim0> as a developer, you can grab any code branch and build it and mix that with package installations, if you so wish
[17:40] <kim0> Very well ..
[17:40] <kim0> remember the magic that happened when we connected the two services together
[17:40] <kim0> the "add-relation" command
[17:40] <kim0> let us see the code that runs from drupal's perspective
[17:41] <kim0> I have just displayed it on the shared screen
[17:41] <kim0> I will paste it in chunks
[17:41] <kim0> #!/bin/bash
[17:41] <kim0> set -eux # -x for verbose logging to ensemble debug-log
[17:41] <kim0> hooksdir=$PWD
[17:41] <kim0> user=`relation-get user`
[17:41] <kim0> password=`relation-get password`
[17:41] <kim0> host=`relation-get host`
[17:41] <kim0> database=`relation-get database`
[17:42] <kim0> these last 4 lines, read various settings from Ensemble provided communication channels
[17:42] <kim0> they read: user, password, host, database
[17:42] <kim0> these settings are provided by the mysql service upon establishing the connection.
[17:42] <kim0> drupal reads them, to configure itself to connect to that DB
[17:43] <kim0> let us see how the connection happens
[17:43] <kim0>     ensemble-log "Setting up Drupal for the first time"
[17:43] <kim0>     cd /var/www/ensemble && drush site-install -y standard \
[17:43] <kim0>     --db-url=mysql://$user:$password@$host/$database \
[17:43] <kim0>     --site-name=Ensemble --clean-url=0
[17:43] <kim0> easy enough!
[17:43] <kim0> we just use drush to install drupal passing the need parameters we just consumed
[17:43] <kim0> What is really important to notice here
[17:44] <kim0> is that I might have never touched mysql before
[17:44] <kim0> I do not have to know how it works or how to configure it
[17:44] <kim0> or I cared about, was the Ensemble provided interface .. those 4 parameters in this case
[17:45] <kim0> The actual script is slightly longer, since it checks whether or not this is first time drupal is being set up
[17:45] <kim0> i.e. are we starting the very first drupal node, or just scaling it up
[17:45] <kim0> oh yeah .. because scaling it up is as simple as
[17:45] <kim0> ensemble add-unit mycms
[17:45] <kim0> yep .. that's it
[17:46] <kim0> So I hope this was a useful introduction to Ensemble
[17:46] <kim0> I'll provide a couple of pointers and answer question
[17:46] <kim0> questions*
[17:46] <kim0> You can read more about Ensemble at: https://ensemble.ubuntu.com/
[17:46] <kim0> Documentation: https://ensemble.ubuntu.com/docs/
[17:46] <kim0> Mailing list: https://lists.ubuntu.com/mailman/listinfo/ensemble
[17:47] <kim0> IRC Channel: #ubuntu-ensemble @ Freenode
[17:47] <kim0> we are a very welcoming community .. it's a party and everyone is invited :)
[17:47] <kim0> So start hacking on your own formula today!
[17:47] <kim0> You can see a list of existing formulas at: https://code.launchpad.net/principia
[17:48] <kim0> Our goal is to cover all of free software!
[17:48] <kim0> Alright .. taking questions
[17:48] <ClassBot> alexm asked: can emsemble be used to deploy outside the cloud?
[17:48] <kim0> alexm: Ensemble uses multiple "providers" to handle what to deploy to
[17:49] <kim0> ec2 cloud is currently the one that is ready, a provider for LXC (Linux container) is being worked on heavily
[17:49] <kim0> and myunderstanding is that it will be ready during this 11.10 cycle
[17:49] <kim0> you can also deploy to private clouds such as openstack or eucalyptus .. not sure how well tested that is, but should mostly work
[17:50] <kim0> Also, Ensemble is being currently integrated with Orchestra
[17:50] <kim0> the Ubuntu server hardware deployment tool
[17:50] <kim0> so you will be able to install to your own hardware farm as well
[17:50] <kim0> I hope that answers your question
[17:51] <ClassBot> There are 10 minutes remaining in the current session.
[17:51] <ClassBot> chadadavis asked: Does ensemble have upstart's concepts of services vs tasks. Backup seems more like a service, whereas migration more like a task.
[17:51] <kim0> Things are a bit too early in Ensemble development right now .. Currently everything is a service
[17:52] <kim0> however the dev team recognize the need that some operation have special needs
[17:52] <kim0> "machine services" are being debated
[17:52] <kim0> various types of services (or whatever they'd be called) can definitely arise
[17:52] <ClassBot> ahs3 asked: each service seems to be a separate machine; can i have multiple services on the same machine?
[17:53] <kim0> ahs3: good question .. With the LXC provider that will become possible
[17:53] <kim0> there is also design work currently to colocate chosen services together
[17:53] <kim0> interested code hackers are invited to hack on ensemble core to make this happen faster :)
[17:53] <kim0> #ubuntu-ensemble
[17:54] <kim0> Ensemble itself is written in python using twisted framework afaik
[17:54] <ClassBot> ahs3 asked: how do i find out what services are available?
[17:54] <kim0> ahs3: As mentioned this is the current list
[17:54] <kim0> https://code.launchpad.net/principia
[17:54] <kim0> this only started a few weeks back
[17:54] <kim0> so it is growing rapidly
[17:55] <kim0> I am more than ready to help anyone write his own first formula
[17:55] <kim0> just grab me (kim0) on #ubuntu-ensemble
[17:55] <kim0> and start hacking on your own formula :)
[17:55] <ClassBot> alexm asked: how does mycms know that it has to use mydb? i.e. mycms is deployed with another db before connecting to mydb?
[17:55] <kim0> alexm: good question
[17:55] <kim0> it doesn't
[17:55] <ClassBot> There are 5 minutes remaining in the current session.
[17:55] <kim0> I tell it to use mydb
[17:55] <kim0> when I issued
[17:56] <kim0> add-relation mycms mydb:db
[17:56] <kim0> This is exactly what "connects" or "relates" them together
[17:56] <kim0> before add-relation they have no idea about each other
[17:56] <kim0> and mycms does NOT have another DB .. in fact it has no db at all and is mostly misconfigured
[17:57] <kim0> Awesome .. that concludes this session
[17:57] <kim0> feel free to ask me any further questions in #ubuntu-ensemble
[17:57] <kim0> till next time .. c ya
[18:01] <ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/07/14/%23ubuntu-classroom.html following the conclusion of the session.
[18:01] <janimo> Hello everybody
[18:01] <janimo> I am Jani Monoses, a member of the Canonical ARM team and will speak about ARM related build failures in this session
[18:02] <janimo> feel free to ask questions as we go, on the -chat channel
[18:03] <janimo> As a reference and overview of today's discussion check out this wiki page https://wiki.ubuntu.com/ARM/FTBFS
[18:03] <janimo> ARM only recently got popular enough so that enough developers have them, but still hw is  unavalable to most people
[18:04] <janimo> this is the reason why there are more build failures (FTBFS from now on) on ARM than on other architectures in Ubuntu
[18:05] <janimo> the situation has improved in the past cycles though, and none of these are very critical or unfixable, given developer attention
[18:05] <janimo> The failures are so common and recurring that there's even a weekly 'portin jam' on #linaro every Wednesday, to deal with failing packages for a few hours
[18:06] <janimo> http://qa.ubuntuwire.com/ftbfs/
[18:06] <janimo> to get an idea of the number of failures, check the ARM column on this page
[18:06] <janimo> click around on some packages which are only red for ARM, and it will take you to the LP build log page
[18:07] <janimo> there you'll encounter the reason for the FTBFS and it very likely falls into one of the categories I'll go over now
[18:07] <janimo> and which are mentioned on the wiki page
[18:08] <janimo> The most innocent one, is that build server hardware has little RAM (<-=512M) so cannot cope with some packages without entering a swapstorm
[18:08] <janimo> these can be ignored as there's nothing we can do about them, short of waiting for the soon to be upgraded ARM build servers
[18:09] <janimo> There are then porting issues, much like there used to be from x86 to big-endian hw, or from 32bit to 64 bit
[18:09] <janimo> only there are different and a bit more varied
[18:10] <janimo> most problems and failing packages are C/C++ as that is where platform details are exposed, and are easy to overlook
[18:11] <janimo> for intance char on ARM is by default unsigned, whereas on x86 it is signed char, so such an assumption can lead to program failure at runtime
[18:11] <janimo> when warnings are treated as errors during compiling, many such differences are caught by gcc though
[18:12] <janimo> even if a bug would only manifest at runtime, the fact that many packages include a test-suite that is run as part of the build process means the build can fail on FAILed tests
[18:12] <janimo> segfaults ro assertions are an indication of such a bug
[18:13] <janimo> there are cases also where upstream just did not test on ARM, or made the build system work with x86/amd64 only
[18:13] <janimo> these should not be hard to fix either
[18:13] <janimo> Many of the current failures are for apps using Qt and OpenGL at the same time
[18:14] <janimo> ARM platforms do not have hw accelerated OpenGL drivers, only accelerated GLES (which is a subset of modern GL)
[18:14] <janimo> so on ARM we make Qt use GLES as its OpenGL rendering backend (Qt does rely on GL for some accelerated rendering, which is transparent to the app developer)
[18:15] <janimo> but Qt also lets the developer use GL directly and provides a Qt surface to render onto
[18:15] <janimo> when this is used and the app contains Qt code and explicit GL API calls it will break on ARM because of GLES and GL headers conflict
[18:16] <janimo> these are not easy to fix, and usually need upstream to port their code to GLES in addition to desktop GL
[18:16] <janimo> Another Qt gotcha that is not uncommon is the use of the type qreal which is a typedef for a floating point type
[18:17] <janimo> on x86 this is a double but on ARM it is floart
[18:17] <janimo> code that treats 'qreal' and 'double' interchangeably will likely not build on ARM, so some explicit casts or rethinking of the types used is needed
[18:18] <janimo> this is simple for plain C code, but Qt - and especially bindings - use autogenerated code which can also rely on this assumption, so one may need to dig deeper in the Qt tools and bindings to fix a certain app
[18:19] <janimo> Sometimes to expose different APIs some libs have slightly different symbols exported on ARM. So debian symbol files may need adjustment and customization from time to time, when upstream did not test ARM
[18:20] <janimo> A family of failures which are luckily getting fewer are ARM architecture incompatibilities
[18:20] <janimo> Ubuntu builds for ARMv7 , currently the most modern variant of the ARM architecture
[18:21] <janimo> For a while, since Debian defaulted to ARMv5, an older but still very widespread variant, some issues were apparent only on Ubuntu
[18:21] <janimo> but now with most mobile devices using ARMv7, and hw availability in the form of devel boards, upstream updates their build systems, and ifdefs in the code to include ARMv7 too
[18:22] <janimo> still if you find a package that FTBFS because it does not check for armv7 (but say only armv5) in it configure scripts, it should be a straightforward fi
[18:22] <janimo> x
[18:23] <janimo> Many of the failures, and the hardest to fix - as it requires toolchain expertise - are those caused by gcc/binutils bugs
[18:23] <janimo> the tools evolve fast and thus sometimes regressions occur
[18:24] <janimo> the package may fail due to a gcc ICE (internal compiler error) or worse have bad code generated and fail in the tests
[18:24] <janimo> or even worse successfully build but then cause weird segfaults in other unrelated packages, especially if it is a widely used library
[18:26] <janimo> when you have one of the above scenarios, try rebuilding with a more mature version of gcc (gcc-4.4 or 4.5 currently) or without optimization (-O0) to see if it is indeed a new gcc optimization regression
[18:26] <janimo> then if so, pass it on the Linaro toolchain developers :)
[18:26] <janimo> I'll take a minute or two to see if there are questions
[18:28] <janimo> Or we can look randomly at any of the bugs listed on the failures page and see if it indeed fits the categories above or I lied
[18:28] <janimo> thank you, what a terrific audience :)
[18:29] <janimo> QUESTION: are there good reasons to export different symbols on arm
[18:30] <janimo> micahg, good question. I think these are generally consequences of bugs (so accidental) or upstream need to do this because of some other libs being used on ARM
[18:30] <janimo> and so it exports a new API to reflect that backend
[18:30] <janimo> I did not encounter these often
[18:31] <janimo> IIRC clutter had such a case but cannot think of another offhand
[18:32] <janimo> now that micahg asked I remember there's another tricky case of failures
[18:32] <janimo> that of apps which generate native code or that use extensive asm code
[18:33] <janimo> the latter need porting and fixing for the ARM variant we use (removing use of deprecated ARMv5 instructions, constraints on register usage) but should be straightforward
[18:33] <janimo> the former though, which have their own JIT (mono, chromium, llvm) can be hard to debug
[18:33] <janimo> and are usually upstream work
[18:34] <janimo> the interaction and failure between gcc we use (which can have a regression), the one they used, and the generated JIT code needs very good knowledge of said project codebase
[18:35] <janimo> and does not fit any of the more generic categories above
[18:35] <janimo> micahg, I see in the next channel that you just wanted to ask this, nice :)
[18:36] <janimo> and when the situation is so complex, one cannot be sure if it is a toolchain issue, or upstream issue or more likely a combination. The JIT featuring apps, tend to be complex in many other ways too
[18:36] <janimo> So it is not surprising that such bugs are the most long-lived and when they get fixed it is not always clear why they went away
[18:37] <janimo> Mono used to be very broken till natty, until NCommander and upstream managed to fix it
[18:37] <janimo> chromium keeps failing too
[18:38] <janimo> and Java, which is the ultimate JIT-based project is so broken that there is no suitable open source and fast enough JVM
[18:39] <janimo> but the vast majority of build failures are like other bugs, not too exciting and matching some patterns
[18:39] <janimo> but they can only be worked on effectively if people have ARM hardware
[18:39] <janimo> QUESTION: is there a guide for the register code cleanup?
[18:40] <janimo> another question from micahg . You mean what I mentioned above - register constraints?
[18:40] <janimo> gcc usually says something like r13 cannot be used here
[18:41] <janimo> or r7 or whatever. Which means that for the target ABI you are building that register is used by gcc
[18:41] <janimo> so I just fixed the 2 or 3 such cases by replacing with an obviously unused register and testing it work.
[18:42] <janimo> I do not have a link, but googling for ARM EABI resered registers or something like that should give the answers
[18:43] <janimo> ARM, like x86 has reserved names for special purpose registers (stack pointer, program counter, frame pointer), but confusingly those can also be referenced by their generic names like r12, r15, r13 or similar
[18:43] <janimo> so the asm code using those may not obviously be using a reserved register for general purpose computation.
[18:45] <janimo> gladk> QUESTION: What ARM-hardware do you usually use and can recommend?
[18:45] <janimo> I and most of the ARM team use TI pandaboards for development
[18:46] <janimo> as they are fast enough. But any ARMv7 that you can afford should be good. Other vendors are starting to offer <200$ devel boards
[18:47] <janimo> I am happy with the panda, but did not use something else extensively to recommend. There are also toshiba ac100 netbooks which have some ubuntu images for SD floating around, those to are ok for building
[18:47] <janimo> although they only have 512M of RAM compared to the panda's 1G
[18:48] <janimo>  micahg has https://www.genesi-usa.com/store/details/12 which seems to do a decent job
[18:48] <janimo> for hw related question feel free to pop in #ubuntu-arm, there are many people with a variety of hw there, and you may get better answers
[18:49] <janimo> With many ARM tablets and netbook appearing and being rooted, chances are that Ubuntu is going to find its way on many of them
[18:51] <ClassBot> There are 10 minutes remaining in the current session.
[18:51] <janimo> While certainly not falling under the scratching their own itch category, devs can help with ARM FTBFS without actually fixing or owning hw but by bug triaging
[18:52] <janimo> we have over 100 failures and the wiki page describes how those can be easier to manage and keep at bay
[18:52] <janimo> Close invalid bugs: Some bugs may get out of date if they are filed automatically on FTBFS but then are forgotten and not closed when a new build succeeds.
[18:52] <janimo> Check the issue with Debian/upstreams and forward upstream or link to upstream bugtracker patches
[18:52] <janimo> Tag them for easier retrieval: they all have the ftbfs and arm-porting-queue tags, but there can be other good ways to tag (arm-build-timeout , qt-opengl-arm, etc)
[18:53] <janimo> although I honestly don't see why one would do such things enthusiastically if not owning ARM hw :)
[18:54] <janimo> Thanks for the questions so far, any others?
[18:55] <ClassBot> There are 5 minutes remaining in the current session.
[18:59] <janimo> cheers, and thanks for reading.
[19:00] <janimo> That includes those reading the irclogs later :)
[19:01] <ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/07/14/%23ubuntu-classroom.html following the conclusion of the session.
[19:01] <jaytaoko> Hello
[19:04] <jcastro> jaytaoko: go ahead and begin!
[19:05] <jaytaoko> My name is Jay Taoko and I am a software developer at Canonical, in the Desktop Experience Team.
[19:05] <jaytaoko> I am the creator of Nux, the toolkit we use for unity's rendering!
[19:06] <jaytaoko> A bit about myself and how I ended at Canonical working on Unity:
[19:06] <jaytaoko> At started working at Matrox, in Montreal, Canada, where I learned a great deal about GPUs and computer graphics.
[19:07] <jaytaoko> After that, I worked at other companies doing graphics, including EA and Ubisoft.
[19:07] <jaytaoko> After leaving Ubisoft, I started my own gig.
[19:07] <jaytaoko> After a few years, out of the blue, someone mentioned that Canonical is looking for an OpenGL developer.
[19:08] <jaytaoko> Having used Linux in the past, I knew about Canonical, but it had been a while since I installed Linux on any of my machines.
[19:09] <jaytaoko> I was skeptic at first. Until I understood that Canonical was very serious about graphics.
[19:09] <jaytaoko> That is when I decided to sign in!
[19:09] <jaytaoko> Coming from the Windows operating system, I had to learn things on Ubuntu.
[19:10] <jaytaoko> I have to say that this hasn't been a big problem.
[19:10] <jaytaoko> I have been very welcomed at Canonical.
[19:10] <jaytaoko> I have annoyed my colleagues with end-of-lines issues in the code, but I  have found ways to fix this and now it has become a practical joke...
[19:11] <jaytaoko> Now, onto Unity and Nux!
[19:11] <jaytaoko> Nux is the toolkit we for Unity's rendering.
[19:11] <jaytaoko> we use*
[19:12] <jaytaoko> I started Nux many years ago and I am very happy to see it used for such a great project.
[19:12] <jaytaoko> Nux is written in C++ and it uses OpenGL for its rendering
[19:13] <jaytaoko> It has a good widget set for writing graphics applications: http://i.imgur.com/ax1Q5.png
[19:14] <jaytaoko> Although Nux has been adapted to support Unity, its original intent (writing real-time graphics application user interface) will remain.
[19:15] <jaytaoko> There are very talented people working on it. They are adding  support for C++0x and other features to it. This is really great!
[19:15] <jaytaoko> Nux provides the rendering of Unity. To that end, Nux has to be facilitate direct access to OpenGL.
[19:16] <ClassBot> kamil_p asked: Which projects besides Unity uses Nux?
[19:16] <jaytaoko> Only Unity uses it at the moment
[19:16] <jaytaoko> Nux has a rendering API that is used for common rendering operation (rendering of widgets).
[19:17] <jaytaoko> It also tries to hide the OpenGL API by providing convenience functions and objects.
[19:18] <jaytaoko> However, we are free to use raw OpenGL is we need to.
[19:18] <jaytaoko> however, one has to know how cooperation between nux and raw opengl works
[19:19] <jaytaoko> But I think that encapsulating OpenGL into a wrapper is the right thing to do for most cases.
[19:20] <jaytaoko> Unity is our flagship product. We want it to be great! We know what we want  Unity to be for this cycle. But we don't know yet what it will be in 2  years.
[19:20] <jaytaoko> We have a design team working on new ideas all the time.
[19:20] <jaytaoko> the deal between Unity and Nux is like this:
[19:21] <jaytaoko> Wherever we take Unity, the Nux has to offer flexibility and convenience to achieve Unity's goal.
[19:21] <jaytaoko> With the DX team working on both Unity and Nux, we have more  opportunities to improve, optimize and react to any changes required.
[19:22] <jaytaoko> It hasn't been easy though. They was some rough edges at first. We had  to modify Nux so that it can be embedded inside a Compiz plugin.
[19:22] <jaytaoko> Also, we have had issues with graphics drivers.
[19:23] <jaytaoko> This is a burning issue.
[19:24] <jaytaoko> We try to get Unity working on as many systems as possible. We have  Unity running well on  Atom N270, or systems with older GPUs: ATI  X1950, NVidia 6600...
[19:24] <jaytaoko> And in Natty, we required less OpenGL features and GPU horse power than people think.
[19:24] <jaytaoko> Only graphics features that have been around for at least 5 years were required.
[19:25] <jaytaoko> Unity is in this unique position that it is advancing desktop rendering on all systems that support it.
[19:26] <jaytaoko> It is bound to reveal more issues with graphics than any other application on the desktop before.
[19:27] <jaytaoko> I have had some question regarding Unity support on geforce 2 cards!
[19:27] <jaytaoko> yes, that is old!
[19:27] <jaytaoko> but this is the challenge of Unity!
[19:28] <jaytaoko> we can't get it to run on old GPU and I hope people understand. But we try as much as possible.
[19:29] <jaytaoko> And there is Unity2D that Canonical is investing in!
[19:29] <jaytaoko> If a system cannot run Unity with full opengl, there is always Unity2D.
[19:30] <jaytaoko> The thing about the graphics issues is like this:
[19:31] <jaytaoko> The more issues we find, the closer we get to  solutions and the better graphics rendering improves for everybody on  Ubuntu and across all Linux systems.
[19:31] <jaytaoko> We are starting something new, but we are going to make things better.
[19:32] <jaytaoko> This is what we started with almost a year ago:
[19:32] <jaytaoko> http://i.imgur.com/zC9v8.jpg
[19:33] <jaytaoko> yes, that is Unity + Compiz + Nux!
[19:33] <jaytaoko> Our Alpha 0 prototype!
[19:34] <jaytaoko> Jason Smith and Neil Patel and I got locked in a room for a week an prototyped the next iteration of Unity with Compiz and Nux...
[19:34] <ClassBot> jsjgruber asked: Unity's indicators disappeared for me under Oneiric sometime in June. Known problem or should I file a bug against nux or some other project?
[19:34] <jaytaoko> As you can see, we have come a long way...
[19:36] <jaytaoko>  jsjgruber: probably a known issue
[19:36] <jaytaoko> The control we have over Nux has allowed us to add the necessary fixes to get Unity working on as many system as possible.
[19:36] <jcastro> Got a question: does nux only work with linux? ()
[19:36] <jcastro> (from the channel, the bot is busted or something)
[19:36] <jaytaoko> Sometimes even at the last minutes before Ubuntu's release (thanks to our  superb Desktop team of packagers: seb128, didrocks and all).
[19:38] <jaytaoko> nux also works on Windows. I am constantly keeping the windows and Linux version in sync. However, I haven't released the windows project files.
[19:38] <jaytaoko> it is quite easy to maintain both version. 95% of the code is the same.
[19:39] <jaytaoko> We have had great support from GPU vendors to help us fix issues with Unity on some systems!
[19:39] <jaytaoko> We also report bugs to open source drivers and our hope is that this will benefit everyone.
[19:40] <jaytaoko> Now, what is coming next in Nux?
[19:40] <jaytaoko> We are improving Nux for unity.
[19:41] <jaytaoko> In Natty, we were using mostly ARB shader programs on all systems except NVidia GPUs.
[19:42] <jaytaoko> We couldn't do it for AMD GPUs in time with the fglrx driver.
[19:43] <jaytaoko> However we worked a great deal with AMD to resolve another issue and that is why we didn't have enough time in the end to test the GLSL shader code path
[19:44] <jaytaoko> For Oneiric, we will enable the GLSL shader code path on a much system as possible.
[19:45] <jaytaoko> What we are going to get from it is the ability to do more in terms of visual quality
[19:45] <jcastro> QUESTION:What is the recommended way to start the project?
[19:46] <jaytaoko> The best way is to approach Nux from Unity's side
[19:46] <jaytaoko> The launcher, the Dash are all rendered with Nux
[19:47] <jaytaoko> Download Unity's source code and take a look at the Launcher code. There you will see some shaders, rendering code...
[19:47] <jaytaoko> That will show you how we use Nux in Unity.
[19:48] <jaytaoko> The tests in Unity are a good sample of Nux programs...
[19:49] <jaytaoko> Give them a try.
[19:49] <jaytaoko> Then, there is Nux itself. It as a few test program of its own.
[19:49] <jcastro> QUESTION: Can I embed GTK+/Qt widgets?
[19:50] <jaytaoko> Maybe one way to start is to try and write a small Nux program. Nothing fancy, just get started.
[19:50] <ClassBot> There are 10 minutes remaining in the current session.
[19:51] <jaytaoko> That will also make you better at debugging in Unity if you choose to.
[19:51] <jaytaoko> Questions?
[19:52] <jcastro> QUESTION: Can I embed GTK+/Qt widgets?
[19:53] <jaytaoko> I think so, but I am not sure.
[19:53] <jaytaoko> Nux uses the glib main loop.
[19:53] <jaytaoko> So it should be compatible with Gtk+/Qt somehow, but I have never tried it
[19:54] <jaytaoko> However, some of us have been thinking about embedding Nux into Gtk+
[19:54] <jaytaoko> Something that Nux is missing right now is documentation.
[19:55] <ClassBot> There are 5 minutes remaining in the current session.
[19:56] <jaytaoko> We are busy working on Unity but it would help people who want to learn if we have better documentation and tutorial on how to program in Nux.
[19:56] <jaytaoko> Questions?
[20:01] <ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/07/14/%23ubuntu-classroom.html following the conclusion of the session.
[20:01] <jamespage> Hi Everyone o/
[20:02] <jamespage> Welcome to the Java library packaging with maven-debian-helper Ubuntu Developer Week session
[20:02] <jamespage> So - organisational bits first:
[20:02] <jamespage> Please ask questions whenever you like on #ubuntu-classroom-chat and please prefix your question with 'QUESTION:'  I'll try to keep and eye out
[20:02] <jamespage> All session logs will be uploaded and accessible from https://wiki.ubuntu.com/UbuntuDeveloperWeek - so if you need a reminder of something covered in the session then please look there.
[20:03] <jamespage> My name is James Page and I've been contributing to Ubuntu since September last year
[20:03] <jamespage> I work for Canonical and I'm a member of the Ubuntu Server team so apologies if some of this session is a little server centric :-)
[20:04] <jamespage> This session is intended to give you an overview of packaging Java libraries for Ubuntu - specifically Java projects that use the Maven build system.
[20:04] <jamespage> So first things first - why package Java libraries for Ubuntu?
[20:05] <ClassBot> Daviey asked: Java tradionally has a bad reputation on Linux, why is this?
[20:05] <jamespage> Timely question - lets cover that one first
[20:05] <jamespage> I think it due to the way the Java projects are typically developed
[20:06] <jamespage> Because the Java Virtual Machine abstracts the developer away from the underlying operating system
[20:06] <jamespage> they are free to load that virtual machine with exactly the code they want
[20:07] <jamespage> dependent libraries are often bundled in a variety of nasty ways
[20:07] <jamespage> which means that its hard to pull out common libraries and base line in the way a Linux distro likes todo.
[20:08] <jamespage> not impossible - just hard
[20:08] <jamespage> to a certain extent the toolsets exacerbate this behaviour
[20:09] <jamespage> so back to my original question - why package Java libraries for Ubuntu?
[20:09] <jamespage> Well from my perspective its about delivering Java applications onto the Ubuntu platform;
[20:09] <jamespage> this would include things like Tomcat, Jenkins, Hadoop, Eclipse etc...
[20:09] <jamespage> (some of which we have in Ubuntu, some of which we don't - yet)
[20:10] <jamespage> However these applications need to rely on the Java libraries that are packaged for Ubuntu
[20:10] <jamespage> in the same way that other libraries are packaged once and then used by all applications that need them we aim todo the same with Java libraries.
[20:11] <jamespage> So having a broad, well maintained set of libraries is key to both maintaining the existing Java applications and delivering new applications into Ubuntu.
[20:11] <jamespage> This does not always align well with the way that most Java project work;
[20:12] <jamespage> as I just discussed each project can pretty much load the Java Virtual Machine with the code then want
[20:12] <jamespage> which means they don't have to give consideration to other Java projects - because they will be isolated in the same way
[20:13] <jamespage> however by maintaining a single set of libraries we try to bring some of the Linux distro goodness to the Java world
[20:13] <jamespage> So - next bit is a little dull but important
[20:13] <jamespage> Java libraries should follow the Debian Java Policy - see http://www.debian.org/doc/packaging-manuals/java-policy/ for the full details.
[20:14] <jamespage> In fact its probably worth pointing out now that 90%+ of the Java libraries come unchanged for Debian
[20:14] <jamespage> As a quick 101:
[20:14] <jamespage> Library packages should be named libXXX-java - for example libcommons-io-java
[20:14] <jamespage> Documentation should be in a separate package libXXX-java-doc
[20:14] <jamespage> Libraries (jars in the case of Java) should be installed into /usr/share/java - publishing Jar's into a single location aids with discover-ability etc...
[20:14] <jamespage> and where possible into /usr/share/maven-repo - more on this in a bit.
[20:15] <jamespage> Fortunately the toolset around generating Java library packaging for Maven projects helps out quite alot with this so you should find it fairly easy to generate a policy compliant library.
[20:16] <jamespage> Just in case you are not familiar with Maven its probably the most popular software project management tool used by Java projects
[20:16] <jamespage> Its much more than just a build tool - hence 'Software Project Management'
[20:17] <jamespage> through a pretty extensive range of plugins it integrates with most SCM's and issue trackers allowing easy automation of defect tracking, release processes, publishing of project artefacts etc...
[20:18] <jamespage> however in Ubuntu it does get pretty much relegated to being a build tool - most of value add is not applicable and is mainly used by the upstream projects
[20:18] <jamespage> It operates by convention; if you stick your code in the right place Maven will find it and build it; it will also have a look for test code and compile and run that as well.
[20:19] <jamespage> Its uses project object model files - POM's
[20:19] <jamespage> to define various metadata about the software project including its namespave, name, dependencies, build process, author, licensing ....
[20:20] <jamespage> the list goes on and is incredibly rich - this information is really useful when packaging
[20:20] <jamespage> but depth is not always great :-(
[20:20] <jamespage> So I'm now going to give a quick demo of packaging a basic Java library using maven-debian-helper
[20:20] <jamespage> To follow the demo you will need to log into the following server
[20:20] <jamespage> ssh guest@ec2-46-137-134-25.eu-west-1.compute.amazonaws.com
[20:20] <jamespage> password should be guest
[20:21] <jamespage> I'm going to be using a tool called byobu so that we can all see the same session.
[20:21] <jamespage> So as it takes a bit of time I've already setup the packaging environment on this Ubuntu server;
[20:22] <jamespage> If you needed to do it
[20:22] <jamespage> sudo apt-get install packaging-dev default-jdk maven-debian-helper javahelper apt-file aptitude
[20:22] <jamespage> packaging-dev (thanks bdrung) is a new package which is intended to setup all the basics for package development;
[20:22] <jamespage> we also need the Java Dev Kit and the java specific helpers (plus some other tools)
[20:22] <jamespage> So next step - generate some basic packaging using mh_make;
[20:23] <jamespage> we are going to pull a upstream tarball from github and then do some basic packaging
[20:24] <jamespage> metainf-services is a very simple library that helps generated metadata for jar files during packaging
[20:24] <jamespage> so as you can see we just have a pom.xml file and a src dir
[20:25] <jamespage> next we use mh_make
[20:25] <jamespage> mh_make tries to guess most things but it does give you the option to change stuff
[20:26] <jamespage> so we are going to run tests and generate API docs
[20:26] <jamespage> mh_make uses apt-file to search for any missing dependencies
[20:26] <jamespage> if it can't find something it needs in /usr/share/maven-repo it will search using apt-file and try to make a recommendation
[20:27] <jamespage> So this bit is quite important
[20:27] <jamespage> when the package is built it gets deployed into /usr/share/maven-repo twice
[20:27] <jamespage> once under the original version - 1.2 in this case
[20:28] <jamespage> and once under a fixed label - this is normally debian or 1.x/2.x if multiple versions of a library are packaged
[20:28] <jamespage> this means that other libraries can 'fix' on a version which can then be changed under the hood if a new version of the library is released
[20:28] <jamespage> without having to update all pom files
[20:28] <jamespage> more on this in a bit
[20:29] <jamespage> mh_make also makes a guess as to with plugins are not useful for packaging
[20:29] <jamespage> this last one is unknow - infact its used for publishing a micro-site to github - which we don't need either
[20:30] <jamespage> mh_make then generates the base packaging
[20:30] <jamespage> you will notice that it used licensecheck to search for useful information on copyright and licensing - we'll see the results of that in a mo
[20:31] <jamespage> So I'm going to make this into a bazaar branch to help out a bit
[20:31] <jamespage> So lets take a look around:
[20:32] <jamespage> So using the information that licensecheck found in the headers mh_make has had a stab at generating a copyright file
[20:32] <jamespage> its not bad - normally this needs a few tweaks to get it exactly right but it does most of the hard work
[20:32] <jamespage> The maven.*rules files are used by maven-debian-helper to transform the Maven pom.xml files during the build of the project;
[20:33] <jamespage> so in maven.ignoreRules you can see the two plugins that we told mh_make to ignore - these get transformed out of the pom.xml during the build
[20:34] <jamespage> maven.rules is pretty simple in this case - this will create a 1.x version alongside the 1.2 version in /usr/share/maven-repo
[20:34] <jamespage> so we also get a maven.cleanIgnoreRules
[20:34] <jamespage> this is used when the clean target is called for the project
[20:35] <jamespage> typically this requires alot less dependencies so it may be a longer list of exclusions
[20:35] <jamespage> for this package its OK for it to be the same as maven.ignoreRules
[20:35] <jamespage> so I'll just do a quick change to the changelog and we are good to go
[20:36] <jamespage> You will notice that mh_make has used  Java Demo <java.demo@ubuntu.com>
[20:36] <jamespage> this gets picked up from DEBEMAIL and DEBFULLNAME environment variabled - I set these up earlier
[20:37] <jamespage> so source package build first
[20:38] <jamespage> maven-debian-helper patches/unpatches the pom.xml file during the process
[20:38] <jamespage> the default target for building the package is 'package' - however for more complex packages 'install' may be more appropriate.
[20:38] <jamespage> generating javadoc
[20:38] <jamespage> (twice - this is a bug!)
[20:39] <jamespage> automatically determining dependencies for the binary packages
[20:40] <jamespage> and done - a few lintian warnings but nothing unsolvable
[20:40] <jamespage> so we now have a built package \o/
[20:41] <jamespage> as we discussed earlier the package deploys 1.2 and 1.x artefacts to /usr/share/maven-repo
[20:42] <jamespage> it also deploys to /usr/share/java - this is to support ant/javahelper based build and applications that require this library
[20:42] <jamespage> and also a -doc package containing the generated API
[20:42] <jamespage>  just to prove that we have created something that at least installs
[20:43] <jamespage> Obviously this is a relatively simple example;
[20:43] <jamespage> however the concepts covered in this session can be used to build up complex dependency chains of packages to support large Java applications like Jenkins.
[20:43] <jamespage> Maven actually makes packaging for Ubuntu easier;
[20:44] <jamespage> because it has a standard way of expressing dependencies and a rich metadata model it is easier to automate the production of packaging
[20:44] <jamespage> packages that use ant are more challenging as they express dependencies in a million bespoke ways
[20:44] <jamespage> (unless they are using a dependency management system like ivy which can make things a little easier).
[20:45] <jamespage> Questions?
[20:46] <ClassBot> coalitians asked: so mavens central repository is never used ?
[20:46] <jamespage> good question - the local Debian repo in /usr/share/maven-repo is used and Maven is executed fully offline
[20:47] <jamespage> maven-debian-helper handles this as part of the packaging build rules
[20:47] <jamespage> so if you switch back to the demo you can see that the debian/rules file is very simple - all of the logic in encapsulated in cdbs classes
[20:48] <jamespage> Any more for any more?
[20:48] <jamespage> OK
[20:48] <jamespage> I hope that you have found this session useful;
[20:49] <jamespage> I normally hang out on #ubuntu-server and #ubuntu-java so if you have any more questions please feel free to ping me.
[20:49] <jamespage> Thankyou and goodnight!
[20:50] <ClassBot> There are 10 minutes remaining in the current session.
[20:55] <ClassBot> There are 5 minutes remaining in the current session.
[21:00] <ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/07/14/%23ubuntu-classroom.html
[23:03] <Nabeel> hello guys
[23:03] <Nabeel> Need some help
[23:04] <Nabeel> hello !!!!
[23:04] <pleia2> the next class doesn't start until 16:00 UTC tomorrow