Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/ofborg
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4fe5685e765c
Choose a base ref
...
head repository: NixOS/ofborg
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 5e2fa6b5b469
Choose a head ref
  • 2 commits
  • 4 files changed
  • 2 contributors

Commits on Jun 28, 2018

  1. abort mass-rebuilder if less than 8Gb of memory is "available"

    …where available is defined as "how much RAM can the kernel give to an
    application immediately without having to reach for swap".
    obadz committed Jun 28, 2018
    Copy the full SHA
    f35a835 View commit details

Commits on Jun 30, 2018

  1. Merge pull request #176 from obadz/8gb-or-no-go

    abort mass-rebuilder if less than 8Gb of memory is "available"
    grahamc authored Jun 30, 2018

    Verified

    This commit was signed with the committer’s verified signature.
    veprbl Dmitry Kalinkin
    Copy the full SHA
    5e2fa6b View commit details
Showing with 43 additions and 3 deletions.
  1. +22 −2 nix/ofborg-carnix.nix
  2. +11 −0 ofborg/Cargo.lock
  3. +1 −0 ofborg/Cargo.toml
  4. +9 −1 ofborg/src/bin/mass-rebuilder.rs
24 changes: 22 additions & 2 deletions nix/ofborg-carnix.nix
Original file line number Diff line number Diff line change
@@ -608,6 +608,16 @@ rec {
sha256 = "1pimp7fpvillhz06xz0k6450h9nis3ab6h1j2hzrzykrpxs2qnyg";
inherit dependencies buildDependencies features;
};
sys_info_0_5_6_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
crateName = "sys-info";
version = "0.5.6";
authors = [ "Siyu Wang <FillZpp.pub@gmail.com>" ];
sha256 = "118ma1x3gnlm5jxxgi0bp8bskka5npnwn4f8m93zncbrbmzic2ff";
libPath = "lib.rs";
libName = "sys_info";
build = "build.rs";
inherit dependencies buildDependencies features;
};
tempdir_0_3_7_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
crateName = "tempdir";
version = "0.3.7";
@@ -1440,7 +1450,7 @@ rec {
num_cpus_1_8_0.default = (f.num_cpus_1_8_0.default or true);
}) [ libc_0_2_40_features ];
ofborg_0_1_5 = { features?(ofborg_0_1_5_features {}) }: ofborg_0_1_5_ {
dependencies = mapFeatures features ([ amqp_0_1_0 either_1_5_0 env_logger_0_4_3 fs2_0_4_3 hubcaps_0_3_16 hyper_0_10_13 hyper_native_tls_0_2_4 log_0_3_8 lru_cache_0_1_1 md5_0_3_7 nom_4_0_0_beta3 serde_1_0_43 serde_derive_1_0_43 serde_json_1_0_16 tempfile_2_2_0 uuid_0_4_0 ]);
dependencies = mapFeatures features ([ amqp_0_1_0 either_1_5_0 env_logger_0_4_3 fs2_0_4_3 hubcaps_0_3_16 hyper_0_10_13 hyper_native_tls_0_2_4 log_0_3_8 lru_cache_0_1_1 md5_0_3_7 nom_4_0_0_beta3 serde_1_0_43 serde_derive_1_0_43 serde_json_1_0_16 sys_info_0_5_6 tempfile_2_2_0 uuid_0_4_0 ]);
};
ofborg_0_1_5_features = f: updateFeatures f (rec {
amqp_0_1_0.default = true;
@@ -1458,10 +1468,11 @@ rec {
serde_1_0_43.default = true;
serde_derive_1_0_43.default = true;
serde_json_1_0_16.default = true;
sys_info_0_5_6.default = true;
tempfile_2_2_0.default = true;
uuid_0_4_0.default = true;
uuid_0_4_0.v4 = true;
}) [ amqp_0_1_0_features either_1_5_0_features env_logger_0_4_3_features fs2_0_4_3_features hubcaps_0_3_16_features hyper_0_10_13_features hyper_native_tls_0_2_4_features log_0_3_8_features lru_cache_0_1_1_features md5_0_3_7_features nom_4_0_0_beta3_features serde_1_0_43_features serde_derive_1_0_43_features serde_json_1_0_16_features tempfile_2_2_0_features uuid_0_4_0_features ];
}) [ amqp_0_1_0_features either_1_5_0_features env_logger_0_4_3_features fs2_0_4_3_features hubcaps_0_3_16_features hyper_0_10_13_features hyper_native_tls_0_2_4_features log_0_3_8_features lru_cache_0_1_1_features md5_0_3_7_features nom_4_0_0_beta3_features serde_1_0_43_features serde_derive_1_0_43_features serde_json_1_0_16_features sys_info_0_5_6_features tempfile_2_2_0_features uuid_0_4_0_features ];
openssl_0_9_24 = { features?(openssl_0_9_24_features {}) }: openssl_0_9_24_ {
dependencies = mapFeatures features ([ bitflags_0_9_1 foreign_types_0_3_2 lazy_static_1_0_0 libc_0_2_40 openssl_sys_0_9_28 ]);
features = mkFeatures (features.openssl_0_9_24 or {});
@@ -1822,6 +1833,15 @@ rec {
(syn_0_13_1.printing or false);
unicode_xid_0_1_0.default = true;
}) [ proc_macro2_0_3_7_features quote_0_5_2_features unicode_xid_0_1_0_features ];
sys_info_0_5_6 = { features?(sys_info_0_5_6_features {}) }: sys_info_0_5_6_ {
dependencies = mapFeatures features ([ libc_0_2_40 ]);
buildDependencies = mapFeatures features ([ cc_1_0_10 ]);
};
sys_info_0_5_6_features = f: updateFeatures f (rec {
cc_1_0_10.default = true;
libc_0_2_40.default = true;
sys_info_0_5_6.default = (f.sys_info_0_5_6.default or true);
}) [ libc_0_2_40_features cc_1_0_10_features ];
tempdir_0_3_7 = { features?(tempdir_0_3_7_features {}) }: tempdir_0_3_7_ {
dependencies = mapFeatures features ([ rand_0_4_2 remove_dir_all_0_5_1 ]);
};
11 changes: 11 additions & 0 deletions ofborg/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions ofborg/Cargo.toml
Original file line number Diff line number Diff line change
@@ -25,6 +25,7 @@ hyper = "0.10.*"
hyper-native-tls = "0.2.4"
lru-cache = "0.1.1"
nom = "4.0.0-beta3"
sys-info = "0.5.6"

#[patch.crates-io]
#amq-proto = { path = "rust-amq-proto" }
10 changes: 9 additions & 1 deletion ofborg/src/bin/mass-rebuilder.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
extern crate ofborg;
extern crate amqp;
extern crate env_logger;
extern crate sys_info;

use std::env;
use std::path::Path;
use std::process;
use ofborg::tasks;
use ofborg::config;
use ofborg::checkout;
@@ -15,13 +17,19 @@ use ofborg::easyamqp;
use ofborg::easyamqp::TypedWrappers;

fn main() {
let memory_info = sys_info::mem_info().expect("Unable to get memory information from OS");

if memory_info.avail < 8 * 1024 * 1024 { // seems this stuff is in kilobytes?
println!("Less than 8Gb of memory available (got {:.2}Gb). Aborting.", (memory_info.avail as f32) / 1024.0 / 1024.0 );
process::exit(1);
};

let cfg = config::load(env::args().nth(1).unwrap().as_ref());

ofborg::setup_log();

println!("Hello, world!");


let mut session = easyamqp::session_from_config(&cfg.rabbitmq).unwrap();
println!("Connected to rabbitmq");