예제 #1
0
def make_conf(testing=True):
    kavlan = NetworkConfiguration(id="net",
                                  type="kavlan",
                                  roles=["network_interface"],
                                  site="nantes")
    prod_net = NetworkConfiguration(id="net_ext",
                                    type="prod",
                                    roles=["neutron_external_interface"],
                                    site="nantes")

    os = MachineConfiguration(roles=["OpenStack"],
                              cluster="ecotype",
                              nodes=10 if testing else 15,
                              primary_network=kavlan,
                              secondary_networks=[prod_net])

    conf = None
    if testing:
        os.cluster = "paravance"
        kavlan.site = "rennes"
        prod_net.site = "rennes"
        conf = (
            Configuration.from_settings(
                walltime="5:00:00",
                job_name="os-imt-aio-test",
                env_name="ubuntu1804-x64-min",
                # You can specify a jobid with
                # oargrid_jobids=[["nantes", "189621"]]
            ).add_network_conf(kavlan).add_network_conf(prod_net).add_machine(
                **os.__dict__))
    else:
        conf = (Configuration.from_settings(
            reservation="2020-02-03 12:00:01",
            walltime="59:59:58",
            job_name="os-imt-aio",
            env_name="ubuntu1804-x64-min").add_network_conf(
                prod_net).add_machine(**os.__dict__))

    conf.finalize()
    return conf
예제 #2
0
## Experiment on a small unbalanced tree of working-boxes with small
## parameters. Boxes get more possibility to distribute objectives to
## other boxes and keep the ones with lowest variance. In turns, there
## is a trade-off between accuracy and fairness. Here, the fairness
## factor is 0.2 .





CLUSTER = "econome"
SITE = "nantes"

conf = Configuration.from_settings(job_type='allow_classic_ssh',
                                   job_name=f'working-boxes {__file__}',
                                   walltime='02:00:00')
network = NetworkConfiguration(id='n1',
                               type='prod',
                               roles=['my_network'],
                               site=SITE)
conf.add_network_conf(network)\
    .add_machine(roles=['collector', 'front', 'working'],
                 cluster=CLUSTER,
                 nodes=1,
                 primary_network=network)\
    .finalize()
                 


SEED = 5
예제 #3
0
from pathlib import Path

from utils import _get_address
from box import Box
from boxes import Boxes, BoxesType

## Experiment on a small unbalanced tree of working-boxes with small
## parameters. Some boxes are voluntarily stopped at given time. We
## still expect a convergence, for boxes are independent. Crash of
## ones do not impact the well-functioning of others.

CLUSTER = "econome"
SITE = "nantes"

conf = Configuration.from_settings(job_type='allow_classic_ssh',
                                   job_name='working-boxes failures_3',
                                   walltime='02:00:00')
network = NetworkConfiguration(id='n1',
                               type='prod',
                               roles=['my_network'],
                               site=SITE)
conf.add_network_conf(network)\
    .add_machine(roles=['collector', 'front', 'working'],
                 cluster=CLUSTER,
                 nodes=1,
                 primary_network=network)\
    .finalize()

SEED = 6
NB_QUERY = 1500
NB_CRASHES = 3
예제 #4
0
                                                  NetworkConfiguration)

import logging

logging.basicConfig(level=logging.DEBUG)

network = NetworkConfiguration(id="n1",
                               type="kavlan",
                               roles=["mynetwork"],
                               site="rennes")
conf = Configuration.from_settings(job_name="flent_on",
                                  env_name="debian9-x64-std")\
                    .add_network_conf(network)\
                    .add_machine(roles=["server"],
                                 cluster="parapluie",
                                 nodes=1,
                                 primary_network=network)\
                    .add_machine(roles=["client"],
                                 cluster="parapluie",
                                 nodes=1,
                                 primary_network=network)\
                    .finalize()

