Exemple #1
0
from enoslib.api import discover_networks, play_on
from enoslib.infra.enos_vmong5k.provider import VMonG5k
from enoslib.infra.enos_vmong5k.configuration import Configuration

import logging

logging.basicConfig(level=logging.DEBUG)

conf = Configuration.from_settings(job_name="flent_on",
                                   image="/grid5000/virt-images/debian9-x64-std-2019040916.qcow2",
                                   gateway="access.grid5000.fr",
                                   gateway_user="******")\
                    .add_machine(roles=["server"],
                                 cluster="grisou",
                                 number=1)\
                    .add_machine(roles=["client"],
                                 cluster="grisou",
                                 number=1)\
                    .finalize()

provider = VMonG5k(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(
        repo="deb http://deb.debian.org/debian stretch main contrib non-free",
Exemple #2
0
from enoslib.api import discover_networks
from enoslib.infra.enos_vmong5k.provider import VMonG5k
from enoslib.infra.enos_vmong5k.configuration import Configuration

import logging
import os

logging.basicConfig(level=logging.DEBUG)

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

# claim the resources
conf = Configuration.from_settings(job_name="tuto-vmong5k",
                                   image="/grid5000/virt-images/debian9-x64-nfs-2019040916.qcow2")\
    .add_machine(roles=["compute"],
                 cluster="grisou",
                 number=100,
                 flavour="tiny")\
    .add_machine(roles=["controller"],
                 cluster="grisou",
                 number=3,
                 flavour="tiny")\
    .finalize()
provider = VMonG5k(conf)

roles, networks = provider.init()
print(roles)
print(networks)
Exemple #3
0
from enoslib.infra.enos_vmong5k.provider import VMonG5k
from enoslib.infra.enos_vmong5k.configuration import Configuration

import logging
import os

logging.basicConfig(level=logging.DEBUG)

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

# claim the resources
conf = Configuration.from_settings(job_name="tuto-vmong5k")\
    .add_machine(roles=["compute"],
                 cluster="grisou",
                 number=100,
                 flavour="tiny")\
    .add_machine(roles=["controller"],
                 cluster="grisou",
                 number=100,
                 flavour="tiny")\
    .finalize()
provider = VMonG5k(conf)

roles, networks = provider.init()
print(roles)
print(networks)
    "paris": {
        "paris": 0.3,
        "strasbourg": 12,
        "edimburgh": 13
    },
    "strasbourg": {
        "strasbourg": 0.3,
        "edimburgh": 30
    },
    "edimburgh": {
        "edimburgh": 0.3
    }
}

# Building the configuration
conf = Configuration.from_settings(job_name="tuto-vmong5k-netem",
                                   image="/grid5000/virt-images/debian9-x64-base-2019040916.qcow2")
cities = list(CITIES.keys())
for city in cities:
    conf.add_machine(roles=[city],
                     cluster="paravance",
                     number=1,
                     flavour="tiny")
conf.finalize()

# Starting the machnes
provider = VMonG5k(conf)
roles, networks = provider.init()

# Building the network constraints
emulation_conf = {
    "enable": True,
from enoslib.infra.enos_vmong5k.provider import VMonG5k
from enoslib.infra.enos_vmong5k.configuration import Configuration

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_name="tuto-vmong5k")\
    .add_machine(roles=["control"],
                 cluster="parapluie",
                 number=3,
                 flavour="large")\
    .add_machine(roles=["compute"],
                 cluster="parapluie",
                 number=100,
                 flavour="tiny")\
    .finalize()
provider = VMonG5k(conf)

roles, networks = provider.init()
print(roles)
print(networks)
Exemple #6
0
master_nodes = []

duration = "04:00:00"


for i in range(0, len(clusters)):

    name_job = name + clusters[i] + str(i)

    role_name = "cluster" + str(clusters[i])
    
    conf = Configuration.from_settings(job_name=name_job,
                                       walltime=duration,
                                       image="/grid5000/virt-images/debian9-x64-base.qcow2")\
                        .add_machine(roles=[role_name],
                                     cluster=clusters[i],
                                     flavour_desc={"core": 2, "mem": 4096},
                                     number=6)\
                        .finalize()
    provider = VMonG5k(conf)

    roles, networks = provider.init()
    roles = discover_networks(roles, networks)

    inventory_file = "kubefed_inventory_cluster" + str(i) + ".ini" 

    inventory = generate_inventory(roles, networks, inventory_file)

    master_nodes.append(roles[role_name][0].address)

    # Make sure k8s is not already running
        "strasbourg": 12,
        "edimburgh": 13
    },
    "strasbourg": {
        "strasbourg": 0.3,
        "edimburgh": 30
    },
    "edimburgh": {
        "edimburgh": 0.3
    }
}

# Building the configuration
conf = Configuration.from_settings(
    job_name="tuto-vmong5k-netem",
    image="/grid5000/virt-images/debian9-x64-base-2019040916.qcow2",
    gateway="access.grid5000.fr",
    gateway_user="******")
cities = list(CITIES.keys())
for city in cities:
    conf.add_machine(roles=[city],
                     cluster="parasilo",
                     number=1,
                     flavour="tiny")
conf.finalize()

# Starting the machnes
provider = VMonG5k(conf)
roles, networks = provider.init()

# Building the network constraints