Skip to content
ewcloudPublic

About

European Weather Cloud (EWC) Command Line Interface (CLI) to interact with EWC services

Resources

Code of conduct

Contributing

Stars

4 stars

Watchers

0 watching

Forks

Repository files navigation


Logo

ewccli

European Weather Cloud Command Line Interface
Watch Demo · Report Bugs · Request Features · Get Support

Table of Contents
  1. Introduction
  2. Prerequisites
  3. Installing
  4. Getting started
  5. Login to prepare the environment
  6. List Items in the catalog
  7. Deploy Items from the catalog
  8. Command-line flags and override precedence
  9. External IP override fix (issue 220)
  10. Test Items unreleased or from private sources
  11. Backends
  12. SW Bill of Materials
  13. Changelog
  14. Contributing
  15. Development
  16. Code Styling
  17. Code Unittesting
  18. Coverage Reporting
  19. Documenting
  20. Releasing to Package Registries
  21. Copyright and License
  22. Authors

Introduction

The ewccli is the European Weather Cloud (EWC) Command Line Interface (CLI). This tool is developed to support EWC users on the use of the EWC services.

Prerequisites

  • You will need a python environment to run the library implementation of this code. Python version 3.10 or higher.
  • git installed on your operating system. (usually is available to most OS nowadays)

Openstack inputs

You can use the following link to obtain:

  • Applications Credentials (ID and secret)

Installing

We recommend installing ewccli inside a virtual environment to avoid dependency conflicts with system packages.

Installing with PIP from PyPI

The EWC CLI Python package is available through PyPI:

pip install ewccli

Installing with conda from conda-forge

Available since version 0.9.1

The EWC CLI Python package is available through conda-forge:

conda install conda-forge::ewccli

Installing from source

  1. Clone this repository and move into it
git clone THIS_REPO && cd ewccli
  1. Create a virtual environment with python version >= 3.10
python3 -m venv ewcclienv
  1. Activate the virtual environment
source ./ewcclienv/bin/activate
  1. Upgrade pip
pip install --upgrade pip
  1. Install the package
pip install -e .

Installing in a container

If Docker is your preferred containerization tool, you can replace podman with docker in the commands below.

You may also run in an completely isolated environment using containerization. After cloning the repository and cd into it.

  1. Clone this repository and move into it
git clone THIS_REPO && cd ewccli
  1. Create a wheel package (./dist/ewccli-<version>-py3-none-any.whl)
pip install -q build
python3 -m build
  1. Build an image including the package previously created
podman build --no-cache -t ewccli -f ./Containerfile .
  1. Start a container with an interactive shell
podman run -it --rm  --workdir /home/ewccli --entrypoint /bin/bash ewccli

Getting started

Then run ewc to verify everything works:

ewccli-default

If you get a WARNING like WARNING: The script ewc is installed in '~/.local/bin' which is not on PATH. Add the following to your profile configuration file:

echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.profile

Login to prepare the environment

ewc login

IMPORTANT:

  • For credentials and profile settings, EWC CLI uses the following order of importance:
    • env variables (for example OS_APPLICATION_CREDENTIAL_ID / OS_APPLICATION_CREDENTIAL_SECRET)
    • CLI config (the saved profile under ~/.ewccli/profiles)
    • any other config (e.g. OpenStack clouds.yaml or Kubernetes kubeconfig file)
  • For deployment flags and item settings, the precedence is different: explicit command-line flags win over environment variables, which win over catalog values. See Override precedence.

All your profiles are saved under ~/.ewccli/profiles

You can manually add profiles in the same file and the ewccli can use them already.

Info required for a profile:

[my-profile]
federee = EUMETSAT or ECMWF
region = CCI1 or CCI2 or ECIS-R1 or ECIS-R2
tenant_name = eumetsat-ewc-communityhub
application_credential_id =
application_credential_secret =
ssh_public_key_path =
ssh_private_key_path =

List Items in the catalog

The following command shows the current available Items. Official Items are listed here.

ewc hub list

ewccli-hub-list

Deploy Items from the catalog

ewccli-hub-deploy

ewc hub deploy ITEM

where ITEM is taken from ewc hub list command under Item column.

Command-line flags and override precedence

Every command supports -h / --help. For the authoritative and up-to-date list of options, run:

ewc hub deploy --help
ewc infra create --help

Most flags also have an equivalent EWC_CLI_* environment variable, which is useful in CI jobs and scripts.

Common flags

