Skip to content

Use a new configuration approach for bootstrapping a database in SQL tutorials #3888

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 13 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
34 changes: 34 additions & 0 deletions .github/workflows/push-pot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Push POTs
on:
push:
branches:
- '3.0'
permissions:
contents: write
jobs:
generate-pot:
runs-on: ubuntu-latest
container: tarantool/doc-builder:fat-4.3
steps:
- uses: actions/checkout@v3

- name: Generate Portable Object Templates
run: |
cmake .
make update-pot

- name: Commit generated pots
run: |
git config --global --add safe.directory /__w/doc/doc
git config --global user.name 'TarantoolBot'
git config --global user.email 'tarantoolbot@mail.ru'

if [[ $(git status) =~ .*"nothing to commit".* ]]; then
echo "status=nothing-to-commit"
exit 0
fi

git add -f locale/en
git commit -m "updated pot"
git push origin 3.0

6 changes: 0 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
[submodule "modules/cartridge"]
path = modules/cartridge
url = https://github.com/tarantool/cartridge.git
[submodule "modules/cartridge-cli"]
path = modules/cartridge-cli
url = https://github.com/tarantool/cartridge-cli.git
[submodule "modules/metrics"]
path = modules/metrics
url = https://github.com/tarantool/metrics.git
Expand Down
44 changes: 0 additions & 44 deletions build_submodules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,50 +12,6 @@ po_dest="${project_root}/locale/ru/LC_MESSAGES"
cp README.rst doc/contributing/docs/_includes/README.rst


# Cartridge
cartridge_root="${project_root}/modules/cartridge"

# Build Cartridge to extract docs
cd "${cartridge_root}" || exit
CMAKE_DUMMY_WEBUI=true tarantoolctl rocks make

# Copy Cartridge docs, including diagrams and images
cartridge_rst_src="${cartridge_root}/build.luarocks/build.rst"
cartridge_rst_dest="${project_root}/doc/book/cartridge"
cd "${cartridge_rst_src}" || exit
mkdir -p "${cartridge_rst_dest}"
find . -iregex '.*\.\(rst\|png\|puml\|svg\)$' -exec cp -r --parents {} "${cartridge_rst_dest}" \;

# Copy translation templates
cartridge_pot_src="${cartridge_root}/build.luarocks/build.rst/locale"
cartridge_pot_dest="${project_root}/locale/book/cartridge"
cd "${cartridge_pot_src}" || exit
mkdir -p "${cartridge_pot_dest}"
find . -name '*.pot' -exec cp -rv --parents {} "${cartridge_pot_dest}" \;

# Copy translations
cartridge_po_src="${cartridge_root}/build.luarocks/build.rst/locale/ru/LC_MESSAGES"
cartridge_po_dest="${po_dest}/book/cartridge"
cd "${cartridge_po_src}" || exit
mkdir -p "${cartridge_po_dest}"
find . -name '*.po' -exec cp -rv --parents {} "${cartridge_po_dest}" \;


# Cartridge CLI
cartridge_cli_root="${project_root}/modules/cartridge-cli/doc"
cartridge_cli_dest="${cartridge_rst_dest}/cartridge_cli"
cartridge_cli_po_dest="${po_dest}/book/cartridge/cartridge_cli"

# Copy Cartridge CLI docs, including diagrams and images
mkdir -p "${cartridge_cli_dest}"
cd ${cartridge_cli_root} || exit
find . -iregex '.*\.\(rst\|png\|puml\|svg\)$' -exec cp -rv --parents {} "${cartridge_cli_dest}" \;

# Copy translations
mkdir -p "${cartridge_cli_po_dest}"
cd "${cartridge_cli_root}/locale/ru/LC_MESSAGES/doc/" || exit
find . -name '*.po' -exec cp -rv --parents {} "${cartridge_cli_po_dest}" \;

# Monitoring
monitoring_root="${project_root}/modules/metrics/doc/monitoring"
monitoring_dest="${project_root}/doc/book"
Expand Down
6 changes: 1 addition & 5 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
project = u'Tarantool'

# |release| The full version, including alpha/beta/rc tags.
release = "2.11.1"
release = "3.0.0"
# |version| The short X.Y version.
version = '.'.join(release.split('.')[0:2])

