-
Notifications
You must be signed in to change notification settings - Fork 202
new validation seems quite slow #1051
Comments
@jstrachan that's long. Btw how long it used to take without validation? Yes, work is going on for optimizing schema loading #1034 |
using that CLI still seems to validate....
|
@jstrachan oh thats my bad, its should be true
|
ok no validation:
validation:
so > 6 mins just validating |
wohh that's too much!! |
I expected validation (until fixed by #1034) would download ~300k per resource from github, so ~2MB and few seconds of delay in the average case. @jstrachan what project are you trying to build? |
am using this project: https://github.com/fabric8io/fabric8-platform which adds > 6 minutes of just validation to the build. I guess part of my issue is I don't have crazy fast wifi ;) I wonder could we at least cache the ~300k resources in the local maven repo; it seems like its downloading ~300k to validate every YAML file - of which there are many of them in the fabric8-platform project - can we cache whatever is downloaded/parsed within a single maven build across different YAML files / maven modules? |
Yeah, in fact that is a collector of resources. The problem with current implementation is that no cache is being used at all. We were looking for a prepackaged jar with all resources to solve this problem, but also caching resources using tmp files or also the maven repo (to have them available across executions) is a good solution. @hrishin are you looking into it? |
@nicolaferraro yes I'm looking into it and maven package is ready but it has some issues, lets discuss it in #1034. Yes as suggested simple in memory caching of files sounds good idea as well, any pointers on how we can cache files in maven workflow? Note: @jamesnetherton @nicolaferraro sorry to say that, but again problem in the current flow is, JSON schema has HTTP references to other schema definitions that may span couple of HTTP requests. |
Following are observations for maven plugin (it has bunch of integration tests) Validation:
Without Validation:
|
@jstrachan Observations for https://github.com/fabric8io/fabric8-platform With Validation:
Without Validation:
|
looks like the maven packaged schema is great ;) |
Looks much better! |
@nicolaferraro yes its validation only. I'm looking into other things as well. We can optimize the process of validation
|
From @nicolaferraro @jstrachan Just had a discussion with @hrishin. We should figure out a way to package different versions as required. I am not sure how it can be pushed to Maven central after that but we should definitely have the option to package a version of your choice (maybe we can pass it as a parameter to the CLI or something). Current results shown above are based on master-standalone version. I would like to see what happens if we use 3.6-standalone which is what we should probably use for fabric8-*. What do you folks think? |
we can parameterise how the validation works if we need to. We should be able to release different versions of the schemas / artifacts like any other resource in maven central right? |
Yes we can. We can include all schemas in the single jar or for each version we can have different jar. Assumption: Default validation schema would be latest stable release of K8/OS. @nicolaferraro @jstrachan any suggestions? |
using the latest version would probably do the trick; as the schema is usually fully backwards compatible. I guess folks could parameterise the version of the schema to validate against? Then there's just 1 version of the schema in 1 jar and fmp defaults to the latest one? |
We have to add support for the version parameters. At present state its not implemented yet. If needed we can implement one.
Yes, its latest one. |
probably sticking with the same schema version as is used for the kubernetes-model / kubernetes-client will do for now? (i.e. the latest) |
Agree we should target the latest version only, so 1 single jar with latest schema should be ok, as it's backward compatible. I've included some Maven bits in the spring-boot live reload part of the plugin to dynamically retrieve a specific jar from Maven on the fly (in that case, it was the project-specific version of the spring-boot devtools library). But in this case I'd prefer to bundle the latest schema version directly in the plugin. |
Sounds valid, it may be good to stick with latest version. |
we just release those maven jars to maven central & depend on them in the fabric8-maven-plugin? |
@nicolaferraro looks wise suggestion, thanks :) |
I think we should just put the schema jars in maven-central (for now let's just have 1 schema per jar and let's use the "latest" released version i.e. 3.6). This keeps the size of fmp to its current size and also fmp can download schema jar when it needs it and also do so when schema jar gets updated. My only suggestion would be let's stick some version that we can fall back on like 3.6 as opposed to Also, @hrishin can you please link your changes/fork here? |
the kubernetes-model project, that generates the DTOs for the kubernetes + openshift schema - also generates and releases a json schema. I wonder if we can reuse that - then the kubernetes-model + json schema stay in sync? |
BTW you should be able to look for |
Here we need a property like
|
fix #1051: resource validation is slow
now we've validation builds seem quite slow. e.g. if you clone and build this repo it used to be pretty fast: https://github.com/fabric8io/fabric8-platform
Now its about 9 minutes on my laptop - just doing YAML generation/validation mostly. After 1 build there should be no downloading from the internet or anything; so should be pretty snappy.
I wonder if the validation stuff could be tuned a bit? e.g. is it loading the schema from scratch as it validates every YAML file in every repo?
The text was updated successfully, but these errors were encountered: