leonardo icon indicating copy to clipboard operation
leonardo copied to clipboard

Custom image on Terra generates confusing error.

Open DailyDreaming opened this issue 4 years ago • 2 comments

Hi, loading a custom image on Terra appears to give me an odd error message:

Error creating cloud environment
Image dailydreaming/genome_browser:r-0.2 doesn't have JUPYTER_HOME or RSTUDIO_HOME environment variables defined. Make sure your custom image extends from one of the Terra base images.
Full error:
{
  "source": "leonardo",
  "message": "Image dailydreaming/genome_browser:r-0.2 doesn't have JUPYTER_HOME or RSTUDIO_HOME environment variables defined. Make sure your custom image extends from one of the Terra base images.",
  "statusCode": 404,
  "exceptionClass": "class org.broadinstitute.dsde.workbench.leonardo.model.InvalidImage",
  "traceId": "c208044856f53329a2bfbe39c049a041/13740522386863581092"
}

The image dailydreaming/genome_browser:r-0.2 has worked before on Terra as a custom image, but is now breaking when attempting to use it again months later. It also has RSTUDIO_HOME defined, so I'm not sure that the error message is accurate.

A clearer error message would solve this issue for me.

DailyDreaming avatar Oct 04 '21 14:10 DailyDreaming

Hi @DailyDreaming ,

I debugged a bit and I think Leo is choking on env vars in the image that are defined but have no values. In particular these 2:

USER_HOME=
USER=

The error is misleading and I think Leo could tolerate this situation a little better. I can make a fix.

However! For this integration going forward we should stop using the runtimes routes with the hacky unused env vars. Instead we should attempt to use the apps routes. Here is an example createApp request for the same image:

{
  "diskConfig": {
    "name": "my-disk"
  },
  "appType": "CUSTOM",
  "descriptorPath": "https://raw.githubusercontent.com/DataBiosphere/terra-app/main/apps/ucsc_genome_browser/app.yaml"
}

Note this references the app descriptor here: https://github.com/DataBiosphere/terra-app/blob/main/apps/ucsc_genome_browser/app.yaml

This schema is a bit more flexible: it lets you define the image, port, and other metadata about the app.

rtitle avatar Oct 04 '21 17:10 rtitle

@rtitle Thanks for looking into this. I'll try running it with the create app API and see how that goes next. I'm also transitioning to basing the image on us.gcr.io/broad-dsp-gcr-public/terra-jupyter-r:2.0.1 rather than cloudtop, so hopefully everything it expects to find in the image will be there once I make the change.

DailyDreaming avatar Oct 05 '21 15:10 DailyDreaming