|
| 1 | +--- |
| 2 | +title: "GSoC'25: Testing Framework for Unikraft Builds | Part IV" |
| 3 | +description: | |
| 4 | + This GSoC project is aimed to develop a testing framework that is able to multiplex the variety of configuration options, VMMs, hypervisors, architectures, boot protocols, to validate the successful building and running of unikernel images. |
| 5 | +publishedDate: 2025-09-25 |
| 6 | +tags: |
| 7 | +- gsoc |
| 8 | +- gsoc25 |
| 9 | +- testing & validation |
| 10 | +- automation |
| 11 | +- devops |
| 12 | +authors: |
| 13 | +- Shashank Srivastava |
| 14 | +--- |
| 15 | + |
| 16 | +<img width="100px" src="https://summerofcode.withgoogle.com/assets/media/gsoc-generic-badge.svg" align="right" /> |
| 17 | + |
| 18 | +## Project Overview |
| 19 | + |
| 20 | +The aim of this project is to develop a robust testing framework that can handle a wide range of configuration options—covering different VMMs, hypervisors, architectures, and boot protocols to validate the successful build and execution of unikernel images. The framework, written in Python, is designed to configure, build, run, and test various Unikraft builds, and there’s scope for further improvements and refactoring as we go. |
| 21 | + |
| 22 | +The main focus is to enhance the existing testing infrastructure and make it smooth and intuitive for both Unikraft developers and users. To achieve this, I am working towards the following key goals: |
| 23 | + |
| 24 | +- Extract and consolidate the testing framework into a dedicated, standalone repository. |
| 25 | + |
| 26 | +- Ensure that the framework works seamlessly with the catalog repositories right out of the box. |
| 27 | + |
| 28 | +- Integrate the framework into the CI/CD pipeline used across Unikraft organization repositories, so that it can automatically validate builds whenever a pull request is opened. |
| 29 | + |
| 30 | +## Recap (Parts I, II & III) |
| 31 | + |
| 32 | +- **Part I**: extracted the framework into a standalone repository, added isolated `.app` sandboxing, modularized code, and added a README parser to generate app configs. |
| 33 | +- **Part II**: introduced LLM-powered `RunConfig` generation, richer test categories (`curl`, `list-of-command`, `no-command`), structured logging, and CSV reporting (`build_report.csv`, `run_report.csv`). Also prepared `test-app-config/` and started creating `BuildConfig.yaml` / `RunConfig.yaml` for library apps. |
| 34 | +- **Part III**: Focused on reliability and observability by introducing persistent `.sessions/` directories for per-run logs and reports, stronger resource cleanup, stabilized catalog/library runs, and prebuilt runtime kernels for examples. Also updated CLI flags and documentation for smoother workflows. |
| 35 | + |
| 36 | +## Current Progress |
| 37 | + |
| 38 | +### CI & GitHub workflow |
| 39 | + |
| 40 | +- Designed and implemented a GitHub Actions workflow to run the testing framework for PRs, including steps to clone the catalog, prepare environment, install dependencies, and dispatch PR metadata to the workflow. |
| 41 | +- Added support for cloning the `catalog` repository and setting up `maintainers-tool` inside the workflow so library builds can be produced automatically. |
| 42 | +- Integrated the workflow with a GitHub App for PR status updates and improved artifact handling (collection and upload of test artifacts). |
| 43 | + |
| 44 | +### Test orchestration & automation |
| 45 | + |
| 46 | +- Created `overall_test.py` — a wrapper script that runs tests across all `catalog/library` applications, intended for use by workflows to automatically exercise the whole catalog. |
| 47 | +- Added the ability for the workflow and framework to run limited sets of apps/targets (faster, targeted runs) to speed up CI iterations. |
| 48 | + |
| 49 | +### CI reporting & results collection |
| 50 | + |
| 51 | +- Introduced generation of a CI summary file (`.sessions/ci_report.json`) to capture overall test results. |
| 52 | +- Improved the CI report structure (`detail_report`) to better store per-application build and run information produced by `overall_test.py`. |
| 53 | +- Implemented mechanisms in the workflow to collect, store and upload test results and artifacts for PR review. |
| 54 | + |
| 55 | +### Documentation & setup |
| 56 | + |
| 57 | +- Improved README formatting and setup instructions (one-sentence-per-line, clearer code blocks, recommended `.venv/` usage). |
| 58 | +- Added a Requirements section detailing packages and configuration needed for the testing framework and workflows. |
| 59 | +- Updated README links and setup commands to reflect repository and workflow changes. |
| 60 | + |
| 61 | +### Reliability fixes, small features & cleanup |
| 62 | + |
| 63 | +- Simplified test result status logic (removed partial-pass state) to make test outcomes clearer. |
| 64 | +- Removed the `main.sh` helper in favor of the more flexible `src/main.py` CLI, reducing maintenance duplication. |
| 65 | +- Corrected curl/port usage for bridge & tap networking to use the configured `ExposedPort`. |
| 66 | +- Multiple hotfixes to improve robustness of kernel selection and runtime creation. |
| 67 | +- Rewrote repository git history to improve commit hygiene and ensure commit messages clearly describe what changed and why. |
| 68 | + |
| 69 | +# Next steps |
| 70 | + |
| 71 | +- The CI workflow is currently stable for building libraries. Moving forward, I will work on adding support to also run tests within the workflow. |
| 72 | +- I plan to extend the CI workflow to include examples, as right now it only covers catalog/library applications. |
| 73 | +- I will continue to address and fix any issues that arise from the usage of the testing framework. |
| 74 | + |
| 75 | +## Acknowledgement |
| 76 | + |
| 77 | +Huge thanks to my mentors, [Razvan Deaconescu](https://github.com/razvand) and [Razvan Virtan](https://github.com/razvanvirtan), for continued guidance. I’m additionally grateful to the entire Unikraft community for their warm support and helpfulness throughout this journey. |
| 78 | + |
| 79 | +## About me |
| 80 | + |
| 81 | +I'm [Shashank Srivastava](https://github.com/shank250/) undergraduate student at GL Bajaj Institute of Technology and Management, B. Tech in Computer Science and Engineering with Specialisation in Artificial Intelligence and Machine Learning, with a strong passion for AI and Cloud. |
| 82 | + |
| 83 | +Feel free to [connect](https://www.linkedin.com/in/shashank-srivastava-375412250/)! |
0 commit comments