libreant icon indicating copy to clipboard operation
libreant copied to clipboard

Migrate automatic testing to docker

Open leophys opened this issue 7 years ago • 8 comments

Hi, I'd volunteer to migrate automatic installation and testing to docker. I am indeed not comfortable with vagrant and have acquired some confidence with docker. I updated my local repo to dev:HEAD and I can make a pull request in few days. Do you agree? Is there any insight on elasticsearch I have to be aware of to do the magic?

Cheers

leophys avatar Nov 06 '17 15:11 leophys

Blallo:

Hi, I'd volunteer to migrate automatic installation and testing to docker.

Installation with docker sounds good. As for testing with docker, I'm not really sure I understand what you mean. You want to create a new docker image each time you need to test it? That sounds complicated. Or you want a "clean environment to code in"? In that case, probably any docker with elasticsearch configured in it would be fine. Maybe seeing the PR will be easier than explaining it.

I updated my local repo to dev:HEAD and I can make a pull request in few days. Do you agree?

sure, if you will also explain how and why to use it in the doc :)

Is there any insight on elasticsearch I have to be aware of to do the magic?

it's not in debian repositories anymore, you need to use their repos.

-- boyska

boyska avatar Nov 06 '17 16:11 boyska

On 11/06/2017 04:55 PM, Blallo wrote:

Hi, I'd volunteer to migrate automatic installation and testing to docker. I am indeed not comfortable with vagrant and have acquired some confidence with docker. I updated my local repo to |dev:HEAD| and I can make a pull request in few days. Do you agree? Is there any insight on elasticsearch I have to be aware of to do the magic?

Cheers

I'm starting a review of the installation process, in particular I would like to update the dependencies (python side and elasticsearch) and fix the relative compatibility problems that will arise. I would also like to use docker for the dev/testing environment.

Did you made any progress on the docker image?\

Double cheers ;)

ael-code avatar Nov 30 '17 12:11 ael-code

After a lot of effort I've successfully setup a docker environment for libreant, I'm experimenting on my local branch 1.

1 - The main Dockerfile allows to build a docker image for the libreant application itself 2 - The docker-compose.yml can be used to start libreant alongside the elasticsearch service that is built upon the official docker image 2

Actually the whole thing is pretty cool, it is possible to run libreant in few seconds without worrying about dependencies and moreover without messing up the local system with elasticsearch crap. It is as simple as running docker-compose up and libreant should be listening on the usual local port 5000.

The only problem is that there are some compatibility issues with elasticsearch 6.x that I still need to solve.

ael-code avatar Nov 30 '17 20:11 ael-code

Additionally it is still necessary to correctly expose the data volume of the two docker containers and provide a straightforward way to pass the libreant configuration to the docker service.

ael-code avatar Nov 30 '17 21:11 ael-code

Mortacci tua! :)

I'll be on it tonight while I'm in train. I hope to look at what you did.

++DAJE

leophys avatar Dec 01 '17 15:12 leophys

I was reasoning on this and in particular on the title of the PR. As @boyska stated, we already have travis making all the tests for us. So I wouldn't use docker to substitute or to be integrated in travis.

Instead I think Docker will be really useful for the following scenarios:

  • Deploy libreant: We can provide an easy way to deploy and configure libreant through container based technology. For this purpose we should provide specific images for all the feature release of libreant. The image build process should fetch the source code from git tagged releases and the docker files should be placed in a stand-alone repository.
  • Development environment I'm actually using docker-compose to locally run libreant and make some test. The docker files should be placed in the project directory and the source code used should be the one you are currently working on.

ael-code avatar Dec 01 '17 17:12 ael-code

@ael-code (cc @boyska) I'd like to clarish my idea: I fundamentally was thinking of your second point

Development environment I'm actually using docker-compose to locally run libreant and make some test. The docker files should be placed in the project directory and the source code used should be the one you are currently working on.

In particular it is true in general that we may develop on different platforms, and keeping the development environment homogeneous may be a pain. What I ment was something as a (debian) container in which elasticsearch and libreant run. Ideally this should happen with the development directory on your local machine mounted on the docker container.

$ docker --rm --ti `pwd`/my-local-libreant:/libreant-dev-in-the-container libreant-docker

What I ment by "running the tests" was to be able to execute

$ pytest -v

Inside the container and get all green lights 😄

Moreover, I'd never deploy in a production environment a docker container (but this is my very own prejudice) against docker as a way to let everyone forget how to configure a server.

In a future issue I'd like to suggest to integrate libreant with uwsgi or something similar.

leophys avatar Dec 03 '17 19:12 leophys

Hi, as I wrote in #338, I'd close this issue and concentrate on modernizing this webapp.

leophys avatar Aug 08 '19 13:08 leophys