kuzzleio / kourou Goto Github PK
View Code? Open in Web Editor NEWThe CLI that helps you manage your Kuzzle application
The CLI that helps you manage your Kuzzle application
Would be nice to have a --print
option
Could take the following values:
For example: kourou sdk:execute --print json < ./snippet.js
could return only the return of the snippet.js
Allow to kill running Kuzzle instances with Kourou.
Kourou should interactively ask which instance.
kourou instance:stop
After an app:scaffold, the github actions added should run fine
The functional-test action is errored
kuzzle_1 | npm ERR! Missing script: "prod"
Add the appropriate "prod" script in the backend/package.json
Change "prod" to "dev" of line 12 in .github/actions/backend-functional-test/action.yml
DOCKER_COMMAND="npm run dev" docker-compose up -d
To use dev
in github runner, must add too
- run: sudo sysctl -w fs.inotify.max_user_watches=524288
kourou app:scaffold backend
Kuzzle version: 2.18.1
Node.js version: 14.17.0
SDK version: 7.10.0
Kourou version: 0.20.6
https://docs.docker.com/compose/migrate/
The command is now docker compose
and not docker-compose
anymore
es:snapshot:dump <es-host> <repo_name> <snapshot_name>
es:snapshot:restore <es-host> <repo_name> <snapshot_name>
es:snapshot:create-repository <es-host> <repo_name> <path_of_the_repo> --compress
es:snapshot:list-repository <es-host>
es:snapshot:list-snapshot <es-host> <repo_name>
es:snapshot:restore --host=<es-host> --repository=<repo_name> --snapshot=<snapshot_name>
es:snapshot:create_repository --host=<es-host> --repository=<repo_name> --location=<path_of_the_repo> --compress=<true|false>
es:snapshot:list_repository --host=<es-host>
es:snapshot:list_snapshot --host=<es-host> --repository=<repo_name>
When importing index/collection aliases, Kourou should create ES aliases instead of duplicating the aliased content.
When exporting indexes with Kourou, if these indexes are aliases, or if they contain aliased collections, then the entire content is duplicated when re-importing the dumps, instead of having these aliases recreated.
Detect if an index/collection is an alias or not. In case of an alias, some kind of dedicated json / file content should be written instead of dumping data.
When importing aliases, Kourou shouldn't care if their aliased sources exist: if they don't, the resulting ES error should simply be printed, and the import should be stopped.
In the same way Flutter provide the super convenient flutter doctor
command to perform checks before development begin (Android SDK version, Android emulator version, Dart version...), we decided that we needed our own command.
Checks and information retrieved need to be discuss but IMO we need at least:
$PATH
for example)vm.max_map_count=262144
)Let's talk about it below ๐
This cause an error because we are separating the file from the extension with a split on character .
kourou vault:encrypt ./file/secrets.json
Current feature only allow fs snapshot, this should be improved to allow other ways of storing snapshots
Move current:
es:get INDEX ID
-> es:indices:get
es:insert INDEX
-> es:indices:insert
es:list-index
-> es:indices:cat
Adds command to recover admin account by directly sending requests to Elasticsearch:
Here is the list of needed changes before releasing the v1.0
api-key:create
: The description
flag should be an argumentapi-key:search
: The filter
flag should be named query
app:start-services
: Should be renamed in services:start
and a flag should be added to specify Docker Compose project nameconfig:diff
: Bug when displaying differences between object values (with the --values
flag)document:search
: The aggregations
flag should be added (maybe just name it aggs
)*:export
: Export commands should all be in the export:
namespace (e.g. index:export
=> export:index
)*:import
: Import commands should be deleted and only the global import
command should be kept*
: All commands using Kuzzle API should accept the --arg
flag to pass arbitrary arguments in the requestinstance:*
: Instance commands should be removed since they are obsolete with kaafredis:list-keys
: There is a bug in the command when no matching key is foundkourou sdk:execute
: Should be renamed to kourou execute
export:user
: A --mappings
flag should be added to export mappings (and the former mappings related commands should be removed)sdk:query
: Should be renamed to api
and the automatic inference of commands as API action should be removedElasticsearch recommends now to use Point in Time API instead of scrolls https://www.elastic.co/guide/en/elasticsearch/reference/7.17/point-in-time-api.html#search-slicing. Scrolls are huge memory consumers but Point in Time API only consume disk space and file descriptors (which are cheaper than memory)
existing param to pass onExistingUsers
when loading fixtures thru cli
no way to specify the flag
Kuzzle version:
Node.js version:
SDK version:
this should work as same before
throwing error about Help package
/usr/local/lib/node_modules/kourou/bin/run:5
const Help_showHelp = Help.prototype.showHelp;
^
TypeError: Cannot read properties of undefined (reading 'prototype')
at Object.<anonymous> (/usr/local/lib/node_modules/kourou/bin/run:5:28)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:17:47
[email protected]
node v16.13.1
npm 8.1.2
macOS BigSur 11.6.1
If you need anything else please let me know.
paas:logs command is actually undocumented.
The command:
https://github.com/kuzzleio/kourou/blob/master/src/commands/paas/logs.ts
List of Kourou commands:
https://github.com/kuzzleio/kourou#commands
kourou sdk:execute < script.ts
should work.
It doesn't work.
import node-ts/register
before the code eval.
I want to install Kuzzle locally on my windows 10 computer. However, it doesn't give a proper error description, why I can't install it. I followed the official instructions to run Kuzzle.
I got this error:
node:events:491
throw er; // Unhandled 'error' event
^
Error: spawn rm ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:285:19)
at onErrorNT (node:internal/child_process:483:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Emitted 'error' event on ChildProcess instance at:
at ChildProcess._handle.onexit (node:internal/child_process:291:12)
at onErrorNT (node:internal/child_process:483:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
errno: -4058,
code: 'ENOENT',
syscall: 'spawn rm',
path: 'rm',
spawnargs: [ '-rf', '/tmp/project-templates' ]
}
after the kourou app:scaffold playground
command.
No files/folders are created.
The steps are in the official website: https://docs.kuzzle.io/core/2/guides/getting-started/run-kuzzle/
My versions are: kourou/0.25.0 win32-x64 node-v19.0.0
Adds a new command to spawn only services needed by Kuzzle
Since this PR, Kuzzle uses aliases instead of directly using indices when dealing with ES. Even though both are very similar for now, they may evolve independently in the future. That is why kourou should provide a command to list aliases similar to the one currently listing indices.
Once this new command has been implemented, Kuzzle could suggest it in the doc section Internal Representation
We have too many formats: Kourou, Kuzzle and the bulk format.
We should use Kuzzle format for mappings, users, profiles and roles. Kourou can try to guess which file correspond to which kind of data (frequency analysis, pattern recognition)
For fixtures, if there is less than 2000 documents (for example), then we can use the standard fixtures format, otherwise Kourou will use JSONL format.
This command should use security:getUserMapping and security:updateUserMappings.
The user mappings dump file should be auto loaded by the kourou import
command
app:scaffold command use nodemon to watch for changes.
But nodemon is not part of devDeps inside the package.json
kourou vault:generate <prefix>
Using kourou to dump my collection stored on elastic search the kourou cli fails on big collections.
The command that are failing are:
kourou index:export
and
kourou collection:export
I am supposed to be able to dump the whole collection directly into a JSONL format file
The command kourou collection:export fails while exporting the data to a JSONL format file.
It seems the scroll API closes itself before the whole collection has been retrieved.
I suspect that the sharding starts to fails on elastic search on big collections.
Try to dump a collection that has more than 17000 documents insides, and export it to a JSONL file using the kourou collection:export command
Trying to extract my data stored using kuzzle framework into jsonL files.
Kuzzle version: 2.18.1
Node.js version: 16.15.1
SDK version: 7.10.1
Since we implemented Elasticsearch getDocument inside the paas, we wanted to add a way to retrieve all files via kourou
paas:elasticsearch:dump
and will use available API call from the paas backend to retrieve all documents.kourou index:export tenant-[group]-[name]
Should be able to dump collections with more than 2000 documents.
Same thing with kourou collection:export tenant-[group]-[name] [my-collection]
.
I get the following error while dumping a collection with 13398 documents:
[X] Error stack:
KuzzleError: Non-existing or expired scroll identifier.
at WebSocketProtocol.query (/home/skymer/.nvm/versions/node/v16.16.0/lib/node_modules/kourou/node_modules/kuzzle-sdk/src/protocols/abstract/Base.js:109:23)
at Kuzzle._timeoutRequest (/home/skymer/.nvm/versions/node/v16.16.0/lib/node_modules/kourou/node_modules/kuzzle-sdk/src/Kuzzle.js:742:34)
at Kuzzle.query (/home/skymer/.nvm/versions/node/v16.16.0/lib/node_modules/kourou/node_modules/kuzzle-sdk/src/Kuzzle.js:575:21)
at DocumentSearchResult.next (/home/skymer/.nvm/versions/node/v16.16.0/lib/node_modules/kourou/node_modules/kuzzle-sdk/src/core/searchResult/SearchResultBase.js:41:33)
at JSONLDumper.dump (/home/skymer/.nvm/versions/node/v16.16.0/lib/node_modules/kourou/lib/support/dump-collection.js:105:43)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async CollectionExport.runSafe (/home/skymer/.nvm/versions/node/v16.16.0/lib/node_modules/kourou/lib/commands/collection/export.js:30:9)
at async CollectionExport.run (/home/skymer/.nvm/versions/node/v16.16.0/lib/node_modules/kourou/lib/common.js:98:17)
at async CollectionExport._run (/home/skymer/.nvm/versions/node/v16.16.0/lib/node_modules/kourou/node_modules/@oclif/command/lib/command.js:43:20)
at async Config.runCommand (/home/skymer/.nvm/versions/node/v16.16.0/lib/node_modules/kourou/node_modules/@oclif/config/lib/config.js:173:24)
at async Main.run (/home/skymer/.nvm/versions/node/v16.16.0/lib/node_modules/kourou/node_modules/@oclif/command/lib/main.js:27:9)
at async Main._run (/home/skymer/.nvm/versions/node/v16.16.0/lib/node_modules/kourou/node_modules/@oclif/command/lib/command.js:43:20)
Error status: 404
Error id: services.storage.unknown_scroll_id (https://docs.kuzzle.io/core/2/api/errors/error-codes/services)
[X] undefined
(I've tried with node 14 & updating kourou & using batch-size, but it has a limit)
kourou collection:import [../../]
kourou collection:export tenant-[group]-[name] [collection]
Trying to export a collection in order to backup data
NodeJS 14 / 16
Kuzzle: 2.19.5
Kourou : kourou/0.24.2 linux-x64 node-v14.20.1
Could be nice to let kourou generate a vault-key
kourou vault:generate-key --prefix
=> ku_<prefix>_<key>
The kourou import
command walk files and directories On OSX there is an error because of the .DS_Store
files, Kourou try to open and import them.
We should only open .json
files
With the arrival of KaaF and Kourou's app module, it would be cool to provide framework mode users with a simple way to package their application via CLI. The generated artifact could be a Docker image or an archive such as ZIP or TAR.GZ.
Targeted UI:
$ kourou app:package --<docker|archive> <OUTPUT: image name|archive filename>
On Mac, app:scaffold
is stuck on Installing dependencies (this can take some time)
forever...
... Or maybe it's just soooooooo long we need some feedback in the stdout to be reassured it's not stuck.
The -v
option of kourou instance:spawn
only allow to choose between both 1 and 2 Kuzzle major
version .
It should be named like kuzzleVersion
or majorVersion
or allow user to specify a full version like 2.3.3
Make es:migrate
test all indexes from the source don't exist on the destination before processing
When the batch size is too big, then the time to download a page of documents may excess the scroll TTL and thus the export fail.
The scroll TTL should be configurable
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.