[00:58] its over for today ? === AlienDev_ is now known as AlienDev [02:51] is there a pc suites for ubuntu? [02:54] anyone in here? [02:54] !classroom [02:54] 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 === emma is now known as em === _LibertyZero is now known as LibertyZero === Igorot is now known as Knightlust [07:16] Hello? === daker_ is now known as daker === msnsachin12 is now known as msnsachin [11:43] where is the class [12:56] 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 === fabio_ is now known as fabio- [15:53] HELLO EVERYBODY! Welcome to Day 4 of Ubuntu Developer Week! [15:53] How are you all doing? [15:53] hey dholbach, hi everyone [15:53] 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] - 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] - If you want to chat or ask questions, please make sure you also join #ubuntu-classroom-chat [15:54] - If you ask questions, please prefix them with QUESTION: [15:54] ie: QUESTION: What does oSoMoN stand for? [15:54] :) [15:54] - if you are on twitter/identi.ca or facebook, follow @ubuntudev to get the latest development updates :) [15:54] ;) [15:54] that's it from me [15:55] you still have 5 minutes until oSoMoN will kick off today and talk about QML App development goodness! [15:55] Have a great day! [15:55] dholbach, bye [15:55] thanks for the introduction dholbach [15:56] let’s wait for 18:00 sharp and we’ll start === Cyberkilla is now known as CK|Spectating === ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu Developer Week - Current Session: From idea to app in no time with QML - Instructors: oSoMoN [16:00] let’s get this rolling… [16:00] 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] let’s get this rolling… [16:01] Hi everyone! [16:01] 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] 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] 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] 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] So, on to the topic! [16:01] There’s a very good introduction of what QML is at http://doc.qt.nokia.com/qdeclarativeintroduction.html. [16:01] There’s also very good documentation, it’s one of the strong points of Qt in general. [16:02] There are official tutorials as well as plenty of unofficial ones on the interwebs. [16:02] Basic tutorial: http://doc.qt.nokia.com/qml-tutorial.html [16:02] Advanced tutorial: http://doc.qt.nokia.com/qml-advtutorial.html === Hutley_ is now known as Hutley [16:02] Here is a non exhaustive list of advantages that make it a great language to develop applications for Ubuntu: [16:02] very good documentation [16:02] implicit animations [16:02] property bindings [16:02] states [16:02] extensible in C++ or Python (using PySide) [16:02] supports touch input (e.g. kinetic scrolling for lists) [16:03] First let’s install the packages we’re going to need: `sudo apt-get install qtcreator qt4-qmlviewer libqtwebkit-qmlwebkitplugin` [16:03] 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] 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] 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] For the sake of the example it’s going to aggregate all feeds from Planet Ubuntu (http://planet.ubuntu.com/). [16:04] 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] 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] 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] Let’s fire up Qt Creator, and click on "Create Project". [16:05] Select "Qt Quick Project" > "Qt Quick UI". [16:05] Let’s call it "feedreader" and create it in e.g. "~/dev/qml". Then click "Next" and then "Finish". [16:05] (if I’m pasting too fast, someone please tell me and I’ll slow down) [16:06] Qt Creator created a skeleton application, which we can already run. [16:06] We will replace this code incrementally to implement the functionality of our feed reader. [16:06] Let’s get started. [16:06] http://bazaar.launchpad.net/~osomon/+junk/qml-feedreader/revision/1 [16:06] 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] 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] 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] 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] 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] http://bazaar.launchpad.net/~osomon/+junk/qml-feedreader/revision/2 [16:08] Instead of a simple Text element, we make the delegate a Rectangle containing two rows of text. [16:08] 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] It is much better already, but we can improve it visually by adding alternating colors to the rows. [16:10] http://bazaar.launchpad.net/~osomon/+junk/qml-feedreader/revision/3 [16:11] 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] 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] http://bazaar.launchpad.net/~osomon/+junk/qml-feedreader/revision/4 [16:13] 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] 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] http://bazaar.launchpad.net/~osomon/+junk/qml-feedreader/revision/5 [16:15] We now want to display the contents of the current entry in a pane to the right of the list. [16:16] The contents are stored in the 'description' attribute, so we need to add it to the XmlListModel. [16:17] 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] 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] http://bazaar.launchpad.net/~osomon/+junk/qml-feedreader/revision/6 [16:18] 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] 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] http://bazaar.launchpad.net/~osomon/+junk/qml-feedreader/revision/7 [16:20] We now add a one-pixel separator between the list view and the webview. [16:20] 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] http://bazaar.launchpad.net/~osomon/+junk/qml-feedreader/revision/8 [16:21] 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] http://bazaar.launchpad.net/~osomon/+junk/qml-feedreader/revision/9 [16:22] 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] This is achieved with a sequential animation; by default animations in QML are run in parallel. [16:24] http://bazaar.launchpad.net/~osomon/+junk/qml-feedreader/revision/10 [16:25] Our webview can be scrolled, that’s nice, but we don’t have any visual indicator of the position within the document. [16:25] 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] 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] 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] http://bazaar.launchpad.net/~osomon/+junk/qml-feedreader/revision/11 [16:28] This scrollbar is very nice, how about we extract it to a separate file so as to make it a reusable component? [16:28] QML files representing components in the same directory as the main one are discovered automatically, no need to import anything else. [16:28] We name the file "ScrollBar.qml", and the component can be used under the name 'ScrollBar'. Easy, heh? [16:29] 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] http://bazaar.launchpad.net/~osomon/+junk/qml-feedreader/revision/12 [16:30] Now that we’ve done that, it is trivial to add a scrollbar to the listview as well. Almost too easy :) === a is now known as Guest32986 [16:31] http://bazaar.launchpad.net/~osomon/+junk/qml-feedreader/revision/13 [16:32] 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] 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] That’s it for the code folks! [16:34] 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] real-world [16:35] 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] 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] 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] It looks like I went really fast (maybe too fast?), let’s open the floor for questions [16:37] !q [16:38] any questions? should I go back to one of the steps and explain in more details? [16:43] abhinav_singh asked: can you please give some links for including QML components with python [16:44] shadeslayer asked: what is the ideal way of communicating with DBus using QML ? [16:44] 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] shadeslayer: one is to use QDeclarativeContext::setContextProperty (assuming you're not using qmlviewer) [16:46] 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] shadeslayer: http://doc.qt.nokia.com/4.7-snapshot/qml-extending.html [16:47] 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] shadeslayer: QtCreator has also some templates to create these plugins easil [16:48] y [16:49] if we’re done with questions, I’d like to mention two cools projects that use QML [16:49] the first one is unity-2d [16:50] the UI is almost entirely written in QML, and it makes it super easy and fun to prototype new ideas [16:50] There are 10 minutes remaining in the current session. [16:51] and the second one is an experiment of mine, a limited clone of the Ubuntu Software Center, written in QML and Python [16:51] this one is more like a playground at the moment [16:52] 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] that’s all I got for you today, we have 10 minutes left, more questions maybe? [16:54] tsimpson asked: have there been any comparisons of the speed of native (C++) apps compared to QML apps? [16:55] tsimpson: I recall reading a blog post about it, let me see if I can find the link for you [16:55] There are 5 minutes remaining in the current session. [16:56] 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] tsimpson: look at the numbers at the end of the article [16:59] looks like it’s time to wrap up, thanks everyone for following and the interesting questions === ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu Developer Week - Current Session: Deploy your App to the cloud, Writing Ensemble formulas 101 - Instructors: kim0 [17:01] 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] Good morning, good afternoon and good evening everyone [17:02] I'm here to introduce you to Ensemble → https://ensemble.ubuntu.com/ [17:02] Ensemble is a cloud orchestration framework [17:02] I am assuming you know what cloud is, and maybe played around a bit with Amazon ec2 [17:03] if you'd like me to provide a quick intro about that as well .. let me know [17:03] just ping me in #ubuntu-classroom-chat or leave a question [17:03] I will be hosting a demo of Ensemble (yay!) [17:04] You can login to this shared screen session → ssh guest@ec2-107-20-18-151.compute-1.amazonaws.com [17:04] password: guest [17:04] or you may view the web UI → https://ec2-107-20-18-151.compute-1.amazonaws.com/ [17:05] So .. as a developer, why would Ensemble interest you ? [17:05] - Ensemble enables you to quickly deploy your code to the cloud for testing/qa purposes [17:05] - You're able to easily test various different versions of operating systems [17:06] - And most importantly .. If deployment instructions for your application are not too simple, Ensemble provides an easy and consistent way [17:06] for your users to deploy your application [17:06] It's like having that big red "easy" button to hit, to deploy your code [17:07] As a developer, you're also ensured that users have deployed your application in exactly the way you would recommend [17:07] If there is any questions so far .. shoot [17:08] Let me jump over a couple of ensemble concepts quickly [17:08] then we'll do the demo [17:08] this session should be short and sweet [17:08] - Ensemble concepts [17:08] * The first thing to note, is that since Ensemble was written in the cloud age [17:09] it does not really care about "servers" .. [17:09] rather it focuses on "services" [17:09] services being .. [17:09] mysql : a database service [17:09] memcached : a high performance caching service [17:09] munin : a monitoring service [17:09] and so on and so forth [17:09] You application, of course interacts with many of those services [17:10] * The second important concept is that Ensemble completely "encapsulates" those services [17:10] that is, if you have no idea how to get munin running [17:10] if you ask ensemble to deploy it, you would have it running within minutes [17:11] and you can connect it (read: relate it) to other services [17:11] and it would start graphing performance metrics from all around your infrastructure [17:11] you do not need to know how to control munin, it is encapsulated [17:12] * The third important concept, is that with Ensemble services are "composable" [17:12] that is, services have well defined interfaces [17:12] such that you can connect/relate many services together .. to form a large infrastructure [17:12] you can replace infrastructure components with others .. such as replace mysql with pgsql if you so wish [17:13] and if both of them implement the same interface! [17:13] In the future, Ensemblse would even handle backing up and migrating your data! [17:13] Cool! [17:13] Enough talk .. let's jump to demo land [17:14] If there's any questions pre demo .. shoot [17:14] * kim0 waits a minute .. and prepares demo land [17:17] = demo begin = [17:17] Please make sure you're logged into the shared ssh session or web UI [17:17] for instructions, scroll up [17:17] Alright! let's get started [17:18] The very fist step, is as I just did in the shared screen [17:18] ensemble bootstrap [17:18] What this does, is it starts a "management" node for Ensemble [17:18] this is the brains for the deployment [17:18] it is a utility node [17:19] of course ec2 needs some time to create this node .. [17:19] so I need to check it is available and ready before proceeding [17:19] I can do this with [17:19] ensemble status [17:20] The node seems to be bootstrapping [17:21] While the node is bootstrapping [17:21] I would like to introduce "formulas" [17:22] Formulas, are Ensemble's way of codifying the experience of deploying code and orchestrating the full service [17:22] So, if you would like to deploy a mysql service [17:22] You would need a mysql formula [17:22] this is the same for any other service [17:23] 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] the "very cool" part! [17:23] is that formulas are language indepndant [17:23] that is, you do not need to learn yet another programming language [17:24] to write those formulas, formulas can be written in python, bash, php, c++ or whatever! [17:24] Very well .. the bootstrap has of course finish bootstrapping [17:24] I will paste ensemble commands and output here for archiving purposes [17:24] $ ensemble status [17:24] 2011-07-14 17:24:16,265 INFO Connecting to environment. [17:24] machines: [17:24] 0: {dns-name: ec2-50-17-153-3.compute-1.amazonaws.com, instance-id: i-f3c13e92} [17:25] services: {} [17:25] 2011-07-14 17:24:18,137 INFO 'status' command finished successfully [17:25] machine number "0" is our bootstrap node [17:25] let us now quickly deploy a wordpress service and a drupal application [17:25] How hard do you think that is? [17:26] Here it is [17:26] ensemble deploy --repository=. drupal mycms [17:26] This deploys an instance of "drupal" .. calls the instance "mycms" [17:27] $ ensemble deploy --repository=. mysql mydb [17:27] This also deploys mysql, calling it mydb! [17:27] doesn't really get much simpler than that! [17:27] let's check out ensemble status now [17:27] $ ensemble status [17:27] 2011-07-14 17:27:34,085 INFO Connecting to environment. [17:27] machines: [17:27] 0: {dns-name: ec2-50-17-153-3.compute-1.amazonaws.com, instance-id: i-f3c13e92} [17:27] 1: {dns-name: ec2-107-20-30-230.compute-1.amazonaws.com, instance-id: i-0537c864} [17:27] 2: {dns-name: ec2-50-19-190-104.compute-1.amazonaws.com, instance-id: i-e537c884} [17:27] services: [17:28] mycms: [17:28] formula: local:drupal-9 [17:28] relations: {} [17:28] units: [17:28] mycms/0: [17:28] machine: 1 [17:28] relations: {} [17:28] state: null [17:28] mydb: [17:28] formula: local:mysql-97 [17:28] relations: {} [17:28] units: [17:28] mydb/0: [17:28] machine: 2 [17:28] relations: {} [17:28] state: null [17:28] 2011-07-14 17:27:35,995 INFO 'status' command finished successfully [17:28] Let us quickly check out the meaning of this status message [17:28] In the machines section .. we now have 3 machines .. 0 1 and 2 [17:28] In the services section, we have two services deployed [17:28] mycms and mydb [17:29] 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] and mydb (mysql) is running on machine 2 [17:30] Let me know paste an updated status [17:30] $ ensemble status [17:30] 2011-07-14 17:29:44,206 INFO Connecting to environment. [17:30] machines: [17:30] 0: {dns-name: ec2-50-17-153-3.compute-1.amazonaws.com, instance-id: i-f3c13e92} [17:30] 1: {dns-name: ec2-107-20-30-230.compute-1.amazonaws.com, instance-id: i-0537c864} [17:30] 2: {dns-name: ec2-50-19-190-104.compute-1.amazonaws.com, instance-id: i-e537c884} [17:30] services: [17:30] mycms: [17:30] formula: local:drupal-9 [17:30] relations: {} [17:30] units: [17:30] mycms/0: [17:30] machine: 1 [17:30] relations: {} [17:30] state: started [17:30] mydb: [17:30] formula: local:mysql-97 [17:30] relations: {} [17:30] units: [17:30] mydb/0: [17:30] machine: 2 [17:30] relations: {} [17:30] state: started [17:30] 2011-07-14 17:29:46,435 INFO 'status' command finished successfully [17:31] Now you can the state of both services is "started" [17:31] which means they have been successfully installed and started [17:31] Note however that till now, the two services are deployed "separately" [17:31] that is mysql knows nothing about drupal and vice versa [17:31] The big bang (a ha) moment happens when you connect both services together! [17:31] let's do just that [17:32] Here is how I just did it [17:32] $ ensemble add-relation mycms mydb:db [17:32] 2011-07-14 17:32:03,640 INFO Connecting to environment. [17:32] 2011-07-14 17:32:04,759 INFO Added mysql relation to all service units. [17:32] 2011-07-14 17:32:04,760 INFO 'add_relation' command finished successfully [17:32] I am using add-relation to connect the two services together [17:32] Once the connection happens [17:33] mysql recognizes drupal needs a database service [17:33] mysql creates a new database for drupal [17:33] sends over the connection information (ip, username, password) needed to connect to the newly created database! cool! [17:33] drupal receives this information, configures itself to connect to that service [17:34] the end result .. with that single command === zyga is now known as zyga-afk [17:34] and with Ensemble in the background [17:34] you have deployed a multi-tier service [17:35] As we just mentioned the url for the mycms machine is http://ec2-107-20-30-230.compute-1.amazonaws.com/ensemble/ [17:35] and you can indeed hit that url with your browser right now [17:35] and you should get drupal waiting for you .. hurray [17:36] I'd like to quickly show you as well .. the formula for drupal [17:36] i.e. how simple it is to write such a formula [17:36] I chose to write this formula in bash, however as mentioned, you can use any language you fancy! [17:38] The install hook (what runs to install the service) is now shown in the shared screen [17:38] I am however .. pasting it as well for archiving purposes [17:38] #!/bin/bash [17:38] set -eux # -x for verbose logging to ensemble debug-log [17:38] ensemble-log "Installing drush,apache2,php via apt-get" [17:38] apt-get -y install drush apache2 php5-gd libapache2-mod-php5 php5-cgi mysql-client-core-5.1 [17:38] a2enmod php5 [17:38] /etc/init.d/apache2 restart [17:38] ensemble-log "Using drush to download latest Drupal" [17:38] cd /var/www && drush dl drupal --drupal-project-rename=ensemble [17:39] As you can see, it simply uses apt-get to install some packages, enables php, restarts apache [17:39] and then uses "drush" the drupal shell, to download a fresh version of drupal [17:39] it's interesting to see that ensemble does NOT force you to only use ubuntu packages [17:39] you can mix and match like I just did [17:40] as a developer, you can grab any code branch and build it and mix that with package installations, if you so wish [17:40] Very well .. [17:40] remember the magic that happened when we connected the two services together [17:40] the "add-relation" command [17:40] let us see the code that runs from drupal's perspective [17:41] I have just displayed it on the shared screen [17:41] I will paste it in chunks [17:41] #!/bin/bash [17:41] set -eux # -x for verbose logging to ensemble debug-log [17:41] hooksdir=$PWD [17:41] user=`relation-get user` [17:41] password=`relation-get password` [17:41] host=`relation-get host` [17:41] database=`relation-get database` [17:42] these last 4 lines, read various settings from Ensemble provided communication channels [17:42] they read: user, password, host, database [17:42] these settings are provided by the mysql service upon establishing the connection. [17:42] drupal reads them, to configure itself to connect to that DB [17:43] let us see how the connection happens [17:43] ensemble-log "Setting up Drupal for the first time" [17:43] cd /var/www/ensemble && drush site-install -y standard \ [17:43] --db-url=mysql://$user:$password@$host/$database \ [17:43] --site-name=Ensemble --clean-url=0 [17:43] easy enough! [17:43] we just use drush to install drupal passing the need parameters we just consumed [17:43] What is really important to notice here [17:44] is that I might have never touched mysql before [17:44] I do not have to know how it works or how to configure it [17:44] or I cared about, was the Ensemble provided interface .. those 4 parameters in this case [17:45] The actual script is slightly longer, since it checks whether or not this is first time drupal is being set up [17:45] i.e. are we starting the very first drupal node, or just scaling it up [17:45] oh yeah .. because scaling it up is as simple as [17:45] ensemble add-unit mycms [17:45] yep .. that's it [17:46] So I hope this was a useful introduction to Ensemble [17:46] I'll provide a couple of pointers and answer question [17:46] questions* [17:46] You can read more about Ensemble at: https://ensemble.ubuntu.com/ [17:46] Documentation: https://ensemble.ubuntu.com/docs/ [17:46] Mailing list: https://lists.ubuntu.com/mailman/listinfo/ensemble [17:47] IRC Channel: #ubuntu-ensemble @ Freenode [17:47] we are a very welcoming community .. it's a party and everyone is invited :) [17:47] So start hacking on your own formula today! [17:47] You can see a list of existing formulas at: https://code.launchpad.net/principia [17:48] Our goal is to cover all of free software! [17:48] Alright .. taking questions [17:48] alexm asked: can emsemble be used to deploy outside the cloud? [17:48] alexm: Ensemble uses multiple "providers" to handle what to deploy to [17:49] ec2 cloud is currently the one that is ready, a provider for LXC (Linux container) is being worked on heavily [17:49] and myunderstanding is that it will be ready during this 11.10 cycle [17:49] 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] Also, Ensemble is being currently integrated with Orchestra [17:50] the Ubuntu server hardware deployment tool [17:50] so you will be able to install to your own hardware farm as well [17:50] I hope that answers your question [17:51] There are 10 minutes remaining in the current session. [17:51] 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] Things are a bit too early in Ensemble development right now .. Currently everything is a service [17:52] however the dev team recognize the need that some operation have special needs [17:52] "machine services" are being debated [17:52] various types of services (or whatever they'd be called) can definitely arise [17:52] ahs3 asked: each service seems to be a separate machine; can i have multiple services on the same machine? [17:53] ahs3: good question .. With the LXC provider that will become possible [17:53] there is also design work currently to colocate chosen services together [17:53] interested code hackers are invited to hack on ensemble core to make this happen faster :) [17:53] #ubuntu-ensemble [17:54] Ensemble itself is written in python using twisted framework afaik [17:54] ahs3 asked: how do i find out what services are available? [17:54] ahs3: As mentioned this is the current list [17:54] https://code.launchpad.net/principia [17:54] this only started a few weeks back [17:54] so it is growing rapidly === janimo` is now known as janimo [17:55] I am more than ready to help anyone write his own first formula [17:55] just grab me (kim0) on #ubuntu-ensemble [17:55] and start hacking on your own formula :) [17:55] 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] alexm: good question [17:55] it doesn't [17:55] There are 5 minutes remaining in the current session. [17:55] I tell it to use mydb [17:55] when I issued [17:56] add-relation mycms mydb:db [17:56] This is exactly what "connects" or "relates" them together [17:56] before add-relation they have no idea about each other [17:56] and mycms does NOT have another DB .. in fact it has no db at all and is mostly misconfigured [17:57] Awesome .. that concludes this session [17:57] feel free to ask me any further questions in #ubuntu-ensemble [17:57] till next time .. c ya === ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu Developer Week - Current Session: Fixing common ARM build failures - Instructors: janimo [18:01] 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] Hello everybody [18:01] I am Jani Monoses, a member of the Canonical ARM team and will speak about ARM related build failures in this session [18:02] feel free to ask questions as we go, on the -chat channel [18:03] As a reference and overview of today's discussion check out this wiki page https://wiki.ubuntu.com/ARM/FTBFS [18:03] ARM only recently got popular enough so that enough developers have them, but still hw is unavalable to most people [18:04] this is the reason why there are more build failures (FTBFS from now on) on ARM than on other architectures in Ubuntu [18:05] the situation has improved in the past cycles though, and none of these are very critical or unfixable, given developer attention [18:05] 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] http://qa.ubuntuwire.com/ftbfs/ [18:06] to get an idea of the number of failures, check the ARM column on this page [18:06] click around on some packages which are only red for ARM, and it will take you to the LP build log page [18:07] 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] and which are mentioned on the wiki page [18:08] 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] 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] 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] only there are different and a bit more varied [18:10] most problems and failing packages are C/C++ as that is where platform details are exposed, and are easy to overlook [18:11] 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] when warnings are treated as errors during compiling, many such differences are caught by gcc though [18:12] 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] segfaults ro assertions are an indication of such a bug [18:13] there are cases also where upstream just did not test on ARM, or made the build system work with x86/amd64 only [18:13] these should not be hard to fix either [18:13] Many of the current failures are for apps using Qt and OpenGL at the same time [18:14] ARM platforms do not have hw accelerated OpenGL drivers, only accelerated GLES (which is a subset of modern GL) [18:14] 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] but Qt also lets the developer use GL directly and provides a Qt surface to render onto [18:15] 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] these are not easy to fix, and usually need upstream to port their code to GLES in addition to desktop GL [18:16] 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] on x86 this is a double but on ARM it is floart [18:17] 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] 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] 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] A family of failures which are luckily getting fewer are ARM architecture incompatibilities [18:20] Ubuntu builds for ARMv7 , currently the most modern variant of the ARM architecture [18:21] For a while, since Debian defaulted to ARMv5, an older but still very widespread variant, some issues were apparent only on Ubuntu [18:21] 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] 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] x [18:23] Many of the failures, and the hardest to fix - as it requires toolchain expertise - are those caused by gcc/binutils bugs [18:23] the tools evolve fast and thus sometimes regressions occur [18:24] 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] or even worse successfully build but then cause weird segfaults in other unrelated packages, especially if it is a widely used library [18:26] 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] then if so, pass it on the Linaro toolchain developers :) [18:26] I'll take a minute or two to see if there are questions [18:28] 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] thank you, what a terrific audience :) [18:29] QUESTION: are there good reasons to export different symbols on arm [18:30] 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] and so it exports a new API to reflect that backend [18:30] I did not encounter these often [18:31] IIRC clutter had such a case but cannot think of another offhand [18:32] now that micahg asked I remember there's another tricky case of failures [18:32] that of apps which generate native code or that use extensive asm code [18:33] 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] the former though, which have their own JIT (mono, chromium, llvm) can be hard to debug [18:33] and are usually upstream work [18:34] 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] and does not fit any of the more generic categories above [18:35] micahg, I see in the next channel that you just wanted to ask this, nice :) [18:36] 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] 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] Mono used to be very broken till natty, until NCommander and upstream managed to fix it === sean is now known as Guest89478 [18:37] chromium keeps failing too [18:38] and Java, which is the ultimate JIT-based project is so broken that there is no suitable open source and fast enough JVM === Guest89478 is now known as Secris [18:39] but the vast majority of build failures are like other bugs, not too exciting and matching some patterns [18:39] but they can only be worked on effectively if people have ARM hardware [18:39] QUESTION: is there a guide for the register code cleanup? [18:40] another question from micahg . You mean what I mentioned above - register constraints? [18:40] gcc usually says something like r13 cannot be used here [18:41] or r7 or whatever. Which means that for the target ABI you are building that register is used by gcc [18:41] so I just fixed the 2 or 3 such cases by replacing with an obviously unused register and testing it work. [18:42] I do not have a link, but googling for ARM EABI resered registers or something like that should give the answers [18:43] 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] so the asm code using those may not obviously be using a reserved register for general purpose computation. [18:45] gladk> QUESTION: What ARM-hardware do you usually use and can recommend? [18:45] I and most of the ARM team use TI pandaboards for development [18:46] 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] 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] although they only have 512M of RAM compared to the panda's 1G [18:48] micahg has https://www.genesi-usa.com/store/details/12 which seems to do a decent job [18:48] 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] 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] There are 10 minutes remaining in the current session. [18:51] 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] we have over 100 failures and the wiki page describes how those can be easier to manage and keep at bay [18:52] 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] Check the issue with Debian/upstreams and forward upstream or link to upstream bugtracker patches [18:52] 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] although I honestly don't see why one would do such things enthusiastically if not owning ARM hw :) [18:54] Thanks for the questions so far, any others? [18:55] There are 5 minutes remaining in the current session. [18:59] cheers, and thanks for reading. [19:00] That includes those reading the irclogs later :) === ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu Developer Week - Current Session: nux - visual rendering in UIs made easy - Instructors: jaytaoko [19:01] 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] Hello [19:04] jaytaoko: go ahead and begin! [19:05] My name is Jay Taoko and I am a software developer at Canonical, in the Desktop Experience Team. [19:05] I am the creator of Nux, the toolkit we use for unity's rendering! [19:06] A bit about myself and how I ended at Canonical working on Unity: [19:06] At started working at Matrox, in Montreal, Canada, where I learned a great deal about GPUs and computer graphics. [19:07] After that, I worked at other companies doing graphics, including EA and Ubisoft. [19:07] After leaving Ubisoft, I started my own gig. [19:07] After a few years, out of the blue, someone mentioned that Canonical is looking for an OpenGL developer. [19:08] 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] I was skeptic at first. Until I understood that Canonical was very serious about graphics. [19:09] That is when I decided to sign in! [19:09] Coming from the Windows operating system, I had to learn things on Ubuntu. [19:10] I have to say that this hasn't been a big problem. [19:10] I have been very welcomed at Canonical. [19:10] 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] Now, onto Unity and Nux! [19:11] Nux is the toolkit we for Unity's rendering. [19:11] we use* [19:12] I started Nux many years ago and I am very happy to see it used for such a great project. [19:12] Nux is written in C++ and it uses OpenGL for its rendering [19:13] It has a good widget set for writing graphics applications: http://i.imgur.com/ax1Q5.png [19:14] Although Nux has been adapted to support Unity, its original intent (writing real-time graphics application user interface) will remain. [19:15] 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] Nux provides the rendering of Unity. To that end, Nux has to be facilitate direct access to OpenGL. [19:16] kamil_p asked: Which projects besides Unity uses Nux? [19:16] Only Unity uses it at the moment [19:16] Nux has a rendering API that is used for common rendering operation (rendering of widgets). [19:17] It also tries to hide the OpenGL API by providing convenience functions and objects. [19:18] However, we are free to use raw OpenGL is we need to. [19:18] however, one has to know how cooperation between nux and raw opengl works [19:19] But I think that encapsulating OpenGL into a wrapper is the right thing to do for most cases. [19:20] 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] We have a design team working on new ideas all the time. [19:20] the deal between Unity and Nux is like this: [19:21] Wherever we take Unity, the Nux has to offer flexibility and convenience to achieve Unity's goal. [19:21] 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] 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] Also, we have had issues with graphics drivers. [19:23] This is a burning issue. [19:24] 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] And in Natty, we required less OpenGL features and GPU horse power than people think. [19:24] Only graphics features that have been around for at least 5 years were required. [19:25] Unity is in this unique position that it is advancing desktop rendering on all systems that support it. [19:26] It is bound to reveal more issues with graphics than any other application on the desktop before. [19:27] I have had some question regarding Unity support on geforce 2 cards! [19:27] yes, that is old! [19:27] but this is the challenge of Unity! [19:28] we can't get it to run on old GPU and I hope people understand. But we try as much as possible. [19:29] And there is Unity2D that Canonical is investing in! [19:29] If a system cannot run Unity with full opengl, there is always Unity2D. [19:30] The thing about the graphics issues is like this: [19:31] 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] We are starting something new, but we are going to make things better. [19:32] This is what we started with almost a year ago: [19:32] http://i.imgur.com/zC9v8.jpg [19:33] yes, that is Unity + Compiz + Nux! [19:33] Our Alpha 0 prototype! [19:34] 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] 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] As you can see, we have come a long way... === yofel_ is now known as yofel [19:36] jsjgruber: probably a known issue === sirmacik is now known as kichawa1 [19:36] 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] Got a question: does nux only work with linux? () [19:36] (from the channel, the bot is busted or something) [19:36] Sometimes even at the last minutes before Ubuntu's release (thanks to our superb Desktop team of packagers: seb128, didrocks and all). === kichawa1 is now known as sirmacik [19:38] 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] it is quite easy to maintain both version. 95% of the code is the same. [19:39] We have had great support from GPU vendors to help us fix issues with Unity on some systems! [19:39] We also report bugs to open source drivers and our hope is that this will benefit everyone. [19:40] Now, what is coming next in Nux? [19:40] We are improving Nux for unity. [19:41] In Natty, we were using mostly ARB shader programs on all systems except NVidia GPUs. [19:42] We couldn't do it for AMD GPUs in time with the fglrx driver. [19:43] 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] For Oneiric, we will enable the GLSL shader code path on a much system as possible. [19:45] What we are going to get from it is the ability to do more in terms of visual quality [19:45] QUESTION:What is the recommended way to start the project? [19:46] The best way is to approach Nux from Unity's side [19:46] The launcher, the Dash are all rendered with Nux [19:47] Download Unity's source code and take a look at the Launcher code. There you will see some shaders, rendering code... [19:47] That will show you how we use Nux in Unity. [19:48] The tests in Unity are a good sample of Nux programs... [19:49] Give them a try. [19:49] Then, there is Nux itself. It as a few test program of its own. [19:49] QUESTION: Can I embed GTK+/Qt widgets? [19:50] Maybe one way to start is to try and write a small Nux program. Nothing fancy, just get started. [19:50] There are 10 minutes remaining in the current session. [19:51] That will also make you better at debugging in Unity if you choose to. [19:51] Questions? [19:52] QUESTION: Can I embed GTK+/Qt widgets? [19:53] I think so, but I am not sure. [19:53] Nux uses the glib main loop. [19:53] So it should be compatible with Gtk+/Qt somehow, but I have never tried it [19:54] However, some of us have been thinking about embedding Nux into Gtk+ [19:54] Something that Nux is missing right now is documentation. [19:55] There are 5 minutes remaining in the current session. [19:56] 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] Questions? === ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu Developer Week - Current Session: Java library packaging with maven-debian-helper - Instructors: jamespage [20:01] 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] Hi Everyone o/ [20:02] Welcome to the Java library packaging with maven-debian-helper Ubuntu Developer Week session [20:02] So - organisational bits first: [20:02] 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] 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] My name is James Page and I've been contributing to Ubuntu since September last year [20:03] 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] 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] So first things first - why package Java libraries for Ubuntu? [20:05] Daviey asked: Java tradionally has a bad reputation on Linux, why is this? [20:05] Timely question - lets cover that one first [20:05] I think it due to the way the Java projects are typically developed [20:06] Because the Java Virtual Machine abstracts the developer away from the underlying operating system [20:06] they are free to load that virtual machine with exactly the code they want [20:07] dependent libraries are often bundled in a variety of nasty ways [20:07] which means that its hard to pull out common libraries and base line in the way a Linux distro likes todo. [20:08] not impossible - just hard [20:08] to a certain extent the toolsets exacerbate this behaviour [20:09] so back to my original question - why package Java libraries for Ubuntu? [20:09] Well from my perspective its about delivering Java applications onto the Ubuntu platform; [20:09] this would include things like Tomcat, Jenkins, Hadoop, Eclipse etc... [20:09] (some of which we have in Ubuntu, some of which we don't - yet) [20:10] However these applications need to rely on the Java libraries that are packaged for Ubuntu [20:10] 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] 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] This does not always align well with the way that most Java project work; [20:12] as I just discussed each project can pretty much load the Java Virtual Machine with the code then want [20:12] which means they don't have to give consideration to other Java projects - because they will be isolated in the same way [20:13] however by maintaining a single set of libraries we try to bring some of the Linux distro goodness to the Java world [20:13] So - next bit is a little dull but important [20:13] Java libraries should follow the Debian Java Policy - see http://www.debian.org/doc/packaging-manuals/java-policy/ for the full details. [20:14] In fact its probably worth pointing out now that 90%+ of the Java libraries come unchanged for Debian [20:14] As a quick 101: [20:14] Library packages should be named libXXX-java - for example libcommons-io-java [20:14] Documentation should be in a separate package libXXX-java-doc [20:14] 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] and where possible into /usr/share/maven-repo - more on this in a bit. [20:15] 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] Just in case you are not familiar with Maven its probably the most popular software project management tool used by Java projects [20:16] Its much more than just a build tool - hence 'Software Project Management' [20:17] 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] 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] 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] Its uses project object model files - POM's [20:19] to define various metadata about the software project including its namespave, name, dependencies, build process, author, licensing .... [20:20] the list goes on and is incredibly rich - this information is really useful when packaging [20:20] but depth is not always great :-( [20:20] So I'm now going to give a quick demo of packaging a basic Java library using maven-debian-helper [20:20] To follow the demo you will need to log into the following server [20:20] ssh guest@ec2-46-137-134-25.eu-west-1.compute.amazonaws.com [20:20] password should be guest [20:21] I'm going to be using a tool called byobu so that we can all see the same session. [20:21] So as it takes a bit of time I've already setup the packaging environment on this Ubuntu server; [20:22] If you needed to do it [20:22] sudo apt-get install packaging-dev default-jdk maven-debian-helper javahelper apt-file aptitude [20:22] packaging-dev (thanks bdrung) is a new package which is intended to setup all the basics for package development; [20:22] we also need the Java Dev Kit and the java specific helpers (plus some other tools) [20:22] So next step - generate some basic packaging using mh_make; [20:23] we are going to pull a upstream tarball from github and then do some basic packaging [20:24] metainf-services is a very simple library that helps generated metadata for jar files during packaging [20:24] so as you can see we just have a pom.xml file and a src dir [20:25] next we use mh_make [20:25] mh_make tries to guess most things but it does give you the option to change stuff [20:26] so we are going to run tests and generate API docs [20:26] mh_make uses apt-file to search for any missing dependencies [20:26] 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] So this bit is quite important [20:27] when the package is built it gets deployed into /usr/share/maven-repo twice [20:27] once under the original version - 1.2 in this case [20:28] 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] 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] without having to update all pom files [20:28] more on this in a bit [20:29] mh_make also makes a guess as to with plugins are not useful for packaging [20:29] this last one is unknow - infact its used for publishing a micro-site to github - which we don't need either [20:30] mh_make then generates the base packaging [20:30] 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] So I'm going to make this into a bazaar branch to help out a bit [20:31] So lets take a look around: [20:32] So using the information that licensecheck found in the headers mh_make has had a stab at generating a copyright file [20:32] its not bad - normally this needs a few tweaks to get it exactly right but it does most of the hard work [20:32] 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] 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] 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] so we also get a maven.cleanIgnoreRules [20:34] this is used when the clean target is called for the project [20:35] typically this requires alot less dependencies so it may be a longer list of exclusions [20:35] for this package its OK for it to be the same as maven.ignoreRules [20:35] so I'll just do a quick change to the changelog and we are good to go [20:36] You will notice that mh_make has used Java Demo [20:36] this gets picked up from DEBEMAIL and DEBFULLNAME environment variabled - I set these up earlier [20:37] so source package build first [20:38] maven-debian-helper patches/unpatches the pom.xml file during the process [20:38] the default target for building the package is 'package' - however for more complex packages 'install' may be more appropriate. [20:38] generating javadoc [20:38] (twice - this is a bug!) [20:39] automatically determining dependencies for the binary packages [20:40] and done - a few lintian warnings but nothing unsolvable [20:40] so we now have a built package \o/ [20:41] as we discussed earlier the package deploys 1.2 and 1.x artefacts to /usr/share/maven-repo [20:42] it also deploys to /usr/share/java - this is to support ant/javahelper based build and applications that require this library [20:42] and also a -doc package containing the generated API [20:42] just to prove that we have created something that at least installs [20:43] Obviously this is a relatively simple example; [20:43] 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] Maven actually makes packaging for Ubuntu easier; [20:44] 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] packages that use ant are more challenging as they express dependencies in a million bespoke ways [20:44] (unless they are using a dependency management system like ivy which can make things a little easier). [20:45] Questions? [20:46] coalitians asked: so mavens central repository is never used ? [20:46] good question - the local Debian repo in /usr/share/maven-repo is used and Maven is executed fully offline [20:47] maven-debian-helper handles this as part of the packaging build rules [20:47] 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] Any more for any more? [20:48] OK [20:48] I hope that you have found this session useful; [20:49] 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] Thankyou and goodnight! [20:50] There are 10 minutes remaining in the current session. [20:55] There are 5 minutes remaining in the current session. [21:00] Logs for this session will be available at http://irclogs.ubuntu.com/2011/07/14/%23ubuntu-classroom.html === ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || === zyga-afk is now known as zyga [23:03] hello guys [23:03] Need some help [23:04] hello !!!! [23:04] the next class doesn't start until 16:00 UTC tomorrow