Emily CLI Documentation

Release-v3.1.0

Emily combines the powers of Python and Docker to build stable and consistent machine learning and datascience python environments. Emily is useful for large cross-team project development as well as for simply running a single jupyter notebook or python script.

Download emily@latest
See earlier versions
$ emily build [options]

Start a new project Valid Emily images: base | slim | cv | nlp torch-slim | torch-cv | torch-nlp | tf-slim tf-cv | tf-nlp | cuda-base | cuda-slim cuda-cv | cuda-nlp |cuda-torch-slim| cuda-torch-cv cuda-torch-nlp| cuda-tf-slim | cuda-tf-cv | cuda-tf-nlp

$ emily build
Emily: Project name::
· getting-started
Emily: An Emily template is a pre-built template containing
essential boilerplate code useful in the development of
microservices.
These templates include relevant endpoints depending on
which template you choose.

? Emily: Which Emily template do you want to use?(Use arrow keys, confirm with ENTER)> Default - Minimal project with hello world script
API - Simple project with API set up and ready
Machine learning [API, DVC, MLFlow, Pytorch] - Machine learning template with API, Data version control (DVC), MLFlow experiment reporting and pytorch
Machine learning API [API, Pytorch] - Machine learning template with API and pytorch
Machine learning [gRPC] - Machine learning template with gRPC
Machine Learning Reporting - Machine learning reporting template
· Default
Emily: An Emily image is a pre-built docker image containing
essential packages that are useful in the development of
microservices.
These images include relevant packages depending on which
type of project you are developing.

? Emily: Which Emily image fits your use case the best?(Use arrow keys, confirm with ENTER)> Base - Contains just enough to run an API
Slim - Contains essential Machine Learning packages
Computer Vision - Contains slim and essential Computer Vision packages
NLP - Contains slim and essential NLP packages
Custom - Use your own image
· Base
? Emily: Which editor do you want to use?(Use arrow keys, confirm with ENTER)
Visual Studio Code
> PyCharm
Jupyter Notebook
Jupyter Lab
· PyCharm
Emily: Creating a new Emily project in my-directory/my-project-name...

$ emily build
$ emily build
-n my-project-name
-i base
-t ml-api
-e lab


$ emily build
Emily: Project name::
· getting-started
Emily: An Emily template is a pre-built template containing essential
boilerplate code useful in the development of microservices.
These templates include relevant endpoints depending on
which template you choose.

? Emily: Which Emily template do you want to use?(Use arrow keys, confirm with ENTER)
Default - Minimal project with hello world script
> API - Simple project with API set up and ready
Machine learning [API, DVC, MLFlow, Pytorch] - Machine learning template with API, Data version control (DVC), MLFlow experiment reporting and pytorch
Machine learning API [API, Pytorch] - Machine learning template with API and pytorch
Machine learning [gRPC] - Machine learning template with gRPC
Machine Learning Reporting - Machine learning reporting template
· API
Emily: An Emily image is a pre-built docker image containing
essential packages that are useful in the development of microservices.
These images include relevant packages depending on which
type of project you are developing.

? Emily: Which Emily image fits your use case the best?(Use arrow keys, confirm with ENTER)> Base - Contains just enough to run an API
Slim - Contains essential Machine Learning packages
Computer Vision - Contains slim and essential Computer Vision packages
NLP - Contains slim and essential NLP packages
Custom - Use your own image
· Base

Running Emily Build

To build a new Emily project, run emily build in your terminal. You will be asked to provide a project name, choose a project template (e.g. Default, API, ML-API, etc.), an Emily image and an editor (e.g. VSCode, PyCharm, Jupyter Notebook or Jupyter Lab).

If you want to build a project without automatically starting a docker container use the flag --no-autostart

When building a project, Emily will let you choose between different project templates and Emily images.

Project templates

A project template is a pre-built selection of software and code snippets that are useful for various use-cases. Emily provides the following project templates:

Template nameDescription
DefaultMinimal project with hello world script
APISimple project with API set up and ready
Machine learning [API, DvC, MLFlow, Pytorch]Machine learning template with API, data version control (DVC), MLFlow experiment reporting and pytorch
Machine learning [API, Pytorch]Machine learning template with API and pytorch
Machine learning [gRPC]Machine learning template with gRPC
Machine learning reportingMachine learning reporting template

For the purpose of creating the first project, we will go with the API template. After selecting the template, your terminal output should resemble the following:

Emily images

Emily comes with a selection of pre-built images configured for different usecases:

  • Basic tasks that include an API (base)
  • Machine learning and data science (slim)
  • Computer vision and image processing (cv)
  • Natural language processing (nlp)

Included packages

The Emily images are pre-built with the following packages :

