-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
add command line option to execute the optimize task standalone #6057
Comments
Seems reasonable, though we don't really need it immediately. If you want to submit a pull we would happily accept it, otherwise it'll probably be awhile. |
I'm using this as a workaround in my Dockerfile:
|
Here is the hack I used in my Dockerfile (kibana-4.5.2):
That way you don't have to rely on an arbitrary sleep value |
Hack from @smousa helps me, but I'm still waiting for an official command that I can execute while I'm building docker image.
|
This would also help in faster deploys on Kubernetes. [EDIT: The above hack works it would still be good to have the command line option.] |
mark, also need this feature |
+1 to getting this added, would be much better to be able to compile AOT rather than JIT on ephemeral container based platforms |
As I commented on #10724 , this can also be caused by setting environment variable
|
My workaround for making a Kibana Docker image with the bundles pre-optimised is to just install a plugin of any kind during the image build stage, as that causes the bundles to be built. |
Seems as though the optimize doesn't happen now if it can't connect to elasticsearch. So starting the kibana command doesn't trigger optimize. Really sucks waiting so damn long for this image to come up every single time. |
Is there any plan to implement this? |
Makes for some pretty crappy docker images when you have to wait like 5 minutes for it to respond. |
I'd like this feature, any ideas for release timing? |
it should have a way to build the image optimized. It makes no sense to optimize on launch, even more in our containers world... The optimization step is making impossible to deploy in servers where you have the exact hardware for runtime. Now you need the requirements for runtime plus the requirements for optimizing (let's call it rebuilding). No sense at all... |
WIth a little bit of cpu capping, our Kibana pods in Kubernetes takes close to 30 minutes to start. We desperately need a robust way of pre-compiling Kibana, hopefully without requiring an active Elasticsearch cluster while compiling (we're just setting some x-pack flags) |
I've been patching Kibana myself, I can supply the backported patch if
you'd like
…On Fri, 2 Feb 2018 at 10:47 Trond Hindenes ***@***.***> wrote:
WIth a little bit of cpu capping, our Kibana pods in Kubernetes takes
close to 30 minutes to start. We desperately need a robust way of
pre-compiling Kibana, hopefully without requiring an active Elasticsearch
cluster while compiling (we're just setting some x-pack flags)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#6057 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAFR810lD9nJP8Pariv55QDAAYMKalM1ks5tQuepgaJpZM4HQViq>
.
|
@FireBurn that would be nice. The bundling and optimizing thing takes about 8 minutes in a 16 core environment after installing a plugin. We should have a way to do this just once. |
seriously , me too checking, how can i run my kibana plugin code, without caching and optimizing code in dev environment. I am trying to find the way, no need to start kibana server again and again after my change in dev environment |
True... fixing a deprecated plugin is a mess... An environment parameter could be useful. |
I'm not sure how long the hacks will keep working, but I found something that works for me. I wanted a custom image of Kibana with a few plugins installed, and a few x-pack settings for disabling some features (causes a reoptimization). I ended up waiting for optimization to finish in the container, then did a |
This particular snippet of Dockerfile allows me to trigger optimization when building my customized Kibana image with Search Guard plugin (not shown) installed. In production, the docker image loads quickly without having to wait for "optimization" during start-up. Using "/usr/local/bin/kibana-docker" instead of "kibana" as seen in Jarpy's original answer, allows some official helper scripts to translate environment variables to appropriate Kibana settings, such as capturing "XPACK_SECURITY_ENABLED false" to "xpack.security.enabled=false" in this particular example. |
unfortunately i'm running into this on 6.4.0, even when using the trick above to optimize before uploading our customized image. Dockerfile:
during build:
on start:
|
@bdashrad If I try the |
@Tenzer i tried a few ways, including the docker file i put above and your suggestion, and still seem to get the optimizing message. I guess we'll skip using the xpack monitoring plugin for now and go back to datadog. |
@d8888's fix works for us currently. We build an image with our preferred modules disabled, works like a charm, startup is instant like it should be. |
Previously when spinning kibana docker container a log message warned of kibana having to optimize and caching bundles, as such: { "type":"log", "@timestamp":"2018-10-18T15:31:44Z", "tags":["info","optimize"], "pid":1, "message":"Optimizing and caching bundles...This may take few minutes" } This would cause kibana to be unreachable for few minutes when starting up the analytics dashboard. This fix moves the optimization at image building time rather than at run time, as suggested by: elastic/kibana#6057 (comment) Feature: Issue 9870 Change-Id: I837d612c988aeebe2d5911003a82cd43e65c6d4b
Previously when spinning kibana docker container a log message warned of kibana having to optimize and caching bundles, as such: { "type":"log", "@timestamp":"2018-10-18T15:31:44Z", "tags":["info","optimize"], "pid":1, "message":"Optimizing and caching bundles...This may take few minutes" } This would cause kibana to be unreachable for few minutes when starting up the analytics dashboard. This fix moves the optimization at image building time rather than at run time, as suggested by: elastic/kibana#6057 (comment) Feature: Issue 9870 Change-Id: Id16df61fab1ea69aef079218adcb07ec35edc137
I'm having similar issues. In my case I believe they are aggravated by the fact that I'm using environment properties on my kibana.yml file, e.g.
Even if I install a plugin during docker build, which takes forever Optimizing and caching browser bundles when I run my docker image I still get Optimizing and caching bundles for ml, stateSessionStorageRedirect, status_page, timelion, graph, login, logout, dashboardViewer, apm and kibana. This may take a few minutes Would using a different environment variable value force the optimization to be ran again? is there any way to not have this behaviour? |
also, would there be a way to keep the result of optimization so that at least optimization is only done once, and not every single time the docker image is restarted? still not ideal, but at least it's waiting for 10min once, not every single time. |
I'm using 6.5.1 and having the same behaviour as bdashrad here: #6057 (comment). In the dockerfile I install search guard, run kibana and grep for "complete". When I start up the container it re-runs the optimize step, not sure if it's triggered by different environment variables and how to avoid that. |
Hello! I have a custom image with Logtrail plugin installed. I've tried to add When I start Kibana on production from my image it runs optimizations immediately:
|
We added a command line option to run the optimize in #16302 A lot of folks here mentioned issues with the duration of the optimize task - this has gotten better over the past couple of years and we hope to soon get rid of it entirely. If there are follow-up issues, please create a new issue or visit us over on the Discuss forums. |
For those who need a pre-cache in docker build stage, this worked for me: |
@bernieke just pass |
Does that work for version 6.2.3 OSS? |
@elpaisa No, this PR is not included in 6.2.3 OSS. You have to merge it yourself in the distribution. Attention: docker files are different from those in github. If you want to patch it and you are using docker version, see https://discuss.elastic.co/t/difference-between-kibana-github-and-kibana-docker-oss/200001. Kibana triggers the optimization process if at least one loaded file changed from the last optimization process. This applies also to configuration files. |
@orinciog, that is correct for all builds. The Javascript files in the builds are transpiled using Babel. If you want to make modifications to the underlying source code you will need to run a build. You can find more information on that with |
We change the basePath setting before packaging, and want to avoid having the optimize step run on each node that package is deployed to. (Also, we don't want to give the user running kibana write permissions to the kibana sources.)
I've now written a small script to run kibana, and scrape the output to detect the end of the optimize step, upon which it kills the process.
Better would be if this could be done directly through a command line option.
The text was updated successfully, but these errors were encountered: