From a8f4e2c8fe91d4063d122869090cfb70894f5567 Mon Sep 17 00:00:00 2001 From: Hieu Hoang Date: Fri, 10 May 2013 15:43:49 +0100 Subject: changes for cruise control --- cruise-control/config.ems | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cruise-control') diff --git a/cruise-control/config.ems b/cruise-control/config.ems index 58e8ad94c..2d04ed9fd 100644 --- a/cruise-control/config.ems +++ b/cruise-control/config.ems @@ -139,7 +139,7 @@ order = 5 # kenlm, also set type to 8 #lm-binarizer = $moses-src-dir/kenlm/build_binary -#type = 8 +type = 8 ### script to create quantized language model format (irstlm) # (default: no quantization) -- cgit v1.2.3 From 6f75022144bf1135fd99a3009ccebb477108b3e3 Mon Sep 17 00:00:00 2001 From: Hieu Hoang Date: Fri, 10 May 2013 16:34:57 +0100 Subject: changes for cruise control --- cruise-control/config.ems | 2 ++ 1 file changed, 2 insertions(+) (limited to 'cruise-control') diff --git a/cruise-control/config.ems b/cruise-control/config.ems index 2d04ed9fd..97eb4bd30 100644 --- a/cruise-control/config.ems +++ b/cruise-control/config.ems @@ -159,6 +159,8 @@ type = 8 # #get-corpus-script = "" +type = 8 + ### raw corpus (untokenized) # raw-corpus = $toy-data/nc-5k.$output-extension -- cgit v1.2.3 From a25193cc5da6a271c4676e843db80ee19221822a Mon Sep 17 00:00:00 2001 From: Jeroen Vermeulen Date: Sun, 17 May 2015 20:04:04 +0700 Subject: Fix a lot of lint, mostly trailing whitespace. This is lint reported by the new lint-checking functionality in beautify.py. (We can change to a different lint checker if we have a better one, but it would probably still flag these same problems.) Lint checking can help a lot, but only if we get the lint under control. --- cruise-control/test_all_new_commits.sh | 6 +++--- cruise-control/web/html_templates.php | 2 +- cruise-control/web/log_wrapper.php | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) (limited to 'cruise-control') diff --git a/cruise-control/test_all_new_commits.sh b/cruise-control/test_all_new_commits.sh index 93ef30cf1..1e0a9c47f 100755 --- a/cruise-control/test_all_new_commits.sh +++ b/cruise-control/test_all_new_commits.sh @@ -115,7 +115,7 @@ function run_single_test () { if [ -z "$err" ]; then ./bjam $MCC_CONFIGURE_ARGS >> $longlog 2>&1 || err="bjam" fi - + echo "## regression tests" >> $longlog if [ -z "$err" ]; then ./bjam $MCC_CONFIGURE_ARGS --with-regtest=$regtest_dir >> $longlog 2>&1 || err="regression tests" @@ -158,7 +158,7 @@ function run_single_test () { status="FAIL:$err" fi echo "## Status: $status" >> $longlog - + nicedate=$(date +"%Y%m%d-%H%M%S") echo "$commit $status $configname $ccversion $nicedate" \ >> "$LOGDIR/brief.log" @@ -180,7 +180,7 @@ done # create info files for new commits for i in $(git rev-list $MCC_SCAN_BRANCHES); do first_char=$(echo $i | grep -o '^.') - mkdir -p "$LOGDIR/logs/$configname/$first_char" + mkdir -p "$LOGDIR/logs/$configname/$first_char" [ -f "$LOGDIR/logs/$configname/$first_char/$i.info" ] && break; git show $i | $MYDIR/shorten_info.pl > "$LOGDIR/logs/$configname/$first_char/$i.info" done diff --git a/cruise-control/web/html_templates.php b/cruise-control/web/html_templates.php index 83f6cc879..b7346914c 100644 --- a/cruise-control/web/html_templates.php +++ b/cruise-control/web/html_templates.php @@ -8,7 +8,7 @@ function show_header($title) $title "; -} +} function show_heading($text, $size = 1) { diff --git a/cruise-control/web/log_wrapper.php b/cruise-control/web/log_wrapper.php index af03db016..9fcf4db00 100644 --- a/cruise-control/web/log_wrapper.php +++ b/cruise-control/web/log_wrapper.php @@ -18,7 +18,7 @@ function get_all_branch_names() } class Branch -{ +{ public function __construct($name) { $this->name = $name; @@ -72,7 +72,7 @@ class Commit while (($line = fgets($log_hdl)) !== false) { if (preg_match('/tests passed/', $line)) { $this->passed_percent = substr($line, 0, strpos('%', $line)); - } + } else if (preg_match('/INVESTIGATE THESE FAILED TESTS/', $line)) { $this->failed_tests = substr($line, 39); } @@ -113,7 +113,7 @@ class Commit return file_exists(StaticData::logs_path . "/" . substr($this->name, 0, 1) . "/" . $this->name . ".OK"); } } - + public function get_status() { return $this->was_tested() @@ -157,12 +157,12 @@ class Commit public function get_log_file() { - return "show_commit.php?commit_id=$this->name&type=log"; + return "show_commit.php?commit_id=$this->name&type=log"; } public function get_info_file() { - return "show_commit.php?commit_id=$this->name&type=info"; + return "show_commit.php?commit_id=$this->name&type=info"; } private function open_log() @@ -182,7 +182,7 @@ class Commit private $message; private $author; private $timestamp; - + } ?> -- cgit v1.2.3 From ab9b9ae3493da391d19b98551af966b6426bd400 Mon Sep 17 00:00:00 2001 From: Hieu Hoang Date: Sun, 31 May 2015 21:27:55 +0400 Subject: 1st pass to automatically beautify --- cruise-control/test_all_new_commits.sh | 3 +++ 1 file changed, 3 insertions(+) (limited to 'cruise-control') diff --git a/cruise-control/test_all_new_commits.sh b/cruise-control/test_all_new_commits.sh index 1e0a9c47f..7f1520452 100755 --- a/cruise-control/test_all_new_commits.sh +++ b/cruise-control/test_all_new_commits.sh @@ -107,6 +107,7 @@ function run_single_test () { #regtest_dir=$PWD/$(basename $regtest_file .tgz) cd .. + ./scripts/other/beautify.py --format echo "## ./bjam clean" >> $longlog ./bjam clean $MCC_CONFIGURE_ARGS --with-regtest=$regtest_dir >> $longlog 2>&1 || warn "bjam clean failed, suspicious" @@ -153,8 +154,10 @@ function run_single_test () { date >> $longlog if [ -z "$err" ]; then + git commit -am "automatic daily beautifier" status="OK" else + git reset --hard HEAD status="FAIL:$err" fi echo "## Status: $status" >> $longlog -- cgit v1.2.3 From afb032014dc22cc184046fbf99fc08569781afe5 Mon Sep 17 00:00:00 2001 From: Hieu Hoang Date: Sun, 31 May 2015 21:51:43 +0400 Subject: skip perltidy. Not available on thor (Ubuntu 12.04) --- cruise-control/test_all_new_commits.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cruise-control') diff --git a/cruise-control/test_all_new_commits.sh b/cruise-control/test_all_new_commits.sh index 7f1520452..bb9305768 100755 --- a/cruise-control/test_all_new_commits.sh +++ b/cruise-control/test_all_new_commits.sh @@ -107,7 +107,7 @@ function run_single_test () { #regtest_dir=$PWD/$(basename $regtest_file .tgz) cd .. - ./scripts/other/beautify.py --format + ./scripts/other/beautify.py --format --skip-perltidy echo "## ./bjam clean" >> $longlog ./bjam clean $MCC_CONFIGURE_ARGS --with-regtest=$regtest_dir >> $longlog 2>&1 || warn "bjam clean failed, suspicious" @@ -190,7 +190,7 @@ done #### Main loop over all commits for i in $MCC_SCAN_BRANCHES; do - warn "On brach $i" + warn "On branch $i" git rev-list $i \ | while read commit; do first_char=$(echo $commit | grep -o '^.') -- cgit v1.2.3 From ca82e9a244773d834b7ffdef548f1966f040a4d5 Mon Sep 17 00:00:00 2001 From: Hieu Hoang Date: Thu, 4 Jun 2015 16:34:02 +0400 Subject: don't run beautify from cruise control. Not master, a particular commit --- cruise-control/test_all_new_commits.sh | 3 --- 1 file changed, 3 deletions(-) (limited to 'cruise-control') diff --git a/cruise-control/test_all_new_commits.sh b/cruise-control/test_all_new_commits.sh index bb9305768..433857eb5 100755 --- a/cruise-control/test_all_new_commits.sh +++ b/cruise-control/test_all_new_commits.sh @@ -107,8 +107,6 @@ function run_single_test () { #regtest_dir=$PWD/$(basename $regtest_file .tgz) cd .. - ./scripts/other/beautify.py --format --skip-perltidy - echo "## ./bjam clean" >> $longlog ./bjam clean $MCC_CONFIGURE_ARGS --with-regtest=$regtest_dir >> $longlog 2>&1 || warn "bjam clean failed, suspicious" @@ -154,7 +152,6 @@ function run_single_test () { date >> $longlog if [ -z "$err" ]; then - git commit -am "automatic daily beautifier" status="OK" else git reset --hard HEAD -- cgit v1.2.3 From 7047c591c8414864ef13020e256e841aa217c4d2 Mon Sep 17 00:00:00 2001 From: Hieu Hoang Date: Thu, 4 Jun 2015 16:46:56 +0400 Subject: Beautify before cruise control test. Push using MosesAdmin account, must be set up with ssh. --- cruise-control/test_all_new_commits.sh | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'cruise-control') diff --git a/cruise-control/test_all_new_commits.sh b/cruise-control/test_all_new_commits.sh index 433857eb5..79d44d3a3 100755 --- a/cruise-control/test_all_new_commits.sh +++ b/cruise-control/test_all_new_commits.sh @@ -17,6 +17,14 @@ configname=$(basename $configf | sed 's/\.config$//') source "$configf" +# beautifier +git clone git@github.com:moses-smt/mosesdecoder.git /tmp/moses +cd /tmp/moses +./scripts/other/beautify.py --format --skip-perltidy +git commit -am "daily automatic beautifier" +git push +rm -rf /tmp/moses + [ -z "$MCC_SCAN_BRANCHES" ] \ && die "Bad config $configf; does not define MCC_SCAN_BRANCHES" -- cgit v1.2.3 From 6a09042e6abd5dab3d0cf0d358804f7a0ef9ca9a Mon Sep 17 00:00:00 2001 From: Hieu Hoang Date: Thu, 4 Jun 2015 16:51:22 +0400 Subject: Beautify before cruise control test. Push using MosesAdmin account, must be set up with ssh. --- cruise-control/test_all_new_commits.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'cruise-control') diff --git a/cruise-control/test_all_new_commits.sh b/cruise-control/test_all_new_commits.sh index 79d44d3a3..c30afa0d1 100755 --- a/cruise-control/test_all_new_commits.sh +++ b/cruise-control/test_all_new_commits.sh @@ -24,6 +24,7 @@ cd /tmp/moses git commit -am "daily automatic beautifier" git push rm -rf /tmp/moses +cd - [ -z "$MCC_SCAN_BRANCHES" ] \ && die "Bad config $configf; does not define MCC_SCAN_BRANCHES" -- cgit v1.2.3 From befd1a4ebb1ad0a19bb51185a5391fb6fea86bdd Mon Sep 17 00:00:00 2001 From: Hieu Hoang Date: Thu, 5 Nov 2015 09:09:34 +0000 Subject: compile.sh works on osx --- cruise-control/create-binary.perl | 55 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100755 cruise-control/create-binary.perl (limited to 'cruise-control') diff --git a/cruise-control/create-binary.perl b/cruise-control/create-binary.perl new file mode 100755 index 000000000..b5b9009fc --- /dev/null +++ b/cruise-control/create-binary.perl @@ -0,0 +1,55 @@ +#!/usr/bin/env perl + +use strict; + +my $HOME = $ENV{"HOME"}; +my $HOSTNAME = "s0565741\@thor.inf.ed.ac.uk"; + +my $sriPath = $ARGV[0]; + +my $cmd; + +# what machine +my $machine = `uname`; +chomp($machine); + +# COMPILE +$cmd = "git checkout master && git pull"; +print STDERR "Executing: $cmd \n"; +system($cmd); + +$cmd = "make -f contrib/Makefiles/install-dependencies.gmake && ./compile.sh --without-tcmalloc"; +print STDERR "Executing: $cmd \n"; +system($cmd); + +#ZIP +if ($machine eq "Darwin") { + $machine = "mac"; +} + +$cmd = "mkdir -p mt-tools/moses && mv bin lib mt-tools/moses"; +print STDERR "Executing: $cmd \n"; +system($cmd); + +$cmd = "tar -zcvf $machine.tgz mt-tools"; +print STDERR "Executing: $cmd \n"; +system($cmd); + +# UPLOAD +my $date = `date "+%F"`; +chomp($date); + +my $targetDir = "/fs/thor1/hieu/binaries/$date/"; +print STDERR "Directory=$targetDir\n"; + +$cmd = "ssh $HOSTNAME mkdir -p $targetDir"; +print STDERR "Executing: $cmd \n"; +system($cmd); + +$cmd = "rsync -rv --delete $machine.tgz $HOSTNAME:$targetDir"; +print STDERR "Executing: $cmd \n"; +system($cmd); + +$cmd = "rm $machine.tgz"; +print STDERR "Executing: $cmd \n"; +system($cmd); -- cgit v1.2.3