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
Важно
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 (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: 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.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.
Примечание
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-listAPPLICATIONS¶ Specify the applications included in a bundle.
Example
$ tt pack tgz --app-list app1,app3
-
--cartridge-compat¶ Applicable to:
tgzPackage a Cartridge CLI-compatible archive.
Важно
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.
-
--depsSTRINGS¶ Applicable to:
deb,rpmSpecify dependencies included in RPM and DEB packages.
Example
$ tt pack deb --deps 'wget,make>0.1.0,unzip>1,unzip<=7'
-
--deps-fileSTRING¶ Applicable to:
deb,rpmSpecify the path to a file containing dependencies included in RPM and DEB packages. For example, the
package-deps.txtfile 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 packcommand 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
-
--namePACKAGE_NAME¶ Specify a package name.
Example
$ tt pack tgz --name sample-app --version 1.0.1
-
--preinst¶ Applicable to:
deb,rpmSpecify the path to a pre-install script for RPM and DEB packages.
Example
$ tt pack deb --preinst pre.sh
-
--postinst¶ Applicable to:
deb,rpmSpecify 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-dockeronly.
-
--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-versionoption.Before executing
tt packwith this option, make sure Docker is running.
-
--versionPACKAGE_VERSION¶ Specify a package version.
Example
$ tt pack tgz --name sample-app --version 1.0.1
-
--with-binaries¶ Include Tarantool and
ttbinaries in a bundle.
-
--with-integrity-checkPRIVATE_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
ttas package dependencies.
-
--without-binaries¶ Don’t include Tarantool and
ttbinaries in a bundle.
-
--without-modules¶ Don’t include external modules in a bundle.