Giter VIP home page Giter VIP logo

cartridge-cli-extensions's Introduction

Tarantool

Actions Status Code Coverage OSS Fuzz Telegram GitHub Discussions Stack Overflow

Tarantool is an in-memory computing platform consisting of a database and an application server.

It is distributed under BSD 2-Clause terms.

Key features of the application server:

Key features of the database:

  • MessagePack data format and MessagePack based client-server protocol.
  • Two data engines: 100% in-memory with complete WAL-based persistence and an own implementation of LSM-tree, to use with large data sets.
  • Multiple index types: HASH, TREE, RTREE, BITSET.
  • Document oriented JSON path indexes.
  • Asynchronous master-master replication.
  • Synchronous quorum-based replication.
  • RAFT-based automatic leader election for the single-leader configuration.
  • Authentication and access control.
  • ANSI SQL, including views, joins, referential and check constraints.
  • Connectors for many programming languages.
  • The database is a C extension of the application server and can be turned off.

Supported platforms are Linux (x86_64, aarch64), Mac OS X (x86_64, M1), FreeBSD (x86_64).

Tarantool is ideal for data-enriched components of scalable Web architecture: queue servers, caches, stateful Web applications.

To download and install Tarantool as a binary package for your OS or using Docker, please see the download instructions.

To build Tarantool from source, see detailed instructions in the Tarantool documentation.

To find modules, connectors and tools for Tarantool, check out our Awesome Tarantool list.

Please report bugs to our issue tracker. We also warmly welcome your feedback on the discussions page and questions on Stack Overflow.

We accept contributions via pull requests. Check out our contributing guide.

Thank you for your interest in Tarantool!

cartridge-cli-extensions's People

Contributors

dokshina avatar yngvar-antonsson avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cartridge-cli-extensions's Issues

Hot reloading works just once

I try to make an admin action for hot reloading.

The probe action works ok (even if I call it many times):

$ make probe
cartridge admin --run-dir tmp/run --name meta probe --uri localhost:3301
Probe "localhost:3301": OK
$ make probe
cartridge admin --run-dir tmp/run --name meta probe --uri localhost:3301
Probe "localhost:3301": OK

But my custom reload action works once:

meta.router | 2023-09-11 10:12:48.485 [58114] main/148/vshard.discovery._static_router/vshard.router I> Updated replicaset(uuid="29690241-8013-4c2e-9bbb-39a894f3ab97", master=localhost:3304(admin@localhost:3304)) buckets: was 14000, became 15000
meta.router | 2023-09-11 10:12:48.485 [58114] main/148/vshard.discovery._static_router/vshard.router I> Updated replicaset(uuid="79089f8b-e99a-443d-9942-00d7443ba80d", master=localhost:3302(admin@localhost:3302)) buckets: was 14000, became 15000
meta.router | 2023-09-11 10:12:48.485 [58114] main/148/vshard.discovery._static_router/vshard.router I> Discovery enters idle mode, all buckets are known. Discovery works with 10 seconds interval now
meta.router | 2023-09-11 10:13:09.142 [58114] main/178/console/unix/:/cartridge.roles roles.lua:575 W> Reloading roles ...
...

But when I call it again it crashed:

$ make reload
cartridge admin --run-dir tmp/run --name meta reload
   ⨯ Failed to parse function call args: Failed to get function "reload" signature: [string "local function func(...) local res, err = __c..."]:1: variable '__cartridge_admin_help' is not declared. Please update cartridge-cli-extensions module or file an issue https://github.com/tarantool/cartridge-cli-extensions/issues/new
make: *** [reload] Error 1

and after that probe
also crashed:

$ make probe
cartridge admin --run-dir tmp/run --name meta probe --uri localhost:3301
   ⨯ Failed to parse function call args: Failed to get function "probe" signature: [string "local function func(...) local res, err = __c..."]:1: variable '__cartridge_admin_help' is not declared. Please update cartridge-cli-extensions module or file an issue https://github.com/tarantool/cartridge-cli-extensions/issues/new
make: *** [probe] Error 1
-- app/admin.lua
local cli_admin = require('cartridge-cli-extensions.admin')
local cartridge = require('cartridge')

local function probe()
  local usage = 'Probe instance'
  local args = {
    uri = {
      type  = 'string',
      usage = 'Instance URI',
    },
  }
  local call = function(opts)
    opts = opts or {}

    if opts.uri == nil then
      return nil, "Please, pass instance URI via --uri flag"
    end

    local ok, err = cartridge.admin_probe_server(opts.uri)

    if not ok then
      return nil, err.err
    end

    return {
      string.format('Probe %q: OK', opts.uri),
    }
  end

  local ok, err = cli_admin.register('probe', usage, args, call)
  assert(ok, err)
end

local function reload()
  local usage = 'Hot reload Cartridge roles'
  local args = {}
  local call = function(opts)
    local cartridge_roles = require('cartridge.roles')
    local ok, err = cartridge_roles.reload()

    if not ok then
      return nil, err.err
    end

    return {
      "Reload: Done",
    }
  end

  local ok, err = cli_admin.register('reload', usage, args, call)
  assert(ok, err)
end

-- register admin function probe to use it with "cartridge admin"
local function init()
  cli_admin.init()
  probe()
  reload()
end

return { init = init }

PS:
Are there any right/standard method for hot reloading?
Perfectly would be with source code watch option (like nodemon in nodejs world).

Add an extention for bulk loading cold data in various formats: CSV, XML, JSON

It's quite common task to load cold data into cluster and every time one have to make it's own wood-wheel. What if to make a framework with:

  • optimal algorithm of parreling load
  • support of various input formats: csv, xml, json and so on
  • subset of helpers to point dest where to load data and reformat loaded data if needed
  • clear runtime logging since the process is usually takes much time
  • easy way to fire the process on multiple routers from multiple servers

How to pass a list through arguments

Problem

I need to pass a id list through arguments.

Workaround

I pass a string and parse it at the script level. But, this is not the best solution.

Possible solutions

Make support for list type, or support reading json, csv.

Add an extension to create core dump

When developing, debugging or investigating outages, it can be useful to make code dumps of running Tarantool instances. Now this procedure is not trivial, it requires connecting to the console and running a magic script, which, as always, is not at hand. It seems that for simplicity, it would be possible to include such a function in this module and then call it if necessary, with the following command:
cartridge admin --name APPNAME core_dump

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.