Skip to content

Commit

Permalink
Merge pull request #58 from grycap/devel
Browse files Browse the repository at this point in the history
Devel
  • Loading branch information
micafer committed Oct 16, 2018
2 parents 0e93163 + 53e177a commit 21ef979
Show file tree
Hide file tree
Showing 6 changed files with 580 additions and 30 deletions.
4 changes: 2 additions & 2 deletions IM2/radl/radl_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,8 +416,8 @@ def d_contextualize_sentence(a, enter, margin, indent):

def d_contextualize_item(a, enter, margin, indent):
assert isinstance(a, contextualize_item)
return "{margin}system {sys} configure {conf} step {num}".format(
margin=margin, sys=a.system, conf=a.configure, num=" %d" % a.num if a.num else "")
return "{margin}system {sys} configure {conf}{num}".format(
margin=margin, sys=a.system, conf=a.configure, num=" step %d" % a.num if a.num else "")

def d_cfeatures_sentence(a, enter, margin, indent):
assert isinstance(a, Features)
Expand Down
7 changes: 5 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ This introduces a cost-efficient approach for Cluster-based computing.
Installation
------------

The program `ec3` requires Python 2.6+, `PLY`_, `PyYAML`_ and an `IM`_ server, which is used to
The program `ec3` requires Python 2.6+, `PLY`_, `PyYAML`_, `Requests`_ and an `IM`_ server, which is used to
launch virtual machines. By default `ec3` uses our public `IM`_ server in
`servproject.i3m.upv.es`. *Optionally* you can deploy a local `IM`_ server. See
`IM documentation <http://imdocs.readthedocs.io/en/latest/manual.html>`_ for more information.

`PyYAML`_ and `PLY`_ are usually available in distribution repositories (``python-yaml``, ``python-ply`` in Debian; ``PyYAML``, ``python-ply`` in Red Hat; and ``PyYAML``, ``PLY`` in pip).
`PyYAML`_, `PLY`_ and `Requests`_ are usually available in distribution repositories (``python-yaml``,
``python-ply``, ``python-requests`` in Debian; ``PyYAML``, ``python-ply``, ``python-requests`` in Red Hat;
and ``PyYAML``, ``PLY``, ``requests`` in pip).

`ec3` can be download from `this <https://github.com/grycap/ec3>`_ git repository::

Expand Down Expand Up @@ -143,6 +145,7 @@ Additional information
.. _`IM`: https://github.com/grycap/im
.. _`PyYAML`: http://pyyaml.org/wiki/PyYAML
.. _`PLY`: http://www.dabeaz.com/ply/
.. _`Requests`: http://docs.python-requests.org/
.. _`EC3 Command-line Interface`: http://ec3.readthedocs.org/en/devel/ec3.html
.. _`Command templates`: http://ec3.readthedocs.org/en/devel/ec3.html#command-templates
.. _`Authorization file`: http://ec3.readthedocs.org/en/devel/ec3.html#authorization-file
Expand Down
16 changes: 9 additions & 7 deletions ec3
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def apply_ec3_expressions(r):
def rm_ec3_prio(t):
t[1].pop("ec3_prio", None); return t[1]
for conf in recipes_prio:
conf.recipe = map(rm_ec3_prio, sorted([ (d.get("ec3_prio", i), d) for i, d in enumerate(conf.recipe) ]))
conf.recipe = list(map(rm_ec3_prio, sorted([ (d.get("ec3_prio", i), d) for i, d in enumerate(conf.recipe) ])))
def sanitize(cad):
return cad.replace("{", "\\x7b").replace("}", "\\x7d")
#return cad.replace("\\", "\\\\").replace("{", "\\x7b").replace("}", "\\x7d")
Expand Down Expand Up @@ -337,8 +337,8 @@ class Display:
'\033[1;32m _____ \033[m']
# Make worm fatter
if sys.stdout.encoding == "UTF-8":
ANIMATION = map(lambda s: s.replace("_", "▄").replace("/", "▟").replace("\\", "▙")
.replace('"', '¨'), ANIMATION)
ANIMATION = list(map(lambda s: s.replace("_", "▄").replace("/", "▟").replace("\\", "▙")
.replace('"', '¨'), ANIMATION))

@staticmethod
def _display_waiting_tty(msg, delay=0.):
Expand Down Expand Up @@ -593,6 +593,7 @@ class CLI:
parser.add_argument("-ll", "--log-level", dest="log_level", nargs=1, type=int, default=[5], help="log level. 1: debug; 2: info; 3: warning; 4: error")
parser.add_argument("-q", "--quiet", action="store_true", dest="quiet", default=False, help="only print messages from front-end")
subparsers = parser.add_subparsers(title="subcommands", description="valid subcommands", help="additional help")
parser.set_defaults(func=None)
for cmd in commands:
cmd.parse(subparsers)
CLI.options = parser.parse_args()
Expand All @@ -603,7 +604,8 @@ class CLI:
CLI.logger = logging.getLogger('ec3')

