Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into plugins-styles
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyler Smalley committed Sep 18, 2018
2 parents d511971 + 388c841 commit 093a52c
Show file tree
Hide file tree
Showing 124 changed files with 5,927 additions and 1,173 deletions.
7 changes: 7 additions & 0 deletions docs/plugins.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ If plugins were installed as a different user and the server is not starting, th
[source,shell]
$ chown -R kibana:kibana /path/to/kibana/optimize

[float]
=== Installing plugins while deferring optimization

The majority of the time spent installing a plugin is running the optimizer. If you're installing multiple plugins it can make sense to omit that step and only run it once.
This can be done by providing --no-optimize to the plugin installation command. You can then either execute bin/kibana --optimize to run the optimizer,
or it will be ran the first time Kibana is started.

[float]
=== Proxy support for plugin installation

Expand Down
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@
"d3-cloud": "1.2.1",
"del": "^3.0.0",
"dragula": "3.7.0",
"elasticsearch": "^14.2.1",
"elasticsearch-browser": "^14.2.1",
"elasticsearch": "^15.1.1",
"elasticsearch-browser": "^15.1.1",
"encode-uri-query": "1.0.0",
"even-better": "7.0.2",
"execa": "^0.10.0",
Expand Down Expand Up @@ -213,6 +213,7 @@
"@types/angular": "^1.6.45",
"@types/babel-core": "^6.25.5",
"@types/bluebird": "^3.1.1",
"@types/boom": "^7.2.0",
"@types/chance": "^1.0.0",
"@types/classnames": "^2.2.3",
"@types/dedent": "^0.7.0",
Expand All @@ -238,11 +239,14 @@
"@types/react-dom": "^16.0.5",
"@types/react-redux": "^6.0.6",
"@types/react-virtualized": "^9.18.7",
"@types/redux": "^3.6.31",
"@types/redux-actions": "^2.2.1",
"@types/sinon": "^5.0.0",
"@types/semver": "^5.5.0",
"@types/sinon": "^5.0.1",
"@types/strip-ansi": "^3.0.0",
"@types/supertest": "^2.0.5",
"@types/type-detect": "^4.0.1",
"@types/uuid": "^3.4.4",
"angular-mocks": "1.4.7",
"babel-eslint": "8.1.2",
"babel-jest": "^23.4.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ Object {
],
"type": "log",
},
Object {
"@timestamp": "## @timestamp ##",
"message": "The elasticsearch plugin is disabled. Skipping migrations.",
"pid": "## PID ##",
"tags": Array [
"warning",
"migration",
],
"type": "log",
},
Object {
"@timestamp": "## @timestamp ##",
"message": "Server running at http://localhost:8274",
Expand Down
11 changes: 10 additions & 1 deletion src/cli/serve/serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ function applyConfigOverrides(rawConfig, opts, extraCliOptions) {
if (opts.verbose) set('logging.verbose', true);
if (opts.logFile) set('logging.dest', opts.logFile);

if (opts.optimize) {
set('server.autoListen', false);
set('plugins.initialize', false);
}

set('plugins.scanDirs', _.compact([].concat(
get('plugins.scanDirs'),
opts.pluginDir
Expand Down Expand Up @@ -170,7 +175,9 @@ export default function (program) {
pluginPathCollector,
[]
)
.option('--plugins <path>', 'an alias for --plugin-dir', pluginDirCollector);
.option('--plugins <path>', 'an alias for --plugin-dir', pluginDirCollector)
.option('--optimize', 'Optimize and then stop the server');


if (CAN_REPL) {
command.option('--repl', 'Run the server with a REPL prompt and access to the server object');
Expand Down Expand Up @@ -213,6 +220,7 @@ export default function (program) {
watch: !!opts.watch,
repl: !!opts.repl,
basePath: !!opts.basePath,
optimize: !!opts.optimize,
},
features: {
isClusterModeSupported: CAN_CLUSTER,
Expand All @@ -223,4 +231,5 @@ export default function (program) {
applyConfigOverrides: rawConfig => applyConfigOverrides(rawConfig, opts, unknownOptions),
});
});

}
1 change: 1 addition & 0 deletions src/cli_plugin/install/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export default function pluginInstall(program) {
.command('install <plugin/url>')
.option('-q, --quiet', 'disable all process messaging except errors')
.option('-s, --silent', 'disable all process messaging')
.option('--no-optimize', 'disable optimization after plugin extraction')
.option(
'-c, --config <path>',
'path to the config file',
Expand Down
4 changes: 3 additions & 1 deletion src/cli_plugin/install/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ export default async function install(settings, logger) {

await renamePlugin(settings.workingPath, path.join(settings.pluginDir, settings.plugins[0].name));

await rebuildCache(settings, logger);
if (settings.optimize) {
await rebuildCache(settings, logger);
}

logger.log('Plugin installation complete');
} catch (err) {
Expand Down
1 change: 1 addition & 0 deletions src/cli_plugin/install/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export function parse(command, options, kbnPackage) {
quiet: options.quiet || false,
silent: options.silent || false,
config: options.config || '',
optimize: options.optimize,
plugin: command,
version: kbnPackage.version,
pluginDir: options.pluginDir || ''
Expand Down
6 changes: 6 additions & 0 deletions src/core/server/bootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ export async function bootstrap({
await shutdown(err);
}

if (cliArgs.optimize) {
const cliLogger = root.logger.get('cli');
cliLogger.info('Optimization done.');
await shutdown();
}

process.on('SIGHUP', () => {
const cliLogger = root.logger.get('cli');
cliLogger.info('Reloading logging configuration due to SIGHUP.', { tags: ['config'] });
Expand Down
1 change: 1 addition & 0 deletions src/core/server/config/__mocks__/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export function getEnvOptions(options: DeepPartial<EnvOptions> = {}): EnvOptions
watch: false,
repl: false,
basePath: false,
optimize: false,
...(options.cliArgs || {}),
},
isDevClusterMaster:
Expand Down
6 changes: 6 additions & 0 deletions src/core/server/config/__snapshots__/env.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Env {
"basePath": false,
"dev": true,
"envName": "development",
"optimize": false,
"quiet": false,
"repl": false,
"silent": false,
Expand Down Expand Up @@ -42,6 +43,7 @@ Env {
"basePath": false,
"dev": false,
"envName": "production",
"optimize": false,
"quiet": false,
"repl": false,
"silent": false,
Expand Down Expand Up @@ -76,6 +78,7 @@ Env {
"cliArgs": Object {
"basePath": false,
"dev": true,
"optimize": false,
"quiet": false,
"repl": false,
"silent": false,
Expand Down Expand Up @@ -110,6 +113,7 @@ Env {
"cliArgs": Object {
"basePath": false,
"dev": false,
"optimize": false,
"quiet": false,
"repl": false,
"silent": false,
Expand Down Expand Up @@ -144,6 +148,7 @@ Env {
"cliArgs": Object {
"basePath": false,
"dev": false,
"optimize": false,
"quiet": false,
"repl": false,
"silent": false,
Expand Down Expand Up @@ -178,6 +183,7 @@ Env {
"cliArgs": Object {
"basePath": false,
"dev": false,
"optimize": false,
"quiet": false,
"repl": false,
"silent": false,
Expand Down
1 change: 1 addition & 0 deletions src/core/server/config/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export interface CliArgs {
watch: boolean;
repl: boolean;
basePath: boolean;
optimize: boolean;
}

export class Env {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Array [
Object {
"basePath": true,
"dev": true,
"optimize": false,
"quiet": true,
"repl": false,
"silent": false,
Expand Down Expand Up @@ -58,6 +59,7 @@ Array [
Object {
"basePath": false,
"dev": true,
"optimize": false,
"quiet": false,
"repl": false,
"silent": true,
Expand Down
2 changes: 0 additions & 2 deletions src/core_plugins/elasticsearch/lib/__tests__/health_check.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ const NoConnections = require('elasticsearch').errors.NoConnections;
import mappings from './fixtures/mappings';
import healthCheck from '../health_check';
import kibanaVersion from '../kibana_version';
import * as patchKibanaIndexNS from '../patch_kibana_index';

const esPort = 9220;
const esUrl = `http://elastic:changement@localhost:9220`;
Expand All @@ -49,7 +48,6 @@ describe('plugins/elasticsearch', () => {

// Stub the Kibana version instead of drawing from package.json.
sandbox.stub(kibanaVersion, 'get').returns(COMPATIBLE_VERSION_NUMBER);
sandbox.stub(patchKibanaIndexNS, 'patchKibanaIndex');

// setup the plugin stub
plugin = {
Expand Down
Loading

0 comments on commit 093a52c

Please sign in to comment.