Quantum-Cli 2.6.0#
quantum-cli is a tool developed by Planetary Quantum for customers of our platform.
Currently, quantum-cli already offers integration options for CI/CD pipelines (e.g., with Jenkins, Drone, GitHub, GitLab) of our customers. Our current quantum-cli release adds two more sub-commands: (quantum-cli) ps and (quantum-cli) exec. We developed these features at the request of our customers, and they significantly simplify the daily handling of containers on the Quantum platform.
quantum-cli ps#
“ps” shows you running tasks (containers) on your cluster. The output is suitable, for example, for finding a specific task (container) or for quick debugging/troubleshooting when problems arise.
quantum-cli exec#
With “exec” you log directly into a container.
The prerequisite is that a shell is installed in the container. And then with “exec”, for example, executing database migrations, simple debugging/troubleshooting, and live testing of changes in containers is possible at any time.
All filters can be controlled not only via the flags on the respective subcommand, –stack and –service, but also via environment variables (QUANTUM_STACK and QUANTUM_SERVICE – as well as the already existing QUANTUM_ENDPOINT, QUANTUM_USER and QUANTUM_PASSWORD). In the repository context, this avoids unnecessary typing and gets you quickly to your goal: access to the services and tasks running for your project. We recommend the tool direnv for this.
quantum-cli ps#
The following excerpt shows all services (and tasks) from a stack (“quantum-id-production”). For each service, a status is displayed, if applicable the task ID and slot (which can optionally be used with exec). We also show when the service was last updated (or when a deployment took place), as well as the currently used Docker image. With the filter –all, you can also display historical data for the service.
❯ quantum-cli ps --stack quantum-id-production
■ stack quantum-id-production
■ service nginx ──────────────────────────────────────────────────── replicated 1/1
STATUS ID SLOT UPDATED NODE IMAGE
running 09d223e1 1 2021-09-27 09:40:14 node-00x.*** r.planetary-quantum.com/***-nginx:0.3
■ service php ────────────────────────────────────────────────────── replicated 1/1
STATUS ID SLOT UPDATED NODE IMAGE
running d294700c 1 2021-09-27 09:40:28 node-00y.*** r.planetary-quantum.com/***id-bothend:0.3
■ service redis ──────────────────────────────────────────────────── replicated 1/1
STATUS ID SLOT UPDATED NODE IMAGE
running 42309ac0 1 2021-09-27 07:12:08 node-00y.*** redis:latest
■ service mysql ──────────────────────────────────────────────────── replicated 1/1
STATUS ID SLOT UPDATED NODE IMAGE
running 7790bfc4 1 2021-09-27 07:12:12 node-00x.*** mysql:5.7quantum-cli exec#
The following excerpt shows an interactive connection to a MySQL container – e.g., to inspect queries, perform backups, or similar.
❯ quantum-cli exec --stack *** --service mysql
# mysql -u SECRET -pSUPER-SECRET
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 39060
Server version: 5.7.35 MySQL Community Server (GPL)
Copyright (c) 2000, 2021, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
mysql> show processlist;
+-------+--------------+-----------+------+---------+------+----------+------------------+
| Id | User | Host | db | Command | Time | State | Info |
+-------+--------------+-----------+------+---------+------+----------+------------------+
| 39060 | secret | localhost | NULL | Query | 0 | starting | show processlist |
+-------+--------------+-----------+------+---------+------+----------+------------------+
1 row in set (0.00 sec)FIN#
As always, we welcome feedback and suggestions for further features. Please reach out to us.