We're sorry but this page doesn't work properly without JavaScript enabled. Please enable it to continue.
Feedback

Building applications at once for Flatpack, Snapd, Dockers

00:00

Formal Metadata

Title
Building applications at once for Flatpack, Snapd, Dockers
Alternative Title
Distributing Freedesktop SDK applications to Flatpak, Snapd and Docker
Title of Series
Number of Parts
44
Author
License
CC Attribution 3.0 Unported:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal purpose as long as the work is attributed to the author in the manner specified by the author or licensor.
Identifiers
Publisher
Release Date
Language
Producer

Content Metadata

Subject Area
Genre
Abstract
BuildStream is used to build Freedesktop SDK for different deployment systems allowing applications based on it to be distributed at once to multiple systems. Flatpak, Snapd and Docker are similar. They are all used for deployment and applications use their own runtime. Each system has its own tools for development. Flatpak uses Flatpak Builder. Snapd uses Snapcraft. Docker development is based on `Dockerfile`s. Freedesktop SDK was developed to be the runtime of Flatpak. It used to be partly built with Flatpak Builder. It has since changed to be built with a deployment system agnostic tool: BuildStream. For this reason we can export the Freedesktop SDK to multiple formats. We will show how it is possible to build an application for the three systems at once.
Software development kitBuildingSystem programmingRun time (program lifecycle phase)CurvatureFreewareFilm editingCartesian coordinate systemComputer animation
System programmingComputing platformAndroid (robot)Scripting languageBuildingComputer-generated imageryVirtual machineVirtual realitySource codeBinary fileRevision controlRun time (program lifecycle phase)Configuration spaceSoftware development kitDisintegrationStack (abstract data type)Front and back endsPlug-in (computing)Process (computing)Element (mathematics)Junction (traffic)MaizeGraph (mathematics)Integrated development environmentVariable (mathematics)Projective planeBitPhysical systemRepository (publishing)Junction (traffic)Medical imagingHeat transferSoftwareData transmissionDifferent (Kate Ryan album)Cartesian coordinate systemKey (cryptography)Electric generatorElement (mathematics)Plug-in (computing)Front and back endsComputer fileComputing platformFreewareRun time (program lifecycle phase)Streaming mediaSource codeSoftware development kitStack (abstract data type)BuildingPatch (Unix)MereologyGraph (mathematics)Configuration spaceINTEGRALType theoryData managementCurvatureLine (geometry)Distribution (mathematics)Parameter (computer programming)Descriptive statisticsGroup actionRational numberVariable (mathematics)Computer configurationDatabaseRevision controlScripting languageSoftware developer1 (number)Device driverExpert systemCASE <Informatik>Integrated development environmentPantographElectronic mailing listMeasurementResultantPhase transitionService (economics)Computer animationLecture/Conference
Computer-generated imageryRepository (publishing)Software repositoryElement (mathematics)Generic programmingScripting languageMetadataChainPlug-in (computing)System programmingCurvatureControl flowScripting languageFunction (mathematics)Cartesian coordinate systemInformationPlug-in (computing)MetadataBitElement (mathematics)Medical imagingCurveoutputDigital photographySoftware repositoryExtension (kinesiology)Flow separationView (database)FreewareComputer animation
Stack (abstract data type)Computer-generated imageryGraph (mathematics)ImplementationChainSoftware development kitGraph (mathematics)System programmingContent (media)Electric currentElement (mathematics)Graph (mathematics)Computing platformMedical imagingBootstrap aggregatingSlide ruleDevice driverProjective planeCurveType theoryJunction (traffic)Personal area networkMetropolitan area networkIdentifiabilityOrder (biology)ChainCartesian coordinate systemMereologyServer (computing)Multiplication signImplementationGraph (mathematics)Cache (computing)Streaming mediaDemonBuildingData transmissionVirtualizationSoftware development kitCASE <Informatik>Key (cryptography)FreewareOrthogonalityGroup actionGreatest elementComputer animation
Server (computing)System programmingComputer programmingMedical imagingSlide ruleDistribution (mathematics)Data transmissionDemonUser interfaceCartesian coordinate systemFunction (mathematics)Goodness of fitDifferent (Kate Ryan album)Front and back endsDebugger1 (number)Line (geometry)Multiplication signComputer animation
Extension (kinesiology)Device driverComputer-generated imageryRun time (program lifecycle phase)Computer fileSystem programmingMehrplatzsystemDistribution (mathematics)Color confinementStreaming mediaEquivalence relationExtension (kinesiology)Link (knot theory)Projective planeDevice driverVirtual machineMedical imagingSoftware bugSoftware frameworkMereologyString (computer science)BitQuicksortComputer animation
Cartesian coordinate systemDirectory serviceIdentical particlesPlug-in (computing)Projective planeRight angleFreewareDataflowMultiplication signRun time (program lifecycle phase)Mobile appCASE <Informatik>BuildingKeyboard shortcutPhysical systemCurvatureKey (cryptography)Lecture/ConferenceMeeting/Interview
System programmingWebsiteComputer animation
Transcript: English(auto-generated)
Good morning My name is Valentine. I work for cut think I work on something called the free desktop SDK Which is a runtime of flat back applications? We are trying to use the free desktop SDK for other purpose than just flat back and
First I will go to that reason so we do desktop applications and for this topic vacation, it's not like Developer not necessarily necessarily Linux experts They have made it maybe
Are not Linux developers at all and they want sometimes to port their existing application to Linux and it's a bit of a problem because on all the other platform you have a Unified SDK and when you come to Linux well, this is not working so
There is no Linux SDK and Of course we don't want any unified next SDK. We it's nice to have a diversity in the next platform But there is a prime then If this person these developers who want to port an application to next
Try to look at how do I distribute my application build and distribute application on Linux? There is a lot of different ways to do it And Many of them are very difficult It's you need to be an expert in dynamic linking to understand some of them
And The thing is that if you want to touch several Large public you will need to deploy to several of them It's not just one you can't just say I will
Just make a package for Ubuntu. Well the first which version of Ubuntu because you probably have to rebuild for each version to be to be safe that it will work everywhere and And it it will just be a very small group of users
In this list is this is not in the complete there is a lot more ways to distribute applications But Here we can see that there are different types and the ones the three ones on top they use containers So the two first is mostly for this top application even though snap can also distribute services and also what's called
Yeah all the stuff and occur is more for backend, but they are very similar the rest is either Difficult to use or difficult to use as a developer so but the problem is that in this three first
Example there is some fragmentation and the fragmentation is not about just having several options having several option is fine the problem is that if you want to Make an application for
Snap the Any of this to make your application work on flat back So this is a issue so
I'll come back to free this up SDK. So free this up easy K is a userland runtime for this top application So it's it's something to work on a runtime for Containers it's not the distribution. There is no packet manager. There is
no configuration tools. There is no installation. It's really a basic thing it's the best for the gnome SDK and the kdSdk on flat back and we We first target flat back, but we want also to target other things It's built with build stream
So build stream what is build stream build stream is not the tool that is used for flat back to build Application for flat back, but we use that for the PDC phases top SDK because it's much more general So it's a tool for integration of a source software software stacks
It's doesn't care about the back end where you will distribute what it cares is about building, so it has just artifacts and It's expensive always plug-in so if you already want to have a back end there you can just add it So here are the thing that we have is that you can also use build stream for your application
You use a fritter step SDK and use build stream, and you can generate flatback repositories or snap files or Docker images, I will talk a bit about build stream, so build stream
how I always use this that You have a project you make a project and you have lots of elements and every month Represents one piece of software for example you have an element for GCC one in one for Benitez I
Don't know an element for Mesa drivers Elements have dependency between each Others so they are built and runtime dependencies, so we have a graph
Which can be quite big? but this is Used to be used to to build an environment to build every step so for example if you will want to build GCC you will need to have the Benitez Any as a build dependency, and it will just make an environment where it
Put the Benitez for you. You probably also have need to have another GCC to produce GCC So it's You can reproduce builds easily this is built with bubble wrap which is a container thing
The artifacts are cached so once you have built once you don't have to rebuild unless you change something so it detects if you have changed something in the rebuild and It can be also remotely cached, so if you work in a team that's useful
So you have a graph of lots of elements When you want to put everything together We have what we call the integration commands This is like posting subscript so what we do is just take all the artifacts Flatten everything together and run all the commands that will just finish the installation of your image
And we do that for every build over a very element We just take all the dependencies and do that and of course if you want to check out an artifact the result of your build the result of your application The build of your application you will get those commands to run and to finish your installation
Another thing that is interesting is that Build stream project can depend on all the build stream project, and they can just take element from the graph Dependency graph from the other project, and we should see how it's useful. This is an example of element
How you write an element in build stream? so it's actually not complete and remove just one part, but This is how to build transmission
Transmission is just a small software for BitTorrent transfer You can see that we described it at using the plug-in autotools on top kind So this will you use all the commands that are already registered for the autotools command We have plugins for many of the different build system, but you can make your own plugin easily
Then you are we have the dependencies you can see that some are build dependencies Some don't have any type, and then it means build and runtime And We have also some dependencies are junctions
So it uses a junction which is a project that is Upstream project in this case will be a transmission of the of 3d stop SDK So we just import some element on from the 3d stop SDK We can set up some variables which is to override some behavior of our plug-in the plug-in will use them
So here we just have config parameters and We have a description of our source source We can hear it's just a simple git a repository that we get the last line which is the The commit is just generated by tracking so you don't have to type that part
You just have to use a command that puts it for you You can of course have patches and lots of differencing there are lots of different plugins for also the sources So this is a very simple way to describe how to compile one element you have to imagine that you have
Lots of files that are like that for each of your elements, and they all depend on each other's so For free desktop SDK. We need three different output, and we made some plugins
for each of these outputs that we have we will have one element that will use one of these plugins and Mainly this will just have a dependency on what we want to put in that image And also some information on the metadata For that image because the metadata that is in flat pack application or snap application or docker is different
For example there is no exposed port in flat pack or maybe there's not much in flat pack There isn't some in docker for example It's like some ball of metadata that we need that will be in the element for this every of these
outputs So for the flat pack We just have two plugins for poo we know the details of flat pack we have a flat pack image, which Prepare an image for flat pack big export, and then we have another plugin that takes multiple images because flat pack typically
split application into several image and extensions So this is the flat pack repo will take all your images and put it to one repo for snap We have a very simple plug-in which Only cares about just putting metadata
next to some artifacts because snap is already very simple, and we use just a generic script to make a squash FS For the care it's a bit more complex plug-in we have a plug-in that makes
Layers Because we want to use layers. We just don't want to check out an artifact and import it right away into docker Because we want to be able to see that an application views for this top SDK should not I should be able to reuse a lady or as all the application that user for this sub SDK and
This plug-in can either output OCI or took her one two images So I will come to the detail of the layering in OCI images because this is the tricky part to understand nothing
So OCI images or docker images are a stack of layers For bloodstream we have a graph It Could be an idea to just say well I've flattened my graph and then get all my layer one layer per element, but this is not possible and the reason is that
if you flatten two different graphs that have common elements the order of those elements in the stack will be different and Might be some element that are also missing So while the identifiers of the layers itself will be
Will be the same If you look at the implementation of pan man or docker the way it will be stored on disk or on the Server Will be using probably some chain ID which is depending on also the type the layers on top of it
On but under it but So we can use it and also we have a lot of elements and the curve is not really made for using a lot of elements especially we have some back-end drivers that might not be able to have
layering on many many years So instead we for the users to say exactly what they want But we provide this layering but you have to be explicit about how you do this layering This is an example, so this is how the layers we have decided to make them in
Phaedis up is key So when simplified the graph because the graph is big and doesn't get in the slide so we are just interested in some element that are the SDK the platform and the bootstrap which are three different
Layers of the offer The virtual layers of SDK and Next to that I've made some elements that Represents the different things that I want to have as a OCI layers
Not that we don't distribute all of them as an image the bootstrap is not distributed But it will be used just to make a layer that would be reused by other
Other elements So here we can see that platform OCI for example Will take platform BST it will take the artifact and it will also use the bootstrap OCI and compare the two layers the two artifacts and build a layer out of the platform BST that will go on top of
bootstrap OCI and Every element we represent a layer and And an image as well So for every layer you make an element If you have an application so here example Transmission daemon which fits very well in Docker
we can This is another project that use the Phaedis up SDK because with the junction we can just reuse We can reuse the the elements from the
upstream project which is Phaedis up is gay we can just say I want to make a layer that is Really on top of my bootstrap layer in this case, but I could also use the platform Yes, that was it for the how it works. That was the tricky part so the current state of of it
We have We push the Lay the the Docker images to the curb you can also just
Build yourself easily and fetch from the cache The images using build stream For flatback of course we have always supported that so we we distribute that since a long time for snap We have something that is missing But it's in there
I Have made some examples using Firefox and transmission to show how to Do this kind of thing so Firefox doesn't provide any Docker images there isn't because the career is not very good for Pure desktop application, but they have another example which transmission transmission has comes with different
Output there is a GTK front end. There's common lines, and there is a demon that is just a web interface If you want the slides by the way you can just go on the program and the slides are put there
And Firefox is a very good example because it's a bigger Application that is very annoying to build several times, so you really want to build only ones for different back ends So Those are just examples. This is to show how we can do it, and I would love to have
feedback from that if there if you think that there is problems or there are If you want to if you want to do your own application and distribute on different things just look at those So as I said we had some problem with in snap so for snap We just wait for one book to be one and not one book one feature to be added in snap
For the month district of confinement doesn't work for us This is something that will be fixed By the end of the year in snap so you can start to use it unless you really want to Distribute something right now But it's coming
Also, there are things that we have to look at for example the way Slash etc is dealt with flat back and and snappy The nvidia drivers have nothing been tested in snap so it's something I need to do But I need to have a machine with nvidia
We don't have equivalent of flatback extension In OCI or snappy and also We have something missing in blue stream to deal with having multiple users in an image
Which would be interesting with 4o CME images, that's something that we need to address Yes, any question
Okay, so it's sort of shown. How builds from works If I were completely new to this where do I get it? How do I run it? Probably should have put a link it's on gitlab so it's if you look go on Gitlab.com slash build stream you will find it. It's there's a
Actually build stream that build as well There there will be also documentation on how to install. It's a python project so you can install it normally with a Pip if you want people install build stream Yes
It's packaged in some distributions. I think fedora is packaged Actually lots of once. It's all described in this documentation between the build It was not clear to me how you distinguish
Between what you're building or I mean for which thing you're building so if you want to if you have to specify the Slash app prefix for flow for flatback. How do you distinguish that in in the manifest for build stream?
I'm sorry if What was the example that you say you want to compile a few dependencies for but for flatback? Sometimes you have to whatever is the you know the build system for the dependency you have to put slash app, okay? How do you distinguish between snap and flatback interesting question?
So the way it's done. It's for snap. You can rebind things so the way you make application so the examples bind the application directory into slash app For OCI is not a problem. Just can't put it there, but you should build your application in slash app
It's not the freely established case that asked for it It's just to be compatible if you want to also put for flatback you will need to have slash up Yeah, but just I mean in the in the case that you so you have to have your dependency compiled already for slash app
Is that the case? My I'm sorry Yeah, everything is built with this, but yeah your application is built with knowing that the prefix is slash up
You have to do that, but it's not very difficult I mean just can your project to just say my prefix is slash up and all the Plugins will take it and you will build everything there So it's pretty Met to be used with the free desktop SDK right it's not meant to be distributed outside of the free desktop SDK runtime
So yeah for slash up yeah Maybe maybe we can talk about that because I think it's time Okay, so thank you very much