Canonical Voices

Posts tagged with 'article'

liam zheng

为了庆祝Ubuntu Core 16正式发布,我们在IoT领域高手云集的深圳,专为欲大展拳脚的各路开发高手,创客团队举办了主题为“Jamming with Ubuntu Core”的黑客松活动。

为了庆祝Ubuntu Core 16正式发布,我们在IoT领域高手云集的深圳,专为欲大展拳脚的各路开发高手,创客团队举办了主题为“Jamming with Ubuntu Core”的黑客松活动。本次活动也是第一次以Ubuntu Core为开发主题的开发活动。活动吸引了来自不同行业的软硬件开发者踊跃参与,他们也通过Ubuntu Core展示了他们独特且创意的作品。

目前,Ubuntu Core 在柜顶交换机、工业网关、家庭网关、无线接入网络、数字标牌机器人和无人机等领域得到了广泛应用。部分活动开发者也来自于上述行业,在36小时的hack时间内,创意和作品将是他们对物联网的完美诠释。

与以往Hackathon活动相比,这次Ubuntu Hackathon多了一些不同,因为不同从而产生不同创意之作。本次活动迎来了远从台北而来的QNAP开发者,致力于在Ubuntu Core上打造IoT与NAS存储器的应用解决方案,同时也有上一届Hackathon的参赛者,更重要的是赢了很多新的开发者参与。他们的精彩项目也为本次黑客松活动添加了特别的气氛。

作品及项目:短短36小时,开发者们为Ubuntu Core带来了8个佳作。他们分别是:

 

天台聚落

团队:Jarvis Chung,Lucas Lu

项目介绍:(snap:water-iot-service)

天台聚落是指在IoT 物联⽹环境下监控⽔质,在不同环境下实现远程监控对水质的监控,解决了因为环境问题而不能时刻掌握水质的困境。该项目利用Ubuntu Core稳定且时刻保持最新的优势将传感器收集的信息传输到NAS再通过web服务显示在前端,实现了数据的采集和分析。

项目的愿景:为水资源的监测和管理提供更加便捷、直观、科学的思路,可用水库、蓄水池、水塔等无人照看且检修、监测困难水资源管理领域。

团队介绍:

威联通科技股份有限公司 (QNAP Systems, Inc.) ,公司专注于提供专业级的网络附加存储(NAS)和网络视频录像机(NVR)解决方案, 威联通的集成技术和设计带来优质的产品,其文件共享,虚拟化应用程序,存储管理和商业环境检测有效地提高企业运行效率。官网:(www.qnap.com/zh-cn)

 

Cooltools

团队:郝建林

项目介绍:(snap:sensor-gw)

用蓝牙连接TI Sensor Tag传感器套件,收集光照传感器数据,并通过本地WebServer实时显示在网页上。结合照明控制系统可以实现用Sensor Tag的物理按键开关灯,以及在环境亮度过小时自动开灯,整个系统都是通过高通 Dragonboard 410c与Ubuntu Core16 连接实现。在现实生活中,本项目可用于自动化环境光照控制,无需派人控制,也可避免因固定设置产生的能源浪费。

团队介绍:参赛团队来自深圳市酷图软件开发有限公司,公司专注于物联网应用开发,目前主要业务是为硬件产品开发APP。正在实践将物联网技术应用于实际生产生活,欢迎各界朋友交流合作。邮箱:cooltools@qq.com

 

Crazyou

团队:张研

项目介绍:(snap:crazy-app)

Crazyou来着深圳,是一家致力于打造智能机器人及开发板的初创团队,本次活动展示的项目则是可远程获取机器人运行状态,可远程开发调试,远程控制机器人或获取机器人摄像头捕捉的图像内容,绘制3D地图等。

团队介绍:趣之科技通过互联网构建实时远控能力,为Robotic类物联产品提供实时远控云应用服务与开放式核心硬件模块,致力用远程技术消除感知的空间距离。官网:www.crazyou.com

 

Simcaffe

团队:老梁

项目介绍:(snap:simcaffe)

simcaffe采用了高通DragonBoard 410c硬件计算能力,整合Ubuntu Cor以及Caffe深度识别平台,用斯坦福的开源深度学习算法, 用Python调用Caffe得到的识别结果实现图片分析和识别。未来可用在视频监控领域,并且该项目也是基于高通 Dragonboard 410c。Github:github.com/curiousguy98

团队介绍:

ABI Hackerspace管理员,目前为多家创业公司合伙人。从事研发工作近20年,在各类型公司实现过量产产品,辅助创业公司十多家。多次获得各类创意比赛大奖。小米硬件黑客马拉松第一名, Global Urban Datafest全球第三名, Moser穿戴式设备大赛一等奖。

 

PCBA

团队:臧鹏,Batur

项目介绍:(snap:sutop/movieword)

sutop是一款系统使用snap应用,基于node.js编写,可进行系统任务、资源、性能监控,并且以图形化的方式展示,界面简洁直观。PCBA团队另外一个项目则是movie word,可对字幕文件进行处理,去除数字、标点、去重,从而从电影字幕学习英语单词。

团队介绍:

臧鹏,热爱科技、电子产品,热爱开源,热爱ubuntu等一些有趣的事;目前致力于嵌入式软件;期望自由,做一些可以改变自己生活、改变自己世界的事,然后影响更多人。

Batur, 一个梦想成为大神的菜鸟。喜欢新奇的技术,最近正在学函数式编程。

 

我的衣柜

团队:黎健成

项目介绍:

使用树莓派上的Ubuntu Core进行衣服图片的自动分类,并存储起来,方便以后进行浏览和搭配。图片暂时使用上传的方式,之后有摄像头可通过摄像头获取。

关于开发者:黎健成,在读研究生,目前从事计算机视觉与深度学习的研究。除了对算法与数据结构等感兴趣外,对嵌入式、IoT等方面的开发也有所关注。喜欢参加各种各样的比赛,与各路大牛交流。个人博客(http://lijiancheng0614.github.io/)

团队介绍:

黎健成,在读研究生,目前从事计算机视觉与深度学习的研究。除了对算法与数据结构等感兴趣外,对嵌入式、IoT等方面的开发也有所关注。喜欢参加各种各样的比赛,与各路大牛交流。

 

Cellboot

团队:沈建丰

项目介绍:

使用Ubuntu Core进行物计算,将多台Ubuntu Core设备建立连接,可计算共享,每台设备都是计算集群的一部分。

团队介绍:

关于开发者:沈建丰是一名Ubuntu的用户,同时也是传媒公司的负责人,运营“华强北那些事儿”微信平台,主要擅长web应用开发。官网(http://www.editrobot.com)

 

在开发者们的精彩demo中,本次Ubuntu Core 16深圳黑客松活动圆满落下了帷幕,在2天的时间里开发者们用自己的code表达、诠释了心中的IoT是什么以及自己会如何去做。没有再见,只有再一次相见,期待与你相遇在下一站活动中。

 

Read more
Michael Hall

Below is a guest post written by Ryan Sipes, Community Manager at System76


Last week System76 engineers participated in a call with Martin Wimpress of the Ubuntu Desktop team to discuss HiDPI support in Ubuntu, specifically Unity 7. HiDPI support exists in Unity 7, but there are areas that could use improvement, and the call focused around those. The conversation was primarily focused around bugs that still remain in the out-of-the-box HiDPI experience; specifically around enabling automatic scaling and Ubuntu recognizing when a HiDPI display is present so that it can adjust accordingly.

This has become a focus of System76 as it has worked to provide a good experience for users purchasing their new 4K HiDPI displays now available on the Oryx Pro and BonoboWS laptops.

“With our HiDPI laptops, everything is twice as crisp; it's like a high-quality printed magazine instead of a traditional computer display. The user interface is clearer, text is sharper, photos are more detailed, games are higher res, and videos can be viewed in full lifelike 4K. This is great whether you're anyone from a casual computer user to a video editor producing high end content or a professional developer who wants a better display for your code editor.”, says Cassidy James Blaede, a developer at System76 and a co-founder of elementary OS, an Ubuntu-based distribution that has put a lot of work into HiDPI support. Cassidy recently wrote a blog post explaining HiDPI, diving into the specifics of how it works.

Some patches that improve HiDPI support are in review and they are expected to land in Ubuntu soon. In order to accelerate this process HiDPI bugs in Launchpad are being tagged accordingly and will make it easier for contributors to focus their efforts more easily. System76 will be contributing heavily to this process, but many other Ubuntu community members have expressed interest in contributing as well, so this will likely be a hot spot in the near future.

Read more
Olivier Tilloy

Recently the ubuntu-app-platform snap has been made available in the store for application developers to build their snaps without bundling all their dependencies. The ubuntu-app-platform snap includes standard Qt libraries (version 5.6.1 as of this writing) and QML runtime, the ubuntu UI toolkit and related dependencies, and oxide (a web engine based on the chromium content API and its QML bindings).

This allows app developers to declare a dependency on this snap through the content sharing mechanism, thus reducing dramatically the size of the resulting app snaps.

 

I went through the exercise with the webbrowser-app snap. This proved surprisingly easy and the size of the snap (amd64 architecture) went down from 136MB to 22MB, a sizeable saving!

For those interested in the details, here are the actual changes in the snapcraft.yaml file: https://bazaar.launchpad.net/~phablet-team/webbrowser-app/staging/revision/1576.

Essentially they consist in:

  • Using the ‘platform’ plug (content interface) and specifying its default provider (‘ubuntu-app-platform’)

  • Removing pretty much all stage packages

  • Adding an implicit dependency on the ’desktop-ubuntu-app-platform’ wiki part

  • Adding an empty ‘ubuntu-app-platform’ directory in the snap where snapd will bind-mount the content shared by the ubuntu-app-platform snap

 

Note that the resulting snap could be made even smaller. There is a known bug in snapcraft where it uses ldd to crawl the dependencies, ignoring the fact that those dependencies are already present in the ubuntu-app-platform snap.

Also note that if your app depends on any Qt module that isn’t bundled with ubuntu-app-platform, you will need to add it to the stage packages of your snap, and this is likely to bring in all the Qt dependencies, thus duplicating them. The easy fix for this situation is to override snapcraft’s default behaviour by specifying which files the part should install, using the “snap” section (see what was done for e.g. address-book-app at https://code.launchpad.net/~renatofilho/address-book-app/ubuntu-app-platform/+merge/311351).

Read more
Benjamin Zeller

Ubuntu SDK meets snapcraft

Everyone who has followed Ubuntu lately for sure stumbled across the snappy technology, which does not only bring the new cross-distro packaging format “snap” but also a sandboxing technology for apps, as well as transactional updates that can be rolled back in case of an update going wrong and a new way of installing and upgrading Ubuntu called “Ubuntu Core”.

Together with all those new technologies came new tools that make it possible for app developers to build and pack their applications to target Snappy and Core. The central tool for that is snapcraft and it aims to unite a lot of tasks that were separate before. It can set up your build environment, build your projects and even package it with just one call in the project directory: “snapcraft”.

We took the last few weeks to start the work on supporting those new tools and now we have the first release of the IDE with direct support for building with snapcraft, as well as a basic template to get you started.

New technologies usually come with certain limitations. This one is not an exception and we hope that these issues will be eliminated in the near future.:

  • Snapcraft uses sudo when it needs to install build packages, however that does not work when run from the QtCreator, simply because sudo does not have a console to ask the password on. So make sure build dependencies are installed before building.

  • “Out of source” builds are not yet implemented in snapcraft, but since QtCreator always uses a extra build directory we had to work around that problem. So for now we rsync the full project into a build directory and run the build there.

  • Also incremental builds are yet not supported, so every build is a complete rebuild.

Snapcraft projects are described in a snapcraft.yaml file, so it made sense for us to use it as the project file in the IDE as well, so instead of opening a .pro or CMakeList.txt file the snapcraft.yaml is opened directly. Naturally implementing a completely new project type manager is not a trivial task, so many key features are still missing.

  • Code model support: while completion does work in the file scope, it does not for the full project.

  • Debugging mode: currently the profiling and debugging run modes do not work, so snap projects can only be executed normally.

Those limitations aside it can be already used to create snap packaged applications.

With this new release we consider the IDE as feature complete for the time being. Since the development of snapcraft is moving in a very fast pace we need to let it evolve to a certain degree to be sure new features added to the IDE represent the future way of building with snapcraft.

Read more
Tim Peeters

Introduction

One of the advantages of snap packages is that they are self-contained. When you install a snap, you know that you don’t need to install additional dependencies (besides the automatically-installed core snap that provides the basic operating system layer), and it will simply work on every Linux distribution that supports snaps.

Here, we show how to create self-contained snap packages for Qt-based applications, and we show an additional approach where some of the app dependencies are provided by a separate snap: the Ubuntu app platform snap. The platform snap provides an (optional) approach for the software provider, and can save disk space in some cases. Below we will explain the two approaches to building a snap for Qt-based software: a snap that is self-contained and includes Qt, and one that uses the platform snap, and we show the advantages of each approach. However, before showing these two approaches that you can apply to your own QML code, we demonstrate how to create a snap from deb packages in the Ubuntu archive so that you can get started right away even before you write any code.

We assume that before reading this blog post, you have acquired knowledge about how to use Snapcraft. So if you haven’t, we recommend reading the documentation on snapcraft.io and the snap-codelabs tutorials.

All the commands that are listed below are executed on an Ubuntu 16.04 LTS machine with the stable-phone-overlay PPA enabled. Some of the snapcraft commands may run on other configurations, but for the “Ubuntu App Platform Snap” section it is a hard requirement because the version of Qt - upstream 5.6 long term support version - and other libraries used to build the snap need to match the versions in the ubuntu-app-platform snap. Installing the snap packages works on different versions of Ubuntu and even different Linux distributions. The examples were tested on amd64 architecture with Intel graphics. If you are running this on a different CPU architecture, naturally the architecture in the directory and snap file names listed below must be modified. If you have an Nvidia GPU and use the Nvidia proprietary drivers there can be problems when running some snapped applications, so in that case we currently recommend to use the open source Nouveau drivers.

The examples are also available in a repository linked to from the Evaluation section.

Qt cloud parts - a simple use case

We will demonstrate how to build a simple app snap that includes the Qt release and Ubuntu UI Toolkit (UITK) from the Ubuntu archives. For this example, we use the UITK gallery which is part of the ubuntu-ui-toolkit-examples deb package on classic Ubuntu systems, so no additional code is needed. Because of that, we can simply use the nil plugin and pull in the examples as stage-packages. We create a directory called uitk-gallery which contains only a snapcraft.yaml file with the following contents:

name: uitk-gallery
version: '0.1'
summary: Showcase gallery that demonstrates the components in the Ubuntu UI Toolkit.
description: |
  See https://developer.ubuntu.com/api/qml/ for the API documentation of the components.

grade: devel
confinement: strict

parts:
  ubuntu-ui-toolkit-examples:
    plugin: nil
    stage-packages:
      - qmlscene
      - qml-module-qtqml-models2
      - ubuntu-ui-toolkit-examples
    after: [desktop-qt5]

apps:
  uitk-gallery:
    command: desktop-launch "qmlscene $SNAP/usr/lib/*/qt5/examples/ubuntu-ui-toolkit/examples/ubuntu-ui-toolkit-gallery/ubuntu-ui-toolkit-gallery.qml"
    plugs: [unity7, opengl]

(notes: the command line assumes you are on and targeting amd64 system. the plugs line is needed so that you have access to graphical subsystem from your confined app)

Under stage-packages we listed all the packages that need to be pulled from the Ubuntu archive, including their dependencies. ubuntu-ui-toolkit-examples contains all the QML code for the UITK gallery that we want to run using qmlscene. We also included qml-module-qtqml-models2 because some pages of the UITK gallery import QtQml.Models. The line after: [desktop-qt5] fetches the desktop-qt5 part from the remote parts repository. It will automatically pull in Qt 5 from the Ubuntu archive, set-up environment variables, and provide the desktop-launch script that is called to start the app. The snap file can be created simply by going to the uitk-gallery directory which contains the snapcraft.yaml file, and running:

snapcraft

Note that Snapcraft will ask for the sudo password to install the Qt5 dev packages that are required to compile Qt apps, but can be left out if all the dependencies are already present. Running snapcraft will create (on an amd64 machine) the file uitk-gallery_0.1_amd64.snap which can then be installed by:

snap install --dangerous uitk-gallery_0.1_amd64.snap

where the dangerous parameter is required because we are installing an unsigned snap that does not come from the Ubuntu store. Note that you do not need to use sudo if you have logged in with snap login. The UITK gallery can now be launched using:

uitk-gallery

The desktop-qt5 cloud part pulls in the current stable version of Qt of the Ubuntu 16.04 LTS release - 5.5.1 normally or 5.6.1 in the case of stable overlay PPA. To uninstall the UITK gallery snap before going to the next section, run:

snap remove uitk-gallery

QML project using parts from the cloud

If your existing QML code is not available as a deb package, then obviously you cannot pull it in from the archive when creating the snap using stage-packages. To show how to include your own QML code, we copy the UITK gallery code to the ubuntu-ui-toolkit-gallery directory inside the snapcraft (uitk-gallery) directory. Go to the parent directory of the uitk-gallery of the previous section, and run:

bzr branch lp:ubuntu-ui-toolkit
cp -R ubuntu-ui-toolkit/examples/ubuntu-ui-toolkit-gallery uitk-gallery/

Alternatively, if you have the ubuntu-ui-toolkit-examples package installed, you can run:

cp -R /usr/lib/*/qt5/examples/ubuntu-ui-toolkit/examples/ubuntu-ui-toolkit-gallery/ uitk-gallery/

You should now have both the snapcraft.yaml and the copied ubuntu-ui-toolkit-gallery directory that contains the source code of the UITK gallery under the uitk-gallery. We can now remove the ubuntu-ui-toolkit-examples from the stage-packages in the snapcraft.yaml file. Because that line is removed, the dependencies of the UITK gallery are no longer pulled in automatically, and we must add them to the YAML file, which then becomes:

name: uitk-gallery
version: '0.2'
summary: Showcase gallery that demonstrates the components in the Ubuntu UI Toolkit.
description: |
  See https://developer.ubuntu.com/api/qml/ for the API documentation of the components.

grade: devel
confinement: strict

parts:
  ubuntu-ui-toolkit-gallery:
    plugin: dump
    source: .
    stage-packages:
      - qmlscene
      - qml-module-qtqml-models2
      - qml-module-qt-labs-folderlistmodel
      - qml-module-qtquick-xmllistmodel
      - qml-module-ubuntu-components
      - ubuntu-ui-toolkit-theme
      - ubuntu-ui-toolkit-tools
    after: [desktop-qt5]

apps:
  uitk-gallery:
    command: desktop-launch "qmlscene $SNAP/ubuntu-ui-toolkit-gallery/ubuntu-ui-toolkit-gallery.qml"
    plugs: [unity7, opengl]

Note that besides the changes in stage-packages, also the location of ubuntu-ui-toolkit-gallery.qml was updated in the uitk-gallery command because the QML files are no longer installed in usr/lib inside the snap, but copied in the root of the snap filesystem. As before, the snap package can be created by executing:

snapcraft

inside the uitk-gallery directory. The UITK gallery can then be installed and started using:

snap install --dangerous uitk-gallery_0.2_amd64.snap
uitk-gallery

and uninstalled by:

snap remove uitk-gallery

Now that you have seen how to package the UITK gallery from source into a snap, you can do the same for your own QML application by using the dump plugin with the dependencies as stage-packages. If your application includes C++ code as well, you need to use another plugin, for example the qmake plugin. For that we refer to the Snapcraft tutorials mentioned in the introduction.

For those who like to experiment with newer versions of upstream Qt, we provide qt57 and qt58 cloud parts in the parts repository for Qt 5.7.1 and 5.8 (in development). However, the qt57 and qt58 cloud parts do not yet include a wrapper script similar to desktop-launch, so one must be included with with snap configuration, see for example timostestapp2. When using these cloud parts, you should usually omit any Qt/QML package from stage-packages, as the ones compiled from newer Qt are used directly, and you should also omit the after: [desktop-qt5].

Ubuntu app platform snap

The snap files we created in the previous sections contain everything that is needed in order to run the UITK gallery application, resulting in a snap file of 86MB. Here we will explain how to use the Ubuntu app platform snap when you have multiple app snaps that all use the same Qt version.

Benefits of this approach include disk space saving, download time and bandwidth usage if metered.

When your snap uses the ubuntu-app-platform snap for Qt and other platform libraries, we can remove the stage-packages from the snapcraft.yaml file because (in this case), all the needed libraries are included in ubuntu-app-platform. We must also replace after: [desktop-qt5] by after: [desktop-ubuntu-app-platform]. This will set-up your snap to use the global desktop theme, icon theme, gsettings integration, etc. A more elaborate description of the desktop-ubuntu-app-platform is given in the parts list on the Ubuntu wiki. In the uitk-gallery directory we must currently create a directory where the files from the platform snap can be mounted using the content interface:

mkdir ubuntu-app-platform

and this empty directory (mount point) must be added in the YAML file as well. At this point the directory structure is as follows:

uitk-gallery/
 .. snapcraft.yaml
 .. ubuntu-ui-toolkit-gallery/
    .. [gallery contents]
 .. ubuntu-app-platform/

The whole YAML is:

name: uitk-gallery
version: '0.3'
summary: Showcase gallery that demonstrates the components in the Ubuntu UI Toolkit.
description: |
  See https://developer.ubuntu.com/api/qml/ for the API documentation of the components. ubuntu-app-platform snap must be installed for this snap to work.

grade: devel
confinement: strict

plugs:
    platform: # plug name, to be used later
        interface: content
        content: ubuntu-app-platform1 # content being mounted and the version, currently 1
        target: ubuntu-app-platform # the mount directory created
        default-provider: ubuntu-app-platform # default content source snap, currently the only provider too

parts:
  ubuntu-ui-toolkit-gallery:
    plugin: dump
    source: .
    after: [desktop-ubuntu-app-platform]
    snap: [ubuntu-ui-toolkit-gallery, ubuntu-app-platform]

apps:
  uitk-gallery:
    command: desktop-launch "qmlscene $SNAP/ubuntu-ui-toolkit-gallery/ubuntu-ui-toolkit-gallery.qml"
    plugs: [platform, unity7, opengl]

Again, the new snap file can be created using:

snapcraft

This time, before we can use the snap, the ubuntu-app-platform snap must be installed and connected to the new uitk-gallery snap. So, execute the following commands:

snap install ubuntu-app-platform
snap install --dangerous uitk-gallery_0.3_amd64.snap
snap connect uitk-gallery:platform ubuntu-app-platform:platform
uitk-gallery

Note that the snaps must be connected before running uitk-gallery for the first time. If uitk-gallery has been executed before the snap connect you will see an error message. To fix the problem, uninstall the uitk-gallery snap, then re-install it and run the snap connect command before executing uitk-gallery. This is a known limitation in snapd which will be resolved soon.

Another note: once support for the default-provider, already defined above, will correctly be implemented in snap, there will no longer be a need to install the platform snap separately - it will be pulled from the store automatically and the interface connects automatically.

Evaluation

We demonstrated three different approaches to creating a UITK gallery snap, which we gave the version numbers 0.1, 0.2 and 0.3. For each of the approaches, the table below lists the time needed for the different stages of a snapcraft run, but the pull and build stages have been combined because when doing pull, some of the prerequisites need to be built already. The all stages row shows the total time when running the snapcraft command in a clean directory, so that all stages are executed sequentially, so the value is less than the sum of the previous rows in the table because in each stage it is not necessary to check completion of the previous stages.

Version (bzr revision)

0.1 (r1)

0.2 (r2)

0.3 (r3)

build (includes pull)

1m49s

1m48s

3.6s

stage

7s

7s

1.5s

prime

33s

34s

1.8s

snap

1m11s

1m13s

1.7s

all stages

3m32s

3m20s

4.0s

install

2.2s

2.4s

1.2s

snap file size

86 MB

86 MB

1.3 MB

The measurements were done on a laptop with an Intel Core i5-6200U CPU with 8 GB RAM and an solid-state drive by running each command three times and listing the average execution time. All build-dependencies were pre-installed so their installation time is not included in the measurements. Note that this table only serves as an illustration, and execution times will vary greatly depending on your system configuration and internet connection, but it can easily be tested on your own hardware by bzr branching revisions r1, r2 and r3 of lp:~tpeeters/+junk/blog-snapping-qt-apps.

The times and file size listed in the last column (version 0.3) do not include downloading and installing the ubuntu-app-platform snap, which is 135 MB (it includes more than just the minimal Qt and UITK dependencies of the UITK gallery). It can be seen that (depending on the internet connection speed, and which files were downloaded already), using the ubuntu-app-platform can speed up the pull and build time when creating a new snap file. However, the most important advantage is the reduction of the sum of the file sizes when installing multiple app snaps that all depend on Qt or other libraries that are part of the platform snap, because the libraries need to be installed only once. The disadvantage of this approach is that the app snap must be built using the exact same Qt (and other libraries) version as the ubuntu-app-platform snap, so the choice whether the snap should be fully self-contained or depend on the platform snap must be made individually for each use case.

Future work

The UITK gallery snap is not yet available in the Ubuntu store, so our next step will be to publish a UITK examples snap that includes the UITK gallery, and to set-up automatic publishing of that snap to different channels when we update the UITK or the examples. We will also evaluate what is the best way to make newer versions of Qt available and determine whether we need to provide prebuilt binaries to replace the qt57 and qt58 cloud parts.

Finally, we will determine which libraries need to be included in the ubuntu-app-platform snap. The plan is to include all APIs that are listed on https://developer.ubuntu.com/api/qml/ and if APIs are missing we will add them to that webpage as well as to the platform snap. Of course, if you think we are forgetting a library that is useful and used in many different applications, please leave a comment below.

Read more
liam zheng

Canonical 今日发布了面向物联网 (IoT) 的 Ubuntu Core 16,除了提供定期的可靠安全更新外,还为智能互联设备带来应用商店服务。

目前,Ubuntu Core 在柜顶交换机、工业网关、家庭网关、无线接入网络、数字标牌、机器人和无人机等领域得到了广泛应用。“Ubuntu Core 可为物联网提供安全保护,并为每部设备带去精彩的应用商店。”Ubuntu 和 Canonical 的创始人 Mark Shuttleworth 说。

“随着许多公司陆续拥抱物联网解决方案,强大的安全性和简单快速的系统更新就变得至关重要。”戴尔物联网战略及合作总监 Jason Shepherd 表示。“戴尔与 Canonical 就 Ubuntu Core 开展合作已经一年有余。目前,我们的 Dell Edge Gateway 系列网关已获得认证,全面支持 Ubuntu Core 16。这使戴尔能够提供工厂和楼宇自动化等物联网应用场合需要的长期支持和安全保护。”

新的 Ubuntu Core 系统提供突破性的安全性、管理功能、操作和升级能力,并且由于采用 Snap 应用包,整个平台具有体积小、对开发者友好的特性。Snap 应用包是受安全限制、只读且防篡改的应用程序映像,它们以数字签名的方式保证 IoT 软件的完整性。

IBM 副总裁兼新兴技术与高级创新部门首席技术官 Mac Devine 评价道:“认知时代的到来催生了更多的智能设备,这需要我们从根本上做出改变,以便处理庞大的数据和进行实时认知分析。Snap 让开发者能以一种可轻松在多个物联网设备间移植和升级的格式构建和部署应用程序,从而能够建立一种云与网络边缘之间的认知关系。”

更新控制功能让软件发行者和制造商可以在应用更新之前,先在生态系统中验证这些更新。Snap 更新属于事务性更新,这意味着一旦更新失败,系统将自动还原,因此开发者将更有信心定期更新他们的应用程序。

开源机器人基金会 (OSRF) 的首席执行官 Brian Gerkey 补充道:“OSRF 与全球各地的工程师、科学家和创业者开展合作,致力于让机器人走出研究实验室,进入我们的日常生活,广泛应用于工厂、施工现场、家庭生活和交通等领域。在将机器人部署到现实生活的过程中,有着许许多多的挑战。其中,远程管理和升级机器人软件是大家共同面临的一个重大问题。我认为,Ubuntu Core 16 能够通过 Snap 的形式部署 ROS 应用程序,让整个软件管理过程变得更加安全和简单,从而为开发者和组织部署机器人提供巨大帮助。”

Ubuntu Core 的操作系统和内核同样采用 Snap 架构,因此整个平台都可以进行事务性升级。所有 Ubuntu Core 设备,无论出自哪家制造商,都将获得免费、定期、可靠的操作系统安全更新。

英特尔制造商与创新集团总经理 James Jackson 表示:“从人们的健康到太空探索,机器人技术几乎对每个行业都能产生深远影响。这样的未来需要一个安全、可靠的平台。我们认为 Ubuntu Core 16 就是一个这样的平台,在 ROS 领域,Ubuntu 平台已经一路领先。”

通用或针对设备的 Snap 应用商店,可在设备的整个生命周期内为开发者提供支持,从 Beta 测试版一直到正式发布版,让开发者能够像云软件、企业软件和移动软件那样,轻松销售物联网软件。贴牌 (White Label) 应用商店则可帮助设备制造商打造品牌化、差异化的设备和软件体验。

“迈入物联网时代后,我们生活的方方面面将出现数十亿部设备。”Linaro 的首席执行官 George Grey 说。“Ubuntu Core 16 将使用 Snap 帮助开发者快速将产品推向市场,为市场带来新一代的基于 Linux 的物联网智能设备。”

Gartner 认为,到 2020 年,超过半数的新业务流程将包含物联网的某些要素。Ubuntu Core 16 带来的 OTA 更新、签名 Snap 和安全模型,可帮助开发者和设备制造商缩短产品上市时间。设备制造商可以从众多支持 Ubuntu Core 的芯片、SoC 及单板机供应商中进行选择,例如 Raspberry Pi 2 和 3、Qualcomm Dragonboard 410c 以及 Intel Joule。
 

Read more
Daniel Holbach

Learning to snap with codelabs

The background

I always felt that learning something new, especially new concepts and workflows usually works best if you see it first-hand and get to do things yourself. If you experience directly how your actions influence the system you're working with, the new connections in your brain form much more quickly. Didier and I talked a while about how to introduce the processes and ideas behind snapd and snapcraft to a new audience, particularly at a workshop or a meet-up and we found we were of the same opinion.

Didier put quite a bit of work into solving the infrastructure question. We re-used the work which was put into Codelabs already, so adding a new codelab merely became a question of creating a Google Doc and adding it using a management command. It works nicely, the UI is simple and easy to understand and lets you focus on the content at hand. It was a lot of fun to work on the content and refine the individual steps in a self-teaching workshop style. Thanks a lot everyone for the reviews!

It's now available for everyone

After some discussion it became clear that a very fitting way for the codelabs to go out would be to ship them as a snap themselves. It's beautifully simple to get started:

$ sudo snap install snap-codelabs

All you need to do afterwards is point your browser to http://localhost:8123/ - that's all. You will be greeted with something like this:

From thereon you can quickly start your snap adventure and get up and running in no time. It's a step-by-step workshop and you always know how much more time you need to complete it.

Expect more codelabs to be added soon. If you have feedback, please let us know here.

Have fun and when you're done with your first codelab, let us know in the comments!

Read more
liam zheng

北京时间9月7日下午1点,Ubuntu作为技术合作伙伴应邀参加亚马逊AWS黑客松活动,Ubuntu Core作为大赛多个技术开发主题之一,成为备受开发者的青睐的开发任务。Ubuntu Core为IoT(物联网)而生,拥有众多新特性以及配备不可获取的安全机制,并且事务性系统升级则是确保IoT(物联网)的高效稳定。

北京时间9月7日下午1点,Ubuntu作为技术合作伙伴应邀参加亚马逊AWS黑客松活动,Ubuntu Core作为大赛多个技术开发主题之一,成为备受开发者的青睐的开发任务。Ubuntu Core为IoT(物联网)而生,拥有众多新特性以及配备不可获取的安全机制,并且事务性系统升级则是确保IoT(物联网)的高效稳定。由于客观原因,大赛时长比普通的黑客松活动稍短,这也给开发者增加了挑战的难度,不过开发者们还是在有限的时间里面交出了满意的答卷。

Ubuntu Core作为将设备彼此连接的重要系统平台,给与设备和设备间创造了无限的可能性,连接至云端则是打通设备与设备间的最后一道障碍。AWS 黑客松活动期间,共有19支参赛队伍中有技术控、设计达人、资深开发者、学生、以及创业团队。在短短的20小时,活动现场有2支小组完成了Ubuntu Core的挑战项目。

 

智能照明:酷图软件

项目链接http://git.oschina.net/erabbit/OpenIoT

项目介绍:基于公有云的IoT实践,以JavaScript作为主要开发语言,通过将蓝牙串口将智能灯泡链接至AWS的公有云,可在Web端进行开关灯泡的动作,从而实现远程控制智能灯泡。。该项目也将制作成snap应用格式。

 

远程3D打印:UCR

项目链接:待更新

项目介绍:3D打印一直是创客、开发者所热衷的创新技术,当3D打印通过装有Ubuntu Core的Bubblegum-96开发板连接到公有云服务后将开创一键上传、自动切片、自动打印的创新应用。而Ubuntu Core则是为3D打印作业的稳定提供了保障。同时,本项目也会有snap格式应用。

除了以上完成项目开发的团队外,还有几个未完成Ubuntu Core任务的团队,相信在赛后开发团队将继续完善他们的项目,将Ubuntu Core带到更多的应用领域。Ubuntu Core的创新之旅才刚刚开始,未完待续。

 

 

 

Read more
Benjamin Zeller

Releasing the 4.1.0 Ubuntu SDK IDE

We are happy to announce the release of the Ubuntu SDK IDE 4.1.0 for the Trusty, Xenial and Yakkety Ubuntu series.

The testing phase took longer than we have expected but finally we are ready. To compensate this delay we have even upgraded the IDE to the most recent 4.1.0 QtCreator.

Based on QtCreator 4.1.0

We have based the new IDE on the most recent QtCreator upstream release, which brings a lot of new features and fixes. To see whats new there just check out: http://blog.qt.io/blog/2016/08/25/qt-creator-4-1-0-released/.

LXD based backend

The click chroot based builders are now deprecated. LXD allows us to download and use pre built SDK images instead of having to bootstrap them every time a new build target is created.  These LXD containers are used to run the applications from the IDE. Which means that the host machine of the SDK IDE does not need any runtime dependencies.

Get started

It is good to know that all existing schroot based builders will not be used by the IDE anymore. The click chroots will remain on the host but will be decoupled from the Ubuntu SDK IDE. If they are not required otherwise just remove them using the Ubuntu dialog in Tools->Options.

If the beta IDE was used already make sure to recreate all containers, there were some bugs in the images that we do not fix automatically.

To get the new IDE use:

sudo add-apt-repository ppa:ubuntu-sdk-team/ppa

sudo apt update && sudo apt install ubuntu-sdk-ide

Check our first blog post about the LXD based IDE for more detailed instructions:

https://developer.ubuntu.com/en/blog/2016/06/14/calling-testers-new-ubuntu-sdk-ide-post/

Read more
liam zheng

第三届硬件自由日于6月23日在北京清华科技园 ∙ 科技大厦国际会议中心举行。Ubuntu应邀参加了以开源硬件为主题的第三届硬件自由日活动。作为Ubuntu Core合作伙伴的LeMaker、威控睿博现场展出了Ubuntu Core与96开发板、LeMaker Hikey在IoT应用场景。

第三届硬件自由日于6月23日在北京清华科技园 ∙ 科技大厦国际会议中心举行。Ubuntu应邀参加了以开源硬件为主题的第三届硬件自由日活动。作为Ubuntu Core合作伙伴的LeMaker、威控睿博现场展出了Ubuntu Core与96开发板、LeMaker Hikey在IoT应用场景。

威控睿博演示:

Ubuntu Core可以适用于很多场景,在硬件自由日活动上威控睿博利用装有Ubuntu Core的96开发板,控制多台3D打印机,从而解决单人同时控制、操作多台3D打印的问题。

LeMaker应用演示:

Lemaker是集开发板与解方案提供商的公司,Lemaker版的HiKey开发板可运行Ubuntu Core,现场还展出了另外一款LeMaker Guitar开发板,同样可运行Ubuntu Core。现场演示内容为:基于HiKey的硬件平台联动RosBot机器人,用Ubuntu Core加ROS的软件搭建的解决方案,可用于室内SLAM、机器人教学。

活动现场有超过100位的观众,在另外一个演讲会议厅有超过40人的行业参观者在场听取了Ubuntu Core技术以及应用的演说。

Read more
Justin McPherson

Introducing React Native Ubuntu

In the Webapps team at Canonical, we are always looking to make sure that web and near-web technologies are available to developers. We want to make everyone's life easier, enable the use of tools that are familiar to web developers and provide an easy path to using them on the Ubuntu platform.

We have support for web applications and creating and packaging Cordova applications, both of these enable any web framework to be used in creating great application experiences on the Ubuntu platform.

One popular web framework that can be used in these environments is React.js; React.js is a UI framework with a declarative programming model and strong component system, which focuses primarily on the composition of the UI, so you can use what you like elsewhere.

While these environments are great, sometimes you need just that bit more performance, or to be able to work with native UI components directly, but working in a less familiar environment might not be a good use of time. If you are familiar with React.js, it's easy to move into full native development with all your existing knowledge and tools by developing with React Native. React Native is the sister to React.js, you can use the same style and code to create an application that works directly with native components with native levels of performance, but with the ease of and rapid development you would expect.

We are happy to announce that along with our HTML5 application support, it is now possible to develop React Native applications on the Ubuntu platform. You can port existing iOS or Android React Native applications, or you can start a new application leveraging your web-dev skills.

You can find the source code for React Native Ubuntu here,

To get started, follow the instructions in README-ubuntu.md and create your first application.

The Ubuntu support includes the ability to generate packages. Managed by the React Native CLI, building a snap is as easy as 'react-native package-ubuntu --snap'. It's also possible to build a click package for Ubuntu devices; meaning React Native Ubuntu apps are store ready from the start.

Over the next little while there will be blogs posts on everything you need to know about developing a React Native Application for the Ubuntu platform; creating the app, the development process, packaging and releasing to the store. There will also be some information on how to develop new reusable modules, that can add extra functionality to the runtime and be distributed as Node Package Manager (npm) modules.

Go and experiment, and see what you can create.

Read more
David Callé

The latest version of snapd, the service powering snaps, has just landed in Ubuntu 16.04, here are some of the highlights of this release.

New commands: buy, find private, disable, revert

A lot of new commands are available, allowing you, for example, to downgrade, disable and buy snaps:

  • When logged into a store, snap find --private lets you see snaps that have been shared with you privately.
  • The new buy command presents you a choice of payment backends for non-free snaps.
  • snap disable allows you to disable specific snaps. A disabled snap won't be updated or launched anymore. It can be enabled with the snap enable command.
  • snap revert allows you to revert a snap to its previous installed version.
  • The refresh command now works with snaps installed in devmode.

Snap try and broken states handling

When using the snap try command to mount a folder containing a snap tree as an installed snap, you can end up with a broken snap if you happen to delete the folder without removing the snap first.

This "broken" state is now acknowledged as a potential snap state and handled gracefully by the system. The broken tag now appears next to the snap in the snap list output and you can remove it with snap remove.

Interfaces changes

  • getsockopt has been allowed for connected x11 plugs.
  • /usr/bin/locale access is now part of the default confinement policy.
  • A new hardware-observe interface that gives snaps read access to hardware information from the system. See the implementation for details.

Snapcraft 2.13

Snapcraft has also seen a new release (2.13) that brings:

  • Enhanced Ubuntu Store integration with the introduction of snapcraft push (which deprecates upload) and snapcraft release. These are very important pieces to the Continuous Integration aspect of snapcraft, you will have more to read on this front very soon!
  • A new plainbox plugin which allows parts containing a Plainbox test collection.
  • Many improvements on sanitizing cloud parts declarations.

Java plugins

There has also been a strong focus on improving Java plugins with, for example:

  • Improvements to the ant and maven plugins (support for targets).
  • Introduction of a gradle plugin

To learn how to use these plugins, the easiest way is to run snapcraft help ant, snapcraft help maven and snapcraft help gradle.

Usage examples can be found in the Playpen repository and guidance in the snapcraft documentation.

Read more
David Callé

If it hasn't already, snapd 2.0.10 should be making its way to your 16.04 systems. Here is what’s new!

The 2.0.10 release contains a number of improvements and fixes over the 2.0.9 release that was available before. The highlights:

Channels

Channels (stable, candidate, beta, edge) usage has been streamlined on the client.

As a shorthand to --channel=<channel>, you can now use --<channel> with the refresh and install commands.

For example:

2027ba20a6d8c6adad917f1b47bc6df3feed300c.png

Interfaces

New interfaces have landed with this release, giving you more freedom to interact with the OS, while keeping your app into the bounds of the existing confinement. This allows, for example, for improvements in the VLC snap’s user experience.

Screenshot from 2016-07-11 13-35-02.png

mpris (new)

  • Allows snaps such as music players to connect to D-Bus as an MPRIS server.
  • You can see an usage example in the VLC snapcraft.yaml.

camera (new)

optical-drive (new)

  • Grants read access to optical drives.

home

  • Allow gvfs shares in home.

General

  • Snaps can be launched under KDE Neon

  • SNAP_COMMON and SNAP_USER_COMMON are paths to unversioned data directories

  • Better handling of removed `snap try` directories

  • Fixes towards running snapd inside LXC

  • `snap change <taskid>` shows task progress

  • Auto-connect the home interface only if running on classic

The changelog is available here and the full details can be found here: https://github.com/snapcore/snapd/tree/2.0.10

Let us know what you think!

We’d like to hear your feedback about snapd and snap technologies. Is there an interface you would need for your app to be working better? Can we do better with integrating with a particular distro? Here’s how we can talk:

Read more
Didier Roche

Background

Integrating desktop applications with snaps has been a little bit challenging in terms of getting them looking and behaving as part of the system. This means following general desktop theming, having global application menu integration, getting the icon caches, getting configuration keys and such. Also, the technologies and toolkits like GTK, Qt, demand a little bit of expertise on that front.

That's the reason why we saw flourishing some desktop helpers like gtkconf or qtconf as cloud snapcraft parts for this. However, they were sharing little code and some part of the integration was working for one flavor and not the other flavor and vice-versa.

New desktop launchers to the rescue!

This is the reason why we are announcing new destkop launchers! The goal was to streamline the experience and ensuring that all following user visible features are working, independent of the toolkit or technology you are using:

  • Bind with current desktop theme if shipped by default (GTK & Qt)
  • Icons theme available for decoding (with the right decoders automatically shipped)
  • Application menu integration (in Unity)
  • Icon cache and images generated on first launch (no more need to ship pre-compile GSettings and Gio caching modules) after a new upgrade
  • Keep previous xdg-based data, even after upgrade
  • GSettings keys available for reading (not only writing)
  • Most of the code is shared between the launchers, so any fix in one will benefit others, and we assemble them at build time.
  • Avoid erratic behavior like cd $SNAP that some launchers were doing and not others (we don't change the current working directory anymore)

Ristretto before applying desktop/gtk3     Ristretto with desktop/gtk3

Those new cloud parts also ship with default package set configuration to ensure all features are enabled, this is overridable as well, as explained by Sergio in his blog post.

Qt-based applications also show those drastic improvements. Note that the appmenu fix for Qt applications will only work starting with snapd 2.0.10.

SMPlayer before using desktop/qt5   SMPlayer using desktop/qt5

Definition and usage

We currently have 5 launchers, depending on the technology you want to support: gtk2, gtk3, qt4, qt5 and glib-only for a lightweight, non graphical app, but needing basic integration like GSettings and MIME types.

Those are grouped under the "desktop" namespace from the snapcraft cloud part functionality, with extensive help on how to use them:

$ snapcraft define desktop/qt5
Maintainer: 'Snapcraft community <snapcraft@lists.snapcraft.io>'
Description:  |
  Helpers for gtk2, gtk3, qt4 and qt5 or glib minimal launchers.
  It brings the necessary code and exports for binding and using those
  desktop technologies in a relocatable fashion, enabling binding with
  global desktop theme, icon theme, image caching, fonts, mimetype handlers
  application global menu and gsettings integration.
  It also brings basics ubuntu dependency packages.
  .
  Usage:
    1. add "after: [desktop/<technology>]" to your launcher:
       - gtk2, gtk3, qt4 and qt5 corresponds to their respective toolkit
         main dependencies and default choices.
       - glib-only enables to compile mime types and gsettings infos. If you
         added your own graphical drivers, it will link them as well.
    2. prepend your command with "desktop-launch", like:
       commands: "desktop-launch foo" if foo is in $PATH. You can as well
       specify: "desktop-launch $SNAP/foo".
    3. add needed plugs to your application:
       - for graphical application:
         plugs: [x11 (or unity7 for appmenu integration)]. Think about adding
         opengl if you need hw acceleration.
       - if your application needs access to sound:
         plugs: [pulseaudio]
       - accessing to user's home directory:
         plugs: [home]
       - read/write to gsettings:
         plugs: [gsettings, home]
         (note that the home plug is needed to read new value)'
desktop/qt5:
  build-packages:
  - qtbase5-dev
  - dpkg-dev
  make-parameters:
  - FLAVOR=qt5
  plugin: make
  source: https://github.com/ubuntu/snapcraft-desktop-helpers.git
  source-subdir: qt
  stage-packages:
  - libxkbcommon0
  - ttf-ubuntu-font-family
  - dmz-cursor-theme
  - light-themes
  - shared-mime-info
  - libqt5gui5
  - libgdk-pixbuf2.0-0
  - libqt5svg5
  - appmenu-qt5

(Note that the descriptions are for now common to any namespaces launchers)

Migrating from gtkconf/qt4conf/qt5conf

As part of this journey, I wanted to see this applied in the real world and migrated all snappy playpen examples to this new launchers. I was delighted to see that some of the goals, like having smaller snapcraft.yaml was a success. Also, broken examples are now fully integrated to the desktop (see some of the pictures above).

Migrating is the existing gtkconf/qt4conf/qt5conf (we plan to deprecate them after a while) is a 2 minutes job:

  1. Replace: after: [<xxx>conf] with after: [desktop/<xxx>] where <xxx> is the targeted toolkit.
  2. Change command: gtk-launch (or qt-launch) foo with commands: desktop-launch foo. For simplicity, all launchers are now called "desktop-launch". Note that foo needs to be in $PATH for your snap, if it's not, replace it to $SNAP/foo.
  3. You can (not mandatory) clean up any build-packages or stages-packages that are shipped and expose in the desktop launcher definition.

By following those simple steps, you can get from an unthemed, no matching icons and no appmenu VLC to a fully integrated one!

Happy snap desktop integration! :)

Read more
David Planella

Shaping up universal snaps

Following the announcement of snaps being supported across a range of key Linux distributions, the development teams working on snaps and Snapcraft are making universal snaps one of the main topics of their next sprint in Heidelberg, Germany, from 18-22 July.

Snappy sprints are face-to-face events where multiple teams working on snap technologies, including Ubuntu founder Mark Shuttleworth, get together to plan, design and develop their next release and longer term roadmap. After the initial positive reception amongst initial adopters, tech media and wider open source community, continuous improvement of the snap user and developer experience is a major focus.

A number of upstreams, contributors and developers of leading open source projects such as DebianElementary OS, Fedora, KDE, Kubuntu, MATE or VLC have already confirmed participation at the sprint to collaborate on better distro-agnostic snap support.

At this point, we'd like to extend this invitation to contributors of other projects to influence the roadmap and work together on shaping up the universal snaps story. If you are interested in participating, we have a limited amount of seats available at the sprint, subject to review and confirmation. Should they need it, sponsorship for travel and accommodation will be available for a set of contributors of upstreams, distros or desktop projects who are willing to actively work towards this goal.

If the answer is yes, feel free to apply for participation and sponsorship to the Heidelberg snappy sprint

Please note that a sprint is not a tech conference: it is a set of focused working and planning sessions where the snappy Engineering team execute work items and plan the next iteration of snapd and Snapcraft. Attendees will be expected to actively participate in discussions and decision making and be willing to take work items where appropriate.

Also do note that while all contributions are valuable, we have a limited capacity to sponsor participants and we cannot support everyone. As such, sponsorship will be subject to review and final confirmation. Once the requests are in, we will review all of the applicants and contact you as soon as possible to let you know if your request for sponsorship has been approved.

It will be a great chance to build together app distribution across platforms and we’ll be looking forward to working with you!

Read more
David Callé

Snapcraft 2.12 is here and is making its way to your 16.04 machines today.

This release takes Snapcraft to a whole new level. For example, instead of defining your own project parts, you can now use and share them from a common, open, repository. This feature was already available in previous versions, but is now much more visible, making this repo searchable and locally cached.

Without further ado, here is a tour of what’s new in this release.

Commands

2.12 introduces ‘snapcraft update’, ‘search’ and ‘define’, which bring more visibility to the Snapcraft parts ecosystem. Parts are pieces of code for your app, that can also help you bundle libraries, set up environment variables and other tedious tasks app developers are familiar with.

They are literally parts you aggregate and assemble to create a functional app. The benefits of using a common tool is that these parts can be shared amongst developers. Here is how you can access this repository.

  • snapcraft update : refresh the list of remote parts
  • snapcraft search : list and search remote parts
  • snapcraft define : display information and content about a remote part

5273725bbff337eaf4eb07a81af97cd82051866b.png

To get a sense of how these commands are used, have a look at the above example, then you can dive into details and what we mean by “ecosystem of parts”.

Snap name registration

Another command you will find useful is the new ‘register’ one. Registering a snap name is reserving the name on the store.

  • snapcraft register

6875784c98c671707e1de1b27bb0cdba4690d68e.png

As a vendor or upstream, you can secure snap names when you are the publisher of what most users expect to see under this name.

Of course, this process can be reverted and disputed. Here is what the store workflow looks like when I try to register an already registered name:

snap-name-register.png

On the name registration page of the store, I’m going to try to register ‘my-cool-app’, which already exists.

snap-name-register-failed.png

I’m informed that the name has already been registered, but I can dispute this or use another name.

snap-name-register-dispute.png

I can now start a dispute process to retrieve ownership of the snap name.

Plugins and sources

Two new plugins have been added for parts building: qmake and gulp.

qmake

The qmake plugin has been requested since the advent of the project, and we have seen many custom versions to fill this gap. Here is what the default qmake plugin allows you to do:

  • Pass a list of options to qmake
  • Specify a Qt version
  • Declare list of .pro files to pass to the qmake invocation

gulp

The hugely popular nodejs builder is now a first class citizen in Snapcraft. It inherits from the existing nodejs plugin and allows you to:

  • Declare a list of gulp tasks
  • Request a specific nodejs version

Subversion

SVN is still a major version control system and thanks to Simon Quigley from the Lubuntu project, you can now use svn: URIs in the source field of your plugins.

Highlights

Many other fixes made their way into the release, with two highlights:

  • You can now use hidden .snapcraft.yaml files
  • snapcraft cleanbuild’ now creates ephemeral LXC containers and won’t clutter your drive anymore

The full changelog for this milestone is available here and the list of bugs in sight for 2.13 can be found here. Note that this list will probably change until the next release, but if you have a Snapcraft itch to scratch, it’s a good list to pick your first contribution from.

Install Snapcraft

On Ubuntu

Simply open up a terminal with Ctrl+Alt+t and run these commands to install Snapcraft from the Ubuntu archives on Ubuntu 16.04 LTS

sudo apt update
sudo apt install snapcraft

On other platforms

Get the Snapcraft source code ›

Get snapping!

There is a thriving community of developers who can give you a hand getting started or unblock you when creating your snap. You can participate and get help in multiple ways:

Read more
David Barth

Cordova Ubuntu Update

A few weeks ago we participated to Phonegap Day EU 2016

A few weeks ago we participated to Phonegap Day EU 2016. It was a great opportunity to meet with the Cordova development team and app developers gathered for this occasion.

We demo'ed the latest Ubuntu 16.04 LTS release, running on a brand new BQ M10 tablet in convergence mode. It was really interesting to discuss with app developers. Creating responsive user interfaces is already a common topic for web developers, and Cordova developers by extension. 

On the second day, we hosted a workshop on developing Ubuntu applications with Cordova and popular frameworks like Ionic. Alexandre Abreu also showed his new cordova-plugin-ble-central for Ubuntu. This one lets you connect to an IoT device, like one of those new RPI boards, directly to an Ubuntu app using the Bluetooth Low Energy stack. Snappy, Ubuntu and Cordova all working together !

Last but not least, we started the release process for cordova-ubuntu 4.3.4. This is the latest stable update to the Ubuntu platform support code for Cordova apps. It's coming along with a set of documentation updates available here and on the upstream cordova doc site

We've made a quick video to summarize this and walk you through the first steps of creating your own Ubuntu app using Cordova. You can now watch it at: https://www.youtube.com/watch?v=ydnG7wVrsW4

Let us know about your ideas : we're eager to see what you can do with the new release and plugins.

Read more
Benjamin Zeller

New Ubuntu SDK Beta Version

A few days ago we have released the first Beta of the Ubuntu SDK IDE using the LXD container solution to build and execute applications. 

A few days ago we have released the first Beta of the Ubuntu SDK IDE using the LXD container solution to build and execute applications.

The first reports were positive, however one big problem was discovered pretty quickly:

Applications would not start on machines using the proprietary Nvidia drivers. Reason for this is that indirect GLX is not allowed by default when using those. The applications need to have access to:

  1. The glx libraries for the currently used driver
  2. The DRI and Nvidia device files

Luckily the snappy team already tackled a similar problem, so thanks to Michael Vogt (a.k.a mvo) we had a first idea how to solve it by reusing the Nvidia binaries and device files from the host by mounting them into the container.

However it is a bit more complicated in our case, because once we have the devices and directories mounted into the containers they will stay there permanently. This is a problem because the Nvidia binary directory has a version numbering, e.g. /usr/lib/nvidia-315, which changes with the currently loaded module and would stop the container from booting after the driver was changed and the old directory on the host is gone, or the container would use the wrong nvidia dir if it was not removed from the host.

The situation gets worse with optimus graphics cards were the user can switch between a integrated and dedicated graphics chip, which means device files in /dev can come and go between reboots.

Our solution to the problem is to check the integrity of the containers on every start of the Ubuntu SDK IDE and if problems are detected, the user is informed and asked for the root password to run automatic fixes. Those checks and fixes are implemented in the “usdk-target” tool and can be used from the CLI as well.

As a bonus this work will enable direct rendering for other graphics chips as well, however since we do not have access to all possible chips there might be still special cases that we could not catch.

So please report all problems to us on one of those channels:

We have released the new tool into the Tools-development PPA where the first beta was released too. However existing container might not be completely fixed automatically. They are better be recreated or manually fixed. To manually fix an existing container use the maintain mode from the options menu and add the current user into the “video” group.

To get the new version of the IDE please update the installed Ubuntu SDK IDE package:

$ sudo apt-get update && sudo apt-get install ubuntu-sdk-ide ubuntu-sdk-tools

Read more
David Callé

As of today and part of our weekly release cadence, a new snapd is making its way to your 16.04 systems. Here is what’s new!

Command line

  • snap interfaces can now give you a list of all snaps connected to a specific interface:
    1a42fb817c663169453b0c7c5e24302d24ecb376.png
  • Introduction of snap run <app.command>, which will provide a clean and simple way to run commands and hooks for any installed revision of a snap. As of writing this post, to try it, you need to wait for a newer core snap to be promoted to the stable channel, or alternatively, switch to the beta channel with snap refresh --channel=beta ubuntu-core

Ecosystem

  • Enable full confinement on Elementary 0.4 (Loki)
  • If a distribution doesn’t support full confinement through Apparmor and seccomp, snaps are installed in devmode by default.

Misc

  • Installing the core snap will now request a restart
  • Rest API: added support to send apps per snap, to allow finer-grained control of snaps from the Software center.

Have a look at the full changelog for more details.

What’s next?

Here are some of the fixes already lined up for the next snapd release:

  • New interfaces to enable more system access for confined snaps, such as “camera”, “optical-drive” and “mpris”. This will give a lot more latitude for media players (control through the mpris dbus interface, playing DVDs, etc.) and communication apps. You can try them now by building snapd from source.
  • Better handling of snaps on nvidia graphics
  • And much more to come, watch the new Snapcraft social channels ( twitter, google+, facebook) for updates!

Read more
Daniel Holbach

Week 3 of the Snappy Playpen

Next week we're going into the third week of the Snappy Playpen. An initiative to snap together, learn from each other, document best practices and get together as a team.

Get started with Snappy

The Snappy Playpen is hosted in github and we meet in both #snappy on Freenode and our gitter channel. We are hanging out there most of the time, but next week on Tuesday, 21st June we will get all experts in one room and together we will make a push to get both

snapped. Obviously you can bring whatever own app you are interested in. Particularly if you are an upstream of a project, we're keen to help you get started.

Snaps are a beautiful and simple way to get your app out to users, so let's make this happen together.

If you are curious and want to take a first look, go to https://snapcraft.io and we'll take care of the questions together.

  • WHAT: Snappy playpen sprint
  • WHEN: Tuesday, 21st June 2016 all day
  • WHERE: Join us on gitter or IRC

Read more