Skip to content

[WIP] feat(rootfs, config): enable disk generation in docker and build multiple platform the same time #106

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

Samuka007
Copy link
Member

Enable disk generation in docker and build multiple platform the same time. Nolonger need to wait for long rebuild time when switching back to the different platform.

Currently, due to the limitation of grub, x86_64 still couldn't do all-in-one building in docker (but riscv64 could). But, building with latest dadk in bare metal machine is ok.

Now this build of DADK can:

  • build normally with build-unmodified branch
  • build with modified build schedule in branch oscomp, on bare metal machine
  • build with modified build schedule in branch oscomp, in container

Also, it is verified ok (but not recommanded) to build the schedule modified and unmodified branch (by simply git checkout between branches, like most of the people do) in the same directory without explicitly cleanup the old outputs under the bin directory.

Copy link

codecov bot commented Apr 2, 2025

Codecov Report

Attention: Patch coverage is 16.75603% with 621 lines in your changes missing coverage. Please review.

Project coverage is 48.23%. Comparing base (b1d3d21) to head (e5bfa34).

Files with missing lines Patch % Lines
dadk/src/actions/rootfs/loopdev_v2.rs 15.46% 257 Missing ⚠️
dadk/src/actions/rootfs/disk_img.rs 2.07% 189 Missing ⚠️
dadk-user/src/executor/mod.rs 21.15% 41 Missing ⚠️
dadk/src/context/mod.rs 0.00% 26 Missing ⚠️
dadk-user/src/executor/source.rs 15.38% 22 Missing ⚠️
dadk-user/src/scheduler/mod.rs 24.00% 19 Missing ⚠️
dadk-user/src/utils/lazy_init.rs 23.07% 10 Missing ⚠️
dadk-user/src/executor/cache.rs 52.94% 8 Missing ⚠️
dadk-config/src/common/target_arch.rs 0.00% 7 Missing ⚠️
dadk/src/actions/rootfs/mod.rs 0.00% 7 Missing ⚠️
... and 12 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #106      +/-   ##
==========================================
- Coverage   51.80%   48.23%   -3.58%     
==========================================
  Files          51       51              
  Lines        4953     5357     +404     
==========================================
+ Hits         2566     2584      +18     
- Misses       2387     2773     +386     
Files with missing lines Coverage Δ
crates/test_base/src/dadk_config.rs 97.43% <100.00%> (-0.13%) ⬇️
dadk-config/src/manifest.rs 100.00% <100.00%> (ø)
dadk-config/src/rootfs/fstype.rs 100.00% <100.00%> (ø)
dadk-config/src/rootfs/mod.rs 98.98% <100.00%> (-1.02%) ⬇️
dadk-config/src/utils.rs 99.42% <100.00%> (ø)
dadk-user/src/executor/tests.rs 97.43% <100.00%> (-0.04%) ⬇️
dadk-user/src/utils/path.rs 80.00% <100.00%> (ø)
dadk/src/console/profile.rs 51.02% <ø> (ø)
dadk/src/console/tests.rs 93.75% <100.00%> (ø)
dadk/src/actions/rootfs/sysroot.rs 0.00% <0.00%> (ø)
... and 21 more

... and 8 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Apr 2, 2025
@Samuka007 Samuka007 added enhancement New feature or request and removed documentation Improvements or additions to documentation labels Apr 2, 2025
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Apr 2, 2025
@Samuka007 Samuka007 force-pushed the 007/docker-multiarch branch from 3118f3e to ab20161 Compare April 2, 2025 14:00
@fslongjin fslongjin changed the title feat(rootfs, config): enable disk generation in docker and build multiple platform the same time [WIP] feat(rootfs, config): enable disk generation in docker and build multiple platform the same time Apr 2, 2025
@github-actions github-actions bot added ambiguous and removed enhancement New feature or request documentation Improvements or additions to documentation labels Apr 2, 2025
@fslongjin
Copy link
Member

代码目前有很多地方是复制代码的,需要优化

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Apr 2, 2025
@Samuka007 Samuka007 force-pushed the 007/docker-multiarch branch from be4e8fb to 118df96 Compare April 3, 2025 05:26
@Samuka007 Samuka007 force-pushed the 007/docker-multiarch branch from 77ad885 to fe8ff7b Compare April 23, 2025 06:19
@Samuka007 Samuka007 marked this pull request as draft April 26, 2025 03:25
Comment on lines 12 to 25
pub static BUILDER_VERSION: OnceLock<BuilderVersion> = OnceLock::new();

pub fn set_builder_version(ctx: &DADKExecContext) {
let version = BuilderVersion::from_str(ctx.manifest().metadata.builder_version.as_str());
BUILDER_VERSION
.set(version)
.expect("Failed to set builder version");
log::info!("Current builder version: {:?}", get_builder_version());
}
pub fn get_builder_version() -> BuilderVersion {
log::info!("Current builder version: {:?}", BUILDER_VERSION.get());

BUILDER_VERSION.get().cloned().unwrap_or(BuilderVersion::V1)
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

目前引入了一个全局变量标志位来减小代码耦合度,但限制了每次执行dadk只能走其中一个pattern

@Samuka007 Samuka007 marked this pull request as ready for review April 26, 2025 03:51
@Samuka007 Samuka007 requested a review from fslongjin May 4, 2025 04:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ambiguous documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants