Skip to content

Starting with zm docker

akshat edited this page Dec 21, 2018 · 1 revision

Pre-requisite

You should have Docker (and Docker Compose) installed and know how to create a swarm.


Steps for bringing up the ZimbraX using zm-docker repository

Step-1

Clone this zm-docker repository from here.

For more information on zm-docker please have a look at its README page.

Step-2

Copy your private key to the following directory

zm-docker/build/config/DOT-ssh

Step-3

Go to the cloned directory and compile the code

For develop branch

make compile

For specific branch edit the config.build file and append the following line

$ vim zm-docker/build/config

%GIT_OVERRIDES = zm-mailbox.branch=bugfix/zcs-6432-memoryLeak

$ make compile

Step-4

After the compiling is finished we need to build the images for each services using the following command

$ make build-all

In case we want to build a specific image at any point in time without building the whole images then we need to specify which container we need to build.

For example, if we want to build only the mailbox image then:

$ make build-zmc-mailbox

Step-5

Once it has finished building we can verify the images for all containers using the following command:

$ docker images

Step-6

(Optional only for running the test)

In case we are going to perform the zm-perf-harness concurrency test then we need to add the following network block at the end of the docker-compose.yml file

$ vim zm-docker/docker-compose.yml

networks:
  default:
   driver: overlay
   attachable: true

Step-7

Now, we need to bring up all the containers using the following command:

$ make up

Note

1. We can see the logs for each services using the following command:

$ docker service logs -f <service-name>

Eg.
$ docker service logs -f zm-docker_zmc-mailbox

2. For seeing all the containers with their sizes

$ docker ps -a --size

3. For seeing all the services

$ docker service ls

Steps for starting up the Concurrency test

Now once our ZimbraX is up and running for stating a concurrency test we need to to use perf-harness container.

Step-1

Clone this zm-perf-harness repository from here.

For more information on zm-perf-harness please have a look at its README page.

Step-2

Generate the list of users at .config/users.csv using the following python script

$ python create_user.py -h
usage: create_user.py [-h] -u <Username> -n <Number of Users>

User generation utility...

optional arguments:
  -h, --help            show this help message and exit
  -u <Username>, --username <Username>
                        Pattern of the username.
  -n <Number of Users>, --number_of_users <Number of Users>
                        Number of users to be created.

Example for generating 200 users with username as user
$ python a.py -u user -n 200 >> zm-perf-harness/.config/users.csv &

Step-3

Copy the environment file from the following location to .secrets/env.prop

Step-4

Now, bring up the zm-perf-harness container

$ make up

Step-5

Login to the zmc-perf-harness container

$ docker exec -it zmc-perf bash

Step-6

Edit the following files before starting the concurrency test

Example for running 10 hours concurrency test for 200 users

$ vim tests/generic/zsoap/load_basic.prop
LOAD.duration=36000
LOAD.delay=5
LOAD.ZSOAP.users=200
LOAD.ZSOAP.userduration=40
LOAD.ZSOAP.rampup=0
LOAD.ZSOAP.loopcount=1


$ vim tests/generic/zsoap/load.prop
LOAD.duration=36000
LOAD.delay=5
LOAD.ZSOAP.users=200
LOAD.ZSOAP.userduration=200
LOAD.ZSOAP.rampup=20
LOAD.ZSOAP.loopcount=-1

Step-7

Now, start the test

$ ant generic-zsoap-all

Monitor the mailbox logs

This will tail all the important logs for all replicas

$ docker service logs -f zm-docker_zmc-mailbox