Skip to content

Commit

Permalink
enabled local config for deployed version
Browse files Browse the repository at this point in the history
  • Loading branch information
pooyanjamshidi committed Jul 2, 2016
1 parent c3768e6 commit 9c31dc5
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ BO4CO
temp
bin
bin.zip
release_history
11 changes: 8 additions & 3 deletions src/init.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ function init()

% read configuration parameters
yamlfile='conf/expconfig.yaml';
if isdeployed
appRoot = ctfroot;
copyfile(yamlfile,[appRoot '/main/conf'],'f'); % copy the local configs to the deployment
end

[params, runConfig, services, application_detail] = readConfig(yamlfile); % Read parameter settings both for the experimental runs and configuration parameters

if ~isdeployed
Expand Down Expand Up @@ -37,14 +42,14 @@ function init()
zookeeper=services{1,6};
else
setmcruserdata('application',application_detail);

setmcruserdata('topology',application_detail.name);
setmcruserdata('exp_name',strcat(topology,'_exp_',num2str(datenum(datetime('now')),'%bu')));

setmcruserdata('config_template',runConfig.conf);
setmcruserdata('config_folder',runConfig.confFolder);
setmcruserdata('save_folder',runConfig.saveFolder);
setmcruserdata('summary_folder',runConfig.saveFolder);
setmcruserdata('summary_folder',runConfig.summaryFolder);
setmcruserdata('exp_budget',runConfig.numIter);
setmcruserdata('initial_design',runConfig.initialDesign);
setmcruserdata('polling_time',runConfig.metricPoll);
Expand All @@ -62,7 +67,7 @@ function init()
setmcruserdata('storm',services{1,4}.URL);
setmcruserdata('storm_ui',services{1,4});
setmcruserdata('kafka',services{1,5}.URL);
setmcruserdata('zookeeper',services{1,6});
setmcruserdata('zookeeper',services{1,6});
end

% setup the python path (for deployment service)
Expand Down
9 changes: 6 additions & 3 deletions src/integrated/summarize_expdata.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,12 @@
summary=[];

filename=[save_folder_ expdata_csv_name];
%lastrow=number_of_rows(filename);
thiscsv=csvread(filename,firstrow,0);

lastrow=number_of_rows(filename);
if lastrow>firstrow
thiscsv=csvread(filename,firstrow,0);
else
thiscsv=[];
end
% if instead of mean percentile required replace it with prctile(X,p)
if ~isempty(thiscsv)
latency=mean(thiscsv(:,latency_column_index));
Expand Down
4 changes: 2 additions & 2 deletions src/setup.m
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@
end
% setup ssh2

cd('external/libs/ssh2/ssh2v2');
%cd('external/libs/ssh2/ssh2v2');
conn = ssh2_setup();
conn = ssh2_setup(conn);
conn = ssh2_setup(now());
cd(myDir);
%cd(myDir);

% if you want to not run this when you exit matlab uncomment this, use
% this: which pathdef.m -all
Expand Down

0 comments on commit 9c31dc5

Please sign in to comment.