Skip to content

Commit

Permalink
feat(Docker): transfer image to Docker Hub for more convenient usage
Browse files Browse the repository at this point in the history
Replace push to GitHub by push to docker
  • Loading branch information
BjoernLudwigPTB committed Nov 12, 2021
2 parents b3b9dc0 + 0926fa6 commit 14aff5f
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 43 deletions.
34 changes: 9 additions & 25 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ workflows:
- Docker publishing for agents
filters:
tags:
only: /^v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/
only: /^v([1-9][0-9]*!)?(0|[1-9][0-9]*)(\.(0|[1-9][0-9]*))*((a|b|rc)(0|[1-9][0-9]*))?(\.post(0|[1-9][0-9]*))?(\.dev(0|[1-9][0-9]*))?$/
- test_image:
context:
- Docker pulls
Expand All @@ -83,17 +83,16 @@ workflows:
- build_image
filters:
tags:
only: /^v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/
only: /^v([1-9][0-9]*!)?(0|[1-9][0-9]*)(\.(0|[1-9][0-9]*))*((a|b|rc)(0|[1-9][0-9]*))?(\.post(0|[1-9][0-9]*))?(\.dev(0|[1-9][0-9]*))?$/
- retag_and_deploy_image:
context:
- Docker pulls
- Docker publishing for agents
- CircleCI agentMET4FOF docker publishing
requires:
- test_image
filters:
tags:
only: /^v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/
only: /^v([1-9][0-9]*!)?(0|[1-9][0-9]*)(\.(0|[1-9][0-9]*))*((a|b|rc)(0|[1-9][0-9]*))?(\.post(0|[1-9][0-9]*))?(\.dev(0|[1-9][0-9]*))?$/
branches:
ignore: /.*/

Expand Down Expand Up @@ -388,32 +387,17 @@ jobs:
name: Retag image with corresponding version number and store new archive
command: |
version=$(docker run --rm ${IMAGE_NAME}:latest \
python -c "from agentMET4FOF import __version__;print(__version__)")
python -c "from agentMET4FOF import __version__;print(__version__)") \
|| true
if [ $CIRCLE_TAG = v$version ]; then
docker tag ${IMAGE_NAME} ${ORG_NAME}/${IMAGE_NAME}:$version
docker save ${ORG_NAME}/${IMAGE_NAME}:$version | \
gzip > tagged_docker_image_agentMET4FOF_jupyter.tar.gz
docker tag ${IMAGE_NAME} ${ORG_NAME}/${IMAGE_NAME}:latest
else
exit 1
fi
- run:
name: Install the GitHub cli 'gh'
name: Push image
command: |
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg |\
sudo gpg --dearmor -o /usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) \
signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] \
https://cli.github.com/packages stable main" | \
sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt-get update
sudo apt-get install gh
- run:
name: Upload current image
command: |
gh release upload --repo \
${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME} \
${CIRCLE_TAG} \
tagged_docker_image_agentMET4FOF_jupyter.tar.gz#"Docker \
image for agentMET4FOF Jupyter Notebook server"
docker login --username $DOCKERHUB_USER --password $DOCKERHUB_PASSWORD
docker push $ORG_NAME/$IMAGE_NAME
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
<!-- Contributor Covenant -->
<a href="https://github.com/Met4FoF/agentMET4FOF/blob/develop/CODE_OF_CONDUCT.md">
<img src="https://img.shields.io/badge/Contributor%20Covenant-2.0-4baaaa.svg" alt="Contributor Covenant"></a>
<!-- Docker Hub -->
<a href="https://hub.docker.com/r/met4fof/agentmet4fof">
<img src="https://img.shields.io/docker/pulls/met4fof/agentmet4fof.svg" alt="Docker Hub badge"></a>
</p>

# Multi-Agent System for IIoT
Expand Down
2 changes: 1 addition & 1 deletion agentMET4FOF/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.12.1"
__version__ = "0.12.2"
22 changes: 6 additions & 16 deletions docs/INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ 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. a) [Start a container from the image for local use](#start-a-container-from-the-image-for-local-use)

b) [Deploy the containerized agents via a webserver](#deploy-the-containerized-agents-via-a-webserver)
Expand All @@ -100,22 +98,14 @@ The [official Docker documentation
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\tagged_docker_image_agentMET4FOF_jupyter.tar.gz
```

### Start a container from the image for local use

After importing the image, you can launch it straight away with
You can download and launch the [Docker image
](https://hub.docker.com/p/met4fof/agentmet4fof) straight away with Docker's built-in
[`run`](https://docs.docker.com/engine/reference/run/) command

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

In this command's output you will find the usual Jupyter Notebook token
Expand All @@ -134,11 +124,11 @@ http://agent.domain.com/YOUR_FOLDER_NAME_OF_CHOICE.

#### Start the container with the dashboard at a subfolder

Launch the container with
Download and launch the container with

```bash
> docker run -p 8888:8888 -p 8050:8050 --rm \
--env DASH_URL_BASE_PATHNAME=/YOUR_FOLDER_NAME_OF_CHOICE/ agentmet4fof
--env DASH_URL_BASE_PATHNAME=/YOUR_FOLDER_NAME_OF_CHOICE/ met4fof/agentMET4FOF
```

This ensures, that the dashboard will be reachable under whatever domain you are
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def make_path_dict(source: str, destination: str) -> dict:
# built documents.
#
# The short X.Y version.
version = "0.12.1"
version = "0.12.2"
# The full version, including alpha/beta/rc tags.
# release = '0.0.1'

Expand Down
1 change: 1 addition & 0 deletions docs/sphinx-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ nbsphinx
recommonmark
sphinx_rtd_theme
ipython
docutils<0.18

0 comments on commit 14aff5f

Please sign in to comment.