Flag Environment variable Applies to What it does
--server-name EWC_CLI_SERVER_NAME hub deploy Name of the target VM (defaults to the item name).
--profile EWC_CLI_LOGIN_PROFILE hub deploy, infra Selects a saved profile from ~/.ewccli/profiles. For infra, put it before the subcommand: ewc infra --profile NAME create ....
--item-inputs, -iu EWC_CLI_ITEM_INPUTS hub deploy Supplies item inputs as key=value; can be repeated. Lists/dicts use YAML syntax.
--image-name, -ig EWC_CLI_OPENSTACK_IMAGE_NAME hub deploy, infra create Overrides the catalog values.osImageName, or selects the OpenStack image for plain VMs.
--flavour-name, -fr EWC_CLI_OPENSTACK_FLAVOUR_NAME hub deploy, infra create Overrides the catalog values.osFlavorName (or the federee/region default).
--external-ip / --no-external-ip EWC_CLI_EXTERNAL_IP hub deploy, infra create Enables or explicitly disables a public floating IP. Overrides ewccli.externalIP from the catalog (see issue 220).
--networks, -n EWC_CLI_OPENSTACK_NETWORKS hub deploy, infra create Selects OpenStack networks.
--security-groups, -sg EWC_CLI_OPENSTACK_SECURITY_GROUPS hub deploy, infra create Overrides the catalog values.osSecurityGroups.
--keypair-name, -kp EWC_CLI_OPENSTACK_KEYPAIR_NAME hub deploy, infra create Selects the OpenStack keypair (default: <user>-ewccli-keypair).
--root-volume — hub deploy, infra create Root disk size in GB when boot-from-volume is enabled (default: 50).
--extra-volume — hub deploy, infra create Attaches an additional disk of the given size in GB; can be repeated.
--dry-run EWC_CLI_DRY_RUN hub deploy, infra create Simulates the operation without making changes in the cloud.
--force EWC_CLI_FORCE hub deploy, infra create Forces refresh/recreation of resources such as the cloned item sources.
--path-to-catalog EWC_CLI_PATH_TO_CATALOGUE hub (group) Uses a custom catalog file. It must be placed before list, show or deploy.

Notes on multi-value flags:

  • On the command line, repeat the flag: --security-groups default --security-groups ssh.
  • In environment variables, use comma-separated values: EWC_CLI_OPENSTACK_SECURITY_GROUPS=default,ssh.

Override precedence

For hub deploy, settings are resolved in this order, highest priority first:

  1. Flags you pass explicitly, for example --flavour-name or --external-ip.
  2. Matching EWC_CLI_* environment variables.
  3. Item metadata in the catalog (values.* and ewccli.*).
  4. EWC CLI built-in defaults (for example, a 50 GB root volume and the <user>-ewccli-keypair keypair).

What this means in practice:

  • Either --external-ip or --no-external-ip always overrides ewccli.externalIP in the catalog. If you pass neither, the catalog value is used; if the catalog does not define the key, no public IP is requested.
  • --flavour-name, --image-name and --security-groups override the corresponding values.osFlavorName, values.osImageName and values.osSecurityGroups catalog values. A warning panel is shown when your choice differs from the flavour, security groups or external IP recommended by the item.
  • Values supplied with --item-inputs override the defaults declared in values.inputSpec. Inputs without a default must be supplied by the user.
  • For infra create there is no catalog, so an unspecified external IP flag means no public IP.
  • Credentials follow the separate rules described in Login to prepare the environment: OS_APPLICATION_CREDENTIAL_* variables and clouds.yaml can take precedence over values given to ewc login.

Examples

Deploy an item with the defaults recommended by the catalog:

ewc hub deploy ecmwf-data-flavour
ewc hub deploy ecmwf-data-flavour --profile my-profile --server-name TOTO

Override the catalog recommendation for the public IP (this is the behavior fixed on the fix-floating-ip branch):

# The catalog may say externalIP: false; this still requests a floating IP
ewc hub deploy ecmwf-data-flavour --server-name TOTO --external-ip

# Explicitly keep a VM private, even if the catalog requests a public IP
ewc hub deploy my-item --no-external-ip

# The same setting via environment variable (an explicit CLI flag still wins)
EWC_CLI_EXTERNAL_IP=true ewc hub deploy ecmwf-data-flavour --server-name TOTO

Override image, flavour, network and disk settings:

ewc hub deploy my-item \
  --image-name "Ubuntu 24.04" \
  --flavour-name 8cpu-16gbmem \
  --security-groups default --security-groups ssh \
  --networks my-network \
  --root-volume 100 \
  --extra-volume 50 --extra-volume 100 \
  --keypair-name my-keypair

Provide item inputs on the command line or via an environment variable:

ewc hub deploy my-item \
  --item-inputs key1=value1 \
  --item-inputs retries=3 \
  --item-inputs "names=['a', 'b']"

EWC_CLI_ITEM_INPUTS="key1=value1,retries=3,names=['a', 'b']" ewc hub deploy my-item

Use a custom catalog, simulate a deployment, or create a plain VM without an item:

ewc hub --path-to-catalog ./custom_catalog.yaml list
ewc hub --path-to-catalog ./custom_catalog.yaml show my-item
ewc hub --path-to-catalog ./custom_catalog.yaml deploy my-item --external-ip

ewc hub deploy my-item --dry-run

ewc infra --profile my-profile create my-vm --external-ip
ewc infra create private-vm --no-external-ip

External IP override fix (issue 220)

Issue #220 reported that ewc hub deploy ... --external-ip was silently ignored when an item defined ewccli.externalIP: false (for example ecmwf-data-flavour), and that there was no way to turn off a catalog-requested public IP from the command line. In versions 0.9.3 and 0.10.0 the catalog value was applied after the CLI value, so the catalog always won — including over EWC_CLI_EXTERNAL_IP.

The current fix-floating-ip branch fixes this by resolving the flag first and falling back to the catalog only when the user did not pass a flag:

  • --external-ip (or EWC_CLI_EXTERNAL_IP=true) now enables a floating IP even when the catalog says externalIP: false.
  • --no-external-ip (or EWC_CLI_EXTERNAL_IP=false) now disables it even when the catalog says externalIP: true.
  • If neither form is given, the catalog value is still honoured; items without ewccli.externalIP remain private by default.
  • A warning panel is printed when your explicit choice differs from the item recommendation.
  • ewc infra create is unaffected: omitting the flag means no external IP.

This fix is implemented in this checkout on branch fix-floating-ip (commit 9153140). It is not part of the 0.10.0 release; it becomes available in a released version once the branch is merged and released. To get the corrected behavior before then, use this branch.

Test Items unreleased or from private sources

If you would like to test the deployment of:

  • an Item with private source code (local or remote)

    OR

  • a new Item, not yet published in the EWC Community Hub

    OR

  • a new version of an Item, not yet updated in the EWC Community Hub

you can take advantage of the --path-to-catalog to point the EWCCLI to the correct source location, and deploy the Item to your target tenant of choice.

Preparing a test

Create a local catalogue file, named ./custom_catalog.yaml, with the complete metadata for your Item.

For reference see the example excerpt of Item metadata, with optional EWCCLI compatibility, enclosed in red below. You can find more concrete examples by browsing over metadata of Items already indexed in the catalog. Additionally, all details about required or optional attributes can be found on the schema documentation.

Item Metadata Excerpt, published on GitHub

Attributes of particular interest during Item development and testing include:

  • ewccli.externalIP requests a public floating IP address for the target VM. Passing --external-ip or --no-external-ip on the command line overrides this catalog value; see Command-line flags and override precedence and issue #220.
  • sources, which can be:
    • Public GIT repository URI
    • Absolute path to a local directory with the Item. The path needs to point to an existing non-empty directory
  • values.inputSpec is the list of inputs you want the user to be able to provide. Any input without default values is treated as required; users can set them when prompted during deployment, or by passing the --item-inputs arg as part of the deploy command.
  • values.osImageName, which can be:
    • The full name of one of the OpenStack image listed on the EWC Knowledge Base
    • The short name of the the OpenStack image; the EWCCLI will auto-resolve to the latest available minor version for the specified operative system
  • values.osFlavorName is the OpenStack flavor (e.g. 4cpu-4gbmem) used as default for the target VM during deployment of an hub item; it can be overridden with the --flavour-name CLI flag. If omitted, the federee/region default flavour is used.
  • values.osSecurityGroups is a list of OpenStack Security Groups assigned to the target VM such that network traffic can reach it on certain ports. It can be overridden with the --security-groups CLI flag.
  • values.pathToMainFile is the relative path to your directory or repository
  • values.pathToRequirementsFile is the relative path to your directory or repository

Running a test

Once metadata is correct and complete, execute list, show or deploy commands as needed. Note that --path-to-catalog is a hub group option, so it goes before the subcommand, and show/deploy require the item name:

ewc hub --path-to-catalog ./custom_catalog.yaml list
ewc hub --path-to-catalog ./custom_catalog.yaml show my-item
ewc hub --path-to-catalog ./custom_catalog.yaml deploy my-item

You can combine it with any of the flags described above, for example:

ewc hub --path-to-catalog ./custom_catalog.yaml deploy my-item \
  --external-ip \
  --item-inputs key1=value1

Backends

This section described the backends used and which commands are backed by those backends.

Openstack

Used by infra and hub subcommands.

Ansible

Used by hub subcommand.

Terraform

Used by hub subcommand. (COMING SOON)

Kubernetes

Used by dns, s3, k8s subcommmands. (COMING SOON)

SW Bill of Materials (SBoM)

Dependencies

The following dependencies are not included in the package but they are required and will be downloaded at build or compilation time:

