Packaging the application | Tarantool
Tooling tt CLI utility Commands Packaging the application

Packaging the application

$ tt pack TYPE [OPTION ...] ..

tt pack packages an application into a distributable bundle of the specified TYPE:

  • tgz: create a .tgz archive.
  • deb: create a DEB package.
  • rpm: create an RPM package.

The command below creates a DEB package with all applications from the current tt environment:

$ tt pack deb

This command generates a .deb file whose name depends on the environment directory name and the operating system architecture, for example, test-env_0.1.0.0-1_x86_64.deb. The package contains the following files:

  • The content of the application directories: source files, resources, dependencies.
  • tt environment files: tarantool and tt executables, tt.yaml configuration file, external modules, headers.
  • .service unit files that allow running applications as systemd services (a separate file for each application).

You can also pass various options to the tt pack command to adjust generation properties, for example, customize a bundle name, choose which artifacts should be included, specify the required application dependencies.

You can customize your application’s systemd unit file generated by tt pack. To add parameters to the unit file, define them in a YAML file named systemd-unit-params.yml in the application directory.

$ tt pack rpm # unit file with parameters from systemd-unit-params.yml if it exists

You can also pass unit parameters from an arbitrary file by adding the --unit-params-file option to the tt pack call:

$ tt pack rpm --unit-params-file my-params.yml # unit file with parameters from my-params.yml

Important

The systemd-unit-params.yml file has a higher priority than the --unit-params-file option. If this file exists, it overrides parameters from the file passed in the option.

tt pack supports the following systemd unit parameters:

  • FdLimit – the number of open file descriptors (LimitNOFile in the unit file).
  • instance-env – a list of environment variables in the <VAR_NAME>: <VALUE> format. Each list item adds an Environment=<VAR_NAME>=<VALUE> line to the unit file.

An example of the systemd-unit-params.yml file:

FdLimit: 200
instance-env:
  INSTANCE: "inst:%i"
  TARANTOOL_WORKDIR: "/tmp"

Enterprise Edition

The integrity check functionality is supported by the Enterprise Edition only.

tt pack can generate checksums and signatures to use for integrity checks when running the application. These files are:

  • hashes.json and hashes.json.sig in each application directory. hashes.json contains SHA256 checksums of executable files that the application uses and its configuration file. hashes.json.sig contains a digital signature for hashes.json.
  • env_hashes.json and env_hashes.json.sig in the environment root are similar files for the tt environment. They contain checksums for Tarantool and tt executables, and for the tt.yaml configuration file.

To generate checksums and signatures for integrity check, use the --with-integrity-check option. Its argument must be an RSA private key.

Note

You can generate a key pair using OpenSSL 3 as follows:

$ openssl genrsa -traditional -out private.pem 2048
$ openssl rsa -in private.pem -pubout > public.pem

To create a tar.gz archive with integrity check artifacts:

$ tt pack tgz --with-integrity-check private.pem

Learn how to perform integrity checks at the application startup and in runtime in the tt start reference.

--all

Include all artifacts in a bundle. In this case, a bundle might include snapshots, WAL files, and logs.

--app-list APPLICATIONS

Specify the applications included in a bundle.

Example

$ tt pack tgz --app-list app1,app3
--cartridge-compat

Applicable to: tgz

Package a Cartridge CLI-compatible archive.

Important

The Tarantool Cartridge framework is deprecated and is not compatible with Tarantool 3.0 and later. This command is added for backward compatibility with earlier versions.

--deps STRINGS

Applicable to: deb, rpm

Specify dependencies included in RPM and DEB packages.

Example

$ tt pack deb --deps 'wget,make>0.1.0,unzip>1,unzip<=7'
--deps-file STRING

Applicable to: deb, rpm

Specify the path to a file containing dependencies included in RPM and DEB packages. For example, the package-deps.txt file below contains several dependencies and their versions:

unzip==6.0
neofetch>=6,<7
gcc>8

If this file is placed in the current directory, a tt pack command might look like this:

$ tt pack deb --deps-file package-deps.txt
--filename

Specify a bundle name.

Example

$ tt pack tgz --filename sample-app.tar.gz
--name PACKAGE_NAME

Specify a package name.

Example

$ tt pack tgz --name sample-app --version 1.0.1
--preinst

Applicable to: deb, rpm

Specify the path to a pre-install script for RPM and DEB packages.

Example

$ tt pack deb --preinst pre.sh
--postinst

Applicable to: deb, rpm

Specify the path to a post-install script for RPM and DEB packages.

Example

$ tt pack deb --postinst post.sh
--tarantool-version

Specify a Tarantool version for packaging in a Docker container. For use with --use-docker only.

--unit-params-file

The path to a file with custom systemd unit parameters.

--use-docker

Build a package in an Ubuntu 18.04 Docker container. To specify a Tarantool version to use in the container, add the --tarantool-version option.

Before executing tt pack with this option, make sure Docker is running.

--version PACKAGE_VERSION

Specify a package version.

Example

$ tt pack tgz --name sample-app --version 1.0.1
--with-binaries

Include Tarantool and tt binaries in a bundle.

--with-integrity-check PRIVATE_KEY

Generate checksums and signatures for integrity checks at the application startup.

See also: Generating files for integrity checks

--with-tarantool-deps

Add Tarantool and tt as package dependencies.

--without-binaries

Don’t include Tarantool and tt binaries in a bundle.

--without-modules

Don’t include external modules in a bundle.

Found what you were looking for?
Feedback