Create an account


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fedora - Fedora Silverblue, an introduction for developers

#1
Fedora Silverblue, an introduction for developers

<div><p>The Fedora <a href="https://silverblue.fedoraproject.org/">Silverblue project</a> takes Fedora workstation, libostree and podman, puts them in a blender, and creates a new Immutable Fedora Workstation. Fedora Silverblue is an OS that stops you from changing the core system files arbitrarily, and readily allows you to change the environment system files. The article <a href="https://fedoramagazine.org/what-is-silverblue/">What is Silverblue</a> describes the big picture, and this article drills down into details for the developer. </p>
<p> <span id="more-30998"></span> </p>
<p>Fedora Silverblue ties together a few different projects to make a system that is a git-like object, capable of layering packages, and has a container focused work flow. Silverblue is not the only distribution going down this road. It is the desktop equivalent of <a href="http://coreos.com/">CoreOS</a>, the server OS used by <a href="https://www.openshift.com/products/container-platform">Red Hat Openshift</a>.</p>
<p>Silverblue’s idea of ‘immutable’ has nothing to do with immutable layers in a container. Silverblue keeps system files immutable by making them read-only.</p>
<h2>Why immutable?</h2>
<p>Has an upgrade left your system in an unusable state? Have you wondered why one server in a pool of identical machines is being weird? These problems can happen when one system library – one tiny little file out of hundreds – is corrupted, badly configured or the wrong version. Or maybe your upgrade works fine but it’s not what you’d hoped for, and you want to roll back to the previous state.</p>
<p>An immutable OS is intended to stop problems like these biting you. This is not an easy thing to achieve – simple changes, like flipping the file system between read-write and read-only, may only change a fault-finding headache to a maintenance headache.</p>
<p>Freezing the system is good news for sysadmins, but what about developers? Setting up a development environment means heavily customizing the system, and filling it with living code that changes over time. The answer is partly a case of combining components, and partly the ability to swap between OS versions. </p>
<h2>How it works </h2>
<p>So how do you get the benefits of immutability without losing the ability to do your work? If you’re thinking ‘containers’, good guess – part of the solution uses <a href="https://github.com/containers/libpod">podman</a>. But much of the work happens underneath the container layer, at the OS level.</p>
<p>Fedora Silverblue ties together a few different projects to turn an immutable OS into a usable workstation. Silverblue uses libostree to provide the base system, lets you edit config files in /etc/, and provides three different ways to install packages. </p>
<ul>
<li><a href="https://rpm-ostree.readthedocs.io/en/latest/">rpm-ostree</a> installs RPM packages, similar to DNF in the traditional Fedora workstation. Use this for things that shouldn’t go in containers, like KVM/libvirt.</li>
<li><a href="https://docs.flatpak.org/en/latest/">flatpak</a> installs packages from a central flathub repo. This is the one-stop shop for graphical desktop apps like LibreOffice.</li>
<li>The traditional <em>dnf install</em> still works, but only inside a <a href="https://github.com/containers/toolbox">toolbox</a> (a Fedora container). A developer’s workbench goes in a toolbox.</li>
</ul>
<p>If you want to know more about these components, check out <a href="https://fedoramagazine.org/pieces-of-fedora-silverblue/">Pieces of Silverblue</a>.</p>
<h2>Rolling back and pinning upgrades </h2>
<p>All operating systems need upgrades. Features are added, security holes are plugged and bugs are squashed. But sometimes an upgrade is not a developer’s friend.</p>
<p>A developer depends on many things to get the job done. A good development environment is stuffed with libraries, editors, toolchains and apps that are controlled by the OS, not the developer. An upgrade may cause trouble. Have any of these situations happened to you?</p>
<ul>
<li>A new encryption library is too strict, and an upgrade stopped an API working.</li>
<li>Code works well, but has deprecated syntax. An upgrade brought error-throwing misery.</li>
<li>The development environment is lovingly hand-crafted. An upgrade broke dependencies and added conflicts.</li>
</ul>
<p> In a traditional environment, unpicking a troublesome upgrade is hard. In Silverblue, it’s easy. Silverblue keeps two copies of the OS – your current upgrade and your previous version. Point the OS at the previous version, reboot, and you’ve got your old system files back. </p>
<p>You aren’t limited to two copies of your file system – you can keep more by pinning your favorite versions. Dusty Mabe, one of the engineers who has been working on the system since the <a href="https://www.projectatomic.io/">Project Atomic</a> days, describes how to pin extra copies of the OS in his article <a href="https://www.projectatomic.io/blog/2018/05/pinning-deployments-ostree-based-systems/">Pinning Deployments in OSTree Based Systems</a>.</p>
<p>Your home directory is not affected by rolling back. Rpm-ostree does not touch /etc/ and /var/.</p>
<h2>System updates and package installs</h2>
<p>Silverblue’s rpm-ostree treats all the files as one object, stored in a repository. The working file system is a checked-out copy of this object. After a system update, you get two objects in that repository – one current object and one updated object. The updated object is checked out and becomes the new file system.</p>
<p>You install your workhorse applications in toolboxes, which provide container isolation. And you install your desktop applications using Flatpak.</p>
<p>This new OS requires a shift in approach. For instance, you don’t have to keep only one copy of your system files – you can store a few and select which one you use. That means you can swap back and forth between an old Fedora release and the rawhide (development) version in a matter of minutes.</p>
<h2>Build your own Silverblue VM</h2>
<p>You can safely install Fedora Silverblue in a VM on your workstation. If you’ve got a hypervisor and half an hour to spare (10 minutes for ISO download, and 20 minutes for the build), you can see for yourself.</p>
<ol>
<li>Download Fedora Silverblue ISO from </li>
<li><a href="https://silverblue.fedoraproject.org/download">https://silverblue.fedoraproject.org/download</a> (not Fedora workstation from https://getfedora.org/).</li>
<li>Boot a VM with the Fedora Silverblue ISO. You can squeeze Fedora into compute resources of 1 CPU, 1024MiB of memory and 12GiB of storage, but bigger is better.</li>
<li>Answer <a href="https://fedoraproject.org/wiki/Anaconda">Anaconda</a>’s questions.</li>
<li>Wait for the <a href="https://www.gnome.org/">Gnome</a> desktop to appear.</li>
<li>Answer <a href="https://fedoraproject.org/wiki/InitialSetup">Initial Setup</a>’s questions.</li>
</ol>
<p>Then you’re ready to set up your developer’s tools. If you’re looking for an IDE, check these out. Use flatpak on the desktop to install them.</p>
<ul>
<li><a href="https://wiki.gnome.org/Apps/Builder">Gnome Builder</a> (Gnome’s official IDE)</li>
<li><a href="https://www.eclipse.org/ide/">Eclipse</a> </li>
<li><a href="http://www.codeblocks.org/">Code::Blocks</a> </li>
</ul>
<p>Finally, use the CLI to create your first toolbox. Load it with modules using <a href="https://www.npmjs.com/package/package">npm</a>, <a href="https://rubygems.org/">gem</a>, <a href="https://pypi.org/">pip</a>, <a href="https://git-scm.com/">git</a> or your other favorite tools. </p>
<h2>Help!</h2>
<p>If you get stuck, ask questions at the <a href="https://discussion.fedoraproject.org/c/desktop/silverblue/6">forum</a>. </p>
<p>If you’re looking for ideas about how to use Silverblue, read articles in the <a href="https://fedoramagazine.org/?s=silverblue">magazine</a>.</p>
<h2>Is Silverblue for you?</h2>
<p>Silverblue is full of shiny new tech. That in itself is enough to attract the cool kids, like moths to a flame. But this OS is not for everyone. It’s a young system, so some bugs will still be lurking in there. And pioneering tech requires a change of habit – that’s extra cognitive load that the new user may not want to take on.</p>
<p>The OS brings immutable benefits, like keeping your system files safe. It also brings some drawbacks, like the need to reboot after adding system packages. Silverblue also enables new ways of working. If you want to explore new directions in the OS, find out if Silverblue brings benefits to your work.</p></p>
</div>


https://www.sickgaming.net/blog/2020/05/...evelopers/
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum software by © MyBB Theme © iAndrew 2016