Make rocksdb work with internal repo

fbshipit-source-id: f52d2b6d39668516270c51945fc4e1693e553ff7
This commit is contained in:
Islam AbdelRahman 2016-10-26 13:45:08 -07:00 committed by Islam AbdelRahman
parent 0aab5e55f0
commit fcd1e0bf6c
3 changed files with 12 additions and 15 deletions

View File

@ -1,6 +1,6 @@
{ {
"project_id" : "rocksdb", "project_id" : "rocksdb",
"conduit_uri" : "https://reviews.facebook.net/", "conduit_uri" : "https://phabricator.fb.com/api/",
"copyright_holder" : "Facebook", "copyright_holder" : "Facebook",
"load" : [ "load" : [
"arcanist_util" "arcanist_util"

1
.gitignore vendored
View File

@ -69,3 +69,4 @@ LOG
db_logs/ db_logs/
tp2/ tp2/
fbcode/ fbcode/
fbcode

View File

@ -12,7 +12,6 @@ define("ENV_HTTPS_APP_VALUE", "HTTPS_APP_VALUE");
define("ENV_HTTPS_TOKEN_VALUE", "HTTPS_TOKEN_VALUE"); define("ENV_HTTPS_TOKEN_VALUE", "HTTPS_TOKEN_VALUE");
define("PRIMARY_TOKEN_FILE", '/home/krad/.sandcastle'); define("PRIMARY_TOKEN_FILE", '/home/krad/.sandcastle');
define("SECONDARY_TOKEN_FILE", '$HOME/.sandcastle');
define("CONT_RUN_ALIAS", "leveldb"); define("CONT_RUN_ALIAS", "leveldb");
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
@ -25,9 +24,7 @@ function postURL($diffID, $url) {
$cmd = 'echo \'{"diff_id": "' . $diffID . '", ' $cmd = 'echo \'{"diff_id": "' . $diffID . '", '
. '"name":"click here for sandcastle tests for D' . $diffID . '", ' . '"name":"click here for sandcastle tests for D' . $diffID . '", '
. '"link":"' . $url . '"}\' | ' . '"link":"' . $url . '"}\' | '
. 'no_proxy=facebook.com,tfbnw.net,fb.com ' . 'arc call-conduit '
. 'http_proxy=fwdproxy.any.facebook.com:8080 '
. 'https_proxy=fwdproxy.any.facebook.com:8080 arc call-conduit '
. 'differential.updateunitresults'; . 'differential.updateunitresults';
shell_exec($cmd); shell_exec($cmd);
} }
@ -41,9 +38,7 @@ function buildUpdateTestStatusCmd($diffID, $test, $status) {
$cmd = 'echo \'{"diff_id": "' . $diffID . '", ' $cmd = 'echo \'{"diff_id": "' . $diffID . '", '
. '"name":"' . $test . '", ' . '"name":"' . $test . '", '
. '"result":"' . $status . '"}\' | ' . '"result":"' . $status . '"}\' | '
. 'no_proxy=facebook.com,tfbnw.net,fb.com ' . 'arc call-conduit '
. 'http_proxy=fwdproxy.any.facebook.com:8080 '
. 'https_proxy=fwdproxy.any.facebook.com:8080 arc call-conduit '
. 'differential.updateunitresults'; . 'differential.updateunitresults';
return $cmd; return $cmd;
} }
@ -108,8 +103,7 @@ function getSteps($applyDiff, $diffID, $username, $test) {
// Patch the code (keep your fingures crossed). // Patch the code (keep your fingures crossed).
$patch = array( $patch = array(
"name" => "Patch " . $diffID, "name" => "Patch " . $diffID,
"shell" => "no_proxy=facebook.com,tfbnw.net,fb.com " "shell" => "arc --arcrc-file ~/.arcrc "
."HTTPS_PROXY=fwdproxy:8080 arc --arcrc-file ~/.arcrc "
. "patch --nocommit --diff " . $diffID, . "patch --nocommit --diff " . $diffID,
"user" => "root" "user" => "root"
); );
@ -178,6 +172,8 @@ function getSteps($applyDiff, $diffID, $username, $test) {
function getSandcastleConfig() { function getSandcastleConfig() {
$sandcastle_config = array(); $sandcastle_config = array();
$cwd = getcwd();
$cwd_token_file = "{$cwd}/.sandcastle";
// This is a case when we're executed from a continuous run. Fetch the values // This is a case when we're executed from a continuous run. Fetch the values
// from the environment. // from the environment.
if (getenv(ENV_POST_RECEIVE_HOOK)) { if (getenv(ENV_POST_RECEIVE_HOOK)) {
@ -188,20 +184,20 @@ function getSandcastleConfig() {
// configuration files. // configuration files.
for ($i = 0; $i < 50; $i++) { for ($i = 0; $i < 50; $i++) {
if (file_exists(PRIMARY_TOKEN_FILE) || if (file_exists(PRIMARY_TOKEN_FILE) ||
file_exists(SECONDARY_TOKEN_FILE)) { file_exists($cwd_token_file)) {
break; break;
} }
// If we failed to fetch the tokens, sleep for 0.2 second and try again // If we failed to fetch the tokens, sleep for 0.2 second and try again
usleep(200000); usleep(200000);
} }
assert(file_exists(PRIMARY_TOKEN_FILE) || assert(file_exists(PRIMARY_TOKEN_FILE) ||
file_exists(SECONDARY_TOKEN_FILE)); file_exists($cwd_token_file));
// Try the primary location first, followed by a secondary. // Try the primary location first, followed by a secondary.
if (file_exists(PRIMARY_TOKEN_FILE)) { if (file_exists(PRIMARY_TOKEN_FILE)) {
$cmd = 'cat ' . PRIMARY_TOKEN_FILE; $cmd = 'cat ' . PRIMARY_TOKEN_FILE;
} else { } else {
$cmd = 'cat ' . SECONDARY_TOKEN_FILE; $cmd = 'cat ' . $cwd_token_file;
} }
assert(strlen($cmd) > 0); assert(strlen($cmd) > 0);
@ -305,7 +301,7 @@ function getSandcastleConfig() {
// Submit to Sandcastle. // Submit to Sandcastle.
$url = 'https://interngraph.intern.facebook.com/sandcastle/generate?' $url = 'https://interngraph.intern.facebook.com/sandcastle/generate?'
.'command=SandcastleUniversalCommand' .'command=SandcastleUniversalCommand'
.'&vcs=rocksdb-git&revision=origin%2Fmaster&type=lego' .'&vcs=rocksdb-int-git&revision=origin%2Fmaster&type=lego'
.'&user=' . $username . '&alias=rocksdb-precommit' .'&user=' . $username . '&alias=rocksdb-precommit'
.'&command-args=' . urlencode(json_encode($command)); .'&command-args=' . urlencode(json_encode($command));
@ -315,7 +311,7 @@ function getSandcastleConfig() {
$app = $sandcastle_config[0]; $app = $sandcastle_config[0];
$token = $sandcastle_config[1]; $token = $sandcastle_config[1];
$cmd = 'https_proxy= HTTPS_PROXY= curl -s -k -F app=' . $app . ' ' $cmd = 'curl -s -k -F app=' . $app . ' '
. '-F token=' . $token . ' "' . $url . '"'; . '-F token=' . $token . ' "' . $url . '"';
$output = shell_exec($cmd); $output = shell_exec($cmd);