Hackweek 18 Update

What Has Been Done During HackWeek 18

  • The REST API plugin (libyui-rest-api RPM) has been split into two independent parts (for Qt and Ncurses frontends). Now it is possible to install the REST API plugin into a minimal system without installing the whole X11 stack, just install the libyui-ncurses-rest-api plugin for the Ncurses UI.
  • It turned out that some widgets with the :notify property set do not send the change event when the value was changed via the REST API. Several widgets have been fixed but there still might be some broken widgets. We should later test all widgets and make sure it works everywhere.
  • Additionally the REST API now allows using the newer IPv6 protocol. There is one quite interesting feature in IPv6 - autoconfiguration. The link local address is automatically created from the MAC address from the network card. This means you can know the IPv6 address of a testing virtual machine even before starting it. That might be useful for automated tests.
  • Now it's also possible to use the simple HTTP Basic Authentication. If you run the REST API you really do not want to allow the access for everybody, especially for YaST which runs as root. Now you can set the credentials via YUI_AUTH_USER and YUI_AUTH_PASSWD environment variables.
    • This means that only one pair user/password can be set
    • ⚠️ Warning ⚠️ The password is still transferred in clear text! Use that feature only in a trusted network! Anybody on the way between the client and the REST API server can read that. To make it really secure we need to enable the SSL encryption.

Implementation Details

This is the complete list of the changes:

  • https://github.com/libyui/libyui-ncurses/pull/77
  • https://github.com/libyui/libyui/pull/143
  • https://github.com/libyui/libyui-rest-api/pull/2
  • https://github.com/libyui/libyui-ncurses-rest-api/pull/1
  • https://github.com/libyui/libyui-qt-rest-api/pull/1
  • https://github.com/libyui/ci-libyui-container/pull/1

Hackweek 17 Update

During Hackweek 17 I did these improvements to the project:

  • Moved the HTTP server handling, now works better and it not blocked by UI calls
  • Added support for the text mode (ncurses Ui)
  • Added more details in the response, supports more UI actions
  • Built testing packages for openSUSE Leap 15.0

See more details in the blog post (more examples) and in the Git repository (how to install the testing packages or how to patch the openSUSE Leap 15.0 installer).

Screencast


=================================================================================================

Remote UI Control

This is actually a continuation of my previous Hackweek project YaST Integration Tests Using Cucumber. That project worked but in the end it turned out to be too big step forward. And was bound to one specific testing framework (cucumber).

Better Approach - REST API

So I was thinking about it how to make it more generic and my idea is: provide a REST API (using HTTP + JSON) for querying the UI and sending the actions.

API Examples

Here are some examples how the API could look. They are not final, it is just a proposal for starting the discussion:

Read (GET):

# dump whole dialog content
curl http://localhost:/dialog
# dump only specific widget(s):
# by internal ID
curl http://localhost:/widget?id=`checkbox
# by label (as displayed = translated!)
curl http://localhost:/widget?label=Enabled
# by type (e.g. check all check box states)
curl http://localhost:/widget?type=YCheckBox

Write, run actions (POST):

# by label (similar to read above)
curl -X POST http://localhost:/widget?label=Enabled&checked=true
curl -X POST http://localhost:/widget?label=Next&action=click

The read output could look like:

{
    "class": "YDialog",
    "children": [
        {
            "class": "YWizard",
            "id": "`wizard",
            "children": [
                 ...
            ]
         }
     ]
}

Advantages

  • Not specific to any testing framework, you can write wrappers for RSpec, Cucumber,... adapting the openQA should be easier than adding the Cucumber support
  • HTTP + JSON is easy to process (even from shell using curl and jq)
  • Can be used remotely when running inside a virtual machine (important for openQA), the only complication is network-less machine, in that case the HTTP requests could be sent from another console via a curl command locally
  • Allows using HTTP Basic/Digest Auth for authentication
  • Switching to secure HTTPS should be relatively easy, then you could send your root password securely over network

Implementation Details

Existing Proof of Concept

