-
-
Notifications
You must be signed in to change notification settings - Fork 41
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
Resources as artifacts and integration core components into Dash #111
Conversation
Thanks @waralex, yes from the looks of it the artifact approach used here should work out alright. It can be a bit of a pain to have to do the artifact uploads (even if an automated script exists) if they do happen to change reasonably often. We recently came up with another approach (https://github.com/JuliaPackaging/RelocatableFolders.jl) which is working out reasonably well for this kind of requirement of shipping non-Julia assets that are still relocatable without having to go through the process of artifact creation and distribution. Whether it would actually make this specific PR less complex I couldn't say for certain. |
Thank you for participating @MichaelHatherly! |
Yeah, that definitely makes sense to just use artifacts then in that case. I assume that custom component packages (https://github.com/facultyai/dash-bootstrap-components for example) will need to do their own artifact creation for their custom components. How much of the generator/upload scripts here will be re-useable by others? Would be great for them not to have to go copy-pasting scripts and altering things here and there to make it work. |
Yesterday I suggested to @alexcjohnson to make an analog of JuliaBinaryWrappers. I.e. flow when any user (not only the components maintainer) can add a PR to a repository with the information necessary to run the generator. And after approve this PR bot from Plotly will release the artifacts and the wrapper package over them. What do you think of this idea? |
That sounds pretty neat, would definitely remove some friction in the process. Is this with all the language bindings (not just Julia) in mind, or specific to dealing with Julia? |
We'll leave Python where it is, but yes it's definitely worth considering an approach like this for other languages. R takes a good deal of language-specific knowledge to make a release, particularly if we try to have all of these packages available on CRAN; This is both a motivation in favor of relieving the component maintainer of this responsibility, and a concern that it may not be possible to automate the process to the extent we can in Julia. .NET is still taking shape, but I've suggested adapting this kind of approach there as well. |
This PR is a demonstration of the concept of using artifacts instead of hardoded resources as well as collecting resources from the python dash without manual copying.
Using artifacts:
Collecting resources from python dash
gen_resources
with the code for generating resources appeared in the root of the repositoryjulia --project=gen_resources gen_resources/generate.jl [--deploy]
gen_resources/Sources.toml
pip install <dir>
in Julia's PyCall environmentPyCall
, it import modules fordash_render
and the main components (the modules that need to be imported are also specified inSources.toml
)_js_dist
and_css_dist
of the renderer and modules, a list of resources corresponding to the module is formedmetadata.json
of modules it generate metadata for component functionsSources.toml
) is сloned and populated with data previous stepsresources
folder of resource repo--deploy
command line argument is specified then:Using the OAuth app, the resource repository is pushed, a tarball with an artifact is created, and a new release is created in the resource repository to which the tarball is applied
9.Artifact bound into
Artifacts.toml
ofDash