Expand All @@ -73,10 +73,6 @@
'how-to/using_docker.rst',
'reference/configuration/cfg_*',
'images',
'book/cartridge/cartridge_overview.rst',
'book/cartridge/CONTRIBUTING.rst',
'book/cartridge/topics',
'book/cartridge/cartridge_api/modules/cartridge.test-helpers.rst',
'reference/reference_rock/luatest/README.rst',
'reference/reference_rock/luatest/modules/luatest.rst',
'**/_includes/*'
Expand Down
2 changes: 2 additions & 0 deletions doc/book/admin/start_stop_instance.rst
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ With a single ``tt`` call, you can:
* connect to a specific instance of an application
* stop a specific instance of an application or all its instances

.. _admin-start_stop_instance-multi-instance-layout:

Application layout
~~~~~~~~~~~~~~~~~~

Expand Down
11 changes: 5 additions & 6 deletions doc/book/admin/upgrades/upgrade_cluster.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,11 @@ Upgrading storages

Before upgrading **storage** instances:

* Disable :doc:`Cartridge failover </book/cartridge/cartridge_cli/commands/failover/>`: run
* Disable Cartridge failover: run

.. code-block:: bash

cartridge failover disable
tt cartridge failover disable

or use the Cartridge web interface (**Cluster** tab, **Failover: <Mode>** button).

Expand All @@ -112,8 +112,7 @@ Before upgrading **storage** instances:

tarantool> vshard.storage.rebalancer_disable()

* Make sure that the Cartridge ``upgrade_schema`` :doc:`option </book/cartridge/cartridge_api/modules/cartridge>`
is ``false``.
* Make sure that the Cartridge ``upgrade_schema`` option is ``false``.

.. include:: ../_includes/upgrade_storages.rst

Expand All @@ -130,11 +129,11 @@ Before upgrading **storage** instances:

Once you complete the steps, enable failover or rebalancer back:

* Enable :doc:`Cartridge failover </book/cartridge/cartridge_cli/commands/failover/>`: run
* Enable Cartridge failover: run

.. code-block:: bash

cartridge failover set [mode]
tt cartridge failover set [mode]

or use the Cartridge web interface (**Cluster** tab, **Failover: Disabled** button).

Expand Down
48 changes: 0 additions & 48 deletions doc/book/cartridge/cartridge_overview.rst

This file was deleted.

Binary file removed doc/book/cartridge/images/auth_creds.png
Binary file not shown.
Binary file removed doc/book/cartridge/images/bootstrap-vshard.png
Binary file not shown.
Binary file removed doc/book/cartridge/images/change-weight.png
Binary file not shown.
Binary file removed doc/book/cartridge/images/create-router.png
Binary file not shown.
Binary file removed doc/book/cartridge/images/create-storage.png
Binary file not shown.
Binary file removed doc/book/cartridge/images/edit-replica-set.png
Binary file not shown.
Binary file removed doc/book/cartridge/images/enabled-failover.png
Binary file not shown.
Binary file removed doc/book/cartridge/images/expelling-instance.png
Binary file not shown.
Binary file removed doc/book/cartridge/images/failover-control.png
Binary file not shown.
Binary file removed doc/book/cartridge/images/failover-priority.png
Binary file not shown.
Binary file removed doc/book/cartridge/images/failover.png
Binary file not shown.
Binary file removed doc/book/cartridge/images/final-cluster.png
Binary file not shown.
Binary file removed doc/book/cartridge/images/join-new-set.png
Binary file not shown.
Binary file removed doc/book/cartridge/images/join-router.png
Binary file not shown.
Binary file removed doc/book/cartridge/images/join-storage.png
Binary file not shown.
Binary file removed doc/book/cartridge/images/new-unconfig.png
Binary file not shown.
Binary file removed doc/book/cartridge/images/probe-server.png
Binary file not shown.
Binary file removed doc/book/cartridge/images/switch-master.png
Binary file not shown.
Binary file removed doc/book/cartridge/images/unconfigured-router.png
Binary file not shown.
Binary file removed doc/book/cartridge/images/users-tab.png
Binary file not shown.
Binary file removed doc/book/cartridge/images/zero-weight.png
Binary file not shown.
Binary file removed doc/book/cartridge/images/zero.png
Binary file not shown.
2 changes: 1 addition & 1 deletion doc/book/connectors/java.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ There are two Java connectors available:
* `cartridge-java <http://github.com/tarantool/cartridge-java/>`__
supports both single Tarantool nodes and clusters,
as well as applications built using the
:doc:`Cartridge framework </book/cartridge/index>` and its modules.
`Cartridge framework <https://github.com/tarantool/cartridge>`__ and its modules.
The Tarantool team actively updates this module with the newest Tarantool features.
* `tarantool-java <http://github.com/tarantool/tarantool-java/>`__
works with early Tarantool versions (1.6 and later)
Expand Down
1 change: 0 additions & 1 deletion doc/book/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ User's Guide
../how-to/index
../concepts/index
box/index
cartridge/index
admin/index
monitoring/index
connectors
Expand Down
42 changes: 30 additions & 12 deletions doc/code_snippets/README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,43 @@
# Tarantool code examples