provider = G5k(conf)
roles, networks = provider.init()
discover_networks(roles, networks)
with play_on("all", roles=roles) as p:
    # flent requires python3, so we default python to python3
    p.shell(
        "update-alternatives --install /usr/bin/python python /usr/bin/python3 1"
    )
    p.apt_repository(
예제 #5
0
 Configuration.from_settings(
     job_type="allow_classic_ssh",
     job_name="QTestJob",
     walltime='2:00:00'
     #env_name="/grid5000/images/debian9-x64-base-2020032721.tgz"
 )
 #.add_network_conf(network_rennes)
 #.add_network_conf(network_nantes)
 #.add_network_conf(network_sophia)
 .add_network_conf(network_luxembourg)
 #.add_network_conf(network_grenoble)
 #.add_network_conf(network_nancy)
 #.add_network_conf(network_lyon)
 #.add_network_conf(network_lille)
 # .add_machine(
 #     roles=["control"],
 #     cluster="paravance",
 #     nodes=1,
 #     primary_network=network_rennes
 # )
 # .add_machine(
 #     roles=["control"],
 #     cluster="econome",
 #     nodes=2,
 #     primary_network=network_nantes
 # )
 # .add_machine(
 #     roles=["control"],
 #     cluster="uvb",
 #     nodes=2,
 #     primary_network=network_sophia
 # )
 .add_machine(roles=["control"],
              cluster="petitprince",
              nodes=4,
              primary_network=network_luxembourg)
 # .add_machine(
 #     roles=["control"],
 #     cluster="dahu",
 #     nodes=2,
 #     primary_network=network_grenoble
 # )
 # .add_machine(
 #     roles=["control"],
 #     cluster="gros",
 #     nodes=2,
 #     primary_network=network_nancy
 # )
 # .add_machine(
 #     roles=["control"],
 #     cluster="nova",
 #     #cluster="taurus",
 #     nodes=2,
 #     primary_network=network_lyon
 # )
 # .add_machine(
 #     roles=["control"],
 #     cluster="chiclet",
 #     nodes=2,
 #     primary_network=network_lille
 # )
 .finalize())
예제 #6
0
# path to the inventory
inventory = os.path.join(os.getcwd(), "hosts")

# claim the resources
network = NetworkConfiguration(id="n1",
                               type="kavlan",
                               roles=["my_network"],
                               site="rennes")

conf = Configuration.from_settings(job_name="test-enoslib")\
    .add_network_conf(network)\
    .add_machine(roles=["control"],
                 cluster="paravance",
                 nodes=1,
                 primary_network=network)\
    .add_machine(roles=["control", "compute"],
                 cluster="paravance",
                 nodes=1,
                 primary_network=network)\
    .finalize()

provider = G5k(conf)
roles, networks = provider.init()

# generate an inventory compatible with ansible
generate_inventory(roles, networks, inventory, check_networks=True)

# destroy the reservation
provider.destroy()
from enoslib.api import generate_inventory
from enoslib.infra.enos_g5k.provider import G5k
from enoslib.infra.enos_g5k.configuration import (Configuration,
                                                  NetworkConfiguration)

import logging
import os

logging.basicConfig(level=logging.INFO)

# path to the inventory
inventory = os.path.join(os.getcwd(), "hosts")

# claim the resources
conf = Configuration.from_settings(job_type="allow_classic_ssh")
prod_network = NetworkConfiguration(id="n1",
                                    type="prod",
                                    roles=["my_network"],
                                    site="rennes")
conf.add_network_conf(prod_network)\
    .add_network(id="not_linked_to_any_machine",
                 type="slash_22",
                 roles=["my_subnet"],
                 site="rennes")\
    .add_machine(roles=["control"],
                 cluster="parapluie",
                 nodes=1,
                 primary_network=prod_network)\
    .finalize()

provider = G5k(conf)
from enoslib.api import generate_inventory
from enoslib.infra.enos_g5k.provider import G5k
from enoslib.infra.enos_g5k.configuration import (Configuration,
                                                  NetworkConfiguration)

import logging
import os

logging.basicConfig(level=logging.INFO)

# path to the inventory
inventory = os.path.join(os.getcwd(), "hosts")

# claim the resources
conf = Configuration.from_settings(job_type="allow_classic_ssh",
                                   job_name="test-non-deploy")
network = NetworkConfiguration(id="n1",
                               type="prod",
                               roles=["my_network"],
                               site="rennes")
conf.add_network_conf(network)\
    .add_machine(roles=["control"],
                 cluster="parapluie",
                 nodes=1,
                 primary_network=network)\
    .add_machine(roles=["control", "network"],
                 cluster="parapluie",
                 nodes=1,
                 primary_network=network)\
    .finalize()
