Star 0
Version 0.7.0
EWC CLI
Maintainers
EWC
support[at]europeanweather.cloud
Support level
EWC
Category
Compute
Technology
Python Package

EWC CLI

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 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:

  • EWC CLI uses the following order of importance:
    • env variables
    • cli config
    • any other config (e.g. Openstack cloud.yaml or Kubernetes kubeconfig file)

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
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.

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.