-
Notifications
You must be signed in to change notification settings - Fork 73
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
[POC] Validation of zip packages using javascript #285
base: main
Are you sure you want to change the base?
Conversation
💔 Build Failed
Expand to view the summary
Build stats
Steps errorsExpand to view the steps failures
|
Thanks for experimenting with this! One question I have is whether or not it would be possible to validate a package without having to save a zip file on disk. Ideally we could pass in a This could also be used as the basis for supporting development of bundled packages directly in the Kibana repo if we could easily access the ability to build a package from a directory. This could be done by using the CLI directly as well in build steps, but it'd be nice to only have way of interacting with elastic-package from our JS code in Kibana. cc @kpollich In terms of packaging and consuming from the Kibana repository, it'd be ideal if elastic-package distributed a |
There are some options for this, the main challenge would be to see how we can plug something like a buffer of bytes in JS to Go. But for example the
Do you expect some use case where this would be needed apart of in build time? In build and development time I guess that it is ok to use the
I have tried to build |
Right this would be a build-time step, so using the elastic-package binary directly might be fine. Thought it might be simpler from a maintenance perspective if we had a single WASM target/NPM package that would support both use cases, but happy to explore using the binary directly. |
@joshdover I have added to the POC package validation using a |
.ci/Jenkinsfile
Outdated
@@ -52,6 +52,7 @@ pipeline { | |||
stage('Test') { | |||
steps { | |||
cleanup() | |||
installTools([ [tool: 'nodejs', version: '10.0' ] ]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't work.
Very nice, that should make consuming this from Kibana very easy. Note that we won't be able to start using this validation until #23 is resolved since the Endpoint package has a transform and index template that aren't valid in the spec currently. |
I got this working in Kibana, but it required a small adjustment to the interface to be able to use this from Node.js. Here's the adjustments to this PR: jsoriano#1 |
Make more easily compatible with Node.js
Great, thanks @joshdover for giving it a try :) We would have to think about how to package this functionality for node, and what functionality to expose. Do you think it can be a problem to include wasm in Kibana? |
Got this preliminary answer, and expecting @azasypkin to chime in as well. No immediate concerns for server-side usage, but client-side may need some research, but I don't think it's necessary: elastic/kibana#128076 (comment) |
We had a discussion about this topic in an internal meeting of the Fleet team, some points we discussed:
|
If we manage to build with tinygo we may solve some of the problems mentioned above: smaller artifact, local exports, no need to keep the go instance running. |
What does this PR do?
Validates packages in zip format from JavaScript, using WebAssembly.
Why is it important?
To use the same validation code in Go-based tooling and JavaScript components as Fleet.
Checklist
test/packages
that prove my change is effective.versions/N/changelog.yml
.Related issues