-
Notifications
You must be signed in to change notification settings - Fork 360
Description
RFC: Sealer Makefile optimization
Problem
Currently, Sealer lacks a clear and consistent structure, making it difficult for developers to work with and improve. In addition, the GitHub actions workflow needs to be optimized and automated for increased efficiency. This process will help me become more familiar with the Sealer runtime and system design.
The following order of priority is based on our design goals 🎯
RFC:
Improve Makefile Structure
- Improve Makefile structure
We propose the following Makefile structure improvements, sorted by priority:
- Implement optional copyright check (if not already implemented by actions).
- Automatically parse help information for all makefile options.
- Ensure consistent behavior, such as enforcing commit guidelines.
- Add necessary options, such as unit test coverage (which we care about but currently do not provide).
- Add debug information and selective debugging. Also, consider providing options to selectively generate binaries via
sealerorseautilto improve compile speed. - Simplify the
/Makefilemodule for readability. - The makefile provides cross-compilation
- The Makefile docker-in-docker does not fully support amd/arm
Optimize GitHub Actions Workflow
- Optimize directory structure
The following changes will be made to optimize the GitHub Actions workflow:
- Provide and automate CHANGELOG management.
- Add automation for micro-operations and functionality not currently covered.
Directory Design
- Optimize actions workflow
Script Directory: We recommend migrating the /hack directory to the /script directory and moving the Makefile portion of the backend implementation to the script/make-rules directory.
CMD Commands: Sealer's commands are increasing in number, especially with alpha extensions. We propose extracting the core of the cmd to the /internal directory (only internally accessible) and /pkg directory (allowing for calls). We recommend moving the /common directory to the /pkg directory.
Version Information: We propose creating separate versions for Sealer system information (git information, Go information, etc.) and pkg runtime. Which directory should the two versions be stored in /pkg/version, /utils/version, or separately? We suggest adjusting the application info to /pkg/version for external access and placing utils/version into the runtime k8s module, abstracting an interface for external access.
Improve Version Control
We propose creating separate versions for Sealer system information (git information, Go information, etc.) and pkg runtime. We suggest moving the core of Sealer's commands (especially alpha extensions) to the /internal directory (internal access only) and /pkg directory (allowing for calls). Additionally, we propose supplementing relevant documentation, such as version API and Makefile guidelines.
Version Interface Design Scheme
We will create a runtime layer to abstract the version layer interface and design the interface. We will extract the versions of k3s, k0s, and Kubernetes and call them from the above versions. They do not need to care which cluster runtime version is being called.
Other RFC
RFC: Supplement k3s implementation.
RFC: Sealer currently lacks the ability to control APP calls, and Pack can help solve this problem. I will research buildpacks and refer to the official documentation of buildpacks.io.
We will provide Pack with the ability to build the upper-level Makefile abstractly, making it easier to build images. If Sealer can package and distribute clusters, it will have a very powerful ability.
We believe that these changes will create a more organized and efficient structure for Sealer and improve its functionality. By implementing these changes, we can make Sealer a more user-friendly and efficient development tool.
Tasks
| Type | Improvement | Issues | PR | Status | Priority |
|---|---|---|---|---|---|
| Makefile | Improve Makefile structure | #2050 | #2148 | ✅ | 🥇 |
| Directory Design | Optimize directory structure | ❌ | 🥈 | ||
| GitHub Actions | Optimize actions workflow | ❌ | 🥉 | ||
| Version Control | Separate versions for Sealer system and pkg runtime, move core commands to /internal and /pkg directories, supplement documentation | ❌ | 4 | ||
| Version Interface Design Scheme | Create runtime layer to abstract version interface, extract versions of k3s, k0s, and Kubernetes | ❌ | 5 | ||
| RFC | Supplement k3s implementation | ❌ | 6 | ||
| RFC | Add control for APP calls using Pack, research buildpacks | ❌ | 7 |