bin/omf_ec in omf_ec-6.0.8.pre.1 vs bin/omf_ec in omf_ec-6.0.8.pre.2
- old
+ new
@@ -42,20 +42,27 @@
desc "Logging config file"
arg_name "file"
flag [:log_config]
+desc "Add some colours to logging"
+switch [:colour]
+
# the path given here is relative to the user's home directory
config_file(".config/omf_ec.yml")
desc "Execute an experiment script"
arg_name "path_to_script_file [-- --experiment_property value]"
command :exec do |c|
c.desc "Experiment name"
c.arg_name "experiment_name"
- c.flag [:e, :experiment]
+ c.flag [:e, :experiment, "experiment-id"]
+ c.desc "Slice name [Deprecated]"
+ c.arg_name "slice_name"
+ c.flag [:slice]
+
c.desc "OML URI to use for collecting the experiment's measurements"
c.arg_name "uri"
c.flag [:oml_uri]
c.desc "OML URI to use for EC Instrumentation"
@@ -71,10 +78,13 @@
c.flag [:inst_oml_domain]
c.desc "Check script version (you need to define OMF_VERSIONS in your script"
c.switch "version_check"
+ c.desc "Parse graph definition to construct graph information in log output"
+ c.switch [:g, "show-graph"]
+
c.action do |global_options, options, args|
help_now! "Missing experiment script" if args[0].nil?
help_now! "Experiment script not found" unless File.exist?(File.expand_path(args[0]))
# User-provided command line values for Experiment Properties cannot be
@@ -92,10 +102,12 @@
end
end
OmfEc.experiment.cmdline_properties = properties
end
+ OmfEc.experiment.show_graph = options['show-graph']
+
# FIXME this loading script is way too simple
load_exp(File.expand_path(args[0]), global_options, options, properties)
end
end
@@ -248,10 +260,16 @@
unless global_options[:debug]
Logging.consolidate 'OmfCommon', 'OmfRc'
end
+ if global_options[:colour]
+ Logging.logger.root.appenders.first.layout = Logging.layouts.pattern(date_pattern: '%F %T %z',
+ color_scheme: 'default',
+ pattern: '[%d] %-5l %c: %m\n')
+ end
+
# FIXME this should go to common setup
if global_options[:log_file_dir] && File.exist?(File.expand_path(global_options[:log_file_dir]))
Logging.logger.root.add_appenders(
Logging.appenders.file(
"#{File.expand_path(global_options[:log_file_dir])}/#{OmfEc.experiment.id}.log",
@@ -277,12 +295,11 @@
logging: {
level: { default: global_options[:debug] ? 'debug' : 'info' },
appenders: {
stdout: {
date_pattern: '%H:%M:%S',
- pattern: '%d %-5l %c{2}: %m\n',
- color_scheme: 'default'
+ pattern: '%d %-5l %c{2}: %m\n'
}
}
}
}
@@ -296,17 +313,19 @@
info "OMF Experiment Controller #{OmfEc::VERSION}"
info "Connected using #{comm.conn_info}"
info "Execute: #{exp_path}"
info "Properties: #{OmfEc.experiment.cmdline_properties}"
- ec_cert = OmfCommon.load_credentials(
- root_cert_dir: global_options[:root_cert_dir],
- entity_cert: global_options[:cert],
- entity_key: global_options[:key]
- )
+ if opts[:communication][:auth] && opts[:communication][:auth][:authenticate]
+ ec_cert = OmfCommon.load_credentials(
+ root_cert_dir: global_options[:root_cert_dir],
+ entity_cert: global_options[:cert],
+ entity_key: global_options[:key]
+ )
- ec_cert.resource_id = OmfCommon.comm.local_address
- OmfCommon::Auth::CertificateStore.instance.register(ec_cert)
+ ec_cert.resource_id = OmfCommon.comm.local_address
+ OmfCommon::Auth::CertificateStore.instance.register(ec_cert)
+ end
begin
include OmfEc::Backward::DefaultEvents
load exp_path
OmfEc::Experiment.start