-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Working with multiple Kibana source codes in parallel #27390
Comments
Kibanas styling(thanks Joe!) (function() {
'use strict';
const colors = {
"5601": "#215732",
"5701": "#1857a4",
"5901": "#d14a29",
"5101": "#028a15"
};
const style = document.createElement("style");
const color = colors[location.port] || 'white';
style.innerText = `.euiHeader:first-child { background-color: ${color}; }`
style.type = "text/css"
document.head.appendChild(style);
/*
* Copyright 2011 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var link = document.querySelector("link[rel~='icon']");
var allLinks = document.querySelectorAll("link[rel~='icon']");
if (!link) {
link = document.createElement("link");
link.setAttribute("rel", "shortcut icon");
document.head.appendChild(link);
}
allLinks.forEach(currentLink => {
if (currentLink !== link) {
currentLink.remove();
}
})
var faviconUrl = link.href || window.location.origin + "/favicon.ico";
function onImageLoaded() {
var canvas = document.createElement("canvas");
canvas.width = 180;
canvas.height = 180;
var context = canvas.getContext("2d");
context.drawImage(img, 0, 0);
context.globalCompositeOperation = "source-in";
context.fillStyle = color;
context.fillRect(0, 0, 180, 180);
context.fill();
link.type = "image/x-icon";
link.href = canvas.toDataURL();
};
var img = document.createElement("img");
img.addEventListener("load", onImageLoaded);
img.src = faviconUrl;
})(); This styles the header and the favicon: VS CodeHere are my settings that look nice and the colors are the same as for Kibanas:
|
This issue is an informational issue.
When working with Kibana I often need to switch between tasks (e.g. reviewing a PR and continue working on my own changes). To prevent needing to stash everything, switch branches,
yarn kbn bootstrap
,yarn start
for every of these context switches. I usually have multiple instances of the Kibana source code in parallel, so I can use one for my coding, while using another for testing/reviewing a PR, etc. So I wanted to share my setup here in case it's useful for other people too.Running Kibanas in parallel
To run another instance in parallel you need to change a couple of settings in the copies
kibana.yml
. For dev purposes it's best to create akibana.dev.yml
in theconfig
folder, which is already ignored by Git and will be used automatically when runningyarn start
. To switch ports for an instance, so it can run in parallel, you just have to place the following three settings in thekibana.dev.yml
(I usually use 5701 for the first copy, 5801 for the second, and so on):Note:
optimize.watchPort
is no longer needed from 7.10 onwards (PR).Now you can easily start all instances in parallel. They will still all connect to the same Elasticsearch, which is for me the desired behavior so I don't need to run multiple instances and all have the same saved objects.
VSCode Workspace Styling
Since it often happened to me, that I am confused around which instance I have opened in which editor window and sometimes happen to make changes in a different instance then I expected, I am now using VSCode's workspace settings to give my different Kibana instances different titlebar styling.
I just place the following code in the workspace settings (
.vscode/settings.json
) of the respective folder:That way I add the Port to the window title, so I can see it directly and also have either a regular window titlebar color, a pink one (I actually named that folder
kibanaPink
) or a green one (kibanaGreen
). That makes mistaking the different editor instances way harder:Please feel free to leave your comments or add useful scripts/snippets for your multi Kibana instance setup.
The text was updated successfully, but these errors were encountered: