Vineyard Cli#
vineyard-ctl: A command-line tool for vineyard.
Connect to vineyard#
Via command-line:
Options:
ipc_socket
: Socket location of connected vineyard server.rpc_host
: RPC HOST of the connected vineyard server.rpc_port
: RPC PORT of the connected vineyard server.rpc_endpoint
: RPC endpoint of the connected vineyard server.
Example:
vineyard-ctl --ipc_socket /var/run/vineyard.sock
Via vineyard configuration file:
This will pick IPC or RPC values from the vineyard configuration file or environment variables.
Supported Commands#
ls
query
head
copy
del
stat
put
config
migrate
debug
start
Note
vineyard-ctl {command}
ls
#
List vineyard objects.
Options:
pattern
: The pattern string that will be matched against the object’s typename.regex
: The pattern string will be considered as a regex expression.limit
: The limit to list.
Example:
vineyard-ctl ls --pattern * --regex --limit 8
query
#
Query a vineyard object.
Options:
object_id
: ID of the object to be fetched.meta
: Metadata of the object (Simple or JSON).metric
: Metric data of the object (nbytes or signature or typename).exists
: Check if the object exists or not.stdout
: Get object to stdout.output_file
: Get object to file.tree
: Get object lineage in tree-like style.memory_status
: Get the memory used by the vineyard object.detail
: Get detailed memory used by the vineyard object.
Example:
vineyard-ctl query --object_id 00002ec13bc81226 --meta json --metric typename
head
#
Print first n(limit) lines of a vineyard object. Currently supported for a pandas dataframe only.
Options:
object_id
: ID of the object to be printed.limit
: Number of lines of the object to be printed.
Example:
vineyard-ctl head --object_id 00002ec13bc81226 --limit 3
copy
#
Copy a vineyard object.
Options:
object_id
: ID of the object to be copied.shallow
: Get a shallow copy of the object.deep
: Get a deep copy of the object.
Example:
vineyard-ctl copy --object_id 00002ec13bc81226 --shallow
del
#
Delete a vineyard object.
Options:
object_id
: ID of the object to be deleted.regex_pattern
: Delete all the objects that match the regex pattern.force
: Recursively delete even if the member object is also referred by others.deep
: Deeply delete an object means we will deleting the members recursively.
Example:
vineyard-ctl del --object_id 00002ec13bc81226 --force
stat
#
Get the status of connected vineyard server.
Options:
instance_id
: Instance ID of vineyardd that the client is connected to.deployment
: The deployment mode of the connected vineyardd cluster.memory_usage
: Memory usage (in bytes) of current vineyardd instance.memory_limit
: Memory limit (in bytes) of current vineyardd instance.deferred_requests
: Number of waiting requests of current vineyardd instance.ipc_connections
: Number of alive IPC connections on the current vineyardd instance.rpc_connections
: Number of alive RPC connections on the current vineyardd instance.
Example:
vineyard-ctl stat
put
#
Put a python value to vineyard.
Options:
value
: The python value you want to put to the vineyard server.file
: The file you want to put to the vineyard server as a pandas dataframe.sep
: Delimiter used in the file.delimiter
: Delimiter used in the file.header
: Row number to use as the column names.
Example:
vineyard-ctl put --file example_csv_file.csv --sep ,
config
#
Edit configuration file.
Options:
ipc_socket_value
: The ipc_socket value to enter in the config file.rpc_host_value
: The rpc_host value to enter in the config file.rpc_port_value
: The rpc_port value to enter in the config file.rpc_endpoint_value
: The rpc_endpoint value to enter in the config file.
Example:
vineyard-ctl config --ipc_socket_value /var/run/vineyard.sock
migrate
#
Migrate a vineyard object.
Options:
ipc_socket_value
: The ipc_socket value for the second client.rpc_host_value
: The rpc_host value for the second client.rpc_port_value
: The rpc_port value for the second client.rpc_endpoint_value
: The rpc_endpoint value for the second client.object_id
: ID of the object to be migrated.local
: Migrate the vineyard object local to local.remote
: Migrate the vineyard object remote to local.
Example:
vineyard-ctl migrate --ipc_socket_value /tmp/vineyard.sock --object_id 00002ec13bc81226 --remote
debug
#
Issue a debug request.
Options:
payload
: The payload that will be sent to the debug handler.
Example:
vineyard-ctl debug --payload '{"instance_status":[], "memory_size":[]}'
start
#
Start vineyardd.
Options:
local
: start a local vineyard cluster.distributed
: start a local vineyard cluster in a distributed fashion.hosts
: A list of machines to launch vineyard server.etcd_endpoints
: Launching vineyard using specified etcd endpoints. If not specified, vineyard will launch its own etcd instance.vineyardd_path
: Location of vineyard server program. If not specified, vineyard will use its own bundled vineyardd binary.size
: The memory size limit for vineyard’s shared memory. The memory size can be a plain integer or as a fixed-point number using one of these suffixes:E
,P
,T
,G
,M
,K
. You can also use the power-of-two equivalents:Ei
,Pi
,Ti
,Gi
,Mi
,Ki
.socket
: The UNIX domain socket socket path that vineyard server will bind and listen on. When the socket parameter is None, a random path under temporary directory will be generated and used.rpc_socket_port
: The port that vineyard will use to privode RPC service.debug
: Whether to print debug logs.
Example:
vineyard-ctl start --local
Autocomplete#
Autocomplete for vineyard-ctl is only supported for the bash shell currently.
Follow the following steps to enable autocomplete for vineyard-ctl on your system:
Install
argcomplete
viapip3
:pip3 install argcomplete
.Copy the
python/vineyard/cli.py
file to/usr/local/bin
.Add
eval "$(register-python-argcomplete cli.py)"
to~/.bashrc
.Run
source /etc/profile
.Run
source ~/.bashrc
.Run
activate-global-python-argcomplete
That is it. You’re good to go. Autocomplete will be enabled working for vineyard-ctl.
Note
In the bash shell, type vineyard-ctl sta
and press tab
, it will autocomplete
to vineyard-ctl start