EEA & Eionet documentation hub

Browse documentation for IT-systems used by the European Environment Agency and the Eionet network.

Docker Orchestration for Copernicus Land Monitoring/In Situ

Installation

  1. Install Docker.

  2. Install Docker Compose.

  3. Install Rancher Compose

Usage

Development

In order to be able to edit source-code on your machine using your favorite editor, without having to do it inside a Docker container, you’ll have to create a new user on your laptop with uid=500 and use this user for development:

$ useradd -u 500 zope-www
$ usermod -a -G docker zope-www
$ sudo su - zope-www

Now get the source code:

$ git clone https://github.com/eea/eea.docker.copernicus.git
$ cd eea.docker.copernicus/devel
$ docker-compose -f source-code.yml up

Start the application:

$ docker-compose up

Within your favorite browser head to http://localhost:8080, add a Plone site and install the following add-ons:

  • EEA Plone buildout profile
  • Copernicus Theme
  • Land Copernicus Content-Types

Now you are ready to develop Plone Add-ons within src folder:

$ ls -l src/

Once you’re done editing, restart the application and test your changes:

$ docker-compose restart

Deployment

Pre-requirements:

  • Rancher Compose
  • Within Rancher UI register min 1 hosts with label: copernicus=yes

Deploy in production

On your laptop do :

$ git clone https://github.com/eea/eea.docker.copernicus.git
$ cd eea.docker.copernicus/deploy

$ rancher-compose --project-name copernicus-land --env-file land.env up -d
$ rancher-compose --project-name copernicus-insitu --env-file insitu.env up -d

See also Rancher tips and tricks for info on how to restore Data.fs and blobstorage

Upgrade

  1. Release a new version of eeacms/plone-copernicus-land:

    $ git clone https://github.com/eea/eea.docker.plone-copernicus-land.git $ cd eea.docker.plone-copernicus-land $ git tag 2020-12-31 $ git push –tags

  2. Update VERSION within .env files:

    $ cd eea.docker.copernicus/deploy $ vim land.env $ vim insitu.env VERSION=2020-12-31

  3. Run the upgrade:

    $ rancher-compose –project-name copernicus-land –env-file land.env pull $ rancher-compose –project-name copernicus-land –env-file land.env up -d –upgrade –interval 90000 –batch-size 1

$ rancher-compose --project-name copernicus-insitu --env-file insitu.env pull
$ rancher-compose --project-name copernicus-insitu --env-file insitu.env up -d --upgrade --interval 90000 --batch-size 1
  1. Confirm that the upgrade went well:

    $ rancher-compose –project-name copernicus-land –env-file land.env up -d –confirm-upgrade

$ rancher-compose --project-name copernicus-insitu --env-file insitu.env up -d --confirm-upgrade
  1. Roll-back if the upgrade didn’t go well:

    $ rancher-compose –project-name copernicus-land –env-file land.env up -d –roll-back

$ rancher-compose --project-name copernicus-insitu --env-file insitu.env up -d --roll-back
  1. Invalidate cache

    $ rancher-compose –project-name copernicus-land –env-file land.env restart memcached

$ rancher-compose --project-name copernicus-insitu --env-file insitu.env restart memcached