Skip to content

Commit

Permalink
docs(ReadTheDocs): include Docker guide
Browse files Browse the repository at this point in the history
  • Loading branch information
BjoernLudwigPTB committed Jul 20, 2021
1 parent dfa2336 commit 7c35bba
Show file tree
Hide file tree
Showing 2 changed files with 118 additions and 40 deletions.
75 changes: 47 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
<p align="center">
<!-- CircleCI Tests -->
<a href="https://circleci.com/gh/Met4FoF/agentMET4FOF"><img alt="CircleCI pipeline status badge" src="https://circleci.com/gh/Met4FoF/agentMET4FOF.svg?style=shield"></a>
<a href="https://circleci.com/gh/Met4FoF/agentMET4FOF"><img alt="CircleCI pipeline
status badge" src="https://circleci.com/gh/Met4FoF/agentMET4FOF.svg?
style=shield"></a>
<!-- ReadTheDocs Documentation -->
<a href="https://agentmet4fof.readthedocs.io/">
<img src="https://readthedocs.org/projects/agentmet4fof/badge/?version=latest" alt="ReadTheDocs badge">
</a>
<!-- CodeCov(erage) -->
<a href="https://codecov.io/gh/Met4FoF/agentMET4FOF">
<img src="https://codecov.io/gh/Met4FoF/agentMET4FOF/branch/master/graph/badge.svg?token=ofAPdSudLy"/>
<img src="https://codecov.io/gh/Met4FoF/agentMET4FOF/branch/master/graph/badge.svg?token=ofAPdSudLy" alt="CodeCov badge"/>
</a>
<!-- PyPI Version -->
<a href="https://pypi.org/project/agentmet4fof">
<img src="https://img.shields.io/pypi/v/agentmet4fof.svg?label=release&color=blue&style=flat-square" alt="pypi">
</a>
<!-- PyPI License -->
<a href="https://www.gnu.org/licenses/lgpl-3.0.en.html">
<img alt="PyPI - license badge" src="https://img.shields.io/pypi/l/agentMET4FOF?color=bright">
<img alt="PyPI - license badge"
src="https://img.shields.io/pypi/l/agentMET4FOF?color=bright">
</a>
<!-- Zenodo DOI -->
<a href="https://doi.org/10.5281/zenodo.4560343">
Expand All @@ -28,7 +31,7 @@
agentMET4FOF is an implementation of a multi-agent system for agent-based
analysis and processing of both static data sets and data streams with IIoT
applications in mind. More on the motivation that drives the project can be found
in the section <a href="#about">About</a>.
in the section <!--suppress HtmlUnknownAnchorTarget --><a href="#about">About</a>.
</p>

## Table of content
Expand Down Expand Up @@ -111,13 +114,14 @@ One of the many questions that drive us in the project is:
Some notable features of agentMET4FOF include :

- Modular agent classes for metrological data streams and analytics
- A built-in buffering mechanism to decouple transmission, processing and visualization of data
- A built-in buffering mechanism to decouple transmission, processing and visualization
of data
- Easy connection among software agents to send and receive data
- Choose backends between:
- [_Osbrain_](https://osbrain.readthedocs.io/en/stable/) for simulating as well as handling real distributed
systems running Python connected via a TCP network, and
- [_Mesa_](https://mesa.readthedocs.io/en/stable/) for local simulations of distributed systems, debugging and
more high-performance execution
- [_Osbrain_](https://osbrain.readthedocs.io/en/stable/) for simulating as well as
handling real distributed systems running Python connected via a TCP network, and
- [_Mesa_](https://mesa.readthedocs.io/en/stable/) for local simulations of
distributed systems, debugging and more high-performance execution
- Interactive and customisable dashboard from the get-go to:
- Visualize and change agent-network topologies
- Visualize groups of cooperative agents as _Coalitions_
Expand All @@ -134,9 +138,10 @@ more pre-made agents to your network all during run-time. The address to your
dashboard is printed to the console on every launch of an agent network.

The following image is close to what you will find in your browser on execution of
tutorial 2. For details on the tutorials visit our [video tutorial series](#video-tutorial-series).
tutorial 2. For details on the tutorials visit our
[video tutorial series](#video-tutorial-series).

![Web Screenshot](https://github.com/raw/Met4FoF/agentMET4FOF/develop/docs/screenshot_met4fof.png)
![](https://github.com/raw/Met4FoF/agentMET4FOF/develop/docs/screenshot_met4fof.png)

## 📖Documentation and video tutorials

Expand All @@ -145,7 +150,9 @@ Extended

### Video tutorial series

Additionally, we provide some [video tutorials based on agentMET4FOF 0.4.1 on the project homepage](https://www.ptb.de/empir2018/met4fof/information-communication/video-portal/)
Additionally, we provide some
[video tutorials based on agentMET4FOF 0.4.1 on the project homepage
](https://www.ptb.de/empir2018/met4fof/information-communication/video-portal/)
in the section _Tutorials for the multi-agent system agentMET4FOF_.
You can self-register on the linked page and get started immediately. The video series
begins with our motivation for creating agentMET4FOF, guide you through the
Expand All @@ -158,21 +165,30 @@ In an early development stage we held a live online tutorial based on
[agentMET4FOF 0.1.0](https://github.com/Met4FoF/agentMET4FOF/releases/0.1.0/)
which you can [download](https://github.com/Met4FoF/agentMET4FOF/releases/download/0.1.0/Met4FoF.MAS.webinar.mp4).

If questions arise, or you feel something is missing, reach out to [us](https://github.com/Met4FoF/agentMET4FOF/graphs/contributors).
If questions arise, or you feel something is missing, reach out to
[us](https://github.com/Met4FoF/agentMET4FOF/graphs/contributors).

## 💻Installation

The installation of agentMET4FOF is as straightforward as the Python
ecosystem suggests. In the [video tutorials series](#video-tutorial-series)
we guide you through every step until you have agentMET4FOF running on
your machine. Besides that we have more details in the [installation
There are two ways to run agentMET4FOF. Either:

1. you [install Python](https://www.python.org/downloads/) and our package
[agentMET4FOF](https://pypi.org/project/agentMET4FOF/) in a virtual Python
environment on your computer, or
2. you [install Docker](https://docs.docker.com/get-docker/), [start agentMET4FOF in
a container](https://agentmet4fof.readthedocs.io/en/latest/INSTALL.html#start-a-container-from-the-image)
and visit the Jupyter Notebook Server and the agentMET4FOF Dashboard directly in
your browser.

In the [video tutorials series](#video-tutorial-series)
we guide you through every step of option 1. More detailed instructions on both
options you can find in the [installation
section of the docs](https://agentmet4fof.readthedocs.io/en/latest/INSTALL.html).

## 💨Coming soon

- Dockerize agentMET4FOF
- Improve handling of metadata
- Further improve plotting
- Improved handling of metadata
- More advanced signal processing

For a comprehensive overview of current development activities and upcoming tasks,
take a look at the [project board](https://github.com/Met4FoF/agentMET4FOF/projects/1),
Expand All @@ -182,20 +198,23 @@ take a look at the [project board](https://github.com/Met4FoF/agentMET4FOF/proje
## 🖋Citation

If you publish results obtained with the help of agentMET4FOF, please cite the linked
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4560344.svg)](https://doi.org/10.5281/zenodo.4560344).
[![](https://zenodo.org/badge/DOI/10.5281/zenodo.4560344.svg)
](https://doi.org/10.5281/zenodo.4560344).

## 💎Acknowledgement

This work was part of the Joint Research Project [Metrology for the Factory of the Future (Met4FoF), project number 17IND12](https://www.ptb.de/empir2018/met4fof/home/)
of the European Metrology Programme for Innovation and Research (EMPIR). The [EMPIR](http://msu.euramet.org)
is jointly funded by the EMPIR participating countries within EURAMET and the European
Union.
This work was part of the Joint Research Project [Metrology for the Factory of the
Future (Met4FoF), project number 17IND12](https://www.ptb.de/empir2018/met4fof/home/)
of the European Metrology Programme for Innovation and Research (EMPIR). The
[EMPIR](http://msu.euramet.org) is jointly funded by the EMPIR participating
countries within EURAMET and the European Union.

## ⚠Disclaimer

This software is developed as a joint effort of several project partners namely:

- [Institute for Manufacturing of the University of Cambridge (IfM)](https://www.ifm.eng.cam.ac.uk/)
- [Institute for Manufacturing of the University of Cambridge (IfM)
](https://www.ifm.eng.cam.ac.uk/)
- [Physikalisch-Technische Bundesanstalt (PTB)](https://www.ptb.de/)
- [Van Swinden Laboratory (VSL)](https://www.vsl.nl/en/)
- [National Physics Laboratory (NPL)](https://www.npl.co.uk/)
Expand All @@ -209,5 +228,5 @@ connection with the use of this software.

## ©License

agentMET4FOF is distributed under the [LGPLv3 license](https://github.com/Met4FoF/agentMET4FOF/blob/develop/license.md).

agentMET4FOF is distributed under the
[LGPLv3 license](https://github.com/Met4FoF/agentMET4FOF/blob/develop/license.md).
83 changes: 71 additions & 12 deletions docs/INSTALL.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
# Installation of agentMET4FOF

As already mentioned in the README, agentMET4FOF can either be [installed as a Python
package](#install-agentmet4fof-as-a-python-package) or [launched in a Docker
container](#use-agentmet4fof-from-inside-a-docker-container).

## Install agentMET4FOF as a Python package

The installation of agentMET4FOF is as straightforward as the Python ecosystem suggests.
In the [video tutorial series linked in the README](https://github.com/Met4FoF/agentMET4FOF#video-tutorial-series)
we guide you through every step until you have agentMET4FOF running on your machine.
In the [video tutorial series linked in the README
](https://github.com/Met4FoF/agentMET4FOF#video-tutorial-series) we guide you
through every step until you have agentMET4FOF running on your machine.

If you want to take the steps manually we guide you through in this document.

### Set up a virtual environment

For the motivation of creating to virtual environment for your installation of the
agents check [the official Python docs on that topic](https://docs.python.org/3/tutorial/venv.html#introduction).
You have the option to do this with _Anaconda_, if you already have it installed,
or use the Python built-in tool `venv`.
The commands differ slightly between [Windows](#create-a-venv-python-environment-on-windows) and [Mac/Linux](#create-a-venv-python-environment-on-mac-linux).
For the motivation of creating a virtual environment for your installation of the
agents check [the official Python docs on that topic
](https://docs.python.org/3/tutorial/venv.html#introduction). You have the option
to do this with _Anaconda_, if you already have it installed, or use the Python
built-in tool `venv`. The commands differ slightly between [Windows
](#create-a-venv-python-environment-on-windows) and [Mac/Linux
](#create-a-venv-python-environment-on-mac-linux) or if you use [Anaconda
](#create-an-anaconda-python-environment).

#### Create a `venv` Python environment on Windows

Expand All @@ -24,7 +34,7 @@ PS C:> cd C:\LOCAL\PATH\TO\ENVS
PS C:\LOCAL\PATH\TO\ENVS> py -3 -m venv agentMET4FOF_venv
PS C:\LOCAL\PATH\TO\ENVS> agentMET4FOF_venv\Scripts\activate
```
Proceed to [step 2](#install-agentmet4fof-via-pip).
Proceed to [the next step](#install-agentmet4fof-via-pip).

#### Create a `venv` Python environment on Mac & Linux

Expand All @@ -36,7 +46,7 @@ $ cd /LOCAL/PATH/TO/ENVS
$ python3 -m venv agentMET4FOF_venv
$ source agentMET4FOF_venv/bin/activate
```
Proceed to [step 2](#install-agentmet4fof-via-pip).
Proceed to [the next step](#install-agentmet4fof-via-pip).

#### Create an Anaconda Python environment

Expand Down Expand Up @@ -64,16 +74,65 @@ Successfully installed agentMET4FOF-[...] [...]
```
That's it!

## Use agentMET4FOF from inside a Docker container

Every version of agentMET4FOF since
[v0.9.1dev](https://github.com/Met4FoF/agentMET4FOF/releases/tag/v0.9.1dev) is
additionally accompanied by a so-called
[Docker image](https://docs.docker.com/get-started/#what-is-a-container-image). With
its help, agentMET4FOF can be launched quickly on any computer with a
[Docker](https://docs.docker.com/get-started/overview/) installation without
installing Python. agentMET4FOF can then be used directly in the browser using the
supplied or your own Jupyter notebooks and even the dashboard can be
visited in the browser after its launch. The following steps are required for this.

1. [Install Docker](#install-docker)
1. [Download and import the agentMET4FOF Docker image
](#download-and-import-the-agentMET4FOF-docker-image)
1. [Start a container from the image](#start-a-container-from-the-image)

### Install Docker

The [official Docker documentation
](https://docs.docker.com/get-started/#download-and-install-docker) guides you through.
Please continue with [the next step](#download-and-import-the-agentMET4FO-docker-image),
once you completed the Docker installation.

### Download and import the agentMET4FOF Docker image

You can download [the _Docker image for agentMET4FOF Jupyter Notebook Server
_ as one of the release assets](https://github.com/Met4FoF/agentMET4FOF/releases/latest)
, import it locally with

```bash
> docker load -i LOCAL\PATH\TO\DOWNLOADS\docker_image_agentMET4FOF_jupyter.tar.gz
```

### Start a container from the image

After importing the image, you can run it straight away with

```bash
> docker run -p 8888:8888 -p 8050:8050 --rm agentmet4fof
```

In this command's output you will find the usual Jupyter Notebook token
URL on your command line, which you can open in your browser. After starting an
agent network in one of the tutorials or your own notebooks, you will find the
dashboard URL in the notebook's output resembling something like
`http://0.0.0.0:8050`.

## Get started developing

As a starter we recommend working through the tutorials which we present in detail in
our [video tutorial series linked in the README](https://github.com/Met4FoF/agentMET4FOF#video-tutorial-series).
our [video tutorial series linked in the README
](https://github.com/Met4FoF/agentMET4FOF#video-tutorial-series).

## Orphaned processes

In the event of agents not terminating cleanly, you can end all Python processes
running on your system (caution: the following commands affect **all** running Python
processes, not just those that emerged from the agents).
running on your system. **Caution**: the following commands affect **all** running
Python processes, not just those that emerged from the agents.

### Killing all Python processes in Windows

Expand Down

0 comments on commit 7c35bba

Please sign in to comment.