I already have a proof of concept code:

  • Compile libyui from my fork, use the http_server branch
  • Compile libyui-qt from my fork, use the http_server branch
  • Recompile/reinstall the yast2-ycp-ui-bindings package (because of the ABI changes in libyui)
  • Run YUI_HTTP_PORT=8888 yast2 as root
  • Run curl http://localhost:8888, you will see the dump of the current dialog in the JSON format (not complete yet, some values might be missing)

It does not support the paths mentioned in the proposal above or POST actions yet, but at least it shows that embedding an HTTP server and processing JSON is not that difficult in C++ as it could look at the first sight.

TODO

  • Propose the REST API endpoints and parameters
  • Improve the JSON dumper
  • Implement the proposed API paths
  • Error handling (widget not found, action not possible)
  • Make the feature optional (e.g. enable/disable by a cmake option, users outside (open)SUSE might not be interested in this feature, it also adds some build and runtime dependencies)
  • Implement the support also in the ncurses UI
  • Implement support also for the packager widget (libyui-qt-pkg and libyui-ncurses-pkg)
  • Write some simple wrappers/helpers for RSpec or Cucumber (see the previous project for the Cucumber step definitions)
  • Document the API
  • As this is a generic libyui solution add also some plain C++ examples (to demonstrate the usage outside YaST)
  • Announce the feature so it can be really used

Related Project

There is the Make YaST Testing Independent of Keyboard Shortcuts hackweek project which is a bit related to this project. It's advantage is that it is simpler and can be possibly easier integrated into the current openQA.

=================================================================================================

Looking for hackers with the skills:

c++ rest http json testing yast yastui integration libyui libyui-qt libyui-ncurses

This project is part of:

Hack Week 16 Hack Week 17 Hack Week 18

Activity

  • about 7 years ago: ancorgs liked this project.
  • about 7 years ago: okurz liked this project.
  • about 7 years ago: wanghaisu liked this project.
  • about 7 years ago: lslezak added keyword "libyui" to this project.
  • about 7 years ago: lslezak added keyword "libyui-qt" to this project.
  • about 7 years ago: lslezak added keyword "libyui-ncurses" to this project.
  • about 7 years ago: lslezak started this project.
  • about 7 years ago: lslezak added keyword "integration" to this project.
  • about 7 years ago: lslezak added keyword "yast" to this project.
  • about 7 years ago: lslezak added keyword "yastui" to this project.
  • about 7 years ago: lslezak added keyword "c++" to this project.
  • about 7 years ago: lslezak added keyword "rest" to this project.
  • about 7 years ago: lslezak added keyword "http" to this project.
  • about 7 years ago: lslezak added keyword "json" to this project.
  • about 7 years ago: lslezak added keyword "testing" to this project.
  • about 7 years ago: lslezak originated this project.

  • Comments

    • lslezak
      almost 7 years ago by lslezak | Reply

      If you are interested in the results see my blog: https://blog.ladslezak.cz/2017/12/06/hackweek-16-yast-ui-rest-api/

    • lslezak
      almost 7 years ago by lslezak | Reply

      Oh, URLs are not auto-linked and Edit is not available... So once more: https://blog.ladslezak.cz/2017/12/06/hackweek-16-yast-ui-rest-api/

    • lslezak
      over 6 years ago by lslezak | Reply

      JFYI: I'm continuing with the project at Hackweek 17...

    Similar Projects

    RISC-V emulator in GLSL capable of running Linux by favogt

    Description

    There are already numerous ways to run Linux and some programs through emulation in a web browser (e.g. x86 and riscv64 on https://bellard.org/jslinux/), but none use WebGL/WebGPU to run the emulation on the GPU.

    I already made a PoC of an AArch64 (64-bit Arm) emulator in OpenCL which is unfortunately hindered by a multitude of OpenCL compiler bugs on all platforms (Intel with beignet or the new compute runtime and AMD with Mesa Clover and rusticl). With more widespread and thus less broken GLSL vs. OpenCL and the less complex implementation requirements for RV32 (especially 32bit integers instead of 64bit), that should not be a major problem anymore.

    Goals

    Write an RISC-V system emulator in GLSL that is capable of booting Linux and run some userspace programs interactively. Ideally it is small enough to work on online test platforms like Shaderoo with a custom texture that contains bootstrap code, kernel and initrd.

    Minimum:

    riscv32 without FPU (RV32 IMA) and MMU (µClinux), running Linux in M-mode and userspace in U-mode.

    Stretch goals:

    FPU support, S-Mode support with MMU, SMP. Custom web frontend with more possibilities for I/O (disk image, network?).

    Resources

    RISC-V ISA Specifications
    Shaderoo
    OpenGL 4.5 Quick Reference Card

    Result as of Hackweek 2024

    WebGL turned out to be insufficient, it only supports OpenGL ES 3.0 but imageLoad/imageStore needs ES 3.1. So we switched directions and had to write a native C++ host for the shaders.

    As of Hackweek Friday, the kernel attempts to boot and outputs messages, but panics due to missing memory regions.

    Since then, some bugs were fixed and enough hardware emulation implemented, so that now Linux boots with framebuffer support and it's possible to log in and run programs!

    The repo with a demo video is available at https://github.com/Vogtinator/risky-v


    YQPkg - Bringing the Single Package Selection Back to Life by shundhammer

    tl;dr

    Rip out the high-level YQPackageSelector widget from YaST and make it a standalone Qt program without any YaST dependencies.

    See section "Result" at the bottom for the current status after the hack week.

    The Past and the Present

    We used to have and still have a powerful software selection with the YaST sw_single module (and the YaST patterns counterpart): You can select software down to the package level, you can easily select one of many available package versions, you can select entire patterns - or just view them and pick individual packages from patterns.

    You can search packages based on name, description, "requires" or "provides" level, and many more things.

    The Future

    YaST is on its way out, to be replaced by the new Agama installer and Cockpit for system administration. Those tools can do many things, but fine-grained package selection is not among them. And there are also no other Open Source tools available for that purpose that even come close to the YaST package selection.

    Many aspects of YaST have become obsolete over the years; many subsystems now come with a good default configuration, or they can configure themselves automatically. Just think about sound or X11 configuration; when did you last need to touch them?

    For others, the desktops bring their own tools (e.g. printers), or there are FOSS configuration tools (NetworkManager, BlueMan). Most YaST modules are no longer needed, and for many others there is a replacement in tools like Cockpit.

    But no longer having a powerful fine-grained package selection like in YaST sw_single will hurt. Big time. At least until there is an adequate replacement, many users will want to keep it.

    The Idea

    YaST sw_single always revolved around a powerful high-level widget on the abstract UI level. Libyui has low-level widgets like YPushButton, YCheckBox, YInputField, more advanced ones like YTable, YTree; and some few very high-level ones like YPackageSelector and YPatternSelector that do the whole package selection thing alone, working just on the libzypp level and changing the status of packages or patterns there.

    For the YaST Qt UI, the YQPackageSelector / YQPatternSelector widgets work purely on the Qt and libzypp level; no other YaST infrastructure involved, in particular no Ruby (or formerly YCP) interpreter, no libyui-level widgets, no bindings between Qt / C++ and Ruby / YaST-core, nothing. So it's not too hard to rip all that part out of YaST and create a standalone program from it.

    For the NCurses UI, the NCPackageSelector / NCPatternSelector create a lot of libyui widgets (inheriting YWidget / NCWidget) and use a lot of libyui calls to glue them together; and all that of course still needs a lot of YaST / libyui / libyui-ncurses infrastructure. So NCurses is out of scope here.

    Preparatory Work: Initializing the Package Subsystem

    To see if this is feasible at all, the existing UI examples needed some fixing to check what is needed on that level. That was the make-or-break decision: Would it be realistically possible to set the needed environment in libzypp up (without being stranded in the middle of that task alone at the end of the hack week)?

    Yes, it is: That part is already working:

    https://github.com/yast/yast-ycp-ui-bindings/pull/71

    Go there for a screenshot

    That's already halfway there.

    The complete Ruby code of this example is here. The real thing will be pure C++ without any YaST dependencies.

    The Plan


    Port some classic game to Linux by MDoucha

    Let's pick some old classic game, reverse engineer the data formats and game rules and write an open source engine for it from scratch. Some games from 1990s are simple enough that we could have a playable prototype by the end of the week.

    Write which games you'd like to hack on in the comments. Don't forget to check e.g. on Open Source Game Clones, Github and SourceForge whether the game is ported already.

    Hack Week 24 - Master of Orion II: Battle at Antares & Chaos Overlords

    Work on Master of Orion II continues but we can hack more than one game. Chaos Overlords is a dystopian, lighthearted, cyberpunk turn-based strategy game originally released in 1996 for Windows 95 and Mac OS. The player takes on the role of a Chaos Overlord, attempting to control a city. Gameplay involves hiring mercenary gangs and deploying them on an 8-by-8 grid of city sectors to generate income, occupy sectors and take over the city.

    How to ~~install & play~~ observe the decompilation progress:

    • Clone the Git repository
    • A playable reimplementation does not exist yet, but when it does, it will be linked in the repository mentioned above.

    Further work needed:

    • Analyze the remaining unknown data structures, most of which are related to the AI.
    • Decompile the AI completely. The strong AI is part of the appeal of the game. It cannot be left out.
    • Reimplement the game.

    Hack Week 20, 21, 22 & 23 - Master of Orion II: Battle at Antares

    Master of Orion II is one of the greatest turn-based 4X games of the 1990s. Explore the galaxy, colonize planets, research new technologies, fight space monsters and alien empires and in the end, become the ruler of the galaxy one way or another.

    How to install & play:

    • Clone the Git repository
    • Run ./bootstrap; ./configure; make && make install
    • Copy all *.LBX files from the original Master of Orion II to the installation data directory (/usr/local/share/openorion2 by default)
    • Run openorion2

    Further work needed:

    • Analyze the rest of the original savegame format and a few remaining data files.
    • Implement most of the game. The open source engine currently supports only loading saved games from the original version and viewing the galaxy map, fleet management and list of known planets.

    Hack Week 19 - Signus: The Artifact Wars

    Signus is a Czech turn-based strategy game similar to Panzer General or Battle Isle series. Originally published in 1998 and open-sourced by the original developers in 2003.

    How to install & play:

    • Clone the Git repository
    • Run ./bootstrap; ./configure; make && make install in both signus and signus-data directories.
    • Run signus

    Further work needed:

    • Create openSUSE package
    • Implement full support for original game data (the open source version uses slightly different data file contents but original game data can be converted using a script).


    New KDE Plasma notification app/applet by apappas

    Description

    My memory is terrible so I depend a lot on notifications to carry me through the workday. As a plasma user I am ok with the current applet, but I don't love it. It is too small for the centrality it has in my day. Also I dislike how you can not go back to notifications you have dismissed

    Goals

    Develop a plasma app that * must gather notifications without disrupting the existing notification app * must offer the ablity to refer to dismissed/archived/seen notification up to some defined point in the past * must allow deletion of notifications


    Add a machine-readable output to dmidecode by jdelvare

    Description

    There have been repeated requests for a machine-friendly dmidecode output over the last decade. During Hack Week 19, 5 years ago, I prepared the code to support alternative output formats, but didn't have the time to go further. Last year, Jiri Hnidek from Red Hat Linux posted a proof-of-concept implementation to add JSON output support. This is a fairly large pull request which needs to be carefully reviewed and tested.

    Goals

    Review Jiri's work and provide constructive feedback. Merge the code if acceptable. Evaluate the costs and benefits of using a library such as json-c.


    Make more sense of openQA test results using AI by livdywan

    Description

    AI has the potential to help with something many of us spend a lot of time doing which is making sense of openQA logs when a job fails.

    User Story

    Allison Average has a puzzled look on their face while staring at log files that seem to make little sense. Is this a known issue, something completely new or maybe related to infrastructure changes?

    Goals

    • Leverage a chat interface to help Allison
    • Create a model from scratch based on data from openQA
    • Proof of concept for automated analysis of openQA test results

    Bonus

    • Use AI to suggest solutions to merge conflicts
      • This would need a merge conflict editor that can suggest solving the conflict
    • Use image recognition for needles

    Resources

    Timeline

    Day 1

    • Conversing with open-webui to teach me how to create a model based on openQA test results

    Day 2

    Highlights

    • I briefly tested compared models to see if they would make me more productive. Between llama, gemma and mistral there was no amazing difference in the results for my case.
    • Convincing the chat interface to produce code specific to my use case required very explicit instructions.
    • Asking for advice on how to use open-webui itself better was frustratingly unfruitful both in trivial and more advanced regards.
    • Documentation on source materials used by LLM's and tools for this purpose seems virtually non-existent - specifically if a logo can be generated based on particular licenses

    Outcomes

    • Chat interface-supported development is providing good starting points and open-webui being open source is more flexible than Gemini. Although currently some fancy features such as grounding and generated podcasts are missing.
    • Allison still has to be very experienced with openQA to use a chat interface for test review. Publicly available system prompts would make that easier, though.


    Hack on isotest-ng - a rust port of isotovideo (os-autoinst aka testrunner of openQA) by szarate

    Description

    Some time ago, I managed to convince ByteOtter to hack something that resembles isotovideo but in Rust, not because I believe that Perl is dead, but more because there are certain limitations in the perl code (how it was written), and its always hard to add new functionalities when they are about implementing a new backend, or fixing bugs (Along with people complaining that Perl is dead, and that they don't like it)

    In reality, I wanted to see if this could be done, and ByteOtter proved that it could be, while doing an amazing job at hacking a vnc console, and helping me understand better what RuPerl needs to work.

    I plan to keep working on this for the next few years, and while I don't aim for feature completion or replacing isotovideo tih isotest-ng (name in progress), I do plan to be able to use it on a daily basis, using specialized tooling with interfaces, instead of reimplementing everything in the backend

    Todo

    • Add make targets for testability, e.g "spawn qemu and type"
    • Add image search matching algorithm
    • Add a Null test distribution provider
    • Add a Perl Test Distribution Provider
    • Fix unittests https://github.com/os-autoinst/isotest-ng/issues/5
    • Research OpenTofu how to add new hypervisors/baremetal to OpenTofu
    • Add an interface to openQA cli

    Goals

    • Implement at least one of the above, prepare proposals for GSoC
    • Boot a system via it's BMC

    Resources

    See https://github.com/os-autoinst/isotest-ng


    Yearly Quality Engineering Ask me Anything - AMA for not-engineering by szarate

    Goal

    Get a closer look at how developers work on the Engineering team (R & D) of SUSE, and close the collaboration gap between GSI and Engineering

    Why?

    Santiago can go over different development workflows, and can do a deepdive into how Quality Engineering works (think of my QE Team, the advocates for your customers), The idea of this session is to help open the doors to opportunities for collaboration, and broaden our understanding of SUSE as a whole.

    Objectives

    • Give $audience a small window on how to get some questions answered either on the spot or within days of how some things at engineering are done
    • Give Santiago Zarate from Quality Engineering a look into how $audience sees the engineering departments, and find out possibilities of further collaboration

    How?

    By running an "Ask me Anything" session, which is a format of a kind of open Q & A session, where participants ask the host multiple questions.

    How to make it happen?

    I'm happy to help joining a call or we can do it async (online/in person is more fun). Ping me over email-slack and lets make the magic happen!. Doesn't need to be during hackweek, but we gotta kickstart the idea during hackweek ;)

    Rules

    The rules are simple, the more questions the more fun it will be; while this will be only a window into engineering, it can also be the place to help all of us get to a similar level of understanding of the processes that are behind our respective areas of the organization.

    Dynamics

    The host will be monitoring the questions on some pre-agreed page, and try to answer to the best of their knowledge, if a question is too difficult or the host doesn't have the answer, he will do his best to provide an answer at a later date.

    Atendees are encouraged to add questions beforehand; in the case there aren't any, we would be looking at how Quality Engineering tests new products or performs regression tests

    Agenda

    • Introduction of Santiago Zarate, Product Owner of Quality Engineering Core team
    • Introduction of the Group/Team/Persons interested
    • Ice breaker
    • AMA time! Add your questions $PAGE
    • Looking at QE Workflows: How is
      • A maintenance update being tested before being released to our customers
      • Products in development are tested before making it generally available
    • Engineering Opportunity Board


    Automated Test Report reviewer by oscar-barrios

    Description

    In SUMA/Uyuni team we spend a lot of time reviewing test reports, analyzing each of the test cases failing, checking if the test is a flaky test, checking logs, etc.

    Goals

    Speed up the review by automating some parts through AI, in a way that we can consume some summary of that report that could be meaningful for the reviewer.

    Resources

    No idea about the resources yet, but we will make use of:

    • HTML/JSON Report (text + screenshots)
    • The Test Suite Status GithHub board (via API)
    • The environment tested (via SSH)
    • The test framework code (via files)


    Testing and adding GNU/Linux distributions on Uyuni by juliogonzalezgil

    Join the Gitter channel! https://gitter.im/uyuni-project/hackweek

    Uyuni is a configuration and infrastructure management tool that saves you time and headaches when you have to manage and update tens, hundreds or even thousands of machines. It also manages configuration, can run audits, build image containers, monitor and much more!

    Currently there are a few distributions that are completely untested on Uyuni or SUSE Manager (AFAIK) or just not tested since a long time, and could be interesting knowing how hard would be working with them and, if possible, fix whatever is broken.

    For newcomers, the easiest distributions are those based on DEB or RPM packages. Distributions with other package formats are doable, but will require adapting the Python and Java code to be able to sync and analyze such packages (and if salt does not support those packages, it will need changes as well). So if you want a distribution with other packages, make sure you are comfortable handling such changes.

    No developer experience? No worries! We had non-developers contributors in the past, and we are ready to help as long as you are willing to learn. If you don't want to code at all, you can also help us preparing the documentation after someone else has the initial code ready, or you could also help with testing :-)

    The idea is testing Salt and Salt-ssh clients, but NOT traditional clients, which are deprecated.

    To consider that a distribution has basic support, we should cover at least (points 3-6 are to be tested for both salt minions and salt ssh minions):

    1. Reposync (this will require using spacewalk-common-channels and adding channels to the .ini file)
    2. Onboarding (salt minion from UI, salt minion from bootstrap scritp, and salt-ssh minion) (this will probably require adding OS to the bootstrap repository creator)
    3. Package management (install, remove, update...)
    4. Patching
    5. Applying any basic salt state (including a formula)
    6. Salt remote commands
    7. Bonus point: Java part for product identification, and monitoring enablement
    8. Bonus point: sumaform enablement (https://github.com/uyuni-project/sumaform)
    9. Bonus point: Documentation (https://github.com/uyuni-project/uyuni-docs)
    10. Bonus point: testsuite enablement (https://github.com/uyuni-project/uyuni/tree/master/testsuite)

    If something is breaking: we can try to fix it, but the main idea is research how supported it is right now. Beyond that it's up to each project member how much to hack :-)

    • If you don't have knowledge about some of the steps: ask the team
    • If you still don't know what to do: switch to another distribution and keep testing.

    This card is for EVERYONE, not just developers. Seriously! We had people from other teams helping that were not developers, and added support for Debian and new SUSE Linux Enterprise and openSUSE Leap versions :-)

    Pending

    FUSS

    FUSS is a complete GNU/Linux solution (server, client and desktop/standalone) based on Debian for managing an educational network.

    https://fuss.bz.it/

    Seems to be a Debian 12 derivative, so adding it could be quite easy.

    • [W] Reposync (this will require using spacewalk-common-channels and adding channels to the .ini file)
    • [W] Onboarding (salt minion from UI, salt minion from bootstrap script, and salt-ssh minion) (this will probably require adding OS to the bootstrap repository creator) --> Working for all 3 options (salt minion UI, salt minion bootstrap script and salt-ssh minion from the UI).
    • [W] Package management (install, remove, update...) --> Installing a new package works, needs to test the rest.
    • [I] Patching (if patch information is available, could require writing some code to parse it, but IIRC we have support for Ubuntu already). No patches detected. Do we support patches for Debian at all?
    • [W] Applying any basic salt state (including a formula)
    • [W] Salt remote commands
    • [ ] Bonus point: Java part for product identification, and monitoring enablement