Packaging the application
$ tt pack TYPE [OPTION ...] ..
tt pack packages an application into a distributable bundle of the
specified TYPE:
tgz: create a.tgzarchive.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.
ttenvironment files:tarantoolandttexecutables,tt.yamlconfiguration file, external modules, headers..serviceunit files that allow running applications assystemdservices (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
tt pack supports the following systemd unit parameters:
FdLimit– the number of open file descriptors (LimitNOFilein the unit file).instance-env– a list of environment variables in the<VAR_NAME>: <VALUE>format. Each list item adds anEnvironment=<VAR_NAME>=<VALUE>line to the unit file.
An example of the systemd-unit-params.yml file:
FdLimit: 200instance-env:INSTANCE: "inst:%i"TARANTOOL_WORKDIR: "/tmp"
tt pack can generate checksums and signatures to use for integrity
checks when running the application. These files are:
hashes.jsonandhashes.json.sigin each application directory.hashes.jsoncontains SHA256 checksums of executable files that the application uses and its configuration file.hashes.json.sigcontains a digital signature forhashes.json.env_hashes.jsonandenv_hashes.json.sigin the environment root are similar files for thettenvironment. They contain checksums for Tarantool andttexecutables, and for thett.yamlconfiguration file.
To generate checksums and signatures for integrity check, use the
--with-integrity-check option. Its argument must be an RSA private
key.
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.
Include all artifacts in a bundle. In this case, a bundle might include snapshots, WAL files, and logs.
Specify the applications included in a bundle.
Example
$ tt pack tgz --app-list app1,app3
Applicable to: tgz
Package a Cartridge CLI-compatible archive.
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'
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.0neofetch>=6,<7gcc>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
Specify a bundle name.
Example
$ tt pack tgz --filename sample-app.tar.gz
Specify a package name.
Example
$ tt pack tgz --name sample-app --version 1.0.1
Applicable to: deb, rpm
Specify the path to a pre-install script for RPM and DEB packages.
Example
$ tt pack deb --preinst pre.sh
Applicable to: deb, rpm
Specify the path to a post-install script for RPM and DEB packages.
Example
$ tt pack deb --postinst post.sh
Specify a Tarantool version for packaging in a Docker container. For use
with --use-docker only.
The path to a file with custom systemd unit parameters.
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.
Specify a package version.
Example
$ tt pack tgz --name sample-app --version 1.0.1
Include Tarantool and tt binaries in a bundle.
Generate checksums and signatures for integrity checks at the application startup.
See also: tt-pack-integrity-check
Add Tarantool and tt as package dependencies.
Don't include Tarantool and tt binaries in a bundle.
Don't include external modules in a bundle.