-
Notifications
You must be signed in to change notification settings - Fork 15
How To Specify RSpecs
There are several ways to specify a resource specification (RSpec) in the createsliver
command in
omni:
omni.py -a myaggregate createsliver myslice <RSpec>
Omni will try to read <RSpec>
by interpreting it in the following order:
- a URL or a file on the local filesystem
- (starting in omni 2.4) a fully specified RSpec Nickname listed in the omni_config
- (starting in omni 2.4) a file in a default location (file or url) defined as:
<default_rspec_location>/<RSpec>.<default_rspec_extension>
All modern versions of omni allow users to specify RSpecs using a full path to a file or a url.
For example, running the following command will reserve resources for the Hello GENI example.
omni.py -a ig-gpo createsliver myslice https://raw.githubusercontent.com/GENI-NSF/geni-tutorials/master/HelloGENI/hellogeni.rspec
Starting in omni 2.4, RSpec nicknames are allowed as well.
RSpec nicknames are a short string specified in the omni_config
file that substitute
for the full url or file location of an RSpec file. RSpec nicknames are similar to
Aggregate nicknames.
Available RSpec Nicknames can be determined by using the output of:
omni.py nicknames
Starting in omni 2.4, users who generate their omni_config
using omni-configure.py
will get the following default [rspec_nicknames]
section. In addition, this text is included in the omni_config.sample
.
#------RSpec nicknames
# When you call
# omni.py -a myaggregate createsliver myslice myrspec
# omni will try to read 'myrspec' by interpreting it in the following order:
# 1. a URL or a file on the local filesystem
# 2. a nickname specified in the omni_config
# 3. a file in a location (file or url) defined as:
# <default_rspec_server>/<rspec_nickname>.<default_rspec_extension>
[rspec_nicknames]
# Format :
# Nickname= [location of RSpec file]
# myawesometopology = ~/.gcf/rspecs/myrspecfile.rspec
hellogeni = https://raw.githubusercontent.com/GENI-NSF/geni-tutorials/master/HelloGENI/hellogeni.rspec
default_rspec_location = https://raw.githubusercontent.com/GENI-NSF/geni-tutorials/master
default_rspec_extension = rspec
The [rspec_nicknames]
section allows users to specify their own RSpec nicknames and also to specify a default location to store a large number of RSpecs.
Fully Specified RSpec Nicknames allow users to specify a nickname and a corresponding URL (or path to a file) in their omni_config
file.
For example, using the default omni_config
,
the user could run the Hello GENI example using the following command:
omni.py -a ig-gpo createsliver hellogeni
Omni will first look for a file named hellogeni
. When omni does not find that file, it will lookup hellogeni
in the omni_config
and expand it to
https://raw.githubusercontent.com/GENI-NSF/geni-tutorials/master/HelloGENI/hellogeni.rspec
.
Moreover, users can now specify a default webserver (or directory on their local machine) and a default file extension. If an unknown nickname is used, omni.py
will look for a file with that name in the specified default location.
Again, using the default omni_config
,
the user could do the Hello GENI example using the command:
omni.py -a ig-gpo createsliver HelloGENI/hellogeni
Omni will first look for a file named HelloGENI/hellogeni
. When omni does not find that file, it will lookup HelloGENI/hellogeni
in the omni_config
and also not find it.
Finally, omni will look in the default location. Here the nickname HelloGENI/hellogeni
will cause omni to look for a file:
https://raw.githubusercontent.com/GENI-NSF/geni-tutorials/master/HelloGENI/hellogeni.rspec
This filename is determined using the following formula:
`<default_rspec_location>/HelloGENI/hellogeni.<default_rspec_extension>`
= `https://raw.githubusercontent.com/GENI-NSF/geni-tutorials/master` + `/HelloGENI/hellogeni.` + `rspec`
GENI is sponsored by the National Science Foundation.