Dependency Version License Home URL
requests 2.32.5 Apache Software License (Apache-2.0) https://requests.readthedocs.io/en/latest
click 8.1.8 BSD-3-Clause https://github.com/pallets/click
rich 14.1.0 MIT License https://github.com/Textualize/rich
rich-click 1.8.9 MIT License https://pypi.org/project/rich-click
prompt_toolkit 3.0.51 BSD-3-Clause License https://python-prompt-toolkit.readthedocs.io/en/stable
pyyaml 6.0.2 MIT License https://pyyaml.org
cryptography 45.0.6 Apache-2.0 OR BSD-3-Clause https://github.com/pyca/cryptography
openstacksdk >=4.6.0,<5 Apache Software License (Apache-2.0) https://docs.openstack.org/openstacksdk/latest/
ansible 10.5.0 GNU General Public License v3 or later (GPLv3+) (GPL-3.0-or-later) https://www.redhat.com/en/ansible-collaborative
ansible-runner 2.4.1 Apache Software License (Apache Software License, Version 2.0) https://ansible.readthedocs.io/projects/runner/en/latest
kubernetes 33.1.0 Apache Software License (Apache License Version 2.0) https://github.com/kubernetes-client/python
pydantic 2.12.5 MIT License https://github.com/pydantic/pydantic

Build/Edit/Test Dependencies

The following dependencies are only required for building/editing/testing the software:

Dependency Version License Home URL
pytest 8.4.1 MIT License (MIT) https://docs.pytest.org/en/latest
pytest-html 4.1.1 MIT License (MIT) https://github.com/pytest-dev/pytest-html
pytest-mock 3.14.1 MIT License (MIT) https://github.com/pytest-dev/pytest-mock
coverage 7.10.5 Apache Software License (Apache License Version 2.0) https://github.com/nedbat/coveragepy
pre-commit 4.3.0 MIT License (MIT) https://github.com/pre-commit/pre-commit
sphinx 8.1.3 BSD-2-Clause License https://www.sphinx-doc.org/en/master
sphinx-click 6.0.0 MIT License (MIT) https://github.com/click-contrib/sphinx-click
sphinx-rtd-theme 3.0.2 MIT License (MIT) https://sphinx-rtd-theme.readthedocs.io/en/stable
pydeps 3.0.1 BSD-2-Clause License https://github.com/thebjorn/pydeps

Changelog

All notable changes (i.e. fixes, features and breaking changes) are documented in the CHANGELOG.md.

Contributing

Thanks for taking the time to join our community and start contributing!

Please make sure to:

Development

  1. Fork this repository and move into it
git clone https://github.com/ewcloud/ewccli.git && cd ewccli
  1. Activate the virtual environment
source ./ewcclienv/bin/activate
  1. Install the package for testing
pip install -e .[test]
  1. Modify the local code and test changes.

  2. Push code to your fork and open a pull request.

Code Styling

Execute all linting tests by running:

pre-commit run --all-files

This will provide you with hints about:

  • Basic format of the files (i.e. spacing, line breaking, etc.) using black
  • PEP standars infringement flagged by flake8
  • Static typing and type hinting recommendations given by mypy

Resolving Style Issues

To enforce basic formating issues , run:

black ./

Currently, there is no automated way of addressing errors raised by flake8 and mypy. To resolve those, check the logs from the pre-commit execution, understand the type of error and adjust the code accordingly.

Code Unittesting

Execute all tests in all test files by running:

pytest

Execute all tests in a test file

pytest ewccli/tests/ewccli_commands_hub_deploy_server_test.py

Execute a specific test in a file

pytest ewccli/tests/ewccli_commands_hub_deploy_server_test.py::test_no_matching_images

Execute a specific test in a file with verbose

pytest -vv ewccli/tests/ewccli_commands_hub_deploy_server_test.py::test_no_matching_images

Coverage Reporting

Generate unittest coverage reports in standard formats by executing:

coverage run --module pytest --no-header --verbose -ra --junitxml=coverage.xml --html=coverage.html

Documenting

Generate documentation from source code docstrings:

sphinx-build -b html docs/source/ Documentation/

Releasing to Package Registries

Checkout RELEASING.md for details.

Copyright and License

Copyright © EUMETSAT, ECMWF 2026

The provided code and instructions are licensed under GPLv3+. They are intended to automate the setup of an environment that includes third-party software components. The usage and distribution terms of the resulting environment are subject to the individual licenses of those third-party libraries.

Users are responsible for reviewing and complying with the licenses of all third-party components included in the environment.

Contact EUMETSAT for details on the usage and distribution terms.

Authors

About

European Weather Cloud (EWC) Command Line Interface (CLI) to interact with EWC services

Resources

Code of conduct

Contributing

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages