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

Improvements to run-graph #234

Merged
merged 18 commits into from
Jul 9, 2018
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
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
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ tokio-core = "0.1.7"
tokio-io = "0.1.1"
tokio-process = "0.1.2"
tokio-timer = "0.1.1"
toml = "0.4.1"
toml = "0.4.6"
url = "1.1"
walkdir = "2"
regex = "0.2.10"
Expand Down
77 changes: 72 additions & 5 deletions config.toml

Large diffs are not rendered by default.

8 changes: 3 additions & 5 deletions docs/cli-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ own rustup installation, crate mirrors, etc.
```
cargo run -- prepare-local --docker-env mini
cargo run -- define-ex --crate-select=demo --cap-lints=forbid stable beta
cargo run -- prepare-ex
cargo run -- run
cargo run -- run-graph --threads NUM_CPUS
cargo run -- gen-report work/ex/default/
```

Expand All @@ -36,9 +35,8 @@ defaults to `default`. Here's what each of the steps does:
* `define-ex` - defines a new experiment
performing a build-test experiment on the 'demo' set of crates.

* `prepare-ex` - fetches repos from github and captures their commit
shas, downloads all crates, hacks up Cargo.toml files, captures
lockfiles, fetches all dependencies, and prepares toolchains.
* `run-graph` - executes the experiment. You can control the number of parallel
tasks executed with the `--threads` flag.

* `run` - runs tests on crates in the experiment, against both
toolchains
Expand Down
23 changes: 3 additions & 20 deletions docs/legacy-workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,31 +113,14 @@ the sheet that does not have a status of 'Complete' or 'Failed'.
necessarily the same date as retrieved in the `BETA_VERSION` command).
- Run `cargo run --release -- define-ex --crate-select=full --ex EX_NAME EX_START EX_END`.
This will complete in a few seconds.
- Run `cargo run --release -- prepare-ex --ex EX_NAME`.
- Change status to 'Preparing'.
- Run `cargo run --release -- run-graph --threads 8 --ex EX_NAME`.
- Change status to 'Running'.
- Update either the PR or the person requesting the run to let them know the run has started.
- Go to next run.
- Preparing
- Log onto appropriate box and connect to multiplexer.
- Switch to the `master` multiplexer window.
- If preparation is ongoing, go to next run.
- If preparation failed, fix it. Known errors:
- "missing sha for ..." - remove the referenced repository from `gh-apps.txt`
and `gh-candidates.txt` (may be present in one or both). Make the same
change locally and make a PR against Crater. Use
`cargo run --release -- delete-all-target-dirs --ex EX_NAME` and
`cargo run --release -- delete-ex --ex EX_NAME`, then jump to start of 'Pending'.
- Switch to the `tc1` multiplexer window.
- Run `cargo run --release -- run-tc --ex EX_NAME EX_START`.
- Switch to the `tc2` multiplexer window.
- Run `cargo run --release -- run-tc --ex EX_NAME EX_END`.
- Go to next run.
- Running
- Log onto appropriate box and connect to multiplexer.
- Switch to the `master` multiplexer window.
- If the run is ongoing in either the `tc1` or `tc2` multiplexer
windows, go to next run.
- Switch to the `master` multiplexer window.
- If the run is ongoing go to next run.
- Run `du -sh work/ex/EX_NAME`, output should be <2GB. If not:
- Run `find work/ex/EX_NAME -type f -size +100M | xargs --no-run-if-empty du -sh`,
there will likely only be a couple of files listed and they should be in the `res` directory.
Expand Down
5 changes: 1 addition & 4 deletions gh-apps.txt
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,6 @@ https://github.com/fosu/myceline
https://github.com/fosu/psilocybin
https://github.com/fourohfour/richter
https://github.com/fralalonde/dipstick
https://github.com/frankier/suchalotofdata
https://github.com/frankmcsherry/COST
https://github.com/franleplant/syntaxis_lexer.rs
https://github.com/frewsxcv/alert-after
Expand Down Expand Up @@ -1024,7 +1023,6 @@ https://github.com/jakubtuchol/ls
https://github.com/jamesmunns/pide
https://github.com/jamespharaoh/btrfs-dedupe
https://github.com/jamespharaoh/rzbackup
https://github.com/jamii/imp
https://github.com/japaric/itm
https://github.com/japaric/particle-tools
https://github.com/japaric/sc-gen
Expand Down Expand Up @@ -1411,7 +1409,6 @@ https://github.com/ohazi/opengl-demo-rust
https://github.com/ohua-dev/ohua-rust-runtime
https://github.com/ojacobson/rust-mount-demo
https://github.com/oldsj/backup-rs
https://github.com/olegakbarov/cali
https://github.com/onefrankguy/chifir
https://github.com/onelson/loose-coupling
https://github.com/onur/at-rust
Expand Down Expand Up @@ -1739,11 +1736,11 @@ https://github.com/starlingjs/starling
https://github.com/stevej/keymaster
https://github.com/steveklabnik/GPACalc.rs
https://github.com/steveklabnik/cryptopals
https://github.com/steveklabnik/doxidize
https://github.com/steveklabnik/echo
https://github.com/steveklabnik/geekout2016
https://github.com/steveklabnik/parse-example
https://github.com/steveklabnik/rustbook
https://github.com/steveklabnik/rustdoc
https://github.com/steveklabnik/semver.crates.io
https://github.com/stewart/rff
https://github.com/sticnarf/shunter-chnroutes
Expand Down
5 changes: 1 addition & 4 deletions gh-candidates.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3301,7 +3301,6 @@ fralalonde/advent-of-code-2017
fralalonde/dipstick
francesca64/hotwatch
frankier/fst-extra-aut
frankier/suchalotofdata
frankmcsherry/COST
frankmcsherry/columnar
frankmcsherry/dataflow-join
Expand Down Expand Up @@ -3908,7 +3907,6 @@ jamesmunns/pide
jamespharaoh/btrfs-dedupe
jamespharaoh/rzbackup
jameysharp/weighted-regexp-rs
jamii/imp
jamiltron/learn_gfx_2d
jamorton/loccr
jamorton/rust-dcpu16
Expand Down Expand Up @@ -5491,7 +5489,6 @@ ojacobson/rust-mount-demo
ojhp/zed
oldmacnut/sgt_initramfs
oldsj/backup-rs
olegakbarov/cali
oli-obk/camera_capture
oli-obk/pandoc-ast
oli-obk/quine-mc_cluskey
Expand Down Expand Up @@ -6824,6 +6821,7 @@ steveklabnik/GPACalc.rs
steveklabnik/compass-rust
steveklabnik/core_mini_http.rs
steveklabnik/cryptopals
steveklabnik/doxidize
steveklabnik/echo
steveklabnik/escape_html
steveklabnik/for_bbatha
Expand All @@ -6836,7 +6834,6 @@ steveklabnik/redis
steveklabnik/ruby.rs
steveklabnik/rust-issue-17417
steveklabnik/rustbook
steveklabnik/rustdoc
steveklabnik/rustque
steveklabnik/semver
steveklabnik/semver-parser
Expand Down
5 changes: 3 additions & 2 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,11 @@ impl Crater {
)?;
}
Crater::PrepareEx { ref ex } => {
let config = Config::load()?;
let ex = ex::Experiment::load(&ex.0)?;
let db = FileDB::default();
ex.prepare_shared(&db)?;
ex.prepare_local()?;
ex.prepare_shared(&config, &db)?;
ex.prepare_local(&config)?;
}
Crater::CopyEx { ref ex1, ref ex2 } => {
ex::copy(&ex1.0, &ex2.0)?;
Expand Down
14 changes: 14 additions & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ pub struct CrateConfig {
pub skip_tests: bool,
#[serde(default = "default_false")]
pub quiet: bool,
#[serde(default = "default_false")]
pub update_lockfile: bool,
#[serde(default = "default_false")]
pub broken: bool,
}

fn default_false() -> bool {
Expand Down Expand Up @@ -82,6 +86,16 @@ impl Config {
self.crate_config(c).map(|c| c.quiet).unwrap_or(false)
}

pub fn should_update_lockfile(&self, c: &Crate) -> bool {
self.crate_config(c)
.map(|c| c.update_lockfile)
.unwrap_or(false)
}

pub fn is_broken(&self, c: &Crate) -> bool {
self.crate_config(c).map(|c| c.broken).unwrap_or(false)
}

pub fn demo_crates(&self) -> &DemoCrates {
&self.demo_crates
}
Expand Down
49 changes: 25 additions & 24 deletions src/crates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,30 +129,10 @@ pub fn prepare(list: &[Crate]) -> Result<()> {
info!("preparing {} crates", list.len());
let mut successes = 0;
for krate in list {
let dir = krate.dir();
match *krate {
Crate::Registry(ref details) => {
let r = dl_registry(&details.name, &details.version, &dir)
.chain_err(|| format!("unable to download {}", krate));
if let Err(e) = r {
util::report_error(&e);
} else {
successes += 1;
}
// crates.io doesn't rate limit. Go fast
}
Crate::GitHub(ref repo) => {
info!(
"cloning GitHub repo {} to {}...",
repo.slug(),
dir.display()
);
if let Err(e) = util::copy_dir(&repo.mirror_dir(), &dir) {
util::report_error(&e);
} else {
successes += 1;
}
}
if let Err(e) = prepare_crate(krate) {
util::report_error(&e);
} else {
successes += 1;
}
}

Expand All @@ -163,6 +143,27 @@ pub fn prepare(list: &[Crate]) -> Result<()> {
Ok(())
}

pub fn prepare_crate(krate: &Crate) -> Result<()> {
let dir = krate.dir();
match *krate {
Crate::Registry(ref details) => {
// crates.io doesn't rate limit. Go fast
dl_registry(&details.name, &details.version, &dir)
.chain_err(|| format!("unable to download {}", krate))?;
}
Crate::GitHub(ref repo) => {
info!(
"cloning GitHub repo {} to {}...",
repo.slug(),
dir.display()
);
util::copy_dir(&repo.mirror_dir(), &dir)?;
}
}

Ok(())
}

fn dl_registry(name: &str, vers: &str, dir: &Path) -> Result<()> {
if dir.exists() {
info!(
Expand Down
Loading