Skip to content

Distributing this thing #21

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

Closed
etpinard opened this issue Oct 6, 2017 · 16 comments
Closed

Distributing this thing #21

etpinard opened this issue Oct 6, 2017 · 16 comments

Comments

@etpinard
Copy link
Contributor

etpinard commented Oct 6, 2017

On top of the @plotly/image-exporter npm package , we'll add standalone Mac, Linux and Window binaries to the release section after every release similar to what's done currently in plotly-database-connector.

Standalone binaries ship with node.js and electron bundled up, but without the fonts we use on prod (if users want the fonts, they'll have to install them locally or use docker). We'll probably use electron-packager same as plotly-database-connector for this task, although there are other options. This part is easy.

Now, we need to figure how to distribute image-exporter to python and R API users. We'll also need to write (thin) python and R wrapper around the plotly-graph-exporter CLI command e.g in python:

from subprocess import call
import json

fig = {"data": [{"y": [1,2,1]}]}
call(['plotly-graph-exporter', json.dumps(fig)])

For distributing, I can think of three different options:

  1. Include the image-exporter standalone binaries in plotly.py and plotly.R packages and write the wrapper there, similar to what we currently do with the plotly.js bundle for offline. Potential problems, we'll have to make platform-dependent installs - is that possible with pip and CRAN? Download times might increase significantly too.
  2. Make new plotly-image-exporter py/pip and R/CRAN packages from this repo - which would include the py/R wrappers. This option would require platform-specific install too.
  3. Make users download and install the standalone binaries from this repo's release section, add wrapper code to plotly.py and plotly.R and make them spit out errors if called when plotly-graph-exporter isn't installed.

cc @chriddyp @cpsievert @jackparmer

@cpsievert
Copy link
Contributor

(3) would certainly be doable/easiest for R (assuming bundles are relatively small)

@jonmmease jonmmease mentioned this issue Apr 7, 2018
@jonmmease
Copy link
Contributor

Quick thought regarding packing this for python users.

poppler and nodejs are both available in the main conda repository (at least for linux and os x, poppler actually isn't available in the window repo). I wonder if it would be feasible (sensible?) to create a conda package that has dependecies on nodejs and poppler and basically just contains the bin/, src/, and node_modules/ directories from this repo, plus a thin python subprocess wrapper around plotly-graph-exporter.js.

cc @jackparmer @chriddyp

@jackparmer
Copy link
Contributor

I wonder if it would be feasible (sensible?) to create a conda package that has dependecies on nodejs and poppler and basically just contains the bin/, src/, and node_modules/ directories from this repo, plus a thin python subprocess wrapper around plotly-graph-exporter.js.

I'm all for this as long as we can get to a point where we feel it works in a bulletproof way. Otherwise be prepared for hundreds of plotly.py user complaints/issues on GitHub and the forum 😬

@etpinard
Copy link
Contributor Author

etpinard commented Apr 9, 2018

To note, we only need poppler for eps exports. Not sure what percentage of python users export in eps, but I suspect it is small.

@jonmmease
Copy link
Contributor

I was assuming poppler was needed for PDF export as well. Nice to know that this isn't the case. So poppler could be an optional dependency.

I may try out what I outlined above for some internal needs. If I do I'll report back. But, to Jack's point, this would certainly require a bit more thought, and a lot more testing, before promoting it to the plotly.py community.

@JamesCropcho
Copy link
Contributor

I tend to favor one way of doing something, over multiple (yes, it's very pythonic of me, ha). So, though my voice is small in these matters, in this case I therefore advise a single vector of local installation.

@jonmmease
Copy link
Contributor

@JamesCropcho That's certainly reasonable :-) What would be your preferred approach for local installation? Is it currently possible to create standalone binaries? I don't see anything in https://github.com/plotly/image-exporter/releases and I don't know enough about electron to build them myself from the repo.

@JamesCropcho
Copy link
Contributor

@jmmease Local installation is actually being figured out and implemented by Plotly and me very actively right now. Hopefully this will be soon possible for Plotly users.

@etpinard
Copy link
Contributor Author

from @jackparmer

image

@JamesCropcho
Copy link
Contributor

Orca sounds nice.

@jackparmer
Copy link
Contributor

@cpetzold and NPM support very kindly helped us acquire the NPM package name orca. 🙇 https://www.npmjs.com/package/orca is owned by NPM user plotly now.

image

@etpinard
Copy link
Contributor Author

etpinard commented Apr 25, 2018

More things to think about from #78:

@n-riesco wrote:

Since the electron app only has one entry point (package.json:main), how about having a single app named plotly-exporter that takes as first argument server, graph, dash-report, ...?

I replied:

Augmenting on @n-riesco 's #78 (comment), maybe we could expose that single entry point as plotly-export (instead of plotly-exporter), so that we get very clean (and cute) sounding CLI commands like:

$ plotly-export graph first.json second.json https://plot.ly/~empet/10 --format pdf

$ plotly-export dash-report https://my-dash-report.com

$ plotly-export serve --port 9090

I still think a single entry point would be the option that scales the best for this project. So now we have:

$ orca graph first.json second.json https://plot.ly/~empet/10 --format pdf

$ orca dash-report https://my-dash-report.com

where the first argument indicates which orca component to use. @JamesCropcho had some reserves about orca serve. We can leave that out of the first release.

@etpinard
Copy link
Contributor Author

... oh and RE #21 (comment), yes we should make our first release v1.0.0.

@JamesCropcho
Copy link
Contributor

yes we should make our first release v1.0.0.

Okay, I have done so, in #82: https://github.com/plotly/orca/pull/82/files#diff-b9cfc7f2cdf78a7f4b91a753d10865a2

@etpinard
Copy link
Contributor Author

Orca v1.0.0 is out:

Please see the installations instructions here.

Our release process is far from perfect, but good enough I'd say to close this issue closed.

@mungojam
Copy link

It would be useful for my workplace if this was bundled in a python package as we don't currently have a good internal way to distribute anything else like node packages as we are python focused. You can make OS dependent wheel files as other projects do

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

No branches or pull requests

6 participants