{"id":591,"date":"2023-08-27T16:28:11","date_gmt":"2023-08-27T16:28:11","guid":{"rendered":"https:\/\/blogs.gentoo.org\/gsoc\/?p=591"},"modified":"2023-08-28T06:20:44","modified_gmt":"2023-08-28T06:20:44","slug":"final-report-automated-gentoo-system-updater","status":"publish","type":"post","link":"https:\/\/blogs.gentoo.org\/gsoc\/2023\/08\/27\/final-report-automated-gentoo-system-updater\/","title":{"rendered":"Final Report, Automated Gentoo System Updater"},"content":{"rendered":"<h2 id=\"project-goals\">Project Goals<\/h2>\n<p>Main goal of the project was to write an app that will automatically handle updates on Gentoo Linux systems and send notifications with update summaries. More specifically, I wanted to:<\/p>\n<ol>\n<li>Simplify the update process for beginners, offering a simpler one-click method.<\/li>\n<li>Minimize time experienced users spend on routine update tasks, decreasing their workload.<\/li>\n<li>Ensure systems remain secure and regularly updated with minimal manual intervention.<\/li>\n<li>Keep users informed of the updates and changes.<\/li>\n<li>Improve the overall Gentoo Linux user experience.<\/li>\n<\/ol>\n<h2 id=\"progress\">Progress<\/h2>\n<p>Here is a summary of what was done every week with links to my blog posts.<\/p>\n<h3 id=\"week-1httpslabbratnetbloggsoc2023week1\"><a href=\"https:\/\/labbrat.net\/blog\/gsoc2023\/week1\/\">Week 1<\/a><\/h3>\n<p>Basic system updater is ready. Also prepared a Docker Compose file to run tests in containers. Available functionality:<\/p>\n<ul>\n<li>update security patches<\/li>\n<li>update @world<\/li>\n<li>merge changed configuration files<\/li>\n<li>restart updated services<\/li>\n<li>do a post-update clean up<\/li>\n<li>read elogs<\/li>\n<li>read news<\/li>\n<\/ul>\n<p>Links:<\/p>\n<ul>\n<li>Pull requests:\u00a0<a href=\"https:\/\/github.com\/Lab-Brat\/gentoo_update\/pull\/2\">#2<\/a>,\u00a0<a href=\"https:\/\/github.com\/Lab-Brat\/gentoo_update\/pull\/3\">#3<\/a>,\u00a0<a href=\"https:\/\/github.com\/Lab-Brat\/gentoo_update\/pull\/4\">#4<\/a><\/li>\n<li>Docker\u00a0<a href=\"https:\/\/github.com\/Lab-Brat\/gentoo_update\/blob\/main\/tests\/compose.yaml\">tests<\/a><\/li>\n<\/ul>\n<h3 id=\"week-2httpslabbratnetbloggsoc2023week2\"><a href=\"https:\/\/labbrat.net\/blog\/gsoc2023\/week2\/\">Week 2<\/a><\/h3>\n<p>Packaged Python code, created an <strong>ebuild<\/strong> and a GitHub Actions workflow that publishes package to PyPI when commit is tagged.<\/p>\n<p>Links:<\/p>\n<ul>\n<li>Pull requests:\u00a0<a href=\"https:\/\/github.com\/Lab-Brat\/gentoo_update\/pull\/5\">#5<\/a><\/li>\n<li>ebuild <a href=\"https:\/\/github.com\/Lab-Brat\/gentoo_update_ebuild\">commit<\/a><\/li>\n<li>GitHub Actions <a href=\"https:\/\/github.com\/Lab-Brat\/gentoo_update\/blob\/main\/.github\/workflows\/main.yml\">workflow<\/a><\/li>\n<\/ul>\n<h3 id=\"week-3httpsblogsgentooorggsoc20230617week-3-report-automated-gentoo-system-updater\"><a href=\"https:\/\/blogs.gentoo.org\/gsoc\/2023\/06\/17\/week-3-report-automated-gentoo-system-updater\/\">Week 3<\/a><\/h3>\n<p>Fixed issue #7 and answered to issue #8 and fixed bug 908308. Added USE flags to manage dependencies. Improve Bash code stability.<\/p>\n<p>Links:<\/p>\n<ul>\n<li>Issues:\u00a0<a href=\"https:\/\/github.com\/Lab-Brat\/gentoo_update\/issues\/7\">#7<\/a>,\u00a0<a href=\"https:\/\/github.com\/Lab-Brat\/gentoo_update\/issues\/8\">#8<\/a><\/li>\n<li>Bugs:\u00a0<a href=\"https:\/\/bugs.gentoo.org\/908308\">908308<\/a><\/li>\n<li>Pull requests:\u00a0<a href=\"https:\/\/github.com\/Lab-Brat\/gentoo_update\/pull\/6\">#6<\/a>,\u00a0<a href=\"https:\/\/github.com\/Lab-Brat\/gentoo_update\/pull\/9\">#9<\/a>,\u00a0<a href=\"https:\/\/github.com\/Lab-Brat\/gentoo_update\/pull\/10\">#10<\/a><\/li>\n<\/ul>\n<h3 id=\"week-4httpsblogsgentooorggsoc20230625week-4-report-automated-gentoo-system-updater\"><a href=\"https:\/\/blogs.gentoo.org\/gsoc\/2023\/06\/25\/week-4-report-automated-gentoo-system-updater\/\">Week 4<\/a><\/h3>\n<p>Fixed errors in <strong>ebuild<\/strong>, replaced USE flags with <strong>optfeature<\/strong> for dependency management. Wrote a blog post to introduce my app and posted it on forums. Fixed a bug in\u00a0<code>--args<\/code>\u00a0flag.<\/p>\n<p>Links:<\/p>\n<ul>\n<li>Pull requests:\u00a0<a href=\"https:\/\/github.com\/Lab-Brat\/gentoo_update\/pull\/11\">#11<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/gentoo\/guru\/commit\/bfffbe1a4bcd10a5e6a20d3ef314ac31cd00641f\">request<\/a>\u00a0to fix ebuild<\/li>\n<li>Blog\u00a0<a href=\"https:\/\/blogs.gentoo.org\/gsoc\/2023\/06\/25\/gentoo_update-introduction\/\">post<\/a>\u00a0and Forum\u00a0<a href=\"https:\/\/forums.gentoo.org\/viewtopic-p-8793590.html#8793590\">post<\/a><\/li>\n<\/ul>\n<h3 id=\"week-5httpsblogsgentooorggsoc20230702week-5-report-automated-gentoo-system-updater\"><a href=\"https:\/\/blogs.gentoo.org\/gsoc\/2023\/07\/02\/week-5-report-automated-gentoo-system-updater\/\">Week 5<\/a><\/h3>\n<p>Received some feedback from forums. Coded much of the parser (<code>--report<\/code>). Improved container testing environment.<\/p>\n<p>Links:<\/p>\n<ul>\n<li>Improved\u00a0<a href=\"https:\/\/github.com\/lab-Brat\/gentoo_dockerfiles\">dockerfiles<\/a><\/li>\n<\/ul>\n<h3 id=\"weeks-6-and-7httpsblogsgentooorggsoc20230716week-67-report-automated-gentoo-system-updater\"><a href=\"https:\/\/blogs.gentoo.org\/gsoc\/2023\/07\/16\/week-67-report-automated-gentoo-system-updater\/\">Weeks 6 and 7<\/a><\/h3>\n<p>Completed parser (<code>--report<\/code>). Also added disk usage calculation before and after the update. Available functionality:<\/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>Links:<\/p>\n<ul>\n<li>Pull requests:\u00a0<a href=\"https:\/\/github.com\/Lab-Brat\/gentoo_update\/pull\/12\">#12<\/a>,\u00a0<a href=\"https:\/\/github.com\/Lab-Brat\/gentoo_update\/pull\/13\">#13<\/a><\/li>\n<\/ul>\n<h3 id=\"week-8httpsblogsgentooorggsoc20230723week-8-report-automated-gentoo-system-updater\"><a href=\"https:\/\/blogs.gentoo.org\/gsoc\/2023\/07\/23\/week-8-report-automated-gentoo-system-updater\/\">Week 8<\/a><\/h3>\n<p>Add 2 notification methods (<code>--send-reports<\/code>) &#8211; IRC bot and emails via sendgrid.<\/p>\n<p>Links:<\/p>\n<ul>\n<li>Pull requests:\u00a0<a href=\"https:\/\/github.com\/Lab-Brat\/gentoo_update\/pull\/14\">#14<\/a>,\u00a0<a href=\"https:\/\/github.com\/Lab-Brat\/gentoo_update\/pull\/15\">#15<\/a><\/li>\n<\/ul>\n<h3 id=\"week-9-10httpsblogsgentooorggsoc20230807week-910-report-automated-gentoo-system-updater\"><a href=\"https:\/\/blogs.gentoo.org\/gsoc\/2023\/08\/07\/week-910-report-automated-gentoo-system-updater\/\">Week 9-10<\/a><\/h3>\n<p>Improved CLI argument handling. Experimented with different mobile app UI layouts and backend options. Fixed issue #17. Started working on mobile app UI, decided to use Firebase for backend.<\/p>\n<p>Links:<\/p>\n<ul>\n<li>Pull requests:\u00a0<a href=\"https:\/\/github.com\/Lab-Brat\/gentoo_update\/pull\/16\">#16<\/a><\/li>\n<li>Issues:\u00a0<a href=\"https:\/\/github.com\/Lab-Brat\/gentoo_update\/issues\/17\">#17<\/a><\/li>\n<\/ul>\n<h3 id=\"week-11-12httpsblogsgentooorggsoc20230820week-1112-report-automated-gentoo-system-updater\"><a href=\"https:\/\/blogs.gentoo.org\/gsoc\/2023\/08\/20\/week-1112-report-automated-gentoo-system-updater\/\">Week 11-12<\/a><\/h3>\n<p>Completed mobile app (UI + backend). Created a plan to migrate to a custom self-hosted backend based on Django+MongoDB+Nginx in the future. Added <code>--send-reports mobile<\/code> option to CLI. Available functionality:<\/p>\n<ul>\n<li>UI\n<ul>\n<li>Login screen: Anonymous login<\/li>\n<li>Reports screen: Receive and view reports send from CLI app.<\/li>\n<li>Profile screen: View token, user ID and Sign Out button.<\/li>\n<\/ul>\n<\/li>\n<li>Backend\n<ul>\n<li>Create anonymous users (Cloud Functions)<\/li>\n<li>Create user tokens (Cloud Functions)<\/li>\n<li>Receive tokens in https requests, verify them, and route to users (Cloud Functions)<\/li>\n<li>Send push notifications (FCM)<\/li>\n<li>Secure database access with Firestore security rules<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>Link:<\/p>\n<ul>\n<li>Pull requests:\u00a0<a href=\"https:\/\/github.com\/Lab-Brat\/gentoo_update\/pull\/18\">#18<\/a><\/li>\n<li>Mobile app\u00a0<a href=\"https:\/\/github.com\/Lab-Brat\/gentoo_update_flutter\">repository<\/a><\/li>\n<\/ul>\n<h3 id=\"final-week\">Final week<\/h3>\n<p>Added token encryption with Cloud Functions. Packaged mobile app with Github Actions and published to Google Play Store. Recorded a demo video and wrote gentoo_update User Guide that covers both CLI and mobile app.<\/p>\n<p>Links:<\/p>\n<ul>\n<li>Demo\u00a0<a href=\"https:\/\/youtu.be\/go6SJZBgpgg?si=bgC2xLA22_aeikOE\">video<\/a><\/li>\n<li><a href=\"https:\/\/blogs.gentoo.org\/gsoc\/2023\/08\/27\/gentoo_update-user-guide\/\">gentoo_update User Guide<\/a><\/li>\n<li>Packaging Github Actions\u00a0<a href=\"https:\/\/github.com\/Lab-Brat\/gentoo_update_flutter\/blob\/main\/.github\/workflows\/main.yml\">workflow<\/a><\/li>\n<li>Google Play <a href=\"https:\/\/play.google.com\/store\/apps\/details?id=net.labbrat.gentoo_update\">link<\/a><\/li>\n<li>Release\u00a0<a href=\"https:\/\/github.com\/Lab-Brat\/gentoo_update_flutter\/releases\">page<\/a><\/li>\n<\/ul>\n<h2 id=\"project-status\">Project Status<\/h2>\n<p>I would say I\u2019m very satisfied with the current state of the project. Almost all tasks were completed from the proposal, and there is a product that can already be used. To summarize, here is a list of deliverables:<\/p>\n<ol>\n<li><a href=\"https:\/\/github.com\/Lab-Brat\/gentoo_update\">Source code<\/a>\u00a0for gentoo_update CLI app<\/li>\n<li>gentoo_update CLI app\u00a0<a href=\"https:\/\/github.com\/gentoo\/guru\/tree\/master\/app-admin\/gentoo_update\">ebuild<\/a>\u00a0in GURU repository<\/li>\n<li>gentoo_update CLI app package in\u00a0<a href=\"https:\/\/pypi.org\/project\/gentoo-update\/\">PyPi<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/Lab-Brat\/gentoo_update_flutter\">Source code<\/a>\u00a0for mobile app<\/li>\n<li>Mobile app for Andoid in\u00a0<a href=\"https:\/\/github.com\/Lab-Brat\/gentoo_update_flutter\/releases\/tag\/1.0.1\">APK<\/a><\/li>\n<li>Mobile app for Android in\u00a0<a href=\"https:\/\/play.google.com\/store\/apps\/details?id=net.labbrat.gentoo_update\">Google Play<\/a><\/li>\n<\/ol>\n<h2 id=\"future-improvements\">Future Improvements<\/h2>\n<p>I plan to add a lot more features to both CLI and mobile apps. Full feature lists can be found in readme\u2019s of both repositories:<\/p>\n<ul>\n<li>CLI app upcoming\u00a0<a href=\"https:\/\/github.com\/Lab-Brat\/gentoo_update\">features<\/a><\/li>\n<li>mobile app upcoming\u00a0<a href=\"https:\/\/github.com\/Lab-Brat\/gentoo_update_flutter\">features<\/a><\/li>\n<\/ul>\n<h2 id=\"final-thoughts\">Final Thoughts<\/h2>\n<p>These 12 weeks felt like a hackathon, where I had to learn new technologies very quickly and create something that works very fast. I faced many challenges and acquired a range of new skills.<\/p>\n<p>Over the course of this project, I coded both Linux CLI applications using Python and Bash, and mobile apps with Flutter and Firebase. To maintain the quality of my work, I tested the code in Docker containers, virtual machines and physical hardware. Additionally, I built and deployed CI\/CD pipelines with GitHub Actions to automate packaging. Beyond the technical side, I engaged actively with Gentoo community, utilizing IRC chats and forums. Through these platforms, I addressed and resolved issues on both GitHub and Gentoo Bugs, enriching my understanding and refining my skills.<\/p>\n<p>I also would like to thank my mentor, Andrey Falko, for all his help and support. I wouldn\u2019t have been able to finish this project without his guidance.<\/p>\n<p>In addition, I want to thank Google for providing such a generous opportunity for open source developers to work on bringing forth innovation.<\/p>\n<p>Lastly, I am grateful to Gentoo community for the feedback that\u2019s helped me to improve the project immensely.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Project Goals Main goal of the project was to write an app that will automatically handle updates on Gentoo Linux systems and send notifications with update summaries. More specifically, I wanted to: Simplify the update process for beginners, offering a &hellip; <a href=\"https:\/\/blogs.gentoo.org\/gsoc\/2023\/08\/27\/final-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\/591"}],"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=591"}],"version-history":[{"count":5,"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/posts\/591\/revisions"}],"predecessor-version":[{"id":595,"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/posts\/591\/revisions\/595"}],"wp:attachment":[{"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/media?parent=591"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/categories?post=591"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/tags?post=591"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}