Skip to content
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

CI: don't build native runner on gui workflow #8726

Merged
merged 4 commits into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions build/build/src/ci.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
// use crate::prelude::*;

use sysinfo::SystemExt;



/// Labels used in the repositories where this library is used for CI.
/// They should be defined in the `.github/settings.yml` file.
pub mod labels {
Expand All @@ -9,3 +13,15 @@ pub mod labels {
/// Name of the label that is used to mark the PRs that require clean builds.
pub const CLEAN_BUILD_REQUIRED: &str = "CI: Clean build required";
}

/// Check if this is a "big memory" machine.
///
/// Our self-hosted runners are big memory machines, but the GitHub-hosted ones are not.
///
/// Certain CI operations are only performed on big machines, as they require a lot of memory.
pub fn big_memory_machine() -> bool {
let github_hosted_macos_memory = 15_032_385;
let mut system = sysinfo::System::new();
system.refresh_memory();
system.total_memory() > github_hosted_macos_memory
}
3 changes: 3 additions & 0 deletions build/build/src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ pub struct BuildConfigurationFlags {
/// Used to check that benchmarks do not fail on runtime, rather than obtaining the results.
pub execute_benchmarks_once: bool,
pub build_engine_package: bool,
/// Build the experimental native Engine Runner.
pub build_native_runner: bool,
pub build_launcher_package: bool,
pub build_project_manager_package: bool,
pub build_launcher_bundle: bool,
Expand Down Expand Up @@ -218,6 +220,7 @@ impl Default for BuildConfigurationFlags {
execute_benchmarks_once: false,
build_engine_package: false,
build_launcher_package: false,
build_native_runner: false,
build_project_manager_package: false,
build_launcher_bundle: false,
build_project_manager_bundle: false,
Expand Down
12 changes: 3 additions & 9 deletions build/build/src/engine/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,23 +300,17 @@ impl RunContext {
// If we have much memory, we can try building everything in a single batch. Reducing number
// of SBT invocations significantly helps build time. However, it is more memory heavy, so
// we don't want to call this in environments like GH-hosted runners.
let github_hosted_macos_memory = 15_032_385;
let big_memory_machine = system.total_memory() > github_hosted_macos_memory;
// Windows native runner is not yet supported.
let build_native_runner =
self.config.build_engine_package() && big_memory_machine && TARGET_OS != OS::Windows;


// === Build project-manager distribution and native image ===
debug!("Bulding project-manager distribution and Native Image");
if big_memory_machine {
if crate::ci::big_memory_machine() {
let mut tasks = vec![];

if self.config.build_engine_package() {
tasks.push("buildEngineDistribution");
tasks.push("engine-runner/assembly");
}
if build_native_runner {
if self.config.build_native_runner {
tasks.push("engine-runner/buildNativeImage");
}

Expand Down Expand Up @@ -411,7 +405,7 @@ impl RunContext {

// === Run benchmarks ===
debug!("Running benchmarks.");
if big_memory_machine {
if crate::ci::big_memory_machine() {
let mut tasks = vec![];
// This just compiles benchmarks, not run them. At least we'll know that they can be
// run. Actually running them, as part of this routine, would be too heavy.
Expand Down
3 changes: 3 additions & 0 deletions build/cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,9 @@ impl Processor {
test_standard_library: true,
test_java_generated_from_rust: true,
build_benchmarks: true,
// Windows is not yet supported for the native runner.
build_native_runner: enso_build::ci::big_memory_machine()
&& TARGET_OS != OS::Windows,
execute_benchmarks: {
// Run benchmarks only on Linux.
let mut ret = BTreeSet::new();
Expand Down
Loading