baseslimcvnlp
GCCbase +slim +slim +
MakeGTKpkg-config
CMake+ 8 packages1libicu-dev
G++
Python 3.8 with:Extra Python packages:Extra Python packages:Extra Python packages:
- protobuf- scikit-learn- OpenCV- spacy
- fastapi- pandas- Scikit-Image- tqdm
- requests- numpy- Tesseract- typer
- jupyter- matplotlib- Imageio- textblob
- tornado- scipy- PyWavelets- wasabi
- click- pillow- imutils- smart-open
- loguru- seaborn- networkx- thinc
- pydantic- cython- packaging- polyglot
- uvloop+ 4 packages2- [imageio]+ 14 packages3
- jinja2- tifffile
+ 77 packages4

The four images may be retrieved ´as-is´ or combined with a deep learning framework such as Tensorflow or PyTorch. Furthermore, the variants may be bundled with CUDA support.

The tables below give an overview of the 20 different variants of the images. Use the --image option followed by the image name shown in the tables below to specify the image you would like to use.

Images without CUDA

No deep learning frameworkTensorflowPyTorch
Basebase--
Slimslimtf-slimtorch-slim
Computer Visioncvtf-cvtorch-cv
Natural Language Processingnlptf-nlptorch-nlp

CUDA-enabled images

No deep learning frameworkTensorflowPyTorch
Basecuda-base--
Slimcuda-slimcuda-tf-slimcuda-torch-slim
Computer Visioncuda-cvcuda-tf-cvcuda-torch-cv
Natural Language Processingcuda-nlpcuda-tf-nlpcuda-torch-nlp

Custom images

You can use a non-Emily image by picking the custom image option when selecting an image. This allows you to either use an image you have created yourself, or to use a publicly available one. For example, to use the official Python image, you can use the flag --image python when running emily build. Note that if you specify a non-existent or faulty image, the Emily project may fail to start once built.

Footnotes

  1. Additional packages for the cv image: libsm6, libxext6, libglib2.0-0, libsm6, libxrender1, libfontconfig1, libxext6, libgl1

  2. Additional python packages for the slim image: joblib, kiwisolver, threadpoolctl, cycler

  3. Additional python packages for the nlp image: blis, catalogue, corenlp, cymem, langcodes, lemmy, morfessor, murmurhash, pathy, preshed, pycld2, pyicu, regex, srsly

  4. Additional python packages for the base image:psutil, gunicorn, prompt-toolkit, starlette, uvicorn, python-dotenv, pycodestyle, attrs, websockets, autopep8, pyzmq, urllib3, websocket-client, prometheus-client, pycparser, bleach, flake8, lxml, mistune, PyYAML, python-dateutil, pyrsistent, pyparsing, beautifulsoup4, grpcio, grpcio-tools, pyflakes, babel, pygments, anyio, watchfiles, toml, debugpy, six, decorator, certifi, traitlets, parso, mccabe, pytz, MarkupSafe, pandocfilters, packagingnest-asyncio, argon2-cffi, fastjsonschema, terminado, defusedxml, wcwidth, charset-normalizer, Send2Trash, cffi, executing, ptyprocess, soupsieve, asttokens, json5, tinycss2, typing-extensions, sniffio, entrypoints, pickleshare, webencodings, stack-data, pure-eval, backcall, argon2-cffi-bindings, pexpect, h11, httptools, idna, ipykernel, ipython-genutils, ipywidgets, jedi, jsonschema

    Options

  • -h,--help

    Display help for command

  • -a,--access-token<token>

    The access token to use for authentication

  • -eu,--emily-user<name>

    The email address for the Emily user related to the access token if provided (only required when --access-token is passed)

  • -n,--project-name<project-name>

    The project name.

  • -o,--out-dir<path>

    The directory in which to create the project.

  • -g,--gpu(--no-gpu)

    Enable GPU capabilities within the container (default: true)

  • -t,--template<template>

    The Emily template to use.

  • -rp,--reporting<server-name><server-port><allow-ssh-key-copy>

    Reporting server assosiated with this project (not applicable for all templates)

  • -i,--image<image>

    The Emily image to use.

  • -ho,--host<host>

    The host address to listen for requests on.

  • -p,--port<port>

    The port to listen for requests on.

  • -nh,--notebook-host<host>

    The Jupyter notebook server host.

  • -np,--notebook-port<port>

    The Jupyter notebook port.

  • -a,--autostart(--no-autostart)

    Automatically start Docker container and open in editor. (default: true)

  • -e,--editor<editor>

    The editor to use [vscode | pycharm | notebook | lab].

  • -d,--detach

    Detached mode: Run container in the background. Requires manual shutdown.

  • -x,--x11(--no-x11)

    Open project with X11 display forwarding, allowing e.g. images and videos to be opened inside the project. (default: true)

  • -s,--silent

    Execute Emily silently. (default: false)

  • -u,--update(--no-update)

    Prompt for update if newer version found. (default: true)

  • -vb,--verbose

    Print detailed information while running commands.