# Run command
CLI.options.func(CLI.options)
if CLI.options.func:
CLI.options.func(CLI.options)

@staticmethod
def display(msg, alt=None, level=logging.INFO, exception=False):
Expand Down Expand Up @@ -663,7 +665,7 @@ class CmdLaunch:
if not options.restapi: raise Exception("option is not set")
if not options.dry_run and options.restapi[0].startswith("http:") and not options.restapi[0].startswith("http://localhost"):
CLI.display("WARNING: you are not using a secure connection and this can compromise the secrecy of the passwords and private keys available in the authorization file.")
if not options.yes and raw_input("Continue [y/N]? ")[0:1].lower() != "y":
if not options.yes and input("Continue [y/N]? ")[0:1].lower() != "y":
sys.exit(1)
except Exception as e:
CLI.display("Error in -u/--restapi-url: %s" % str(e), level=logging.ERROR)
Expand Down Expand Up @@ -1066,7 +1068,7 @@ class CmdDestroy:
try:
r = ClusterStore.load(options.clustername)
CLI.display("WARNING: you are going to delete the infrastructure (including frontend and nodes).")
if not options.yes and raw_input("Continue [y/N]? ")[0:1].lower() != "y":
if not options.yes and input("Continue [y/N]? ")[0:1].lower() != "y":
sys.exit(1)
new_im_server_url, infrId, _, auth = ClusterStore.get_im_server_infrId_and_vmId_and_auth(r)
if options.auth_file:
Expand Down Expand Up @@ -1639,7 +1641,7 @@ class CmdStop:
try:
r = ClusterStore.load(options.clustername)
CLI.display("WARNING: you are going to stop the infrastructure (including frontend and nodes).")
if not options.yes and raw_input("Continue [y/N]? ")[0:1].lower() != "y":
if not options.yes and input("Continue [y/N]? ")[0:1].lower() != "y":
sys.exit(1)
cluster_im_server_url, infrId, _, auth = ClusterStore.get_im_server_infrId_and_vmId_and_auth(r)

Expand Down
1 change: 1 addition & 0 deletions ec3.py
38 changes: 19 additions & 19 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,28 @@
# Add contextualization dir files
install_path = '/etc/ec3/'
datafiles = [(os.path.join(install_path, root), [os.path.join(root, f) for f in files])
for root, dirs, files in os.walk("templates")]

# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
# string in below ...
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
for root, dirs, files in os.walk("templates")]

setup(
name = "ec3",
version = "0.0.1",
author = "Amanda Calatrava, Eloy Romero, Miguel Caballer",
author_email = "",
description = ("Tool to deploy virtual elastic clusters on the cloud."),
license = "Apache 2.0",
keywords = "cloud cluster elasticity",
url = "http://www.grycap.upv.es/ec3/",
data_files=datafiles,
name="ec3",
version="2.0.0",
author="Amanda Calatrava, Eloy Romero, Miguel Caballer",
author_email="",
description=("Tool to deploy virtual elastic clusters on the cloud."),
license="Apache 2.0",
keywords="cloud cluster elasticity",
url="http://www.grycap.upv.es/ec3/",
data_files=datafiles,
packages=['IM2', 'IM2.radl'],
package_data={'IM2.radl': ['radl_schema.json']},
scripts=["ec3"],
install_requires=["ply","PyYAML","jsonschema"],
long_description=read('README.rst'),
install_requires=["ply", "PyYAML", "jsonschema", "requests"],
long_description=("Elastic Cloud Computing Cluster (EC3) is a tool to create elastic virtual clusters on top"
"of Infrastructure as a Service (IaaS) providers, either public (such as Amazon Web Services,"
"Google Cloud or Microsoft Azure)"
"or on-premises (such as OpenNebula and OpenStack). We offer recipes to deploy TORQUE"
"(optionally with MAUI), SLURM, SGE, HTCondor, Mesos, Nomad and Kubernetes clusters that can be self-managed with CLUES:"
"it starts with a single-node cluster and working nodes will be dynamically deployed and provisioned"
"to fit increasing load (number of jobs at the LRMS). Working nodes will be undeployed when they are idle."
"This introduces a cost-efficient approach for Cluster-based computing."),
)
Loading

0 comments on commit 21ef979

Please sign in to comment.