-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Add support for Docker and Serverless to kbn/es #161927
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
Merged
Merged
Changes from all commits
Commits
Show all changes
85 commits
Select commit
Hold shift + click to select a range
307e024
Start docker cli
Ikuni17 eeaa4f9
Merge branch 'main' into feature/159260/kbn-es-docker
Ikuni17 3a1c84e
Base docker command kind of working
Ikuni17 623c2d6
Expand CLI options
Ikuni17 d4f9c38
Derive isDocker
Ikuni17 988fa0c
Change Docker params to single quoted string. Cleanup logging
Ikuni17 ee22e63
WIP default cmd setup
Ikuni17 e362822
Merge branch 'main' into feature/159260/kbn-es-docker
Ikuni17 558526c
Merge branch 'main' into feature/159260/kbn-es-docker
Ikuni17 f17feba
Fix console for docker. Setup consts snapshots and versions
Ikuni17 70762ce
Add docker cmd and img resolutions. improve logging and examples
Ikuni17 2da1964
WIP docker log parsing
Ikuni17 4960514
Merge branch 'main' into feature/159260/kbn-es-docker
Ikuni17 7efb57d
Fix stderr output
Ikuni17 aa557ff
Combine log files and tests.
Ikuni17 28bfd7f
Add non json test
Ikuni17 35d7ee2
Remove non-capture fn
Ikuni17 e880721
wip serverless commands
Ikuni17 8c4f2c2
Merge branch 'main' into feature/159260/kbn-es-docker
Ikuni17 249cbb3
Merge branch 'main' into feature/159260/kbn-es-docker
Ikuni17 84a9856
Add verify docker method
Ikuni17 ef2ceca
Restructure
Ikuni17 39d68d5
Merge branch 'main' into feature/159260/kbn-es-docker
Ikuni17 441caae
Add serverless command and networks setup
Ikuni17 a08fe58
Cleanup logging
Ikuni17 8a00034
Add local volume setup and clean flag
Ikuni17 3153036
Cleanup volume logging
Ikuni17 8536aad
Cleanup network logging
Ikuni17 2f21f90
WIP runServerlessEsNode
Ikuni17 679398c
Logging and param cleanup
Ikuni17 3625e8a
Fix es_java_opts
Ikuni17 923432c
Fix es_java_opts
Ikuni17 a240473
Enable rm. Fixed node roles
Ikuni17 9f919b7
Logging fixes for succ
Ikuni17 c170d1e
Cleanup constants, consistency between serverless and docker cli
Ikuni17 95684ee
Fix image resolution for both.
Ikuni17 da3f5ef
Cleanup
Ikuni17 703ae94
Restructure cluster
Ikuni17 23e3b38
Merge branch 'main' into feature/159260/kbn-es-docker
Ikuni17 3d1ce70
Cleanup
Ikuni17 99cd96f
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine 357110b
Adjust var name
Ikuni17 39e6786
Prefix ports with localhost
Ikuni17 cdef8d2
Switch log style to file. inherit stdio
Ikuni17 5810b07
Combine docker run into _exec
Ikuni17 6a1e754
Merge branch 'feature/159260/kbn-es-docker' of github.com:Ikuni17/kib…
Ikuni17 144af4b
Merge branch 'main' into feature/159260/kbn-es-docker
Ikuni17 7d1e16e
Merge branch 'main' into feature/159260/kbn-es-docker
Ikuni17 d780922
Centralize and cleanup serverless logic into utils
Ikuni17 52b015e
Use promise.all
Ikuni17 e1525fb
Split docker out again
Ikuni17 cb1094e
Remove unused docker cli options
Ikuni17 70aeb45
cleanup
Ikuni17 639d5ae
Merge remote-tracking branch 'origin/main' into feature/159260/kbn-es…
Ikuni17 7966d00
Cleanup cli, reporting
Ikuni17 a9f6578
Comments
Ikuni17 87af604
Use .es dir instead of data
Ikuni17 e23ffd6
adjust logs cmnd
Ikuni17 8d7d910
Add support for overriding esargs
Ikuni17 039a809
Resolve esargs for docker. Support pw
Ikuni17 9661259
Verify image is from elastic registry
Ikuni17 3fd028c
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine 33f526e
Update readme
Ikuni17 177a69e
Merge remote-tracking branch 'origin/main' into feature/159260/kbn-es…
Ikuni17 b62184a
resolve image tests
Ikuni17 75064ac
wip setupDocker tests
Ikuni17 aeb4b2e
Add test files
Ikuni17 16b888f
resolveEsArgs tests
Ikuni17 ecf2c32
setup volumes tests
Ikuni17 55971a7
resolveDockerCmd tests
Ikuni17 ba9f199
Verify docker installed tests
Ikuni17 79fb477
maybe create network tests
Ikuni17 bd8f7ea
wip run serverless node tests
Ikuni17 ef64ed8
fix log output for serverless node
Ikuni17 9667ecd
add serverless cluster tests. cleanup mockFs hooks
Ikuni17 b836e17
runDockercontainer tests
Ikuni17 733dbc0
Merge remote-tracking branch 'origin/main' into feature/159260/kbn-es…
Ikuni17 2a9bf11
Adjust image help text
Ikuni17 a87765d
cleanup
Ikuni17 663a1f6
Merge branch 'main' into feature/159260/kbn-es-docker
mistic 02423f6
Merge branch 'main' into feature/159260/kbn-es-docker
mistic fb1e8b9
Adjust docker env variables. Fix socket issue
Ikuni17 7171c63
Revert parseEsDockerLog
Ikuni17 3407aa2
Merge remote-tracking branch 'origin/main' into feature/159260/kbn-es…
Ikuni17 0dc386e
Merge branch 'main' into feature/159260/kbn-es-docker
Ikuni17 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License | ||
| * 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
| * in compliance with, at your election, the Elastic License 2.0 or the Server | ||
| * Side Public License, v 1. | ||
| */ | ||
|
|
||
| import dedent from 'dedent'; | ||
| import getopts from 'getopts'; | ||
| import { ToolingLog } from '@kbn/tooling-log'; | ||
| import { getTimeReporter } from '@kbn/ci-stats-reporter'; | ||
|
|
||
| import { Cluster } from '../cluster'; | ||
| import { DOCKER_IMG, DOCKER_REPO, DOCKER_TAG } from '../utils'; | ||
| import { Command } from './types'; | ||
|
|
||
| export const docker: Command = { | ||
| description: 'Run an Elasticsearch Docker image', | ||
| usage: 'es docker [<args>]', | ||
| help: (defaults: Record<string, any> = {}) => { | ||
| const { password } = defaults; | ||
|
|
||
| return dedent` | ||
| Options: | ||
|
|
||
| --tag Image tag of ES to run from ${DOCKER_REPO} [default: ${DOCKER_TAG}] | ||
| --image Full path to image of ES to run, has precedence over tag. [default: ${DOCKER_IMG}] | ||
| --password Sets password for elastic user [default: ${password}] | ||
| -E Additional key=value settings to pass to Elasticsearch | ||
| -D Override Docker command | ||
|
|
||
| Examples: | ||
|
|
||
| es docker --tag master-SNAPSHOT-amd64 | ||
| es docker --image docker.elastic.co/repo:tag | ||
| es docker -D 'start es01' | ||
| `; | ||
| }, | ||
| run: async (defaults = {}) => { | ||
| const runStartTime = Date.now(); | ||
| const log = new ToolingLog({ | ||
| level: 'info', | ||
| writeTo: process.stdout, | ||
| }); | ||
| const reportTime = getTimeReporter(log, 'scripts/es docker'); | ||
|
|
||
| const argv = process.argv.slice(2); | ||
| const options = getopts(argv, { | ||
| alias: { | ||
| esArgs: 'E', | ||
| dockerCmd: 'D', | ||
| }, | ||
|
|
||
| string: ['tag', 'image', 'D'], | ||
|
|
||
| default: defaults, | ||
| }); | ||
|
|
||
| const cluster = new Cluster(); | ||
| await cluster.runDocker({ | ||
| reportTime, | ||
| startTime: runStartTime, | ||
| ...options, | ||
| }); | ||
| }, | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License | ||
| * 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
| * in compliance with, at your election, the Elastic License 2.0 or the Server | ||
| * Side Public License, v 1. | ||
| */ | ||
|
|
||
| import dedent from 'dedent'; | ||
| import getopts from 'getopts'; | ||
| import { ToolingLog } from '@kbn/tooling-log'; | ||
| import { getTimeReporter } from '@kbn/ci-stats-reporter'; | ||
|
|
||
| import { Cluster } from '../cluster'; | ||
| import { SERVERLESS_REPO, SERVERLESS_TAG, SERVERLESS_IMG } from '../utils'; | ||
| import { Command } from './types'; | ||
|
|
||
| export const serverless: Command = { | ||
| description: 'Run Serverless Elasticsearch through Docker', | ||
| usage: 'es serverless [<args>]', | ||
| help: (defaults: Record<string, any> = {}) => { | ||
| return dedent` | ||
| Options: | ||
|
|
||
| --tag Image tag of ES Serverless to run from ${SERVERLESS_REPO} [default: ${SERVERLESS_TAG}] | ||
| --image Full path of ES Serverless image to run, has precedence over tag. [default: ${SERVERLESS_IMG}] | ||
| --clean Remove existing file system object store before running | ||
| -E Additional key=value settings to pass to Elasticsearch | ||
|
|
||
| Examples: | ||
|
|
||
| es serverless --tag git-fec36430fba2-x86_64 | ||
| es serverless --image docker.elastic.co/repo:tag | ||
| `; | ||
| }, | ||
| run: async (defaults = {}) => { | ||
| const runStartTime = Date.now(); | ||
| const log = new ToolingLog({ | ||
| level: 'info', | ||
| writeTo: process.stdout, | ||
| }); | ||
| const reportTime = getTimeReporter(log, 'scripts/es serverless'); | ||
|
|
||
| const argv = process.argv.slice(2); | ||
| const options = getopts(argv, { | ||
| alias: { | ||
| basePath: 'base-path', | ||
| esArgs: 'E', | ||
| }, | ||
|
|
||
| string: ['tag', 'image'], | ||
| boolean: ['clean'], | ||
|
|
||
| default: defaults, | ||
| }); | ||
|
|
||
| const cluster = new Cluster(); | ||
| await cluster.runServerless({ | ||
| reportTime, | ||
| startTime: runStartTime, | ||
| ...options, | ||
| }); | ||
| }, | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.