Logo

dev-resources.site

for different kinds of informations.

KDE Development with Podman

Published at
8/10/2021
Categories
podman
kde
linux
Author
ayush1325
Categories
3 categories in total
podman
open
kde
open
linux
open
Author
9 person written this
ayush1325
open
KDE Development with Podman

Introduction

I have been using KDE for quite some time and recently decided to start contributing to KDE development. However, I hit a few problems in the way before deciding to create a CLI tool.

Toolbox

I use Fedora as my daily driver. Toolbox is built on top of Podman. It is mainly designed for use with immutable OS like Fedora Silverblue but can be used with other distributions. I use toolbox for most of my development, so I started setting up the development environment in it as outlined here.

However, when I tried building Solid using kdesrc-build, I started getting many errors about Undefined Reference everywhere. I tried installing pretty much the whole plasma inside the toolbox but couldn't fix the problem. I also opened a bug report but no luck. So I kind of left there to get some fresh air.

Docker

This was my second attempt to set up a development environment. KDE provides a guide to set up a docker container for development here.

It seemed a little old since it used nvidia-docker instead of nvidia-container-toolkit. There were a few problems though:

  1. Docker didn't work well when I installed it.
  2. Neither nvidia-docker nor nvidia-container-toolkit are not officially supported in Fedora

I didn't try too hard to fix docker in my system since I use Fedora Silverblue on my laptop, and I don't want to install docker on it. So I moved on to podman.

Podman

At first, I thought I could just modify the build scripts a little to work with Podman. I was partially correct since to get the container started, I just replaced the docker command with podman.

However, getting Nvidia to work was much more complicated. Now, I am not a container expert, so a lot of it was because of my unfamiliarity with the technology. At first, I had to get nvidia-container-toolkit using CentOS package. The test containers given in the instructions here worked fine. However, I soon understood that nvidia-container-toolkit requires basing the image on nvidia official containers or going through this and figure out how to create a custom container. Most documentation online seemed to be about nvidia-docker or just covered the install portion of nvidia-container-toolkit. There was almost nothing available on how to create a custom image. After some digging around and copying and pasting (I still don't understand some of it), I was able to create a container with nvidia-smi, and other cuda commands working.

At this point, the modification to the collection of scripts was getting a little bigger. So I decided to create a CLI tool to combine everything.

KDE Container CLI

I started writing a cli that could create containers for me and added features like launching GUI apps inside the container without entering. It supports both podman and docker, but the docker side isn't tested since I don't use docker much.

Usage

It uses a structure of subcommands to work. We have four commands at the top level:

  1. Build: To build the container image for development.
  2. Run: To run/start/attach to the container.
  3. Config: For storing extra configuration that might be required in some systems. E.g., Podman requires adding to xhost to display GUI applications.
  4. Launch: To launch GUI applications like Kdevelop without entering the container.

All commands other than Config have a subcommand to choose between docker and podman.

Problems

  1. Nvidia still doesn't work perfectly. GUI applications like glxgear and qtcreator can't seem to find graphic drivers even though CLI applications work.
  2. Docker part isn't tested.

Conclusion

My current setup for KDE development is working quite well. The CLI tool is hosted here. I hope to finally start some work with KDE development now that everything seems to be working.

Contributions are, of course, welcome from everyone in the form of issues or code. It would be great if someone could fix the nvidia part of the CLI.

Currently, the binary is distributed as a tar.gz file with the dockerfiles and other assets required.

kde Article's
30 articles in total
Favicon
(Quick-note) Troubleshooting Dual Monitor Issues on KDE on Ubuntu/ Linux Mint
Favicon
bash: No such file or directory
Favicon
How To Unhide Titlebars on Maximised Windows in KDE Plasma 6
Favicon
DinaWall 0.2
Favicon
How to enable auto dark mode (night theme) in KDE Plasma
Favicon
Using KConfig with Rust
Favicon
Bitflags in Rust
Favicon
Season of KDE 2022
Favicon
Creating Rust/QML Project using Templates
Favicon
My sleek and modern Linux development machine in 2021
Favicon
Activate USB Wi-Fi Receiver from Terminal
Favicon
KDE Development with Podman
Favicon
My KDE Workfloaw
Favicon
How to recover KDE if it doesn't load after updating FreeBSD from 12.x to 13.0-RELEASE
Favicon
Fuck FreeBSD
Favicon
The state of Linux as a daily use OS in 2021
Favicon
SPOTIFY SYSTEM TRAY [KDE]
Favicon
Fedora - KDE development journey (Qt5X11Extras)
Favicon
Fedora - KDE development journey (Qt5UiPlugin)
Favicon
Fedora - KDE development journey (Qt5Qml / qmake)
Favicon
KDE vs GNOME
Favicon
Setting up Arch Linux with KDE Plasma in Windows Subsystem for Linux 2
Favicon
âš™ My Arch Linux setup
Favicon
Writing a KDE Plasmoid to display JioFi Stats
Favicon
KDE Plasma & ssh keys
Favicon
Trying out KDE
Favicon
My (k)Ubuntu (OSX look alike) desktop setup
Favicon
KDE Neon on 2017 MacBook Air
Favicon
Script your Yakuake with default tabs
Favicon
How to execute Firefox with support for KDE filepicker

Featured ones: