Skip to content

Conversation

@antoinerg
Copy link
Collaborator

@antoinerg antoinerg commented Mar 27, 2019

Closes #187

@scjody suggested we reuse our existing Dockerfile to publish our official Docker images. In order to do so, I had to adapt its ENTRYPOINT to support CLI invocation (see #187 (comment) for details). If the first argument is either --version, --help or graph we assume Orca is used as a CLI. If the first argument is serve or anything else, we launch the server as we used to do.

  • Publish Docker image as plotly/orca
  • Support CLI invocation
  • Advertise our Docker image in the documentation
  • Add image tests

image tests

The inclusion of image tests in this PR eliminates the risk of missing dependencies in the final Docker image. By using software rendering, we get reproducible images that we can compare pixel per pixel with a set of baselines in an exact manner. By visually testing all image formats (pdf, eps, svg, png, emf), we catch missing system dependencies such as Poppler, Inkscape, Mathjax or missing fonts. Hopefully, this will catch regressions whenever we perform system upgrades.

  • document image tests in CONTRIBUTING.md
  • runs automatically on CircleCI as a final job

@plotly/devops please have a look at the new entrypoint.

@jonmmease
Copy link
Contributor

Thanks for working on this @antoinerg, this is going to be really helpful!

I'd like to see if we can work through how Python/R/Julia users could take advantage of orca as a docker image without each library needing to include docker related logic. Would it be possible to distribute a shell script, orca.sh, that presents that same interface as the native orca binary? Something like

if orca graph then call docker run -i quay.io/plotly/orca graph "$@"

if orca serve --port=8123 then call docker run -d -p 8123:8123 quay.io/plotly/orca "$@"

The R and Julia libraries use the orca graph command line API, while plotly.py uses the orca serve API with --port and --graph-only options. If we had a shell script like this for users to put on their path then I think all of the client libraries would work without modification. Can docker pull add something to the PATH or would that have to be a manual step?

What do you think?

@antoinerg
Copy link
Collaborator Author

Thanks for working on this @antoinerg, this is going to be really helpful!

I'm glad to see lots of people are excited about this one!

I'd like to see if we can work through how Python/R/Julia users could take advantage of orca as a docker image without each library needing to include docker related logic. Would it be possible to distribute a shell script, orca.sh, that presents that same interface as the native orca binary?

That is certainly one of the goal here. Making an orca.sh shell script calling Docker as you suggested would be great and I will try to add one to this PR.

Can docker pull add something to the PATH or would that have to be a manual step?

As far as I know, it cannot. It would have to be a manual step.

@scjody
Copy link

scjody commented Mar 28, 2019

Sounds like a great idea to me!

Minor request: if you're adding a tool that users are expected to run, it should not have a .sh (or .bash, .py, etc.) extension. Rationale

Also note that we have a company-wide bash style guide (mostly incorporates Progrium's).

@etpinard etpinard added this to the v1.3 milestone Apr 17, 2019
It forwards a call to Orca in Docker in a seamless fashion by:
- binding the container to the host's networking stack
- bind-mounting the current folder into the container at the same path
- setting the current directory to the current path
@antoinerg
Copy link
Collaborator Author

antoinerg commented Apr 26, 2019

@jonmmease I wrote a little shell script in commit 94bb0a4 to call Orca in Docker. Please see the commit message for details. Also, can you test it out on MacOS and adapt it if it doesn't work. Anyway, let me know what you think!

@antoinerg antoinerg changed the title Release official Docker image Release official Docker image + pixel exact image tests Apr 26, 2019
@antoinerg
Copy link
Collaborator Author

antoinerg commented May 23, 2019

Any comments for this PR? @etpinard @jonmmease @plotly/devops

Thank you all!

@etpinard
Copy link
Contributor

💃 from me

@antoinerg antoinerg merged commit f409622 into master Jun 21, 2019
@antoinerg antoinerg deleted the docker-release branch June 21, 2019 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Docker in installation methods

5 participants