{"id":531,"date":"2023-07-16T18:49:22","date_gmt":"2023-07-16T18:49:22","guid":{"rendered":"https:\/\/blogs.gentoo.org\/gsoc\/?p=531"},"modified":"2023-07-16T18:49:22","modified_gmt":"2023-07-16T18:49:22","slug":"week-67-report-automated-gentoo-system-updater","status":"publish","type":"post","link":"https:\/\/blogs.gentoo.org\/gsoc\/2023\/07\/16\/week-67-report-automated-gentoo-system-updater\/","title":{"rendered":"Week 6+7 Report, Automated Gentoo System Updater"},"content":{"rendered":"<h3 id=\"progress-on-weeks-6--7\">Progress on Weeks 6 + 7<\/h3>\n<p>These 2 weeks were spent on the parser and the reporter. During this time, I\u2019ve added many features to it, but there are still much more things left to be done. Due to limited time of GSoC I will implement additional features after the program end.<\/p>\n<p>Here is a list of features that were implemented so far:<\/p>\n<ul>\n<li>If the update was successful, report will show:\n<ul>\n<li>updated package names<\/li>\n<li>package versions in the format \u201cold -&gt; new\u201d<\/li>\n<li>USE flags of those packages<\/li>\n<li>disk usage before and after the update<\/li>\n<\/ul>\n<\/li>\n<li>If the emerge pretend has failed, report will show:\n<ul>\n<li>error type (for now only supports \u2018blocked packages\u2019 error)<\/li>\n<li>error details (for blocked package it will show problematic packages)<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>And here are the errors that I plan to add support for in the future:<\/p>\n<ul>\n<li>Mutually exclusive USE flags<\/li>\n<li>Errors due to licenses<\/li>\n<li>OOM<\/li>\n<li>Not enough disk space<\/li>\n<li>Network issues during the update<\/li>\n<\/ul>\n<p>I also had a good idea about how to go about testing\u00a0<code>gentoo_update<\/code>. Basically, I can set up a CI\/CD pipeline that will detect newly published stage3 Docker containers, and whenever there a new container is detected &#8211; run <code>gentoo_update<\/code>\u00a0on it and check the output. Eventually, it will run into some errors that I will then use to improve\u00a0<code>gentoo_update<\/code>. Pipeline itself can be set up with Jenkins, for example. This idea is a bit out of scope of my proposal, so I will work on it after GSoC \ud83d\ude42<\/p>\n<h3 id=\"challenges\">Challenges<\/h3>\n<p>While trying to find ways to generate errors in Portage I realized how hard it is to break Portage intentionally, and it\u2019s almost impossible without deliberately creating faulty ebuilds and USE flags, which of course is a good thing!<\/p>\n<p>So far I only managed to test out \u2018blocked package\u2019 error, here is how it was done:<\/p>\n<ul>\n<li>Create a simple\u00a0<a href=\"https:\/\/github.com\/Lab-Brat\/gentoo_loctests\">Bash script<\/a>\u00a0that prints out some ASCII art (prints an owl, in my case);<\/li>\n<li>Set up a local repository, and add an ebuild for this script;<\/li>\n<li>Install the script on the system;<\/li>\n<li>Version bump the script, for example 0.1 -&gt; 0.2;<\/li>\n<li>Then add\u00a0<code>RDEPEND=\"!net-print\/cups\"<\/code>\u00a0to the ebuild, which will raise an error if cups is installed. cups is just a package that was installed on my system, any other package will do;<\/li>\n<li>Run update @world and look how Portage starts to throw errors \ud83d\ude42<\/li>\n<\/ul>\n<p>What sounds like a couple simple steps actually took me about 2 days to figure out\u2026 Although challenging, it actually is very fun to find ways to break things \ud83d\ude42<\/p>\n<h3 id=\"plans-for-week-8\">Plans for Week 8<\/h3>\n<p>Week 8 will be dedicated to writing code to send reports via emails and IRC chats. But before that, I need to do some more work to improve integration between the updater, parser and reporter.<\/p>\n<p>Ideally, I also need to spend some more time on error catching and improving overall stability of\u00a0<code>gentoo_update<\/code>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Progress on Weeks 6 + 7 These 2 weeks were spent on the parser and the reporter. During this time, I\u2019ve added many features to it, but there are still much more things left to be done. Due to limited &hellip; <a href=\"https:\/\/blogs.gentoo.org\/gsoc\/2023\/07\/16\/week-67-report-automated-gentoo-system-updater\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":182,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[16,18],"tags":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/posts\/531"}],"collection":[{"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/users\/182"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/comments?post=531"}],"version-history":[{"count":1,"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/posts\/531\/revisions"}],"predecessor-version":[{"id":532,"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/posts\/531\/revisions\/532"}],"wp:attachment":[{"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/media?parent=531"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/categories?post=531"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/tags?post=531"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}