E2Clab command-line interface

Getting help

You can also get all the following information by running the following command:

e2clab --help

E2Clab Command Line Interface

The commands allowed in E2Clab are presented below. Note that you can use just a single command to deploy your application deploy or you can deploy it separately using the commands layers-services, network, workflow (prepare, launch, or finalize), and finalize, respectively.

e2clab

Work with your e2clab experiment defined in SCENARIO_DIR and experiment artifacts in ARTIFACTS_DIR. You can also use environment variables like E2C_<OPTION_NAME> to set an option value e.g. E2C_DEBUG=true or E2C_SCENARIO_DIR=./ or define them in a .e2c_env file at the root of your experiment.

e2clab [OPTIONS] COMMAND [ARGS]...

Options

--version

Show the version and exit.

-d, --debug

Enable debug logging.

-e, --mute_enoslib

Mute EnOSlib logging.

-a, --mute_ansible

Mute Ansible spinning callback

--ansible_forks <ansible_forks>

Set Ansible forks level

Check the documentation at https://e2clab.gitlabpages.inria.fr/e2clab/ for more details

check-configuration

Checks configuration files syntax

e2clab check-configuration [OPTIONS] SCENARIO_DIR

Options

-c, --command <command>

Check the configuration files for the command you want to run,defaults to ‘deploy’

Options:

deploy | layers-services | network | workflow | finalize

-a, --app_conf

Check workflow_env.yaml syntax

Arguments

SCENARIO_DIR

Required argument

Environment variables

E2C_SCENARIO_DIR

Provide a default for SCENARIO_DIR

check-testbeds

Checks the connectivity to the various testbeds.

e2clab check-testbeds [OPTIONS]

deploy

Deploys scenarios or list of scenarios. When using ‘app_conf’, ‘prepare’ task from the workflow is only enforced once, independently from the ‘app_conf’ parameter

e2clab deploy [OPTIONS] SCENARIO_DIR ARTIFACTS_DIR

Options

--scenarios_name <scenarios_name>

Scenario names separated by comma.

--app_conf <app_conf>

Application configurations separated by comma.

--repeat <repeat>

Number of times to repeat the experiment.

--duration <duration>

Duration of each experiment in seconds.

--destroy

Run destroy after successful deploy

--destroy-on-fail

Run destroy if there is a workflow error

-p, --pause

Pause after launch step and duration completed, waiting for user input.

Arguments

SCENARIO_DIR

Required argument

ARTIFACTS_DIR

Required argument

Environment variables

E2C_SCENARIO_DIR

Provide a default for SCENARIO_DIR

E2C_ARTIFACTS_DIR

Provide a default for ARTIFACTS_DIR

destroy

Frees experiment testbed resources

e2clab destroy [OPTIONS] SCENARIO_DIR

Options

--network

To only destroy network emulation

Arguments

SCENARIO_DIR

Required argument

Environment variables

E2C_SCENARIO_DIR

Provide a default for SCENARIO_DIR

edit

Opens an editor for e2clab configuration files

e2clab edit [OPTIONS] SCENARIO_DIR

Arguments

SCENARIO_DIR

Required argument

Environment variables

E2C_SCENARIO_DIR

Provide a default for SCENARIO_DIR

finalize

Finalize workflow and backup experiment data

e2clab finalize [OPTIONS] SCENARIO_DIR

Options

--destroy

Run destroy after finalize

Arguments

SCENARIO_DIR

Required argument

Environment variables

E2C_SCENARIO_DIR

Provide a default for SCENARIO_DIR

get-output-dir

Get latest output dir path

e2clab get-output-dir [OPTIONS] SCENARIO_DIR

Arguments

SCENARIO_DIR

Required argument

Environment variables

E2C_SCENARIO_DIR

Provide a default for SCENARIO_DIR

init

Initialise DIR to easily use with e2clab by creating a .e2c_env

e2clab init [OPTIONS] [DIR]

Options

--scenario-dirname <scenario_dirname>
--artifacts-dirname <artifacts_dirname>
--workflow-env <workflow_env>

Setup a workflow_env.yaml file

Arguments

DIR

Optional argument

layers-services

Enforce Layers & Services in experiment environment

e2clab layers-services [OPTIONS] SCENARIO_DIR ARTIFACTS_DIR

Arguments

SCENARIO_DIR

Required argument

ARTIFACTS_DIR

Required argument

Environment variables

E2C_SCENARIO_DIR

Provide a default for SCENARIO_DIR

E2C_ARTIFACTS_DIR

Provide a default for ARTIFACTS_DIR

network

Enforce communication rules in experiment environment.

e2clab network [OPTIONS] SCENARIO_DIR

Arguments

SCENARIO_DIR

Required argument

Environment variables

E2C_SCENARIO_DIR

Provide a default for SCENARIO_DIR

services

Manage E2clab services

e2clab services [OPTIONS] COMMAND [ARGS]...
add

Add NEW_SERVICE_FILE to E2clab user-defined services.

e2clab services add [OPTIONS] NEW_SERVICE_FILE

Options

--copy, --link

Choose to use a copy of your e2clab service file or a symlink.

Arguments

NEW_SERVICE_FILE

Required argument

list

Get list of installed services.

e2clab services list [OPTIONS]
remove

Remove SERVICE_NAME service. See available services: e2clab services list

e2clab services remove [OPTIONS] SERVICE_NAME

Arguments

SERVICE_NAME

Required argument

ssh

Utility command to ssh to experiment’s remote host

e2clab ssh [OPTIONS] SCENARIO_DIR

Options

-f, --forward

ssh tunneling

-l, --local-port <local_port>

local port

-r, --remote-port <remote_port>

remote port

Arguments

SCENARIO_DIR

Required argument

Environment variables

E2C_SCENARIO_DIR

Provide a default for SCENARIO_DIR

workflow

Enforce Workflow in experiment environment

e2clab workflow [OPTIONS] SCENARIO_DIR {prepare|launch|finalize}

Options

--app_conf <app_conf>

Application configurations separated by comma.

--finalize

Automatically run finalize after launch

Arguments

SCENARIO_DIR

Required argument

TASK

Required argument

Environment variables

E2C_SCENARIO_DIR

Provide a default for SCENARIO_DIR

Enabling Tab Completion

As e2clab relies on the Click Python package it provides tab completion for Bash Zsh and Fish shells.

From the documentation, to enable tab completion you may follow the following procedure:

Save the script somewhere.

_E2CLAB_COMPLETE=bash_source e2clab > ~/.e2clab-complete.bash

Source the file in ~/.bashrc.

. ~/.e2clab-complete.bash