* chore(NA): update gitignore to include first changes from moving into a single package.json * chore(NA): update gitignore * chore(NA): move all the dependencies into the single package.json and apply changes to bootstrap * chore(NA): fix types problems after the single package json * chore(NA): include code to find the dependencies used across the code * chore(NA): introduce pure lockfile for install dependencies on build * chore(NA): update clean task to not delete anything from xpack node_modules * chore(NA): update gitignore to remove development temporary rules * chore(NA): update notice file * chore(NA): update jest snapshots * chore(NA): fix whitelisted licenses to include a new specify form of an already included one * chore(NA): remove check lockfile symlinks from child projects * chore(NA): fix eslint and add missing declared deps on single pkg json * chore(NA): correctly update notice * chore(NA): fix failing jest test for storyshots.test.tsx * chore(NA): fix cypress multi reporter path * chore(NA): fix Project tests check * chore(NA): fix problem with logic to detect used dependes on oss build * chore(NA): include correct x-pack plugins dep discovery * chore(NA): discover entries under dynamic requires on vis_type_timelion * chore(NA): remove canvas * test(NA): fix jest unit tests * chore(NA): remove double react declaration from storyshot test file * chore(NA): try removing isOSS check * chore(NA): support for plugin development * chore(NA): update logic to fix unit tests and typechecking * chore(NA): support to run npm scripts in child kbn projects across all envs * chore(NA): support github checks reporter on x-pack and remove cpy types as the package correctly provides them * chore(NA): update cpy version * chore(NA): include last kbn pm changes * chore(NA): update style on build_production_projects.ts * chore(NA): remove any cast fom telemetry opt in stats * chore(NA): remove del and re-use rm -rf again Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> |
||
---|---|---|
.. | ||
scripts | ||
src | ||
package.json | ||
README.md | ||
tsconfig.json |
@kbn/es
A command line utility for running elasticsearch from source or archive.
Getting started
If running elasticsearch from source, elasticsearch needs to be cloned to a sibling directory of Kibana.
To run, go to the Kibana root and run node scripts/es --help
to get the latest command line options.
Examples
Run a snapshot install with a trial license
node scripts/es snapshot --license=trial
Run from source with a configured data directory
node scripts/es source --Epath.data=/home/me/es_data
API
run
Start a cluster
var es = require('@kbn/es');
es.run({
license: 'basic',
version: 7.0,
})
.catch(function (e) {
console.error(e);
process.exitCode = 1;
});
Options
options.license
Type: String
License type, one of: trial, basic, gold, platinum
options.version
Type: String
Desired elasticsearch version
options['source-path']
Type: String
Cloned location of elasticsearch repository, used when running from source
options['base-path']
Type: String
Location where snapshots are cached
Snapshot Pinning
Sometimes we need to pin snapshots for a specific version. We'd really like to get this automated, but until that is completed here are the steps to take to build, upload, and switch to pinned snapshots for a branch.
To use these steps you'll need to setup the google-cloud-sdk, which can be installed on macOS with brew cask install google-cloud-sdk
. Login with the CLI and you'll have access to the gsutil
to do efficient/parallel uploads to GCS from the command line.
-
Clone the elasticsearch repo somewhere
-
Checkout the branch you want to build
-
Run the following to delete old distributables
find distribution/archives -type f \( -name 'elasticsearch-*-*.tar.gz' -o -name 'elasticsearch-*-*.zip' \) -not -path *no-jdk* -exec rm {} \;
-
Build the new artifacts
./gradlew -p distribution/archives assemble --parallel
-
Copy new artifacts to your
~/Downloads/tmp-artifacts
rm -rf ~/Downloads/tmp-artifacts mkdir ~/Downloads/tmp-artifacts find distribution/archives -type f \( -name 'elasticsearch-*-*.tar.gz' -o -name 'elasticsearch-*-*.zip' \) -not -path *no-jdk* -exec cp {} ~/Downloads/tmp-artifacts \;
-
Calculate shasums of the uploads
cd ~/Downloads/tmp-artifacts find * -exec bash -c "shasum -a 512 {} > {}.sha512" \;
-
Check that the files in
~/Downloads/tmp-artifacts
look reasonable -
Upload the files to GCS
gsutil -m rsync . gs://kibana-ci-tmp-artifacts/
-
Once the artifacts are uploaded, modify
packages/kbn-es/src/custom_snapshots.js
in a PR to use a URL formatted like:// force use of manually created snapshots until ReindexPutMappings fix if (!process.env.KBN_ES_SNAPSHOT_URL && !process.argv.some(isVersionFlag)) { // return undefined; return 'https://storage.googleapis.com/kibana-ci-tmp-artifacts/{name}-{version}-{os}-x86_64.{ext}'; }
For 6.8, the format of the url should look like:
'https://storage.googleapis.com/kibana-ci-tmp-artifacts/{name}-{version}.{ext}';