Git Product home page Git Product logo

kourou's People

Contributors

alexandrebouthinon avatar aschen avatar berthieresteban avatar chillpc avatar clementbolin avatar jenow avatar kuruyia avatar leodau avatar mathieuveber avatar matissepage avatar njuelle avatar oliviercavadenti avatar rolljee avatar scottinet avatar sebtiz13 avatar shiranuit avatar thomas-mauran avatar unclesamswiss avatar xbill82 avatar yoann-abbes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kourou's Issues

Add --print option

Would be nice to have a --print option
Could take the following values:

  • verbose (print every kourou request response) util for dev/debugging
  • default (current behavior)
  • json (only the resut of the action)

For example: kourou sdk:execute --print json < ./snippet.js could return only the return of the snippet.js

Windows env support

Expected Behavior

Using powershell the npm install should be successful

Current Behavior

npm install fails :
image

Context (Environment)

Windows > powershell

[app:scaffold] error with github actions provided: npm ERR! Missing script: "prod"

Expected Behavior

After an app:scaffold, the github actions added should run fine

Current Behavior

The functional-test action is errored

kuzzle_1         | npm ERR! Missing script: "prod"

Possible Solution

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

Steps to Reproduce

  1. Create Github repository
  2. run kourou app:scaffold backend
  3. move the .github to the root of the repository
  4. Push to trigger pipeline and check the action error

Context (Environment)

Kuzzle version: 2.18.1
Node.js version: 14.17.0
SDK version: 7.10.0
Kourou version: 0.20.6

Add es:snapshot module

  • es:snapshot:dump <es-host> <repo_name> <snapshot_name>
  • Dump the ES data into a snapshot
  • es:snapshot:restore <es-host> <repo_name> <snapshot_name>
  • Restore a specific snapshot from a specific repository to an ES
  • es:snapshot:create-repository <es-host> <repo_name> <path_of_the_repo> --compress
  • Create a repository into an ES cluster
  • es:snapshot:list-repository <es-host>
  • List repository known by the current ES
  • es:snapshot:list-snapshot <es-host> <repo_name>
  • List snapshot from a repository known by the current ES
Original issue - [ ] `es:snapshot:dump --host= --repository= --name=` * Dump the ES data into a snapshot
  • es:snapshot:restore --host=<es-host> --repository=<repo_name> --snapshot=<snapshot_name>
  • Restore a specific snapshot from a specific repository to an ES
  • es:snapshot:create_repository --host=<es-host> --repository=<repo_name> --location=<path_of_the_repo> --compress=<true|false>
  • Create a repository into an ES cluster
  • es:snapshot:list_repository --host=<es-host>
  • List repository known by the current ES
  • es:snapshot:list_snapshot --host=<es-host> --repository=<repo_name>
  • List snapshot from a repository known by the current ES

Handling aliases when exporting/importing indexes

Expected Behavior

When importing index/collection aliases, Kourou should create ES aliases instead of duplicating the aliased content.

Current Behavior

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.

Possible Solution

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.

New command kourou app:doctor

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:

  • Node.js:
    • Installed and configured (binary file in $PATH for example)
    • Version
  • Kuzzle version check
  • Elasticsearch:
    • Running
    • Version
    • Kernel settings (vm.max_map_count=262144)
  • Redis:
    • Running
    • Version

Let's talk about it below ๐Ÿ˜„

Add es:indices module

Move current:

  • kourou es:get INDEX ID-> es:indices:get
  • kourou es:insert INDEX -> es:indices:insert
  • kourou es:list-index -> es:indices:cat

Recover admin account

Adds command to recover admin account by directly sending requests to Elasticsearch:

  • reset user password (either with policies or set a new password)
  • creates a new user with admin profile

Kourou v1.0

Kourou v1.0

Here is the list of needed changes before releasing the v1.0

  • api-key:create : The description flag should be an argument
  • api-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 name
  • config: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 request
  • instance:* : Instance commands should be removed since they are obsolete with kaaf
  • redis:list-keys : There is a bug in the command when no matching key is found
  • kourou 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 removed

cannot pass onExistingUsers from cli

Expected Behavior

existing param to pass onExistingUsers when loading fixtures thru cli

Current Behavior

no way to specify the flag

Possible Solution

Steps to Reproduce

Context (Environment)

Kuzzle version:
Node.js version:
SDK version:

throwing help package error

Expected Behavior

this should work as same before

Current Behavior

throwing error about Help package

Possible Solution

Steps to Reproduce

  1. install any node version. (I used Homebrew to install v14 and v16)
  2. npm install -g kourou (I tested some previous version of package also, but same error)
  3. kourou --help (or any command)
/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

Context (Environment)

[email protected]
node v16.13.1
npm 8.1.2
macOS BigSur 11.6.1

If you need anything else please let me know.

Can't create app in windows cmd

Expected Behavior

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.

Current Behavior

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.

Possible Solution

Steps to Reproduce

The steps are in the official website: https://docs.kuzzle.io/core/2/guides/getting-started/run-kuzzle/

Context (Environment)

My versions are: kourou/0.25.0 win32-x64 node-v19.0.0

New command es:aliases:cat

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

Use same format for dump files as for mappings, securities, and fixtures

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.

BUG: Scroll API failing on index:export and collection:export

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

Expected Behavior

I am supposed to be able to dump the whole collection directly into a JSONL format file

image

Current Behavior

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.

image
image

Possible Solution

I suspect that the sharding starts to fails on elastic search on big collections.

Steps to Reproduce

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

Context (Environment)

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

Implements dump command for paas elastic search

Overview

Since we implemented Elasticsearch getDocument inside the paas, we wanted to add a way to retrieve all files via kourou

  • The command will be named paas:elasticsearch:dump and will use available API call from the paas backend to retrieve all documents.

Non-existing or expired scroll identifier when exporting collection / index from Kourou

Expected Behavior

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].

Current Behavior

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)

Steps to Reproduce

  1. Import a collection with more than 2000 documents (see documents.jsonl.txt and mappings.json.txt) into your kuzzle: kourou collection:import [../../]
  2. Export the collection kourou collection:export tenant-[group]-[name] [collection]

Context (Environment)

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

Ignore .DS_STORE when importing objects

Description

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

New command kourou app:package

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> 

app:scaffold stuck on dependencies install

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.