The `doc/code_snippets` folder of a Tarantool documentation repository contains runnable code examples that show how to work with various Tarantool modules. Code from these examples is [referenced](#referencing-code-snippets) in corresponding documentation sections.
The `doc/code_snippets` folder of a Tarantool documentation repository contains runnable code examples that show how to work with Tarantool:

- The [snippets](snippets) folder contains sample applications that demonstrate how to configure a Tarantool cluster.
- The [test](test) folder contains testable Lua examples that show how to work with various Tarantool modules.

Code from these examples is [referenced](#referencing-code-snippets) in corresponding documentation sections.

## Prerequisites

First, install the [tt CLI utility](https://www.tarantool.io/en/doc/latest/reference/tooling/tt_cli/).
Then, go to the `doc/code_snippets` folder and install the following libraries:
- Install the [tt CLI utility](https://www.tarantool.io/en/doc/latest/reference/tooling/tt_cli/).
- To be able to run tests for samples from [test](test), go to the `doc/code_snippets` folder and install the following libraries:

- Install [luatest](https://github.com/tarantool/luatest):
```shell
tt rocks install luatest
```
- [luatest](https://github.com/tarantool/luatest):
```shell
tt rocks install luatest
```

- [luarapidxml](https://github.com/tarantool/luarapidxml):
```shell
tt rocks install luarapidxml
```

- Install [luarapidxml](https://github.com/tarantool/luarapidxml):
```shell
tt rocks install luarapidxml
```


## Running

### Running applications from 'snippets'

To run applications placed in [snippets](snippets), follow these steps:

1. Go to the directory containing samples for a specific feature, for example, [snippets/replication](snippets/replication).
2. To run applications placed in [instances.enabled](instances.enabled), execute the `tt start` command, for example:

```console
$ tt start auto_leader
```

## Running and testing examples
### Running and testing examples from 'test'

To test all the examples, go to the `doc/code_snippets` folder and execute the `luatest` command:

Expand Down
11 changes: 11 additions & 0 deletions doc/code_snippets/snippets/config/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Configuration

A sample application demonstrating various features related to Tarantool [configuration](https://www.tarantool.io/en/doc/latest/concepts/configuration/).

## Running

To run applications placed in [instances.enabled](instances.enabled), go to the `config` directory in the terminal and execute the `tt start` command, for example:

```console
$ tt start application
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
app:
file: 'myapp.lua'
cfg:
greeting: 'Hello'

groups:
group001:
replicasets:
replicaset001:
instances:
instance001:
iproto:
listen: "3301"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
instance001:
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-- myapp.lua --
local log = require('log').new("myapp")
local config = require('config')
log.info("%s from app, %s!", config:get('app.cfg.greeting'), box.info.name)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
config:
etcd:
endpoints:
- http://localhost:2379
prefix: /example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
instance001:
instance002:
instance003:
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
config:
etcd:
endpoints:
- http://localhost:2379
prefix: /example
username: testuser
password: foobar
ssl:
ca_file: ca.crt
http:
request:
timeout: 3
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
instance001:
instance002:
instance003:
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
iproto:
listen: "3301"

groups:
group001:
replicasets:
replicaset001:
instances:
instance001: {}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
instance001:
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
groups:
group001:
iproto:
listen: "3301"
replicasets:
replicaset001:
instances:
instance001: {}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
instance001:
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
groups:
group001:
replicasets:
replicaset001:
instances:
instance001:
iproto:
listen: "3301"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
instance001:
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
groups:
group001:
replicasets:
replicaset001:
iproto:
listen: "3301"
instances:
instance001: {}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
instance001:
Loading