Page tree
Skip to end of metadata
Go to start of metadata
Icon

For installation procedure of V1.0, see this page.


In this page we assume you are interested to develop new modules for Cytomine-Core (e.g. new web services, new entity in the data model,...) and/or new modules for Cytomine-IMS (e.g. support of a new image format, new image web service, ...).

If you are only interested to plug a new script of image analysis algorithm, we recommend instead to look at the [DOC] Interoperability (data & algorithms) documentation page.

 

We will explain all the necessary steps to configure a development environment on your computer. The idea is to install a Cytomine instance on your localhost and all the development tools/libraries required so that you can develop and test on your own computer. 

 

Step 1) First of all, retrieve the Cytomine-Core and Cytomine-IMS source code in a local directory (e.g. $HOME/Cytomine/):

Pre-requirements:

Clone Cytomine-core and Cytomine-IMS from our source repository: 

 

Step 2) Install an intregrated development environement (e.g. IntelliJ IDEA Ultimate Edition) and import the Cytomine-Core and Cytomine-IMS source project. 

Step 3) Install Grails.

These two steps are illustrated with screenshots here: How to install IntelliJ, Grails, and import Cytomine projects


Step 4) Create a Dockerized development environment.

One of the main interest of Docker is to have the same environment between developers and final users.

In order to do this and to avoid installation of an additional local machine, we will setup a Dockerized development environment.

Before doing anything else, we will follow the two first points of an Automatic Installation with Docker (the points 3 and 4 will be used after the instructions of this page).

 

Then, choose which module you want to develop : for Core & IMS development or for Core development only.

 

For Core development only.

Make the following changes :

  • In Cytomine_boostrap directory
    • Go to the nginx subdirectory, edit the nginx/deploy.sh file, at the top of the file the command:
    • Replace       sed -i "s/CORE_ALIAS/core/g" /tmp/nginx.conf.sample       by           sed -i "s/CORE_ALIAS/$(route -n | awk '/UG[ \t]/{print $2}'/g" /tmp/nginx.conf.sample
  • In the Cytomine-core/grails-app/conf/Config.groovy file of your Cytomine-core project (in your IDE):
    • Edit the value grails.serverURL (development part) by "http://CORE_URL:8080" (example : "http://localhost-core:8080").
    • Edit the value grails.imageServerURL (development part) by your IMS_URL (on port 80, e.g. "http://localhost-ims:80").
    • Change the storage_path by where you will store the images (e.g. "/data/"). 
    • Below the previous line, add a line storage_buffer="/tmp/" (or another temp directory).
    • Update the value grails.adminPassword by the default password of the admin user
    • Don't forget to fill the grails.notification variables
  • Add the local URLs (e.g. 127.0.0.1 localhost-core) to your /etc/hosts (as explained on the page in the section "If you deploy on a local host").
  • Add the line "127.0.0.1   rabbitmq" to you /etc/hosts file

At the end, in IntelliJ, in the "Run" menu toolbar, Go to "Edit configurations" edit the Command Line by "-reloading -Dserver.port=8080 run-app -echoOut --stacktrace -nocoverage --verbose" 

In Cytomine-boostrap directory, you can now run the script start_dev.sh. This will deploy the Docker containers:

In IntelliJ, you can now run the Cytomine-core project that will simulate a server at the grails.serverURL mentionned above. So in this example you can now access the core development server at http://CORE_URL:8080 to test your core dev environment. It will rely on other containers installed by Docker but use your own core development container.

For Core & IMS development.

As IMS will run on your machine, you will need all the dependencies of IMS : tiffinfo, identify, vips.

Run the following commands to get the related libs :


In Cytomine_boostrap/ directory, make the following changes:

  • In the nginx/deploy.sh file, add LOCAL=$(route -n | awk '/UG[ \t]/{print $2}') and replace ims:8080 by $LOCAL:9080' in the command sed -i "s/IMS_URLS_CONFIG/                        proxy_pass http:\/\/ims:8080; \\`echo -e '\n\r'` IMS_URLS_CONFIG/g" /tmp/nginx.conf.sample
  • At the begining of the nginx/deploy.sh file, replace the command 
            sed -i "s/CORE_ALIAS/core/g" /tmp/nginx.conf.sample   by sed -i "s/CORE_ALIAS/$LOCAL/g" /tmp/nginx.conf.sample
            sed -i "s/IMS_ALIAS/ims/g" /tmp/nginx.conf.sample         by sed -i "s/IMS_ALIAS/$LOCAL:9080/g" /tmp/nginx.conf.sample
  • In the nginx/nginx.conf.sample file, replace proxy_pass   http://IMS_ALIAS:8080;  by  proxy_pass   http://IMS_ALIAS;

Don't forget to add the local URLs to your /etc/hosts.

 

The last modifications need to be done in your development environment (IDE).

  • In the Cytomine-core/grails-app/conf/Config.groovy file of your Cytomine-core project, update the value grails.serverURL (development part) by "http://CORE_URL:8080".
  • In the Cytomine-ims/grails-app/conf/Config.groovy file of your Cytomine-ims project, as long as the database is not Dockerized, update the the cytomine.imageServerPrivateKey and cytomine.imageServerPublicKey values by the private and public keys of the username 'ImageServer1' (in the sec_user table) in the database.
  • In the DataSource.groovy file of your Cytomine-core project, update the value username and password (development part) by "docker" and the url by "jdbc:postgresql://localhost:5432/docker".
  • In the Config.groovy file of your Cytomine-core projectupdate the value grails.adminPassword by the default password of the admin user


At the end, in IntelliJ, in the "Run" menu toolbar, Go to "Edit configurations" edit the Command Line by "-reloading -Dserver.port=9080 run-app -echoOut --stacktrace -nocoverage --verbose".

In Cytomine-boostrap directory, you can now run the script start_dev.sh. This will deploy the Docker containers:

In IntelliJ, you can now run the Cytomine-core and Cytomine-ims projects that will simulate a server. So in this example you can now access the core development server at http://CORE_URL:8080 to test your core dev environment. It will rely on other containers installed by Docker but use your own core and ims development containers.

 

 

 

  • No labels