orca icon indicating copy to clipboard operation
orca copied to clipboard

Output error message when no display is available

Open scottwilson312 opened this issue 5 years ago • 4 comments

#!/usr/bin/env node


const path = require('path')
const { spawn } = require('child_process')
const electronPath = require('electron')

const args = process.argv.slice(2)
const pathToMain = path.join(__dirname, 'orca_electron.js')
args.unshift(path.resolve(pathToMain))

spawn(electronPath, args, { stdio: 'inherit' })
root@mw-8479d67f8b-nxzdl:/usr/bin# orca
root@mw-8479d67f8b-nxzdl:/usr/bin# orca kcdjkajfd
root@mw-8479d67f8b-nxzdl:/usr/bin# node orca

I'm not familiar enough with node to know what's up. This is inside an Ubuntu docker. The script isn't erroring out, but it isn't producing any output.

scottwilson312 avatar Mar 23 '19 22:03 scottwilson312

Within a Docker container, one needs to run xvfb

Xvfb (short for X virtual framebuffer) is an in-memory display server for UNIX-like operating system (e.g., Linux). It enables you to run graphical applications without a display (e.g., browser tests on a CI server) while also having the ability to take screenshots.

I am working on releasing an official Docker image for Orca. Stay tune, it is coming very soon!

antoinerg avatar Mar 25 '19 16:03 antoinerg

@scottwilson312 I went ahead and changed the title of the issue. I agree that the current behavior is not user-friendly at all... In the absence of a display, an error should be displayed to the user.

Thanks for reporting this!

antoinerg avatar Mar 25 '19 16:03 antoinerg

Thanks for the response, much appreciated. I ended up getting it working with xvfb, however I needed to run the docker container as privileged.

I ended up adapting the dockerfile here https://hub.docker.com/r/cpsievert/plotly-orca/dockerfile

scottwilson312 avatar Mar 26 '19 07:03 scottwilson312

Similarly, we should output a friendlier error message when plotly.js cannot be found by the renderer as discussed in https://github.com/plotly/orca/issues/232

antoinerg avatar May 28 '19 02:05 antoinerg