0

I have a workspace with the following config

{
  "environments": {
    "default": {
      "machines": {
        "db": {
          "attributes": {
            "memoryLimitBytes": "536870912"
          },
          "servers": {},
          "agents": [
            "org.eclipse.che.terminal",
            "org.eclipse.che.exec"
          ]
        },
        "dev-machine": {
          "attributes": {
            "memoryLimitBytes": "2684354560"
          },
          "servers": {},
          "agents": [
            "org.eclipse.che.ssh",
            "org.eclipse.che.ws-agent",
            "org.eclipse.che.terminal",
            "org.eclipse.che.exec"
          ]
        }
      },
      "recipe": {
        "type": "compose",
        "content": "services:\n db:\n  image: 'terrywbrady/dspacedb:latest'\n  mem_limit: 1073741824\n dev-machine:\n  image: 'terrywbrady/dspace:latest'\n  mem_limit: 2147483648\n  depends_on:\n   - db\n",
        "contentType": "application/x-yaml"
      }
    }
  },
  ...
}

I can start my workspace, build code, and deploy to tomcat. Data is written to postgres.

When I halt my workspace and then restart it, all of my built content is gone.

How can I declare volumes that will persist from workspace session to workspace session?

terrywb
  • 3,740
  • 3
  • 25
  • 50

1 Answers1

0

It really depends on a Che flavor and version you are using. Is it local Che? Which version of Che? Is it hosted at codenvy.com? Is it on Docker or openshift or kubernetes? Depending on this I can help you figuring out what to do.

So looks like there are couple of ppl that run different flavours of Che. And there are other flavors which could be interesting for other ppl.

For codenvy there are 2 solution (it runs enterprise grade modification of Che 5): - snapshot workspaces - configure software to persist data in /projects folder which is automatically synced

For local Che 6 (which has all the enterprise stuff and more out of the box) it is better to follow thread on GitHub. There is no snapshotting functionality but it allows to configure volumes for custom paths. Depending on a platform that runs Che 6 (Docker, Kubernetes, Openshift) you might need to additionally configure Che to achieve persistence in a way that fit your needs best. To get more info it is better to ask on GitHub since all the maintainers track it.

gaal
  • 148
  • 1
  • 5
  • I am running on Codenvy. I have been able to work around this by deploying code to /home/user/... and by setting PGDATA to /home/user/pgdata – terrywb Mar 15 '18 at 16:32
  • The following link was shared with me regarding setting up volumes in Che. I need to experiment with this to see if it allows me to use more meaningful path names. https://www.eclipse.org/che/docs/6/che/docs/volumes.html – terrywb Mar 15 '18 at 16:34