provider = G5k(conf)
예제 #9
0
# path to the inventory
inventory = os.path.join(os.getcwd(), "hosts")

# claim the resources
network = NetworkConfiguration(id="n1",
                               type="prod",
                               roles=["my_network"],
                               site="rennes")

force_deploy = True if os.environ.get("G5K_FORCE") else False

conf = Configuration.from_settings(job_name="Miguel_test",
                                   env_name="debian9-x64-std",
                                   force_deploy=force_deploy,
                                   walltime="02:00:00")\
    .add_network_conf(network)\
    .add_machine(roles=["control"],
                 cluster="parasilo",
                 nodes=1,
                 primary_network=network)\
    .finalize()

provider = G5k(conf)
roles, network = provider.init()

VAGRANT_URL = "https://releases.hashicorp.com/vagrant/2.0.3/vagrant_2.0.3_x86_64.deb"
VBOX_URL = "https://download.virtualbox.org/virtualbox/5.2.10/virtualbox-5.2_5.2.10-122088~Debian~stretch_amd64.deb"

with play_on("all", roles=roles) as p:
    p.shell(
        "update-alternatives --install /usr/bin/python python /usr/bin/python3 1"
    )
예제 #10
0
    with EVENT_DATABASE_PATH.open('r') as f:
        event_db = json.load(f.read())
        logging.info(f"Loading event database from local file…")
else:
    logging.info(f"Event database not found locally, initialize one…")

cs = get_all_clusters_sites()

for cluster in CLUSTERS:
    if cluster not in cs:
        raise Exception(
            f'Cluster {cluster} was not found in list of clusters…')

    ## parallel callibration of clusters
    conf = Configuration.from_settings(
        job_type='allow_classic_ssh',
        job_name=f'calibrate energy-service at {cluster}',
        walltime='01:00:00')
    ## (TODO) check the default available network at each site
    network = NetworkConfiguration(id='n1',
                                   type='prod',
                                   roles=['my_network'],
                                   site=cs[cluster])

    conf.add_network_conf(network)\
        .add_machine(roles=['calibrate'],
                     cluster=cluster,
                     nodes=1, ## we deploy everything on 1 machine
                     primary_network=network)\
        .finalize()

    provider = G5k(conf)
예제 #11
0
from enoslib.infra.enos_g5k.configuration import (Configuration,
                                                  NetworkConfiguration)
from enoslib.service import Locust

from energy import Energy

import logging
logging.basicConfig(level=logging.DEBUG)

CLUSTER1 = "econome"
CLUSTER2 = "ecotype"
SITE = "nantes"

# claim the resources
conf = Configuration.from_settings(job_type='allow_classic_ssh',
                                   job_name='energy-service',
                                   walltime='01:00:00')
network = NetworkConfiguration(id='n1',
                               type='prod',
                               roles=['my_network'],
                               site=SITE)
conf.add_network_conf(network)\
    .add_machine(roles=['control'],
                 cluster=CLUSTER1,
                 nodes=1,
                 primary_network=network)\
    .add_machine(roles=['compute'],
                 cluster=CLUSTER1,
                 nodes=1,
                 primary_network=network)\
    .finalize()
        ip = ['10'] + [str(int(i, 2)) for i in mac.bits().split('-')[-3:]]
        yield str(mac).replace('-', ':'), '.'.join(ip)


# claim the resources
prod = NetworkConfiguration(id="n1",
                            type="prod",
                            roles=["my_network"],
                            site="rennes")
conf = Configuration.from_settings(job_type="allow_classic_ssh",
                                   job_name="enoslib-virt",
                                   walltime="01:00:00")\
                    .add_network_conf(prod)\
                    .add_network(id="_subnet_network",
                                 type="slash_22",
                                 roles=["my_subnet"],
                                 site="rennes")\
                    .add_machine(roles=["compute"],
                                 cluster="parasilo",
                                 nodes=PMS,
                                 primary_network=prod)\
                    .finalize()

provider = G5k(conf)
roles, networks = provider.init()

# path to the inventory
inventory = os.path.join(os.getcwd(), "hosts")

# generate an inventory compatible with ansible
generate_inventory(roles, networks, inventory, check_networks=True)