Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Volumes in compose #897

Closed
soanni opened this issue Oct 4, 2016 · 5 comments
Closed

Volumes in compose #897

soanni opened this issue Oct 4, 2016 · 5 comments

Comments

@soanni
Copy link

soanni commented Oct 4, 2016

Hello Codenvy team,
Today we discussed with Brad possibility to implement volumes in Codenvy compose environments.
Let me share with you my thoughts about how it can be possibly implemented.

  1. During installation Codenvy could create some folder on the host filesystem like /codenvy_volumes
  2. When someone starts to create a workspace (for example, workspace_1) from compose Codenvy will create a subfolder /codenvy_volumes/workspace_1
  3. Let assume that i have this compose file:
lhq-web:
    build:
      context: ./lhq/lhq-web/
      args:
        - JAVA_VERSION=7u80
        - JAVA_RELEASE=b15
        - TOMCAT_VERSION=6.0.45
        - APACHE_VERSION=2.2.31
    image: 89295756879.dkr.ecr.us-east-1.amazonaws.com/aurea/lyris-hq:lhq-web_v1.1
    command: /usr/local/startup.sh
    container_name: lyrishq_web
    networks:
      internal:
        aliases: ['lhq.ec2.internal']
    volumes:
    - lhq_conf:/usr/local/conf
    - lhq_webapp:/usr/local/tomcat/webapps
    - lhq_tomcat_log:/usr/local/tomcat/logs
    - lhq_apache_log:/usr/local/apache/logs
    depends_on:
    - database
    - lhq-queue
  1. So during workspace creation Codenvy will create this folders:

/codenvy_volumes/workspace_1/lhq_conf bound to container 'lhq_web' /usr/local/conf
/codenvy_volumes/workspace_1/lhq_webapp bound to container 'lhq_web' /usr/local/tomcat/webapps
/codenvy_volumes/workspace_1/lhq_tomcat_log bound to container 'lhq_web' /usr/local/tomcat/logs
/codenvy_volumes/workspace_1/lhq_apache_log bound to container 'lhq_web' /usr/local/apache/logs

Or may be even better to create inside one more folder named under container's name like this:

/codenvy_volumes/workspace_1/lhq_web/lhq_conf bound to container 'lhq_web' /usr/local/conf
/codenvy_volumes/workspace_1/lhq_web/lhq_webapp bound to container 'lhq_web' /usr/local/tomcat/webapps
/codenvy_volumes/workspace_1/lhq_web/lhq_tomcat_log bound to container 'lhq_web' /usr/local/tomcat/logs
/codenvy_volumes/workspace_1/lhq_web/lhq_apache_log bound to container 'lhq_web' /usr/local/apache/logs

  1. If it's possible also implement read-write permissions (for example, :ro)
  2. After workspace got deleted - all folders tree also got deleted.

Thank you.

@soanni
Copy link
Author

soanni commented Oct 4, 2016

use case: if a volume is a folder for database (which is very likely for database container). Sys admins can implement back-up scripts on host to properly back up database.

@ghost
Copy link

ghost commented Oct 4, 2016

@soanni what if you just mount some host dirs to all workspaces that you start in the system? There's such a property in codenvy.pp

@soanni
Copy link
Author

soanni commented Oct 5, 2016

@eivantsov okay, i want to try it.

i set up the option, created the folder, set user:group to 'codenvy' on this folder

image

And got this error during workspace start-up

image

@bmicklea bmicklea assigned garagatyi and ghost and unassigned garagatyi Oct 10, 2016
@ghost
Copy link

ghost commented Oct 11, 2016

@soanni The format is as follows:hostPath:containerPath

@TylerJewell
Copy link
Contributor

@eivantsov - let's get this added to the default .pp file on what the format is. The example that we provide didn't make it clear that it's hostPath:containerPath.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants