From c69c9724cf0640de96a696c37a5a25a1dd5b1815 Mon Sep 17 00:00:00 2001 From: Alexey Protsenko <a.protsenko@picodata.io> Date: Wed, 8 Jun 2022 16:53:24 +0300 Subject: [PATCH] build(gitlab): setup all CI Add to .gitlab.ci.yml test_linux, test_debian_docker_luacheck, coverage from .travis.mk. Also sign package on build Add checkpatch linter. Add docker image build. Image copies original tarantool/tarantool from Dockerhub NO_DOC=ci change NO_TEST=ci change NO_CHANGELOG=ci change --- .gitlab-ci.yml | 461 +++++++++ .luacheckrc | 1 + debian-picodata/changelog | 4 + debian-picodata/compat | 1 + debian-picodata/control | 131 +++ debian-picodata/copyright | 511 ++++++++++ debian-picodata/rules | 77 ++ debian-picodata/source/format | 1 + debian-picodata/source/lintian-overrides | 6 + debian-picodata/source/options | 13 + ...rantool-picodata-common.install.systemd.in | 9 + ...antool-picodata-common.install.sysvinit.in | 5 + ...arantool-picodata-common.lintian-overrides | 1 + .../tarantool-picodata-common.picodata.dirs | 5 + .../tarantool-picodata-common.postinst | 28 + .../tarantool-picodata-common.postrm | 15 + .../tarantool-picodata-common.tarantool.init | 1 + .../tarantool-picodata-dev.install | 1 + .../tarantool-picodata.README.Debian | 7 + debian-picodata/tarantool-picodata.docs | 2 + debian-picodata/tarantool-picodata.install | 4 + .../tarantool-picodata.lintian-overrides | 3 + debian-picodata/tarantool-picodata.postinst | 11 + debian-picodata/tarantool-picodata.prerm | 9 + debian-picodata/tarantool.service | 1 + debian-picodata/watch | 2 + docker/Dockerfile | 136 +++ docker/files/console | 15 + docker/files/docker-entrypoint_centos.sh | 22 + docker/files/luarocks-config.lua | 9 + docker/files/luarocks-config_centos.lua | 11 + docker/files/tarantool-entrypoint.lua | 306 ++++++ docker/files/tarantool.default | 22 + docker/files/tarantool_is_up | 41 + docker/files/tarantool_set_config.lua | 132 +++ rpm/tarantool-picodata.spec | 962 ++++++++++++++++++ tools/Dockerfile | 43 + 37 files changed, 3009 insertions(+) create mode 100644 .gitlab-ci.yml create mode 100644 debian-picodata/changelog create mode 100644 debian-picodata/compat create mode 100644 debian-picodata/control create mode 100644 debian-picodata/copyright create mode 100755 debian-picodata/rules create mode 100644 debian-picodata/source/format create mode 100644 debian-picodata/source/lintian-overrides create mode 100644 debian-picodata/source/options create mode 100644 debian-picodata/tarantool-picodata-common.install.systemd.in create mode 100644 debian-picodata/tarantool-picodata-common.install.sysvinit.in create mode 100644 debian-picodata/tarantool-picodata-common.lintian-overrides create mode 100644 debian-picodata/tarantool-picodata-common.picodata.dirs create mode 100755 debian-picodata/tarantool-picodata-common.postinst create mode 100755 debian-picodata/tarantool-picodata-common.postrm create mode 120000 debian-picodata/tarantool-picodata-common.tarantool.init create mode 100644 debian-picodata/tarantool-picodata-dev.install create mode 100644 debian-picodata/tarantool-picodata.README.Debian create mode 100644 debian-picodata/tarantool-picodata.docs create mode 100644 debian-picodata/tarantool-picodata.install create mode 100644 debian-picodata/tarantool-picodata.lintian-overrides create mode 100755 debian-picodata/tarantool-picodata.postinst create mode 100755 debian-picodata/tarantool-picodata.prerm create mode 120000 debian-picodata/tarantool.service create mode 100644 debian-picodata/watch create mode 100644 docker/Dockerfile create mode 100755 docker/files/console create mode 100755 docker/files/docker-entrypoint_centos.sh create mode 100644 docker/files/luarocks-config.lua create mode 100644 docker/files/luarocks-config_centos.lua create mode 100755 docker/files/tarantool-entrypoint.lua create mode 100644 docker/files/tarantool.default create mode 100755 docker/files/tarantool_is_up create mode 100755 docker/files/tarantool_set_config.lua create mode 100644 rpm/tarantool-picodata.spec create mode 100644 tools/Dockerfile diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000..0fbd0f0241 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,461 @@ +variables: + # set larger git depth, so git describe works properly + GIT_DEPTH: 0 + USER: 'tarantool' + +stages: + - test + - build + - pack + - sign + - deploy + - check-deployment + - docker + +.test: + stage: test + before_script: + - git submodule update --init --recursive + - git submodule foreach --recursive 'git clean -xffd' + - git clean -xffd + +luacheck: + extends: .test + tags: [docker] + image: docker-public.binary.picodata.io/tarantool-testing:latest + script: + - make -f .test.mk luacheck + +test-ubuntu: + extends: .test + retry: 2 + tags: [docker] + image: docker-public.binary.picodata.io/tarantool-testing:latest + script: + - make -f .test.mk test-release + +test_mac-m1: + extends: .test + tags: [mac-dev-m1] + script: + - ulimit -n 10240 + - sudo chown -R $(id -u) /private/tmp/t + - make -f .test.mk build + +checkpatch: + extends: .test + tags: [shell_p_t] + script: + - git clone git@github.com:tarantool/checkpatch.git + - checkpatch/checkpatch.pl --color=always --git HEAD~1..HEAD + +# run long tests and coverage on release build +coverage: + extends: .test + stage: build + only: + - web + - tags + retry: 2 + tags: [docker] + image: docker-public.binary.picodata.io/tarantool-testing:latest + variables: + TEST_RUN_RETRIES: 3 + SERVER_START_TIMEOUT: 400 + REPLICATION_SYNC_TIMEOUT: 400 + TEST_TIMEOUT: 420 + NO_OUTPUT_TIMEOUT: 440 + script: + - make -f .test.mk test-coverage + +.pack: + tags: + - shell_p_t + only: + - web + - tags + variables: + MAKE_CHECK: 'false' + PRESERVE_ENVVARS: MAKE_CHECK + before_script: + - git describe --long + - git submodule update --init --recursive + - git submodule foreach --recursive 'git clean -xffd' + - git clean -xffd + - rm rpm/tarantool.spec + - rm -rf debian + - cp -r debian-picodata debian + - mkdir -p ~/.docker + - echo $DOCKER_AUTH_RO > ~/.docker/config.json + timeout: 2h + dependencies: [] + +build-sources: + stage: pack + extends: .pack + script: + - git clone https://github.com/packpack/packpack.git packpack + - OS=centos DIST=7 BUILDDIR=$PWD/build_sources packpack/packpack tarball + artifacts: + paths: + - build_sources/tarantool*.tar.xz + +build-package-centos: + stage: pack + extends: .pack + script: + - OS=centos DIST=7 BUILDDIR=$PWD/build_rpm/ make -f .pack.mk package + - OS=centos DIST=8 BUILDDIR=$PWD/build_rpm/ make -f .pack.mk package + artifacts: + paths: + - build_rpm/tarantool*.rpm + +build-package-altlinux: + stage: pack + extends: .pack + script: + - git clone https://github.com/packpack/packpack.git packpack + - DOCKER_REPO=docker-picodata.binary.picodata.io/packpack/alt DOCKER_IMAGE=p9 BUILDDIR=$PWD/build_rpm/ packpack/packpack + - DOCKER_REPO=docker-picodata.binary.picodata.io/packpack/alt DOCKER_IMAGE=p10 BUILDDIR=$PWD/build_rpm/ packpack/packpack + artifacts: + paths: + - build_rpm/tarantool*.rpm + +build-package-ubuntu: + stage: pack + extends: .pack + script: + - OS=ubuntu DIST=focal BUILDDIR=$PWD/build_${DIST}/ RELEASE=${DIST} make -f .pack.mk package + - OS=ubuntu DIST=jammy BUILDDIR=$PWD/build_${DIST}/ RELEASE=${DIST} make -f .pack.mk package + artifacts: + paths: + - build_focal/*.deb + - build_jammy/*.deb + +build-package-debian: + stage: pack + extends: .pack + script: + - OS=debian DIST=bullseye BUILDDIR=$PWD/build_${DIST}/ RELEASE=${DIST} make -f .pack.mk package + artifacts: + paths: + - build_bullseye/*.deb + +build-package-redos: + stage: pack + extends: .pack + script: + - OS=redos DIST=7.3 BUILDDIR=$PWD/build_redos/ make -f .pack.mk package + artifacts: + paths: + - build_redos/tarantool*.rpm + +build-package-astralinux: + stage: pack + extends: .pack + script: + - git clone https://github.com/packpack/packpack.git packpack + - DOCKER_REPO=docker-picodata.binary.picodata.io/packpack/astra DOCKER_IMAGE=orel-2.12 BUILDDIR=$PWD/build_astra packpack/packpack + artifacts: + paths: + - build_astra/*.deb + +build-package-macos-arm: + stage: pack + tags: + - mac-dev-m1 + only: + - web + - tags + variables: + PKGNAME: 'tarantool-picodata' + BUILDDIR: 'build_mac_arm' + MACOS: 'ventura' + before_script: + - git describe --long + - git submodule update --init --recursive + - git submodule foreach --recursive 'git clean -xffd' + - mkdir $BUILDDIR + script: | + CURDIR=$PWD + VER=$(git describe --long | sed -n 's/^\([0-9\.]*\)-\([0-9]*\)-\([a-z0-9]*\)/\1.\2/p') + MAJOR=$(echo $VER | cut -f 1-2 -d '.') + echo $VER > VERSION + pushd $BUILDDIR + INSTALL_PREFIX=/opt/homebrew/Cellar/$PKGNAME@$MAJOR/$VER + rm -rf $INSTALL_PREFIX + echo "-------------------------------------------------------------------" + echo "Prepare bottle" + echo "-------------------------------------------------------------------" + cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DDARWIN_BUILD_TYPE=None -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX -DENABLE_DIST=ON + make + make install + cp ../AUTHORS ../README.md ../LICENSE ../TODO $INSTALL_PREFIX/ + cd $INSTALL_PREFIX + mkdir .bottle + mv etc var .bottle/ + rm -rf lib + cd ../../ + tar -caf $CURDIR/$BUILDDIR/$PKGNAME@$MAJOR-$VER.arm64_$MACOS.bottle.tar.gz $PKGNAME@$MAJOR/$VER + popd + echo "-------------------------------------------------------------------" + echo "Prepare tarball with sources" + echo "-------------------------------------------------------------------" + mkdir $BUILDDIR/$PKGNAME-$VER + rsync -r -l \ + --exclude=.git --exclude='.gitignore' --exclude='.gitmodules' \ + --exclude=FreeBSD --exclude=debian --exclude=rpm --exclude=rump \ + --exclude=apk --exclude=$BUILDDIR \ + * $BUILDDIR/$PKGNAME-$VER/ + cd $BUILDDIR + tar --uid=0 --gid=0 -caPf $PKGNAME-$VER.tar.gz $PKGNAME-$VER + shasum -a 256 $PKGNAME*$VER*.tar.gz + timeout: 1h + dependencies: [] + artifacts: + paths: + - $BUILDDIR/*.tar.gz + +.sign: + tags: + - shell_p_t + only: + - web + - tags + before_script: + - mkdir -p ~/.docker + - echo $DOCKER_AUTH_RO > ~/.docker/config.json + +sign-rpm-packages: + stage: sign + extends: .sign + script: + - echo "$GPG_KEY_KDY" | base64 -d > build_rpm/kdy.asc + - echo "$GPG_KEY_KDY" | base64 -d > build_redos/kdy.asc + - docker run --rm -e KEY_FILE=kdy.asc -v $PWD/build_rpm:/build docker-picodata.binary.picodata.io/rpmsign:centos7 + - docker run --rm -e KEY_FILE=kdy.asc -v $PWD/build_redos:/build docker-picodata.binary.picodata.io/rpmsign:centos7 + artifacts: + paths: + - build_rpm/tarantool*.rpm + - build_redos/tarantool*.rpm + dependencies: + - build-package-centos + - build-package-altlinux + - build-package-redos + +sign-astralinux-packages: + stage: sign + extends: .sign + script: + - echo "$GPG_KEY_ASTRA" | base64 -d > build_astra/pico.asc + - echo "$GPG_PASS_ASTRA" > build_astra/pico.pass + - docker run --rm -e KEY_FILE=pico.asc -e PASS_FILE=pico.pass -e SIGNER="5A7D5C9D749260B6CCD24D72A45397D5554CBECD" -v $PWD/build_astra:/build docker-picodata.binary.picodata.io/astrasign:orel-2.12 + artifacts: + paths: + - build_astra/tarantool*_signed.deb + dependencies: + - build-package-astralinux + +deploy-job: + stage: deploy + tags: + - shell_p_t + only: +# - web + - tags + before_script: + - eval $(ssh-agent -s) + - echo "$DEPLOY_PROD_SSH_KEY" | base64 -d | ssh-add - + - echo "$GPG_KEY_KDY" | base64 -d > /tmp/key.asc + script: + - echo "Deploying application..." + - echo + - echo "Deploying rpm-packets..." + # Sources + - scp -o stricthostkeychecking=no build_sources/tarantool*.tar.xz ansible@picodata.io:/data/nginx/www/packrepo/tarantool-picodata/sources/ + # CentOS7 + - scp -o stricthostkeychecking=no build_rpm/tarantool*.el7.*rpm ansible@picodata.io:/data/nginx/www/packrepo/tarantool-picodata/el/7/x86_64/ + - ssh -o stricthostkeychecking=no ansible@picodata.io "cd /data/nginx/www/packrepo/tarantool-picodata/el/7/ && createrepo --update x86_64 && gpg --no-tty --yes -u kdy@picodata.io --detach-sign --armor x86_64/repodata/repomd.xml" + # CentOS8 + - scp -o stricthostkeychecking=no build_rpm/tarantool*.el8.*rpm ansible@picodata.io:/data/nginx/www/packrepo/tarantool-picodata/el/8/x86_64/ + - ssh -o stricthostkeychecking=no ansible@picodata.io "cd /data/nginx/www/packrepo/tarantool-picodata/el/8/ && createrepo --update x86_64 && gpg --no-tty --yes -u kdy@picodata.io --detach-sign --armor x86_64/repodata/repomd.xml" + - echo "rpm-packets successfully deployed." + - echo + # Ubuntu focal + - echo "Deploying deb-packets..." + - ssh -o stricthostkeychecking=no ansible@picodata.io "mkdir -p ~/.deb/tnt-focal" + - scp -o stricthostkeychecking=no build_focal/tarantool*deb ansible@picodata.io:.deb/tnt-focal/ + - ssh -o stricthostkeychecking=no ansible@picodata.io "reprepro -b /data/nginx/www/packrepo/tarantool-picodata/ubuntu/ -C main includedeb focal ~/.deb/tnt-focal/tarantool*deb; rm -rf ~/.deb/tnt-focal" + # Ubuntu jammy + - ssh -o stricthostkeychecking=no ansible@picodata.io "mkdir -p ~/.deb/tnt-jammy" + - scp -o stricthostkeychecking=no build_jammy/tarantool*deb ansible@picodata.io:.deb/tnt-jammy/ + - ssh -o stricthostkeychecking=no ansible@picodata.io "reprepro -b /data/nginx/www/packrepo/tarantool-picodata/ubuntu/ -C main includedeb jammy ~/.deb/tnt-jammy/tarantool*deb; rm -rf ~/.deb/tnt-jammy" + # Debian bullseye + - ssh -o stricthostkeychecking=no ansible@picodata.io "mkdir -p ~/.deb/tnt-bullseye" + - scp -o stricthostkeychecking=no build_bullseye/tarantool*deb ansible@picodata.io:.deb/tnt-bullseye/ + - ssh -o stricthostkeychecking=no ansible@picodata.io "reprepro -b /data/nginx/www/packrepo/tarantool-picodata/debian/ -C main includedeb bullseye ~/.deb/tnt-bullseye/tarantool*deb; rm -rf ~/.deb/tnt-bullseye" + - echo "deb-packets successfully deployed." + - echo + # Altlinux p9 + - ssh -o stricthostkeychecking=no ansible@picodata.io "mkdir -p /tmp/altlinux/" + - echo "Deploying altlinux-p9 packet..." + - scp -o stricthostkeychecking=no build_rpm/tarantool*.p9.*rpm ansible@picodata.io:/tmp/altlinux/ + - echo "altlinux-p9 packet successfully deployed." + - echo + # Altlinux p10 + - echo "Deploying altlinux-p10 packet..." + - scp -o stricthostkeychecking=no build_rpm/tarantool*.p10.*rpm ansible@picodata.io:/tmp/altlinux/ + - echo "altlinux-p10 packet successfully deployed." + - ssh -o stricthostkeychecking=no ansible@picodata.io "/usr/local/bin/repogen.sh" + - echo "Altlinux packets successfully deployed." + - echo + # RedOS + - echo "Deploying RedOS 7 packet..." + - scp -o stricthostkeychecking=no build_redos/tarantool*.el7.*rpm ansible@picodata.io:/data/nginx/www/packrepo/tarantool-picodata/redos/7/x86_64/ + - ssh -o stricthostkeychecking=no ansible@picodata.io "cd /data/nginx/www/packrepo/tarantool-picodata/redos/7/ && createrepo --update x86_64 && gpg --no-tty --yes -u kdy@picodata.io --detach-sign --armor x86_64/repodata/repomd.xml" + - echo "RedOS 7 packet successfully deployed." + - echo + # Astralinux + - echo "Deploying Astralinux packet..." + - ssh -o stricthostkeychecking=no ansible@picodata.io "mkdir -p ~/.deb/tnt-astra" + - scp -o stricthostkeychecking=no build_astra/tarantool*_signed.deb ansible@picodata.io:.deb/tnt-astra/ + - ssh -o stricthostkeychecking=no ansible@picodata.io "reprepro -b /data/nginx/www/packrepo/tarantool-picodata/astra -C main includedeb orel ~/.deb/tnt-astra/tarantool*_signed.deb; rm -rf ~/.deb/tnt-astra" + - echo "Astralinux packets successfully deployed." + - echo + - echo "Application successfully deployed." + dependencies: + - build-sources + - build-package-debian + - build-package-ubuntu + - sign-rpm-packages + - sign-astralinux-packages + +deploy-macos: + stage: deploy + tags: + - mac-dev-m1 + only: +# - web + - tags + variables: + PKGNAME: 'tarantool-picodata' + BUILDDIR: 'build_mac_arm' + script: | + VER=$(git describe --long | sed -n 's/^\([0-9\.]*\)-\([0-9]*\)-\([a-z0-9]*\)/\1.\2/p') + MAJOR=$(echo $VER | cut -f 1-2 -d '.') + curl -v -H "Authorization: Basic $RAW_AUTH_RW" --upload-file $BUILDDIR/$PKGNAME-$VER.tar.gz $RAW_REGISTRY/brew/packages/ + curl -v -H "Authorization: Basic $RAW_AUTH_RW" --upload-file $BUILDDIR/$PKGNAME@$MAJOR-$VER.*.bottle.tar.gz $RAW_REGISTRY/brew/bottle/ + dependencies: + - build-package-macos-arm + +.check-deployment: + stage: check-deployment + tags: + - docker + only: +# - web + - tags + before_script: + - mkdir -p ~/.docker + - echo $DOCKER_AUTH_RO > ~/.docker/config.json + image: ${BASE_IMAGE} + needs: + - deploy-job + +check_deployment_rpm: + extends: .check-deployment + parallel: + matrix: + - BASE_IMAGE: centos:7 + PACKAGE: el/7/x86_64/picodata-release-1.1.1.0-1.el7.x86_64.rpm + GIT_FETCH_PARAM: depth + - BASE_IMAGE: rockylinux:8 + PACKAGE: el/8/x86_64/picodata-release-1.1.1.0-1.el8.x86_64.rpm + GIT_FETCH_PARAM: deepen + - BASE_IMAGE: packpack/packpack:redos-7.3 + PACKAGE: redos/7/x86_64/picodata-release-1.1.1.0-1.el7.x86_64.rpm + GIT_FETCH_PARAM: deepen + before_script: + - yum install -y git + - until git describe; do git fetch --${GIT_FETCH_PARAM} 100; done + - export VER=$(git describe --long | sed -n 's/^\([0-9\.]*\)-\([0-9]*\)-\([a-z0-9]*\)/\1.\2/p' | sed 's/-/~/') + script: + - rpm --import https://download.picodata.io/tarantool-picodata/el/RPM-GPG-KEY-kdy + - yum install -y https://download.picodata.io/tarantool-picodata/${PACKAGE} + - yum install -y tarantool-picodata-${VER} tarantool-picodata-devel-${VER} + +check-deployment-deb: + extends: .check-deployment + variables: + DEBIAN_FRONTEND: noninteractive + TZ: Europe/Moscow + parallel: + matrix: + - BASE_IMAGE: debian:bullseye + - BASE_IMAGE: ubuntu:focal + - BASE_IMAGE: ubuntu:jammy + before_script: + - apt update + - apt install -y curl gpg software-properties-common git + - export DIST=$(lsb_release -si | tr [:upper:] [:lower:]) + - export CODENAME=$(lsb_release -sc) + - until git describe; do git fetch --deepen 100; done + - export VER=$(git describe --long | sed -n 's/^\([0-9\.]*\)-\([0-9]*\)-\([a-z0-9]*\)/\1.\2/p' | sed 's/-/~/') + script: + - curl -s https://download.picodata.io/tarantool-picodata/ubuntu/picodata.gpg.key | gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/picodata.gpg --import + - chmod 644 /etc/apt/trusted.gpg.d/picodata.gpg + - add-apt-repository -y "deb [arch=amd64] https://download.picodata.io/tarantool-picodata/${DIST}/ ${CODENAME} main" + - apt update + - apt install -y tarantool-picodata=${VER}-${CODENAME} tarantool-picodata-dev=${VER}-${CODENAME} + +check-deployment-alt: + extends: .check-deployment + parallel: + matrix: + - DIST: p10 + - DIST: p9 + image: docker.binary.picodata.io/altlinux/base:${DIST} + script: + - apt-get update + - apt-get install -y curl git apt-https + - until git describe; do git fetch --deepen 100; done + - export VER=$(git describe --long | sed -n 's/^\([0-9\.]*\)-\([0-9]*\)-\([a-z0-9]*\)/\1.\2/p') + - apt-get install -y https://download.picodata.io/tarantool-picodata/altlinux/${DIST}/picodata-release-1.0.2.7-1.${DIST}.x86_64.rpm + - apt-get update + - apt-get install -y tarantool-picodata=${VER} tarantool-picodata-devel=${VER} + +check-deployment-astra: + extends: .check-deployment + image: docker-picodata.binary.picodata.io/astra/orel:2.12 + script: + - apt-get update + - apt-get install -y curl git apt-transport-https + - until git describe; do git fetch --deepen 100; done + - export VER=$(git describe --long | sed -n 's/^\([0-9\.]*\)-\([0-9]*\)-\([a-z0-9]*\)/\1.\2/p') + - curl -s https://download.picodata.io/tarantool-picodata/ubuntu/picodata.gpg.key | gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/picodata.gpg --import + - chmod 644 /etc/apt/trusted.gpg.d/picodata.gpg + - echo "deb [arch=amd64] https://download.picodata.io/tarantool-picodata/astra/ orel main" > /etc/apt/sources.list.d/picodata.list + - apt-get update + - apt-get install -y tarantool-picodata=${VER}-1 tarantool-picodata-dev=${VER}-1 + +docker: + stage: docker + only: +# - web + - tags + variables: + DOCKER_REGISTRY_PUB: docker-public.binary.picodata.io + DOCKER_AUTH_CONFIG: $DOCKER_AUTH_RW + tags: + - shell_p_t + before_script: + - mkdir -p $CI_PROJECT_DIR/.docker + - echo $DOCKER_AUTH_RW > $CI_PROJECT_DIR/.docker/config.json + - TAG_SHORT=$(git describe | awk -F- '{print $1}') + - TAG_LONG=$(git describe --long | sed -n 's/^\([0-9\.]*\)-\([0-9]*\)-\([a-z0-9]*\)/\1.\2/p') + - echo $TAG_SHORT + - echo $TAG_LONG + script: + - docker build docker/ -t $DOCKER_REGISTRY_PUB/tarantool:$TAG_SHORT -t $DOCKER_REGISTRY_PUB/tarantool:$TAG_LONG -t $DOCKER_REGISTRY_PUB/tarantool:latest + - docker --config $CI_PROJECT_DIR/.docker/ push -a $DOCKER_REGISTRY_PUB/tarantool + dependencies: [] diff --git a/.luacheckrc b/.luacheckrc index 52da40f6b4..2e31c7ed6a 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -33,6 +33,7 @@ include_files = { } exclude_files = { + "docker/files/*.lua", "build/**/*.lua", "test-run/**/*.lua", "test/app/*.test.lua", diff --git a/debian-picodata/changelog b/debian-picodata/changelog new file mode 100644 index 0000000000..ddb651fe0f --- /dev/null +++ b/debian-picodata/changelog @@ -0,0 +1,4 @@ +tarantool-picodata (2.10.3.8-0-gd76d7625e) unstable; urgency=medium + * Picodata fork + + -- Dmitry Kibirev <kdy@picodata.io> Mon, 05 Dec 2022 18:02:37 +0300 diff --git a/debian-picodata/compat b/debian-picodata/compat new file mode 100644 index 0000000000..f599e28b8a --- /dev/null +++ b/debian-picodata/compat @@ -0,0 +1 @@ +10 diff --git a/debian-picodata/control b/debian-picodata/control new file mode 100644 index 0000000000..d4a99b5fa3 --- /dev/null +++ b/debian-picodata/control @@ -0,0 +1,131 @@ +Source: tarantool-picodata +Priority: optional +Maintainer: Dmitry Kibirev <kdy@picodata.io> +Uploaders: + Dmitry Kibirev <kdy@picodata.io>, + PackPack <build@tarantool.org> +Build-Depends: cdbs (>= 0.4.100), debhelper (>= 9), dpkg-dev (>= 1.16.1~), +# It is recommended to use debhelper version equal to or greater than +# compatibility level. This is a workaround for Ubuntu Xenial repos +# missing debhelper 10. + base-files (<< 9.9) | debhelper (>= 10), +# Enable systemd for Debian Jessie+ and Ubuntu Wily+ + debhelper (>= 9.20160709) | dh-systemd (>= 1.22) | sysvinit (<< 2.88dsf-59) | upstart (<< 1.13), +# XXX: This is a tiny hack to support Tarantool build on the old +# distributions (e.g. Ubuntu Trusty Tahr) providing CMake 3+ via +# cmake3 package that conflicts and replaces cmake package (that +# provides CMake 2.18). Alternatives resolution order allows to +# make package manager seek for cmake3 package at first and use it +# if found or fallback to cmake package (that provides CMake 3+ +# for modern distributions) otherwise. + cmake3 (>= 3.3) | cmake (>= 3.3), + libreadline-dev, + libncurses5-dev, + libssl-dev, + libunwind-dev | libunwind8-dev | libunwind7-dev, + libicu-dev, +# libcurl build dependencies + zlib1g-dev, +# Install prove to run LuaJIT tests. + libtest-harness-perl, +# Install dependencies for functional tests. + python3-gevent, + python3-yaml, +# needed for datetime tests + tzdata, +Section: database +Standards-Version: 4.5.1 +Homepage: http://picodata.io +VCS-Browser: https://git.picodata.io/picodata/tarantool +VCS-Git: https://git.picodata.io/picodata/tarantool.git + +Package: tarantool-picodata-common +Architecture: all +Priority: optional +Conflicts: tarantool-common (<< 2.2.1), + tarantool-lts-modules, + tarantool-lts-client, + tarantool-lts-postgresql-module, + tarantool-lts-mysql-module, + tarantool-dbg (<< 1.5.2), + tarantool-client (<< 1.6~), + tarantool-client-dbg (<< 1.6~), + tarantool-plugins (<< 1.6~), + tarantool-mysql-plugin (<< 1.6~), + tarantool-postgresql-plugin (<< 1.6~), + tarantool-modules, + tarantool-mysql-module, + tarantool-postgresql-module, + libtarantool-dev (<< 1.6~) +Replaces: tarantool-common (<< 2.2.1), tarantool-lts-common +Depends: ${misc:Depends}, adduser, lsb-base, +# Deps for built-in package manager +# https://github.com/tarantool/tarantool/issues/2612 + openssl +Recommends: tarantool-picodata-dev, git, build-essential, cmake +Description: Tarantool in-memory database - common files + Tarantool is an in-memory database and Lua application server. + This package provides scripts to work with tarantool configuration + and log files. + +Package: tarantool-picodata +Architecture: i386 amd64 armhf arm64 +Priority: optional +Depends: ${shlibs:Depends}, ${misc:Depends}, netbase, libgomp1, + openssl, tarantool-picodata-common (>= 2.2.1), tzdata, +# libcurl dependencies (except ones we have already) + zlib1g +Replaces: tarantool-lts +Conflicts: tarantool-lts-modules, + tarantool-lts-postgresql-module, + tarantool-lts-mysql-module, + tarantool-lts-client, + tarantool-dbg (<< 1.5.2), + tarantool-common (<< 2.2.1), + tarantool-client (<< 1.6~), + tarantool-client-dbg (<< 1.6~), + tarantool-plugins (<< 1.6~), + tarantool-mysql-plugin (<< 1.6~), + tarantool-postgresql-plugin (<< 1.6~), + libtarantool-dev (<< 1.6~), + tarantool-modules (<< 1.6.7), + tarantool-mysql-module (<< 1.6.7), + tarantool-postgresql-module (<< 1.6.7), + tarantool +Description: In-memory database with a Lua application server + Tarantool is an in-memory database and a Lua application server. + Its key properties include: + . + * flexible data model + * multiple index types: HASH, TREE, BITSET + * optional persistence and strong data durability + * log streaming replication + * Lua functions, procedures, triggers, with rich access to database API, + JSON support, inter-procedure and network communication libraries + . + This package provides Tarantool command line interpreter and server. + +Package: tarantool-picodata-dev +Architecture: i386 amd64 armhf arm64 +Priority: optional +Section: libdevel +Replaces: tarantool-lts-dev +Conflicts: tarantool-lts-dev, + tarantool-lts-modules, + tarantool-lts-postgresql-module, + tarantool-lts-mysql-module, + tarantool-lts-client, + tarantool-dbg (<< 1.5.2), + tarantool-common (<< 2.2.1), + tarantool-client (<< 1.6~), + tarantool-client-dbg (<< 1.6~), + tarantool-plugins (<< 1.6~), + tarantool-mysql-plugin (<< 1.6~), + tarantool-postgresql-plugin (<< 1.6~), + libtarantool-dev (<< 1.6~) +Depends: ${shlibs:Depends}, ${misc:Depends}, + tarantool-picodata (= ${binary:Version}) +Description: Tarantool in-memory database - development headers + Tarantool is an in-memory database and Lua application server. + This package provides server development files needed to build pluggable + modules. diff --git a/debian-picodata/copyright b/debian-picodata/copyright new file mode 100644 index 0000000000..b43bafa247 --- /dev/null +++ b/debian-picodata/copyright @@ -0,0 +1,511 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: tarantool +Upstream-Contact: dev@tarantool.org +Source: https://github.com/tarantool/tarantool + +Files: * +Copyright: 2010-2021 Tarantool AUTHORS: + Aleksandr Lyapunov, Aleksey Demakov, Aleksey Mashanov, + Alexandre Kalendarev, Andrey Drozdov, Anton Barabanov, + Damien Lefortier, Dmitry E. Oboukhov, Dmitry Simonenko, + Eugene Blikh, Eugene Shadrin, Konstantin Knizhnik, Konstantin Osipov, + Konstantin Shulgin, Mons Anderson, Marko Kevac, Oleg Tsarev, + Pavel Cherenkov, Roman Antipin, Roman Tokarev, Roman Tsisyk, + Teodor Sigaev, Timofey Khryukin, Veniamin Gvozdikov, Vassiliy Soshnikov, + Vladimir Rudnyh, Yuriy Nevinitsin, Yuriy Vostrikov +License: BSD-2-Clause + +Files: third_party/libev/* third_party/coro/* third_party/libeio/* +Copyright: 2007-2012 Marc Alexander Lehmann. +License: BSD-2-Clause or GPL-2+ + +Files: third_party/libev/event_compat.h +Copyright: 2000-2004 Niels Provos <provos@citi.umich.edu>, + 2008 Marc Alexander Lehmann <libev@schmorp.de> +License: BSD-3-Clause + +Files: third_party/libev/ev.c +Copyright: 2007-2012 Marc Alexander Lehmann <libeio@schmorp.de>, + 2011 Emanuele Giaquinta +License: BSD-2-Clause or GPL-2+ + +Files: third_party/libeio/ecb.h +Copyright: 2011, Emanuele Giaquinta + 2009-2015, Marc Alexander Lehmann <libecb@schmorp.de> +License: BSD-2-Clause or GPL-2+ + +Files: third_party/coro/conftest.c +Copyright: 1999-2001 Ralf S. Engelschall <rse@engelschall.com> +License: LGPL-2.1+ + +Files: third_party/crc32_impl.c +Copyright: 1986 Gary S. Brown + 2004-2006 Intel Corporation +License: BSD-3-Clause + +Files: third_party/memrchr.c third_party/memmem.c +Copyright: 2008 The NetBSD Foundation, Inc. +License: BSD-2-Clause-NetBSD + All rights reserved. + . + This code is derived from software contributed to The NetBSD Foundation + by Christos Zoulas. + . + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + . + THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +Files: src/lib/small/third_party/pmatomic.h src/lib/small/pmatomic/* +Copyright: 2011 Ed Schouten <ed@FreeBSD.org> + David Chisnall <theraven@FreeBSD.org> +License: BSD-2-Clause + +Files: third_party/luajit/src/lj_alloc.c +Copyright: Doug Lea <dl@cs.oswego.edu> +License: public-domain + The person or persons who have associated work with this document (the + "Dedicator" or "Certifier") hereby either (a) certifies that, to the best + of his knowledge, the work of authorship identified is in the public domain + of the country from which the work is published, or (b) hereby dedicates + whatever copyright the dedicators holds in the work of authorship + identified below (the "Work") to the public domain. A certifier, moreover, + dedicates any copyright interest he may have in the associated work, and + for these purposes, is described as a "dedicator" below. + . + A certifier has taken reasonable steps to verify the copyright status of + this work. Certifier recognizes that his good faith efforts may not shield + him from liability if in fact the work certified is not in the public + domain. + . + Dedicator makes this dedication for the benefit of the public at large and + to the detriment of the Dedicator's heirs and successors. Dedicator intends + this dedication to be an overt act of relinquishment in perpetuity of all + present and future rights under copyright law, whether vested or + contingent, in the Work. Dedicator understands that such relinquishment of + all rights includes the relinquishment of all rights to enforce (by lawsuit + or otherwise) those copyrights in the Work. + . + Dedicator recognizes that, once placed in the public domain, the Work may + be freely reproduced, distributed, transmitted, used, modified, built upon, + or otherwise exploited by anyone for any purpose, commercial or + non-commercial, and in any way, including by methods that have not yet been + invented or conceived. + +Files: third_party/luajit/* +Copyright: 2005-2017 Mike Pall. All rights reserved. + 1994-2012 Lua.org, PUC-Rio. +License: Expat + +Files: third_party/libutil_freebsd/* +Copyright: 2007, Dag-Erling Coïdan Smørgrav +License: BSD-2-Clause + +Files: third_party/libutil_freebsd/pidfile.c +Copyright: 2005, Pawel Jakub Dawidek <pjd@FreeBSD.org> +License: BSD-2-Clause + +Files: third_party/lua-cjson/* +Copyright: 2010-2012, Mark Pulford <mark@kyne.com.au> +License: Expat + +Files: third_party/luafun/* +Copyright: 2013, 2014, Roman Tsisyk <roman@tsisyk.com> +License: Expat + +Files: test-run/lib/msgpack-python/* +Copyright: 2008-2011, INADA Naoki <songofacandy@gmail.com> +License: Apache-2.0 + +Files: test-run/lib/checks/* +Copyright: 2018-2021 Tarantool + 2012 Sierra Wireless, Fabien Fleutot +License: MIT + +Files: test-run/lib/luatest/* +Copyright: 2019-2020 Tarantool AUTHORS +License: BSD-2-Clause + Based on luaunit. Copyright 2005-2018, + Philippe Fremy <phil at freehackers dot org> + Ryu, Gwang (http://www.gpgstudy.com/gpgiki/LuaUnit) + . + Redistribution and use in source and binary forms, with or + without modification, are permitted provided that the following + conditions are met: + . + 1. Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + . + 2. Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials + provided with the distribution. + . + THIS SOFTWARE IS PROVIDED BY AUTHORS ``AS IS'' AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF + THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + +Files: test-run/lib/msgpack-python/msgpack/* +Copyright: 2008-2010, FURUHASHI Sadayuki +License: Apache-2.0 + +Files: test-run/lib/pytap13.py +Copyright: 2013, Red Hat, Inc +License: GPL + +Files: third_party/qsort_arg.c + third_party/qsort_arg_mt.c + third_party/compat/sys/bsd_time.h + third_party/queue.h + third_party/rb.h + src/lib/small/small/rb.h +Copyright: 1992, 1993 The Regents of the University of California. +License: BSD-3-Clause + +Files: third_party/compat/unwind.h +Copyright: 2001, 2003, 2004, 2006 Free Software Foundation, Inc. +License: GPL + This file is part of GCC. + . + GCC is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + . + GCC is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + License for more details. + . + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING. If not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA. + . + As a special exception, if you include this header file into source + files compiled by GCC, this header file does not by itself cause + the resulting executable to be covered by the GNU General Public + License. This exception does not however invalidate any other + reasons why the executable file might be covered by the GNU General + Public License. + . + On Debian systems, the complete text of the GNU General + Public License can be found in '/usr/share/common-licenses/GPL'. + +Files: src/lib/small/third_party/valgrind/* +Copyright: 2000-2015 Julian Seward. +License: BSD-4-Clause + All rights reserved. + . + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + . + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + . + 2. The origin of this software must not be misrepresented; you must + not claim that you wrote the original software. If you use this + software in a product, an acknowledgment in the product + documentation would be appreciated but is not required. + . + 3. Altered source versions must be plainly marked as such, and must + not be misrepresented as being the original software. + . + 4. The name of the author may not be used to endorse or promote + products derived from this software without specific prior written + permission. + . + THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Files: third_party/sptree.h +Copyright: 2010 Mail.RU + 2010 Teodor Sigaev +License: BSD-2-Clause + +Files: src/proc_title.[ch] +Copyright: 2000-2010 PostgreSQL Global Development Group +License: BSD-2-Clause + +Files: src/lib/salad/rope.* +Copyright: 1993-1994 by Xerox Corporation. +License: BSD-2-Clause + +Files: third_party/base64.[ch] +Copyright: Chris Venter <chris.venter@gmail.com> +License: BSD-2-Clause + +Files: third_party/PMurHash.* +Copyright: Austin Appleby +License: Public-Domain + MurmurHash3 was written by Austin Appleby, and is placed in the public + domain. + . + This implementation was written by Shane Day, and is also public domain. + . + This is a portable ANSI C implementation of MurmurHash3_x86_32 (Murmur3A) + with support for progressive processing. + +Files: third_party/libyaml/* +Copyright: 2006, Kirill Simonov <xi@resolvent.net> +License: Expat + +Files: third_party/lua-yaml/* +Copyright: 2009, Andrew Danforth <acd@weirdness.net> +License: Expat + +Files: ./third_party/sha1.* +Copyright: Steve Reid <steve@edmweb.com> +License: Public-Domain + Public Domain. + +Files: third_party/zstd/* +Copyright: 2014-2015, Yann Collet +License: BSD-2-Clause + +Files: third_party/c-ares/* +Copyright: 2007-2018, Daniel Stenberg <daniel@haxx.se> with contributors +License: MIT + Permission to use, copy, modify, and distribute this software and + its documentation for any purpose and without fee is hereby granted, + provided that the above copyright notice appear in all copies and + that both that copyright notice and this permission notice appear + in supporting documentation, and that the name of M.I.T. not be used + in advertising or publicity pertaining to distribution of the software + without specific, written prior permission. M.I.T. makes no + representations about the suitability of this software for any purpose. + It is provided "as is" without express or implied warranty. + +Files: third_party/c-dt/* +Copyright: 2012-2015 Christian Hansen <chansen@cpan.org> +License: BSD-2-Clause + +Files: third_party/curl/* +Copyright: 1996-2021, Daniel Stenberg, <daniel@haxx.se>, and contributors +License: curl license + All rights reserved. + . + Permission to use, copy, modify, and distribute this software for any purpose + with or without fee is hereby granted, provided that the above copyright + notice and this permission notice appear in all copies. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN + NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE + OR OTHER DEALINGS IN THE SOFTWARE. + . + Except as contained in this notice, the name of a copyright holder shall not + be used in advertising or otherwise to promote the sale, use or other dealings + in this Software without prior written authorization of the copyright holder. + +Files: third_party/decNumber/* +Copyright: 1995-2005 International Business Machines Corporation and others +License: Expat + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, and/or sell copies of the Software, and to permit persons + to whom the Software is furnished to do so, provided that the above + copyright notice(s) and this permission notice appear in all copies of + the Software and that both the above copyright notice(s) and this + permission notice appear in supporting documentation. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT + OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL + INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING + FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, + NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION + WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + . + Except as contained in this notice, the name of a copyright holder + shall not be used in advertising or otherwise to promote the sale, use + or other dealings in this Software without prior written authorization + of the copyright holder. + +Files: third_party/lua-zlib/* +Copyright: 2009 Brian Maher +License: MIT + +Files: third_party/luarocks/* +Copyright: 2007-2018 Kepler Project +License: MIT + +Files: third_party/xxHash/* +Copyright: 2012-2020 Yann Collet +License: BSD-2-Clause + +Files: third_party/nghttp2/* +Copyright: 2012, 2014, 2015, 2016 Tatsuhiro Tsujikawa + 2012, 2014, 2015, 2016 nghttp2 contributors +License: MIT + +Files: src/proc_title.c +Copyright: 2000-2010, PostgreSQL Global Development Group +License: BSD-2-Clause + +License: BSD-2-Clause + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + . + THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + +License: BSD-3-Clause + You may use this program, or code or tables extracted from it, + as desired without restriction. + . + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + . + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. Neither the name of the University nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + . + THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + +License: Expat + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + “Softwareâ€), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + . + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + . + THE SOFTWARE IS PROVIDED “AS ISâ€, WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + +License: Apache-2.0 + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS"BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + . + On Debian systems, the complete text of the Apache License, + Version 2.0 can be found in '/usr/share/common-licenses/Apache-2.0'. + +License: GPL-2+ + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; version 2 of the License, or (at your option) + any later version. + . + On Debian systems, the complete text of version 2 of the GNU General Public + License can be found in `/usr/share/common-licenses/GPL-2'. + +License: LGPL-2.1+ + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by the + Free Software Foundation; version 2.1 of the License, or (at + your option) any later version. + . + On Debian systems, the complete text of version 2.1 of the GNU Lesser + General Public License can be found in `/usr/share/common-licenses/LGPL-2.1'. + +License: MIT + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + . + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. diff --git a/debian-picodata/rules b/debian-picodata/rules new file mode 100755 index 0000000000..3a5bea1f2e --- /dev/null +++ b/debian-picodata/rules @@ -0,0 +1,77 @@ +#!/usr/bin/make -f + +VERSION := $(shell dpkg-parsechangelog|grep ^Version|awk '{print $$2}') +UVERSION := $(shell echo $(VERSION)|sed 's/-[[:digit:]]\+$$//') + +ifneq ($(wildcard /usr/bin/dh_systemd_start),) +WITH_SYSTEMD:=ON +else +WITH_SYSTEMD:=OFF +endif + +DEB_CMAKE_EXTRA_FLAGS := \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_INSTALL_LIBDIR=lib/$(DEB_HOST_MULTIARCH) \ + -DCMAKE_INSTALL_SYSCONFDIR=/etc \ + -DCMAKE_INSTALL_LOCALSTATEDIR=/var \ + -DENABLE_DIST=ON \ + -DWITH_SYSVINIT=ON \ + -DWITH_SYSTEMD=$(WITH_SYSTEMD) + +# Append -DLUAJIT_ENABLE_GC64=ON flag if ${GC64} env variable is 'true'. +ifeq ($(GC64), true) + DEB_CMAKE_EXTRA_FLAGS += -DLUAJIT_ENABLE_GC64=ON +endif + +ifneq ($(MAKE_CHECK), false) + DEB_MAKE_CHECK_TARGET := test-force +endif + +# Install tarantool.service within tarantool-common package, but does not +# install it within tarantool and tarantool-dev packages. +DEB_DH_INSTALLINIT_ARGS := --name=tarantool-picodata +DEB_DH_SYSTEMD_ENABLE_ARGS_tarantool := --name=tarantool-picodata +DEB_DH_SYSTEMD_ENABLE_ARGS_tarantool-common := --name=tarantool-picodata tarantool.service +DEB_DH_SYSTEMD_START_ARGS_tarantool-common := --no-restart-on-upgrade tarantool.service + +# Needed for proper backtraces in fiber.info() +DEB_DH_STRIP_ARGS := -X/usr/bin/tarantool +DPKG_EXPORT_BUILDFLAGS = 1 + +include /usr/share/dpkg/buildflags.mk +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/class/cmake.mk + +debian/tarantool-picodata-common.install: +ifneq ($(wildcard /usr/bin/dh_systemd_start),) + cp -p debian/tarantool-picodata-common.install.systemd.in $@ +else + cp -p debian/tarantool-picodata-common.install.sysvinit.in $@ +endif + +build-indep: debian/tarantool-picodata-common.install + +tarball: clean + git describe --long --always > VERSION + tar --exclude=.git --exclude=debian \ + --exclude=doc/www \ + --exclude=doc/sphinx \ + --exclude=src/lib/small/debian \ + --exclude=src/lib/msgpuck/debian \ + --exclude=test-run/lib/tarantool-python/debian \ + --exclude=third_party/luafun/debian \ + --exclude=FreeBSD \ + --exclude="*.exe" \ + --exclude="*.dll" \ + --transform='s,^\.,tarantool-picodata_$(UVERSION),S' \ + -czf ../tarantool-picodata_$(UVERSION).orig.tar.gz . + +clean:: + find -type f -name \*.pyc -delete + find -type d -name CMakeFiles -exec rm -fr '{}' + + rm -f CMakeCache.txt + rm -f CPackConfig.cmake + rm -f CPackSourceConfig.cmake + rm -f src/trivia/config.h + +install/tarantool-picodata:: diff --git a/debian-picodata/source/format b/debian-picodata/source/format new file mode 100644 index 0000000000..163aaf8d82 --- /dev/null +++ b/debian-picodata/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian-picodata/source/lintian-overrides b/debian-picodata/source/lintian-overrides new file mode 100644 index 0000000000..ab621ed2d4 --- /dev/null +++ b/debian-picodata/source/lintian-overrides @@ -0,0 +1,6 @@ +# This override can be removed after Ubuntu Xenial support is dropped +# and debian/control Build-Depends Ubuntu Xenial workaround +# 'base-files (<< 9.9) | debhelper (>= 10)' is replaced with strict +# 'debhelper (>= 10)' condition. +tarantool-picodata source: package-needs-versioned-debhelper-build-depends 10 +tarantool-picodata source: newer-standards-version * diff --git a/debian-picodata/source/options b/debian-picodata/source/options new file mode 100644 index 0000000000..e51c9cb059 --- /dev/null +++ b/debian-picodata/source/options @@ -0,0 +1,13 @@ +# don't pack some non-free and generated files for Debian +extend-diff-ignore = ".*\.git$" +extend-diff-ignore = ".*\.git/.*" +extend-diff-ignore = "FreeBSD/" +extend-diff-ignore = "test-run/lib/.*/debian/" +extend-diff-ignore = "doc/www/" +extend-diff-ignore = "doc/sphinx/" +extend-diff-ignore = "src/lib/.*/debian/" +extend-diff-ignore = "src/lib/.*/test.sh" +extend-diff-ignore = "src/lib/small/test" +extend-diff-ignore = "third_party/.*/debian/" +extend-diff-ignore = "third_party/luajit/doc" +extend-diff-ignore = "third_party/luafun/(tests|doc)" diff --git a/debian-picodata/tarantool-picodata-common.install.systemd.in b/debian-picodata/tarantool-picodata-common.install.systemd.in new file mode 100644 index 0000000000..f5b1b68c17 --- /dev/null +++ b/debian-picodata/tarantool-picodata-common.install.systemd.in @@ -0,0 +1,9 @@ +/etc/default/tarantool +/usr/bin/tarantoolctl +/etc/tarantool/instances.available/example.lua +/etc/logrotate.d/tarantool +/lib/systemd/system/tarantool.service +/lib/systemd/system/tarantool@.service +/lib/systemd/system-generators/tarantool-generator +/usr/lib/tmpfiles.d/tarantool.conf +/usr/share/man/man1/tarantoolctl.1 diff --git a/debian-picodata/tarantool-picodata-common.install.sysvinit.in b/debian-picodata/tarantool-picodata-common.install.sysvinit.in new file mode 100644 index 0000000000..790d0f9038 --- /dev/null +++ b/debian-picodata/tarantool-picodata-common.install.sysvinit.in @@ -0,0 +1,5 @@ +/etc/default/tarantool +/usr/bin/tarantoolctl +/etc/tarantool/instances.available/example.lua +/etc/logrotate.d/tarantool +/usr/share/man/man1/tarantoolctl.1 diff --git a/debian-picodata/tarantool-picodata-common.lintian-overrides b/debian-picodata/tarantool-picodata-common.lintian-overrides new file mode 100644 index 0000000000..3f93791275 --- /dev/null +++ b/debian-picodata/tarantool-picodata-common.lintian-overrides @@ -0,0 +1 @@ +tarantool-picodata-common: unusual-interpreter usr/bin/tarantoolctl #!tarantool diff --git a/debian-picodata/tarantool-picodata-common.picodata.dirs b/debian-picodata/tarantool-picodata-common.picodata.dirs new file mode 100644 index 0000000000..043a39eabe --- /dev/null +++ b/debian-picodata/tarantool-picodata-common.picodata.dirs @@ -0,0 +1,5 @@ +/etc/tarantool/instances.available +/etc/tarantool/instances.enabled +/var/log/tarantool +/var/lib/tarantool +/usr/share/tarantool/luarocks diff --git a/debian-picodata/tarantool-picodata-common.postinst b/debian-picodata/tarantool-picodata-common.postinst new file mode 100755 index 0000000000..03e4b22157 --- /dev/null +++ b/debian-picodata/tarantool-picodata-common.postinst @@ -0,0 +1,28 @@ +#!/bin/sh + +set -e + +SYSUSER=tarantool + +case "$1" in + configure) + if ! getent passwd $SYSUSER > /dev/null; then + adduser \ + --system \ + --group \ + --quiet \ + --home \ + /var/spool/$SYSUSER \ + --no-create-home \ + --disabled-login \ + tarantool + fi + + # Use setgid to allow `adm` members to read logs + install -d -o$SYSUSER -gadm -m2750 /var/log/tarantool + install -d -o$SYSUSER -g$SYSUSER -m750 /var/run/tarantool + install -d -o$SYSUSER -g$SYSUSER -m750 /var/lib/tarantool + ;; +esac + +#DEBHELPER# diff --git a/debian-picodata/tarantool-picodata-common.postrm b/debian-picodata/tarantool-picodata-common.postrm new file mode 100755 index 0000000000..f9b39b39be --- /dev/null +++ b/debian-picodata/tarantool-picodata-common.postrm @@ -0,0 +1,15 @@ +#!/bin/sh + +set -e + +case "$1" in + purge) + rm -fr \ + /etc/tarantool \ + /var/log/tarantool \ + /var/run/tarantool \ + /var/lib/tarantool + ;; +esac + +#DEBHELPER# diff --git a/debian-picodata/tarantool-picodata-common.tarantool.init b/debian-picodata/tarantool-picodata-common.tarantool.init new file mode 120000 index 0000000000..3e8b3b2b53 --- /dev/null +++ b/debian-picodata/tarantool-picodata-common.tarantool.init @@ -0,0 +1 @@ +../extra/dist/tarantool.init \ No newline at end of file diff --git a/debian-picodata/tarantool-picodata-dev.install b/debian-picodata/tarantool-picodata-dev.install new file mode 100644 index 0000000000..44cfcdf5f2 --- /dev/null +++ b/debian-picodata/tarantool-picodata-dev.install @@ -0,0 +1 @@ +usr/include/tarantool diff --git a/debian-picodata/tarantool-picodata.README.Debian b/debian-picodata/tarantool-picodata.README.Debian new file mode 100644 index 0000000000..b221e8d80f --- /dev/null +++ b/debian-picodata/tarantool-picodata.README.Debian @@ -0,0 +1,7 @@ +To create new instance You should: + + 1. place instance_name.cfg into /etc/tarantool/instances.available/ + 2. create symlink + /etc/tarantool/instances.available/instance_name.cfg -> + /etc/tarantool/instances.enabled/instance_name.cfg + 3. do invoke-rc.d tarantool restart diff --git a/debian-picodata/tarantool-picodata.docs b/debian-picodata/tarantool-picodata.docs new file mode 100644 index 0000000000..5faa2f278d --- /dev/null +++ b/debian-picodata/tarantool-picodata.docs @@ -0,0 +1,2 @@ +README.md +AUTHORS diff --git a/debian-picodata/tarantool-picodata.install b/debian-picodata/tarantool-picodata.install new file mode 100644 index 0000000000..dfa5b57fe2 --- /dev/null +++ b/debian-picodata/tarantool-picodata.install @@ -0,0 +1,4 @@ +/usr/bin/tarantool +/usr/lib/*/tarantool +/usr/share/tarantool +/usr/share/man/man1/tarantool.1 diff --git a/debian-picodata/tarantool-picodata.lintian-overrides b/debian-picodata/tarantool-picodata.lintian-overrides new file mode 100644 index 0000000000..79a1f5ad1c --- /dev/null +++ b/debian-picodata/tarantool-picodata.lintian-overrides @@ -0,0 +1,3 @@ +tarantool-picodata: unstripped-binary-or-object usr/bin/tarantool +tarantool-picodata: embedded-library usr/bin/tarantool: curl +tarantool-picodata: embedded-library usr/bin/tarantool: libyaml diff --git a/debian-picodata/tarantool-picodata.postinst b/debian-picodata/tarantool-picodata.postinst new file mode 100755 index 0000000000..7a8acd3970 --- /dev/null +++ b/debian-picodata/tarantool-picodata.postinst @@ -0,0 +1,11 @@ +#!/bin/sh -e + +case "$1" in + configure) + update-alternatives \ + --install /usr/bin/lua lua-interpreter /usr/bin/tarantool 50 \ + --slave /usr/share/man/man1/lua.1.gz lua-manual \ + /usr/share/man/man1/tarantool.1.gz +esac + +#DEBHELPER# diff --git a/debian-picodata/tarantool-picodata.prerm b/debian-picodata/tarantool-picodata.prerm new file mode 100755 index 0000000000..18c7ce5e35 --- /dev/null +++ b/debian-picodata/tarantool-picodata.prerm @@ -0,0 +1,9 @@ +#!/bin/sh -e + +case "$1" in + remove) + update-alternatives --remove lua-interpreter /usr/bin/tarantool + ;; +esac + +#DEBHELPER# diff --git a/debian-picodata/tarantool.service b/debian-picodata/tarantool.service new file mode 120000 index 0000000000..b3ee7aa948 --- /dev/null +++ b/debian-picodata/tarantool.service @@ -0,0 +1 @@ +../extra/dist/tarantool.service \ No newline at end of file diff --git a/debian-picodata/watch b/debian-picodata/watch new file mode 100644 index 0000000000..41471cbb5e --- /dev/null +++ b/debian-picodata/watch @@ -0,0 +1,2 @@ +version=3 +http://download.tarantool.org/tarantool/1.7/src/tarantool-(.+).tar.gz diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000000..5a00148d57 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,136 @@ +ARG BASE_IMAGE +FROM ${BASE_IMAGE}centos:7 + +ARG TNT_VER \ + GC64 + +ENV GC64=${GC64:-false} \ + LUAROCK_VSHARD_VERSION=0.1.18 \ + LUAROCK_AVRO_SCHEMA_VERSION=3.0.6 \ + LUAROCK_EXPERATIOND_VERSION=1.1.1 \ + LUAROCK_QUEUE_VERSION=1.1.0 \ + LUAROCK_CONNPOOL_VERSION=1.1.1 \ + LUAROCK_HTTP_VERSION=1.2.0 \ + LUAROCK_MEMCACHED_VERSION=1.0.1 \ + LUAROCK_METRICS_VERSION=0.12.0 \ + LUAROCK_TARANTOOL_PG_VERSION=2.0.2 \ + LUAROCK_TARANTOOL_MYSQL_VERSION=2.1.0 \ + LUAROCK_TARANTOOL_GIS_VERSION=1.0.0 \ + LUAROCK_TARANTOOL_PROMETHEUS_VERSION=1.0.4 \ + LUAROCK_TARANTOOL_GPERFTOOLS_VERSION=1.0.1 + +COPY files/luarocks-config_centos.lua /usr/local/etc/luarocks/config-5.1.lua +COPY files/luarocks-config.lua /usr/local/etc/tarantool/rocks/config-5.1.lua + +RUN ["groupadd", "tarantool"] +RUN ["adduser", "-g", "tarantool", "tarantool"] + +# Set yum repository for Postgresql 14 since this version +# has been removed from pgdg repository. +RUN echo $'[pg]\n\ +name=PostgreSQL 14 RHEL/CentOS $releasever - $basearch\n\ +baseurl=https://download.postgresql.org/pub/repos/yum/14/redhat/rhel-7-$basearch\n\ +enabled=1\n\ +gpgcheck=1\n\ +gpgkey=https://download.postgresql.org/pub/repos/yum/RPM-GPG-KEY-PGDG-14\n\ +repo_gpgcheck = 1\n'\ +>> /etc/yum.repos.d/pg.repo \ + && rpm --import https://download.picodata.io/tarantool-picodata/el/RPM-GPG-KEY-kdy \ + && yum install -y https://download.picodata.io/tarantool-picodata/el/7/x86_64/picodata-release-1.1.1.0-1.el7.x86_64.rpm \ + && yum -y install epel-release centos-release-scl-rh \ + && yum -y install llvm-toolset-7-clang \ + && : "---------- tarantool ----------" \ + && yum install -y \ + tarantool-picodata \ + tarantool-picodata-devel \ + mariadb-libs \ + postgresql14-libs \ + cyrus-sasl \ + libev \ + proj \ + geos \ + unzip \ + openssl-libs \ + luarocks \ + git \ + cmake \ + make \ + gcc-c++ \ + postgresql14-devel \ + cyrus-sasl-devel \ + libev-devel \ + wget \ + proj-devel \ + geos-devel \ + openssl-devel \ + gperftools-libs \ + && ln -s /usr/lib64/libprofiler.so.0 /usr/lib64/libprofiler.so \ + && ln -s $(cat /etc/ld.so.conf.d/postgresql-pgdg-libs.conf | cut -f 1-3 -d '/') /usr/include/postgresql \ + && mkdir -p /rocks \ + && tarantoolctl rocks install lua-term \ + && tarantoolctl rocks install vshard $LUAROCK_VSHARD_VERSION \ + && tarantoolctl rocks install checks $LUAROCK_CHECKS_VERSION \ + && tarantoolctl rocks install avro-schema $LUAROCK_AVRO_SCHEMA_VERSION \ + && tarantoolctl rocks install expirationd $LUAROCK_EXPERATIOND_VERSION \ + && tarantoolctl rocks install queue $LUAROCK_QUEUE_VERSION \ + && tarantoolctl rocks install connpool $LUAROCK_CONNPOOL_VERSION \ + && tarantoolctl rocks install http $LUAROCK_HTTP_VERSION \ + && tarantoolctl rocks install pg $LUAROCK_TARANTOOL_PG_VERSION \ + && tarantoolctl rocks install mysql $LUAROCK_TARANTOOL_MYSQL_VERSION \ + && tarantoolctl rocks install memcached $LUAROCK_MEMCACHED_VERSION \ + && tarantoolctl rocks install metrics $LUAROCK_METRICS_VERSION \ + && tarantoolctl rocks install prometheus $LUAROCK_TARANTOOL_PROMETHEUS_VERSION \ + && tarantoolctl rocks install gis $LUAROCK_TARANTOOL_GIS_VERSION \ + && tarantoolctl rocks install gperftools $LUAROCK_TARANTOOL_GPERFTOOLS_VERSION \ + && : "---------- remove build deps ----------" \ + && rm -rf /rocks \ + && yum -y remove \ + git \ + cmake \ + postgresql14-devel \ + cyrus-sasl-devel \ + libev-devel \ + wget \ + proj-devel \ + geos-devel \ + openssl-devel \ + kernel-headers \ + cpp \ + perl \ + && rm -rf /var/cache/yum \ + && : "---------- gosu ----------" \ + && gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys \ + B42F6819007F00F88E364FD4036A9C25BF357DD4 \ + && curl -o /usr/local/bin/gosu -SL \ + "https://github.com/tianon/gosu/releases/download/1.2/gosu-amd64" \ + && curl -o /usr/local/bin/gosu.asc -SL \ + "https://github.com/tianon/gosu/releases/download/1.2/gosu-amd64.asc" \ + && gpg --verify /usr/local/bin/gosu.asc \ + && rm /usr/local/bin/gosu.asc \ + && rm -r /root/.gnupg/ \ + && chmod +x /usr/local/bin/gosu \ + && mkdir -p /var/lib/tarantool \ + && chown tarantool:tarantool /var/lib/tarantool \ + && mkdir -p /opt/tarantool \ + && chown tarantool:tarantool /opt/tarantool \ + && mkdir -p /var/run/tarantool \ + && chown tarantool:tarantool /var/run/tarantool \ + && chown tarantool:tarantool /etc/tarantool \ + && ln -s usr/local/bin/docker-entrypoint.sh /entrypoint.sh + +VOLUME /var/lib/tarantool +WORKDIR /opt/tarantool + +COPY files/tarantool-entrypoint.lua /usr/local/bin/ +COPY files/tarantool_set_config.lua /usr/local/bin/ +COPY files/docker-entrypoint_centos.sh /usr/local/bin/docker-entrypoint.sh +COPY files/console /usr/local/bin/ +COPY files/tarantool_is_up /usr/local/bin/ +COPY files/tarantool.default /usr/local/etc/default/tarantool + +ENTRYPOINT ["docker-entrypoint.sh"] + +HEALTHCHECK CMD tarantool_is_up + +EXPOSE 3301 +CMD [ "tarantool" ] diff --git a/docker/files/console b/docker/files/console new file mode 100755 index 0000000000..d6fb1925af --- /dev/null +++ b/docker/files/console @@ -0,0 +1,15 @@ +#!/usr/bin/env tarantool + +local CONSOLE_SOCKET_PATH = 'unix/:/var/run/tarantool/tarantool.sock' + +console = require('console') +console.on_start(function(self) + local status, reason + status, reason = pcall(function() require('console').connect(CONSOLE_SOCKET_PATH) end) + if not status then + self:print(reason) + self.running = false + end +end) +console.on_client_disconnect(function(self) self.running = false end) +console.start() diff --git a/docker/files/docker-entrypoint_centos.sh b/docker/files/docker-entrypoint_centos.sh new file mode 100755 index 0000000000..b1bfad715f --- /dev/null +++ b/docker/files/docker-entrypoint_centos.sh @@ -0,0 +1,22 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +# or first arg is `something.conf` +if [ " -${1#?}" = " $1" ]; then + set -- tarantool "$@" +fi + +# allow the container to be started with `--user` +if [ "$1" = 'tarantool' -a "$(id -u)" = '0' ]; then + chown -R tarantool /var/lib/tarantool + exec gosu tarantool "$0" "$@" +fi + +# entry point wraps the passed script to do basic setup +if [ "$1" = 'tarantool' ]; then + shift + exec tarantool "/usr/local/bin/tarantool-entrypoint.lua" "$@" +fi + +exec "$@" diff --git a/docker/files/luarocks-config.lua b/docker/files/luarocks-config.lua new file mode 100644 index 0000000000..111f9551e4 --- /dev/null +++ b/docker/files/luarocks-config.lua @@ -0,0 +1,9 @@ +rocks_trees = { + { name = [[user]], root = home..[[/.luarocks]] }, + { name = [[system]], root = [[/usr/local]] } +} + +rocks_servers = { + [[http://rocks.tarantool.org/]], + [[http://luarocks.org/repositories/rocks]] +} diff --git a/docker/files/luarocks-config_centos.lua b/docker/files/luarocks-config_centos.lua new file mode 100644 index 0000000000..4c48b74412 --- /dev/null +++ b/docker/files/luarocks-config_centos.lua @@ -0,0 +1,11 @@ +rocks_trees = { + { name = [[user]], root = home..[[/.luarocks]] }, + { name = [[system]], root = [[/usr/local]] } +} + +lib_modules_path="/lib64/lua/"..lua_version + +rocks_servers = { + [[http://rocks.tarantool.org/]], + [[http://luarocks.org/repositories/rocks]] +} diff --git a/docker/files/tarantool-entrypoint.lua b/docker/files/tarantool-entrypoint.lua new file mode 100755 index 0000000000..ba6f90725b --- /dev/null +++ b/docker/files/tarantool-entrypoint.lua @@ -0,0 +1,306 @@ +#!/usr/bin/env tarantool + +local fio = require('fio') +local errno = require('errno') +local urilib = require('uri') +local console = require('console') +local term = require('term') +local log = require('log') +local yaml = require('yaml') + +local TARANTOOL_DEFAULT_PORT = 3301 +local CONSOLE_SOCKET_PATH = 'unix/:/var/run/tarantool/tarantool.sock' +local CFG_FILE_PATH = '/etc/tarantool/config.yml' + + +local orig_cfg = box.cfg + +local function read_config() + local f = io.open(CFG_FILE_PATH, "rb") + if f == nil then + log.error("Can't open " .. CFG_FILE_PATH ..": ", errno.strerror()) + os.exit(1) + end + local content = f:read("*all") + f:close() + return yaml.decode(content) +end + +local function write_config(cfg) + local f = io.open(CFG_FILE_PATH, "w+") + if f == nil then + print("Can't open " .. CFG_FILE_PATH ..": ", errno.strerror()) + os.exit(1) + end + local content = yaml.encode(cfg) + f:write(content) + f:close() +end + +local function parse_replication_source(replication_source, user_name, user_password) + if replication_source == nil then + return nil + end + + local replication_source_table = {} + for uri in string.gmatch(replication_source, "[^,]+") do + local parsed_uri = urilib.parse(uri) + if parsed_uri == nil then + error("Incorrect replication source URI format: '"..uri.."'") + end + local host = parsed_uri.host + local port = parsed_uri.service or TARANTOOL_DEFAULT_PORT + local user = parsed_uri.login or user_name + local password = parsed_uri.password or user_password + + if user == 'guest' or user == nil then + replication_source = string.format("%s:%s", host, port) + elseif password == nil then + replication_source = string.format("%s:@%s:%s", user, host, port) + else + replication_source = string.format("%s:%s@%s:%s", user, password, + host, port) + end + + table.insert(replication_source_table, replication_source) + end + + return replication_source_table +end + +local function choose_option(main, substitute, cfg) + if cfg[main] then + return main + end + if cfg[substitute] then + return substitute + end + return main +end + +function set_replication_source(replication_source, user_name, user_password) + local replication_source_table = parse_replication_source( + replication_source, user_name, user_password + ) + local choice = choose_option('replication', 'replication_source', box.cfg) + box.cfg{[choice] = replication_source_table} + log.info("Updated box.cfg.%s to %s", choice, replication_source) +end + +local function create_user(user_name, user_password) + if user_name ~= 'guest' and user_password == nil then + user_password = "" + + local warn_str = [[**************************************************** +WARNING: No password has been set for the database. + This will allow anyone with access to the + Tarantool port to access your database. In + Docker's default configuration, this is + effectively any other container on the same + system. + Use "-e TARANTOOL_USER_PASSWORD=password" + to set it in "docker run". +****************************************************]] + log.warn('\n'..warn_str) + end + + if user_name == 'guest' and user_password == nil then + local warn_str = [[**************************************************** +WARNING: 'guest' is chosen as primary user. + Since it is not allowed to set a password for + guest user, your instance will be accessible + by anyone having direct access to the Tarantool + port. + If you wanted to create an authenticated user, + specify "-e TARANTOOL_USER_NAME=username" and + pick a user name other than "guest". +****************************************************]] + log.warn('\n'..warn_str) + end + + if user_name == 'guest' and user_password ~= nil then + user_password = nil + + local warn_str = [[**************************************************** +WARNING: A password for guest user has been specified. + In Tarantool, guest user can't have a password + and is always allowed to login, if it has + enough privileges. + If you wanted to create an authenticated user, + specify "-e TARANTOOL_USER_NAME=username" and + pick a user name other than "guest". +****************************************************]] + log.warn('\n'..warn_str) + end + + if user_name ~= 'admin' and user_name ~= 'guest' then + if not box.schema.user.exists(user_name) then + log.info("Creating user '%s'", user_name) + box.schema.user.create(user_name) + end + end + + if user_name ~= 'admin' then + log.info("Granting admin privileges to user '%s'", user_name) + box.schema.user.grant(user_name, 'read,write,execute,create,drop', + 'universe', nil, {if_not_exists = true}) + box.schema.user.grant(user_name, 'replication', + nil, nil, {if_not_exists = true}) + end + + if user_name ~= 'guest' then + log.info("Setting password for user '%s'", user_name) + box.schema.user.passwd(user_name, user_password) + end +end + +function set_credentials(user_name, user_password) + create_user(user_name, user_password) +end + +local function wrapper_cfg(override) + local work_dir = '/var/lib/tarantool' + local snap_filename = "*.snap" + local snap_path = work_dir..'/'..snap_filename + + local first_run = false + if next(fio.glob(snap_path)) == nil then + first_run = true + end + + + local file_cfg = {} + local config_file_exists = fio.stat(CFG_FILE_PATH) ~= nil + if not config_file_exists then + log.info("Creating configuration file: " .. CFG_FILE_PATH) + + file_cfg.TARANTOOL_USER_NAME = os.getenv('TARANTOOL_USER_NAME') + file_cfg.TARANTOOL_USER_PASSWORD = os.getenv('TARANTOOL_USER_PASSWORD') + file_cfg.TARANTOOL_SLAB_ALLOC_ARENA = os.getenv('TARANTOOL_SLAB_ALLOC_ARENA') + file_cfg.TARANTOOL_SLAB_ALLOC_FACTOR = os.getenv('TARANTOOL_SLAB_ALLOC_FACTOR') + file_cfg.TARANTOOL_SLAB_ALLOC_MINIMAL = os.getenv('TARANTOOL_SLAB_ALLOC_MINIMAL') + file_cfg.TARANTOOL_SLAB_ALLOC_MAXIMAL = os.getenv('TARANTOOL_SLAB_ALLOC_MAXIMAL') + file_cfg.TARANTOOL_PORT = os.getenv('TARANTOOL_PORT') + file_cfg.TARANTOOL_FORCE_RECOVERY = os.getenv('TARANTOOL_FORCE_RECOVERY') + file_cfg.TARANTOOL_LOG_FORMAT = os.getenv('TARANTOOL_LOG_FORMAT') + file_cfg.TARANTOOL_LOG_LEVEL = os.getenv('TARANTOOL_LOG_LEVEL') + file_cfg.TARANTOOL_WAL_MODE = os.getenv('TARANTOOL_WAL_MODE') + file_cfg.TARANTOOL_REPLICATION_SOURCE = os.getenv('TARANTOOL_REPLICATION_SOURCE') + file_cfg.TARANTOOL_REPLICATION = os.getenv('TARANTOOL_REPLICATION') + file_cfg.TARANTOOL_SNAPSHOT_PERIOD = os.getenv('TARANTOOL_SNAPSHOT_PERIOD') + file_cfg.TARANTOOL_MEMTX_MEMORY = os.getenv('TARANTOOL_MEMTX_MEMORY') + file_cfg.TARANTOOL_CHECKPOINT_INTERVAL = os.getenv('TARANTOOL_CHECKPOINT_INTERVAL') + file_cfg.TARANTOOL_MEMTX_MIN_TUPLE_SIZE = os.getenv('TARANTOOL_MEMTX_MIN_TUPLE_SIZE') + file_cfg.TARANTOOL_MEMTX_MAX_TUPLE_SIZE = os.getenv('TARANTOOL_MEMTX_MAX_TUPLE_SIZE') + + write_config(file_cfg) + else + log.info("Loading existing configuration file: " .. CFG_FILE_PATH) + + file_cfg = read_config() + end + + local user_name = file_cfg.TARANTOOL_USER_NAME or + os.getenv('TARANTOOL_USER_NAME') or 'guest' + local user_password = file_cfg.TARANTOOL_USER_PASSWORD or + os.getenv('TARANTOOL_USER_PASSWORD') + + + local cfg = override or {} + -- Placeholders for deprecated options + cfg.slab_alloc_arena = tonumber(file_cfg.TARANTOOL_SLAB_ALLOC_ARENA) or + override.slab_alloc_arena + cfg.slab_alloc_maximal = tonumber(file_cfg.TARANTOOL_SLAB_ALLOC_MAXIMAL) or + override.slab_alloc_maximal + cfg.slab_alloc_minimal = tonumber(file_cfg.TARANTOOL_SLAB_ALLOC_MINIMAL) or + override.slab_alloc_minimal + cfg.snapshot_period = tonumber(file_cfg.TARANTOOL_SNAPSHOT_PERIOD) or + override.snapshot_period + -- Replacements for deprecated options + cfg.memtx_memory = tonumber(file_cfg.TARANTOOL_MEMTX_MEMORY) or + override.memtx_memory + cfg.memtx_min_tuple_size = tonumber(file_cfg.TARANTOOL_MEMTX_MIN_TUPLE_SIZE) or + override.memtx_min_tuple_size + cfg.memtx_max_tuple_size = tonumber(file_cfg.TARANTOOL_MEMTX_MAX_TUPLE_SIZE) or + override.memtx_max_tuple_size + cfg.checkpoint_interval = tonumber(file_cfg.TARANTOOL_CHECKPOINT_INTERVAL) or + override.checkpoint_interval + -- Deprecated options with default values + local choice = choose_option('memtx_dir', 'snap_dir', override) + cfg[choice] = override[choice] or '/var/lib/tarantool' + + -- Remaining configuration + cfg.slab_alloc_factor = tonumber(file_cfg.TARANTOOL_SLAB_ALLOC_FACTOR) or + override.slab_alloc_factor + cfg.listen = tonumber(file_cfg.TARANTOOL_PORT) or + override.listen or TARANTOOL_DEFAULT_PORT + cfg.wal_mode = file_cfg.TARANTOOL_WAL_MODE or + override.wal_mode + + cfg.force_recovery = file_cfg.TARANTOOL_FORCE_RECOVERY == 'true' + cfg.log_format = file_cfg.TARANTOOL_LOG_FORMAT or 'plain' + cfg.log_level = tonumber(file_cfg.TARANTOOL_LOG_LEVEL) or 5 + + cfg.wal_dir = override.wal_dir or '/var/lib/tarantool' + cfg.vinyl_dir = override.vinyl_dir or '/var/lib/tarantool' + cfg.pid_file = override.pid_file or '/var/run/tarantool/tarantool.pid' + + local choice = choose_option('TARANTOOL_REPLICATION', 'TARANTOOL_REPLICATION_SOURCE', file_cfg) + local replication_source_table = parse_replication_source(file_cfg[choice], + user_name, + user_password) + + if replication_source_table then + cfg.replication = replication_source_table + else + local choice = choose_option('replication', 'replication_source', override) + cfg[choice] = override[choice] + end + + log.info("Config:\n" .. yaml.encode(cfg)) + + orig_cfg(cfg) + + box.once('tarantool-entrypoint', function () + if first_run then + log.info("Initializing database") + + create_user(user_name, user_password) + end + end) + + console.listen(CONSOLE_SOCKET_PATH) + + local metrics_port = tonumber(os.getenv('TARANTOOL_PROMETHEUS_DEFAULT_METRICS_PORT')) or 0 + if metrics_port > 0 then + require('metrics.default_metrics.tarantool').enable() + local prometheus = require('metrics.plugins.prometheus') + local httpd = require('http.server').new('0.0.0.0', metrics_port) + httpd:route( { path = '/metrics' }, prometheus.collect_http) + httpd:start() + end +end + +box.cfg = wrapper_cfg + +-- re-run the script passed as parameter with all arguments that follow +execute_script = arg[1] +if execute_script == nil then + box.cfg {} + + if term.isatty(io.stdout) then + console.start() + os.exit(0) + end +else + narg = 0 + while true do + arg[narg] = arg[narg + 1] + if arg[narg] == nil then + break + end + narg = narg + 1 + end + + dofile(execute_script) +end diff --git a/docker/files/tarantool.default b/docker/files/tarantool.default new file mode 100644 index 0000000000..fffe3b0d13 --- /dev/null +++ b/docker/files/tarantool.default @@ -0,0 +1,22 @@ +-- +-- System-wide settings for tarantoolctl and init scripts +-- +-- This file is meant to enable the usage of tarantoolctl inside +-- docker containers. Since there is no init system, most of its +-- functionality will not work, except 'tarantoolctl enter' or +-- 'tarantoolctl status'. +-- + +default_cfg = { + pid_file = "/var/run/tarantool", -- /var/run/tarantool/${INSTANCE}.pid + wal_dir = "/var/lib/tarantool", -- /var/lib/tarantool/${INSTANCE}/ + snap_dir = "/var/lib/tarantool", -- /var/lib/tarantool/${INSTANCE} + vinyl_dir = "/var/lib/tarantool", -- /var/lib/tarantool/${INSTANCE} + logger = "/var/log/tarantool", -- /var/log/tarantool/${INSTANCE}.log + username = "tarantool", +} + +-- instances.available - all available instances +-- instances.enabled - instances to autostart by sysvinit +instance_dir = "/usr/local/etc/tarantool/instances.enabled" +-- vim: set ft=lua : diff --git a/docker/files/tarantool_is_up b/docker/files/tarantool_is_up new file mode 100755 index 0000000000..71148d5844 --- /dev/null +++ b/docker/files/tarantool_is_up @@ -0,0 +1,41 @@ +#!/bin/sh + +status=$( (tarantool <<-'EOF' +local CONSOLE_SOCKET_PATH = 'unix/:/var/run/tarantool/tarantool.sock' +local console = require('console') +local os = require("os") +local yaml = require("yaml") + +console.on_start(function(self) + local status, reason + status, reason = pcall(function() require('console').connect(CONSOLE_SOCKET_PATH) end) + if not status then + self:print(reason) + os.exit(1) + end + + cmd = 'box.info.status' + local res = self:eval(cmd) + if res ~= nil then + res = yaml.decode(res) + print(res[1]) + end + + os.exit(0) +end) + +console.on_client_disconnect(function(self) self.running = false end) +console.start() + +os.exit(0) +EOF +) 2>/dev/null) + + +echo "$status" + +if [ "$status" = "running" ]; then + exit 0 +else + exit 1 +fi diff --git a/docker/files/tarantool_set_config.lua b/docker/files/tarantool_set_config.lua new file mode 100755 index 0000000000..95d3a25d4b --- /dev/null +++ b/docker/files/tarantool_set_config.lua @@ -0,0 +1,132 @@ +#!/usr/bin/env tarantool + +local CONSOLE_SOCKET_PATH = 'unix/:/var/run/tarantool/tarantool.sock' +local CFG_FILE_PATH = '/etc/tarantool/config.yml' + +local yaml = require('yaml') +local console = require('console') +local errno = require('errno') + +local function read_config() + local f = io.open(CFG_FILE_PATH, "rb") + if f == nil then + print("Can't open " .. CFG_FILE_PATH ..": ", errno.strerror()) + os.exit(1) + end + local content = f:read("*all") + f:close() + return yaml.decode(content) +end + +local function write_config(cfg) + local f = io.open(CFG_FILE_PATH, "w+") + if f == nil then + print("Can't open " .. CFG_FILE_PATH ..": ", errno.strerror()) + os.exit(1) + end + local content = yaml.encode(cfg) + f:write(content) + f:close() +end + +local function nop(console, cfg, value) +end + +local function update_replication_source(console, cfg, value) + local user_name = "nil" + if cfg['TARANTOOL_USER_NAME'] then + user_name = "'" .. cfg['TARANTOOL_USER_NAME'] .. "'" + end + + local user_password = "nil" + if cfg['TARANTOOL_USER_PASSWORD'] then + user_password = "'" .. cfg['TARANTOOL_USER_PASSWORD'] .. "'" + end + + local cmd = "set_replication_source('"..value.."', " .. user_name .. "," .. user_password .. ")" + print("cmd: ", cmd) + + local res = console:eval(cmd) + + if res ~= nil then + print(res) + end +end + +local function update_credentials(console, cfg, value) + local user_name = "nil" + if cfg['TARANTOOL_USER_NAME'] then + user_name = "'" .. cfg['TARANTOOL_USER_NAME'] .. "'" + end + + local user_password = "nil" + if cfg['TARANTOOL_USER_PASSWORD'] then + user_password = "'" .. cfg['TARANTOOL_USER_PASSWORD'] .. "'" + end + + local cmd = "set_credentials(" .. user_name .. "," .. user_password .. ")" + + local res = console:eval(cmd) + + if res ~= nil then + print(res) + end + + local replication_source = cfg['TARANTOOL_REPLICATION_SOURCE'] + + if replication_source ~= nil then + update_replication_source(console, cfg, replication_source) + end +end + + +local vars = { + TARANTOOL_SLAB_ALLOC_ARENA=nop, + TARANTOOL_SLAB_ALLOC_FACTOR=nop, + TARANTOOL_SLAB_ALLOC_MAXIMAL=nop, + TARANTOOL_SLAB_ALLOC_MINIMAL=nop, + TARANTOOL_PORT=nop, + TARANTOOL_FORCE_RECOVERY=nop, + TARANTOOL_LOG_FORMAT=nop, + TARANTOOL_LOG_LEVEL=nop, + TARANTOOL_WAL_MODE=nop, + TARANTOOL_USER_NAME=update_credentials, + TARANTOOL_USER_PASSWORD=update_credentials, + TARANTOOL_REPLICATION_SOURCE=update_replication_source, + TARANTOOL_REPLICATION=update_replication_source, +} + +console.on_start(function(self) + local status, reason + status, reason = pcall(function() require('console').connect(CONSOLE_SOCKET_PATH) end) + if not status then + self:print(reason) + os.exit(1) + end + + if arg[1] == nil or arg[2] == nil then + self:print("Usage: " .. arg[0] .. " <variable> <value>") + os.exit(1) + end + + if vars[arg[1]] == nil then + self:print("Unknown var: " .. arg[1]) + os.exit(1) + end + + local cfg = read_config() + cfg[arg[1]] = arg[2] + + local func = vars[arg[1]] + func(self, cfg, arg[2]) + + write_config(cfg) + + self.running = false + os.exit(0) +end) + +console.on_client_disconnect(function(self) self.running = false end) +console.start() + +os.exit(0) diff --git a/rpm/tarantool-picodata.spec b/rpm/tarantool-picodata.spec new file mode 100644 index 0000000000..8c50d8dfa7 --- /dev/null +++ b/rpm/tarantool-picodata.spec @@ -0,0 +1,962 @@ +# Enable systemd for on RHEL >= 7 and Fedora >= 15 +%if (0%{?fedora} >= 15 || 0%{?rhel} >= 7 || 0%{?sle_version} >= 1500 || %{?_build_vendor} == alt) +%bcond_without systemd +%else +%bcond_with systemd +%endif + +# XXX: There is an old CMake (2.8.12) provided by cmake package in +# main CentOS 7 repositories. At the same time, there is a newer +# package cmake3 providing CMake 3+ from EPEL repository. So, one +# need to use cmake3 package to build Tarantool on old systems. +%define use_cmake3 0%{?rhel} == 7 + +# Get ${GC64} env variable which can keep the value of 'true' or 'false' to +# enable or disable luajit gc64. +%define _gc64 "%{getenv:GC64}" + +%if %use_cmake3 +# XXX: Unfortunately there is no way to make rpmbuild install and +# enable EPEL repository prior to the build step. However, the +# requirement below obligues user to enable EPEL by himself, +# otherwise this dependency is left unmet. If there are any issues +# with building an RPM package on RHEL/CentOS 7 read the docs: +# https://www.tarantool.io/en/doc/latest/dev_guide/building_from_source/ +BuildRequires: cmake3 >= 3.3 +%else +BuildRequires: cmake >= 3.3 +%endif + +BuildRequires: make +%if (0%{?fedora} >= 22 || 0%{?rhel} >= 7 || 0%{?sle_version} >= 1500) +BuildRequires: gcc >= 4.5 +BuildRequires: gcc-c++ >= 4.5 +%endif +BuildRequires: coreutils +BuildRequires: sed +BuildRequires: readline-devel +BuildRequires: openssl-devel +BuildRequires: libicu-devel +#BuildRequires: msgpuck-devel +%if 0%{?fedora} > 0 +# pod2man is needed to build man pages +BuildRequires: perl-podlators +%endif +Requires(pre): %{_sbindir}/useradd +Requires(pre): %{_sbindir}/groupadd + +# libcurl dependencies (except ones we have already). +BuildRequires: zlib-devel +Requires: zlib + +%if %{with systemd} +Requires(post): systemd +Requires(preun): systemd +Requires(postun): systemd +BuildRequires: systemd +%else +Requires(post): chkconfig +Requires(post): initscripts +Requires(preun): chkconfig +Requires(preun): initscripts +%endif + +# Enable backtraces everywhere, except ancient GCC versions, which +# lack compiler features required for backtrace. +%define __cc "%{getenv:CC}" +%if %{__cc} == "" +%define __cc "cc" +%endif +%if "%(printf '%%s\n' "5.3.0" "$(%{__cc} -dumpfullversion -dumpversion)" | sort -V | head -n1)" == "5.3.0" +%bcond_without backtrace +%else +%bcond_with backtrace +%endif +%undefine __cc + +# openSuSE sets its own build directory in its macros, but we +# want to use in-source build there to simplify the RPM spec. +%if (0%{?sle_version} >= 1500) +%global __builddir . +%endif + +%if %{with backtrace} +BuildRequires: libunwind-devel +# +# Disable stripping of /usr/bin/tarantool to allow the debug symbols +# in runtime. Tarantool uses the debug symbols to display fiber's stack +# traces in fiber.info(). +# +%global _enable_debug_package 0 +%global debug_package %{nil} +%if %{?_build_vendor} != alt +%global __os_install_post /usr/lib/rpm/brp-compress %{nil} +%endif +%global __strip /bin/true +%endif + +%if %{?_build_vendor} == alt +%global _check_contents_method none +%endif + +# Set dependences for tests. +BuildRequires: python3 + +%if %{?_build_vendor} == alt +BuildRequires: python3-module-six +BuildRequires: python3-module-gevent +BuildRequires: python3-module-pyaml +%else +BuildRequires: python3-six +BuildRequires: python3-gevent +%if (0%{?sle_version} >= 1500) +BuildRequires: python3-PyYAML +%else +BuildRequires: python3-pyyaml +%endif +%endif + +# needed for datetime tests +%if 0%{?sle_version} >= 1500 +BuildRequires: timezone +%else +BuildRequires: tzdata +%endif + +# Install prove to run LuaJIT tests. +%if %{?_build_vendor} == alt +BuildRequires: perl-Tapper-TAP-Harness +%else +BuildRequires: perl-Test-Harness +%endif + +Conflicts: tarantool + +Name: tarantool-picodata +# ${major}.${major}.${minor}.${patch}, e.g. 1.6.8.175 +# Version is updated automaically using git describe --long --always +Version: 1.7.2.385 +Release: 1%{?dist} +Group: Applications/Databases +Summary: In-memory database and Lua application server +License: BSD + +Provides: tarantool-picodata-debuginfo = %{version}-%{release} +Provides: tarantool-picodata-common = %{version}-%{release} +Obsoletes: tarantool-picodata-common < 1.6.8.434-1 +# Add dependency on network configuration files used by `socket` module +# https://github.com/tarantool/tarantool/issues/1794 +Requires: /etc/protocols +Requires: /etc/services +# Deps for built-in package manager +# https://github.com/tarantool/tarantool/issues/2612 +Requires: openssl +%if 0%{?sle_version} >= 1500 +Requires: timezone +%else +Requires: tzdata +%endif +%if (0%{?fedora} >= 22 || 0%{?rhel} >= 8 || 0%{?sle_version} >= 1500) +# RHEL <= 7 doesn't support Recommends: +Recommends: tarantool-picodata-devel +Recommends: git-core +Recommends: cmake >= 3.3 +Recommends: make +Recommends: gcc >= 4.5 +Recommends: gcc-c++ >= 4.5 +%endif + +URL: http://picodata.io +Source0: http://download.tarantool.org/tarantool/1.7/src/tarantool-%{version}.tar.gz +%description +Tarantool is a high performance in-memory NoSQL database and Lua +application server. Tarantool supports replication, online backup and +stored procedures in Lua. + +This package provides the server daemon and admin tools. + +%package devel +Summary: Server development files for %{name} +Group: Applications/Databases +Requires: %{name}%{?_isa} = %{version}-%{release} +%description devel +Tarantool is a high performance in-memory NoSQL database and Lua +application server. Tarantool supports replication, online backup and +stored procedures in Lua. + +This package provides server development files needed to create +C and Lua/C modules. + +%prep +%setup -q -n %{name}-%{version} + +%build +# RHBZ #1301720: SYSCONFDIR an LOCALSTATEDIR must be specified explicitly +# Must specified explicitly since Fedora 33: +# 1. -B . +# because for now binary path by default value like: +# '-B x86_64-redhat-linux-gnu' +# 2. -DENABLE_LTO=ON +# because for now LTO flags are set in CC/LD flags by default: +# '-flto=auto -ffat-lto-objects' +# XXX: KISS, please. I can play with RPM macros to redefine cmake +# macro for cmake3 usage, but it totally doesn't worth it. +%if %use_cmake3 +%cmake3 \ +%else +%cmake \ +%endif + -B . \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_INSTALL_LOCALSTATEDIR:PATH=%{_localstatedir} \ + -DCMAKE_INSTALL_SYSCONFDIR:PATH=%{_sysconfdir} \ +%if %{with backtrace} + -DENABLE_BACKTRACE:BOOL=ON \ +%else + -DENABLE_BACKTRACE:BOOL=OFF \ +%endif +%if %{with systemd} + -DWITH_SYSTEMD:BOOL=ON \ + -DSYSTEMD_UNIT_DIR:PATH=%{_unitdir} \ + -DSYSTEMD_TMPFILES_DIR:PATH=%{_tmpfilesdir} \ +%endif +%if 0%{?fedora} >= 33 + -DENABLE_LTO=ON \ +%endif +%if %{_gc64} == "true" + -DLUAJIT_ENABLE_GC64:BOOL=ON \ +%endif + -DENABLE_WERROR:BOOL=ON \ + -DENABLE_DIST:BOOL=ON + +make %{?_smp_mflags} + +%install +%if %{?_build_vendor} == alt +%makeinstall_std +%else +%make_install +# %%doc and %%license macroses are used instead +rm -rf %{buildroot}%{_datarootdir}/doc/tarantool/ +%endif + +%if "%{getenv:MAKE_CHECK}" != "false" +%check +make test-force +%endif + +%pre +/usr/sbin/groupadd -r tarantool > /dev/null 2>&1 || : +/usr/sbin/useradd -M %{?rhel:-N} -g tarantool -r -d /var/lib/tarantool -s /sbin/nologin\ + -c "Tarantool Server" tarantool > /dev/null 2>&1 || : + +%post +%if %{with systemd} +%tmpfiles_create tarantool.conf +%systemd_post tarantool@.service +%else +chkconfig --add tarantool || : +%endif + +%preun +%if %{with systemd} +%systemd_preun tarantool@.service +%else +if [ $1 -eq 0 ] ; then # uninstall + service tarantool stop || : + chkconfig --del tarantool || : +fi +%endif + +%postun +%if %{with systemd} +%systemd_postun_with_restart tarantool@.service +%endif + +%files +%{_bindir}/tarantool +%{_mandir}/man1/tarantool.1* +%doc README.md +%{!?_licensedir:%global license %doc} +%if %{?_build_vendor} == alt +%doc LICENSE AUTHORS +%else +%license LICENSE AUTHORS +%endif + +%{_bindir}/tarantoolctl +%{_mandir}/man1/tarantoolctl.1* +%config(noreplace) %{_sysconfdir}/sysconfig/tarantool +%dir %{_sysconfdir}/tarantool +%dir %{_sysconfdir}/tarantool/instances.available +%config(noreplace) %{_sysconfdir}/tarantool/instances.available/example.lua +# Use 0750 for database files +%attr(0750,tarantool,tarantool) %dir %{_localstatedir}/lib/tarantool/ +%attr(0750,tarantool,tarantool) %dir %{_localstatedir}/log/tarantool/ +%config(noreplace) %{_sysconfdir}/logrotate.d/tarantool +# tarantool package should own module directories +%dir %{_libdir}/tarantool +%dir %{_datadir}/tarantool +%{_datadir}/tarantool/luarocks + +%if %{with systemd} +%{_unitdir}/tarantool@.service +%{_tmpfilesdir}/tarantool.conf +%else +%{_sysconfdir}/init.d/tarantool +%dir %{_sysconfdir}/tarantool/instances.enabled +%attr(-,tarantool,tarantool) %dir %{_localstatedir}/run/tarantool/ +%endif + +%files devel +%dir %{_includedir}/tarantool +%{_includedir}/tarantool/lauxlib.h +%{_includedir}/tarantool/lmisclib.h +%{_includedir}/tarantool/luaconf.h +%{_includedir}/tarantool/lua.h +%{_includedir}/tarantool/lua.hpp +%{_includedir}/tarantool/luajit.h +%{_includedir}/tarantool/lualib.h +%{_includedir}/tarantool/module.h +%{_includedir}/tarantool/curl + +%changelog +* Thu Aug 19 2021 Kirill Yukhin <kyukhin@tarantool.org> 2.8.2.0-1 +- Introduced support for LJ_DUALNUM mode in luajit-gdb.py. +- The new method table.equals compares two tables by value with respect + to the __eq metamethod. +- The log module now supports symbolic representation of log levels. +- Descriptions of type mismatch error and inconsistent type error + have become more informative. +- Removed explicit cast from BOOLEAN to numeric types and vice versa. +- Removed explicit cast from VARBINARY to numeric types and vice versa. +- Fixed a bug due to which a string that is not NULL terminated + could not be cast to BOOLEAN, even if the conversion should + be successful according to the rules. +- fiber.wakeup() in Lua and fiber_wakeup() in C became NOP on + the currently running fiber. +- Various bugfixes, see GitHub release notes: + https://github.com/tarantool/tarantool/releases/tag/2.8.2 + +* Thu Aug 19 2021 Kirill Yukhin <kyukhin@tarantool.org> 2.7.3.0-1 +- Provide information about state of synchronous replication via + box.info.synchro interface. +- Introduced support for LJ_DUALNUM mode in luajit-gdb.py. +- The new method table.equals compares two tables by value with respect + to the __eq metamethod. +- Descriptions of type mismatch error and inconsistent type error + have become more informative. +- Removed explicit cast from BOOLEAN to numeric types and vice versa. +- Removed explicit cast from VARBINARY to numeric types and vice versa. +- Fixed a bug due to which a string that is not NULL terminated + could not be cast to BOOLEAN, even if the conversion should + be successful according to the rules. +- fiber.wakeup() in Lua and fiber_wakeup() in C became NOP on + the currently running fiber. +- Various bugfixes, see GitHub release notes: + https://github.com/tarantool/tarantool/releases/tag/2.7.3 + +* Thu Aug 19 2021 Kirill Yukhin <kyukhin@tarantool.org> 1.10.11.0-1 +- Introduced support for LJ_DUALNUM mode in luajit-gdb.py. +- fiber.wakeup() in Lua and fiber_wakeup() in C became +- NOP on the currently running fiber. +- Fixed memory leak on each box.on_commit() and box.on_rollback(). +- Fixed invalid results produced by json module's encode function when it + was used from the Lua garbage collector. +- Fixed a bug when iterators became invalid after schema change. +- Fixed crash in case of reloading a compiled module when the + new module lacks some of functions which were present in the + former code. +- Fixed console client connection breakage if request times out. +- Added missing broadcast to net.box.future:discard() so that now + fibers waiting for a request result are woken up when the request + is discarded. +- Fix possible keys divergence during secondary index build which might + lead to missing tuples in it. +- Fix crash which may occur while switching read_only mode due to + duplicating transaction in tx writer list. +- Fixed a race between Vinyl garbage collection and compaction + resulting in broken vylog and recovery. +- Fix replication stopping occasionally with ER_INVALID_MSGPACK when + replica is under high load. +- Fixed optimization for single-char strings in IR_BUFPUT + assembly routine. +- Fixed slots alignment in lj-stack command output when + LJ_GC64 is enabled. +- Fixed dummy frame unwinding in lj-stack command. +- Fixed detection of inconsistent renames even in the presence + of sunk values. +- Fixed the order VM registers are allocated by LuaJIT frontend + in case of BC_ISGE and BC_ISGT. +- When error is raised during encoding call results, + auxiliary lightuserdata value is not removed from the main + Lua coroutine stack. +- Fixed Lua C API misuse, when the error is raised during call results + encoding on unprotected coroutine and expected to be catched + on the different one, that is protected. +- Fixed possibility crash in case when trigger removes itself. +- Fixed possibility crash in case when someone destroy trigger, + when it's yield. + +* Wed Apr 21 2021 Kirill Yukhin <kyukhin@tarantool.org> 2.8.1.0-1 +- Implement ability to run multiple iproto threads. +- Set box.cfg options with environment variables. +- Introduce box.ctl.promote() and the concept of manual elections. +- Lua memory profiler enhancements. +- Many other features and bugfixes, see GitHub release notes: + https://github.com/tarantool/tarantool/releases/tag/2.8.1 + +* Wed Apr 21 2021 Kirill Yukhin <kyukhin@tarantool.org> 2.7.2.0-1 +- Introduce the concept of WAL queue and a new configuration option: + wal_queue_max_size. +- Introduce box.ctl.promote() and the concept of manual elections. +- Updated CMake minimum required version to 3.1. +- Drop autotools dependencies. +- Bump built-in zstd version from v1.3.3 to v1.4.8. +- Enable smtp and smtps protocols in bundled libcurl. +- Ship libcurl headers to system path "${PREFIX}/include/tarantool" + in the case of libcurl included as bundled library or static build. +- Various bugfixes, see GitHub release notes: + https://github.com/tarantool/tarantool/releases/tag/2.7.2 + +* Wed Apr 21 2021 Kirill Yukhin <kyukhin@tarantool.org> 2.6.3.0-1 +- Introduce the concept of WAL queue and a new configuration option: + wal_queue_max_size. +- Introduce box.ctl.promote() and the concept of manual elections. +- Updated CMake minimum required version to 3.1. +- Drop autotools dependencies. +- Stop publishing new binary packages for Debian Jessie. +- Bump built-in zstd version from v1.3.3 to v1.4.8. +- Enable smtp and smtps protocols in bundled libcurl. +- Ship libcurl headers to system path "${PREFIX}/include/tarantool" + in the case of libcurl included as bundled library or static build. +- Various bugfixes, see GitHub release notes: + https://github.com/tarantool/tarantool/releases/tag/2.6.3 + +* Wed Apr 21 2021 Kirill Yukhin <kyukhin@tarantool.org> 1.10.10.0-1 +- Updated CMake minimum required version in Tarantool + build infrastructure to 3.1. +- Stop publishing new binary packages for Debian Jessie. +- Backported -DENABLE_LTO=ON/OFF cmake option. +- Bump built-in zstd version from v1.3.3 to v1.4.8. +- libcurl symbols in the case of bundled libcurl are now exported. +- Enable smtp and smtps protocols in bundled libcurl. +- Ship libcurl headers to system path "${PREFIX}/include/tarantool" + in the case of libcurl included as bundled library or static build. +- Extensive usage of uri and uuid modules with debug log level could lead to + a crash or corrupted result of the functions from these modules. + The same could happen with some functions from the modules fio, + box.tuple, iconv. +- Fixed -e option, when tarantool always entered interactive mode + when stdin is a tty. +- Make recovering with force_recovery option delete newer than + snapshot vylog files. + +* Wed Dec 30 2020 Kirill Yukhin <kyukhin@tarantool.org> 2.7.1.0-1 +- LuaJIT memory profiler. +- Expression evaluation for replication_synchro_quorum. +- The ALTER TABLE ADD COLUMN statement. +- Many other features and bugfixes, see GitHub release notes: + https://github.com/tarantool/tarantool/releases/tag/2.7.1 + +* Wed Dec 30 2020 Kirill Yukhin <kyukhin@tarantool.org> 2.6.2.0-1 +- The new box.ctl.is_recovery_finished() function allows user + to determine whether memtx recovery is finished. +- It is now possible to specify synchro quorum as a function of + a number N of registered replicas. +- Show JSON tokens themselves instead of token names T_* + in the JSON decoder error messages. +- Show a decoding context in the JSON decoder error messages. +- Various bugfixes, see GitHub release notes: + https://github.com/tarantool/tarantool/releases/tag/2.6.2 + +* Wed Dec 30 2020 Kirill Yukhin <kyukhin@tarantool.org> 2.5.3.0-1 +- The new box.ctl.is_recovery_finished() function allows user + to determine whether memtx recovery is finished. +- A lot of bugfixes, see GitHub release notes: + https://github.com/tarantool/tarantool/releases/tag/2.5.3 + +* Wed Dec 30 2020 Kirill Yukhin <kyukhin@tarantool.org> 1.10.9.0-1 +- Deploy packages for Debian Bullseye. +- Don't start an 'example' instance after installing tarantool. +- fiber.cond:wait() now correctly throws an error when + a fiber is cancelled. +- Fixed a memory corruption issue. +- A dynamic module now gets correctly unloaded from memory in case + of an attempt to load a non-existing function from it. +- The fiber region (the box region) won't be invalidated on + a read-only transaction. +- Dispatching __call metamethod no longer causes address clashing. +- Fixed a false positive panic when yielding in debug hook. +- An attempt to use a net.box connection which is not established yet + now results in a correctly reported error. +- Fixed a hang which occurred when tarantool ran a user script with + the -e option and this script exited with an error. + +* Thu Oct 22 2020 Kirill Yukhin <kyukhin@tarantool.org> 2.6.1.0-1 +- Transactional manager for the memtx engine that allows yielding + in transactions. +- Raft-based automated failover mechanism for a single-leader replica set. +- Many other features and bugfixes, see GitHub release notes: + https://github.com/tarantool/tarantool/releases/tag/2.6.1 + +* Thu Oct 22 2020 Kirill Yukhin <kyukhin@tarantool.org> 2.5.2.0-1 +- New function space:alter(options). +- Exposed the box region, key_def and several other functions. +- A lot of bugfixes, see GitHub release notes: + https://github.com/tarantool/tarantool/releases/tag/2.5.2 + +* Thu Oct 22 2020 Kirill Yukhin <kyukhin@tarantool.org> 2.4.3.0-1 +- Exposed the box region, key_def and several other functions + in order to implement external tuple.keydef and tuple.merger + modules on top of them. +- Various improvements and bugfixes, see GitHub release notes: + https://github.com/tarantool/tarantool/releases/tag/2.4.3 + +* Thu Oct 22 2020 Kirill Yukhin <kyukhin@tarantool.org> 1.10.8.0-1 +- Exposed the box region, key_def and several other functions in order + to implement external tuple.keydef and tuple.merger modules + on top of them. +- Fixed fibers switch-over to prevent JIT machinery misbehavior. +- Fixed fibers switch-over to prevent implicit GC disabling. +- Fixed unhandled Lua error that might lead to memory leaks and + inconsistencies in <space_object>:frommap(), <key_def_object>:compare(), + <merge_source>:select(). +- Fixed the error occurring on loading luajit-gdb.py with Python2. +- Fixed potential lag on boot up procedure when system's password + database is slow in access. +- Get rid of typedef redefinitions for compatibility with C99. + +* Fri Jul 17 2020 Kirill Yukhin <kyukhin@tarantool.org> 2.5.1.0-1 +- Synchronous replication (beta). +- Allow an anonymous replica follow another anonymous replica. +- Fixed numerous crashes in Vinyl. +- Make implicit cast rules for assignment operation more strict in SQL. +- Updated curl version to 7.71. +- Don't start 'example' instance after installing tarantool. +- Many other features and bugfixes, see GitHub release notes: + https://github.com/tarantool/tarantool/releases/tag/2.5.1 + +* Fri Jul 17 2020 Kirill Yukhin <kyukhin@tarantool.org> 2.4.2.0-1 +- box.session.push() parameter sync is deprecated. +- Don't start 'example' instance after installing tarantool. +- Various bugfixes, see GitHub release notes: + https://github.com/tarantool/tarantool/releases/tag/2.4.2 + +* Fri Jul 17 2020 Kirill Yukhin <kyukhin@tarantool.org> 2.3.3.0-1 +- Various improvements and bugfixes, see GitHub release notes: + https://github.com/tarantool/tarantool/releases/tag/2.3.3 + +* Fri Jul 17 2020 Kirill Yukhin <kyukhin@tarantool.org> 1.10.7.0-1 +- Fixed a bug in C module reloading. +- Fixed races and corner cases in box (re)configuration. +- Fixed check of index field map size which led to crash. +- Fixed wrong mpsgpack extension type in an error message at decoding. +- Fixed error while closing socket.tcp_server socket. +- Don't ruin rock name when freshly installing *.all.rock +- with dependencies. +- Fixed crash during compaction due to tuples with size exceeding + vinyl_max_tuple_size setting. +- Fixed crash during recovery of vinyl index due to the lack of file + descriptor. +- Fixed crash during executing upsert changing primary key + in debug mode. +- Fixed crash due to triggered dump process during secondary index + creation. +- Fixed crash/deadlock (depending on build type) during dump process + scheduling and concurrent DDL operation. +- Fixed crash during read of prepared but still not yet + not committed statement. +- Fixed squashing set and arithmetic upsert operations. +- Create missing folders for vinyl spaces and indexes if needed + to avoid confusing fails of tarantool started from backup. +- Fixed crash during squash of many (more than 4000) upserts modifying + the same key. + +* Mon Apr 20 2020 Kirill Yukhin <kyukhin@tarantool.org> 2.4.1.0-1 +- UUID type was introduced. +- It is now possible to report stack of errors. +- Added popen built-in module. +- Create errors of custom type and transparent marshaling over net.box. +- Many other features and bugfixes, see GitHub release notes: + https://github.com/tarantool/tarantool/releases/tag/2.4.1 + +* Mon Apr 20 2020 Kirill Yukhin <kyukhin@tarantool.org> 2.3.2.0-1 +- fiber.storage is cleaned between requests. +- tuple/space/index:update()/upsert() were fixed not to turn + a value into an infinity when a float value was added to or + subtracted from a float column and exceeded the float value range +- Fix potential execution abort when operating the system runs + under heavy memory load. +- Make RTREE indexes handle the out of memory error. +- Fix the error message returned on using an already dropped sequence. +- Add cancellation guard to avoid WAL thread stuck. +- Fix execution abort when memtx_memory and vinyl_memory are set + to more than 4398046510080 bytes. +- Fix rebootstrap procedure not working in case replica itself is + listed in box.cfg.replication. +- Fix possible user password leaking via replication logs. +- Refactor vclock map to be exactly 4 bytes in size. +- Fix crash when the replication applier rollbacks a transaction. +- Local space operations are now counted in 0th vclock component. +- Gc consumers are now ordered by their vclocks and not by vclock + signatures. +- json:decode() doesn't spoil instance's options with per-call ones. +- Handle empty input for uri.format() properly. +- os.environ() is now changed when os.setenv() is called. +- netbox.self:call/eval() now returns the same types as + netbox_connection:call/eval. +- box.tuple.* namespace is cleaned up from private functions. +- tarantoolctl rocks search: fix the --all flag. +- tarantoolctl rocks remove: fix the --force flag. +- Fix box.stat() behavior: now it collects statistics on the + PREPARE and EXECUTE methods as expected. +- The inserted values are inserted in the order in which they are given + in case of SQL INSERT into space with autoincrement. +- When building Tarantool with bundled libcurl, link it with the c-ares + library by default. +- __pairs/__ipairs metamethods handling is removed. +- Introduce luajit-gdb.py extension with commands for inspecting + LuaJIT internals. +- Fix string to number conversion. +- "FFI sandwich"(*) detection is introduced. +- luaJIT_setmode call is prohibited while mcode execution. +- Fix assertion fault due to triggered dump process during + secondary index build. +- Fix crashes at attempts to use -e and -l command line options + concatenated with their values. +- Fix inability to upgrade from 2.1 if there was an automatically + generated sequence. +- Update libopenssl version to 1.1.1f since the previous one was EOLed. +- Fix static build (-DBUILD_STATIC=ON) when libunwind depends on liblzma. + +* Mon Apr 20 2020 Kirill Yukhin <kyukhin@tarantool.org> 2.2.3.0-1 +- Various improvements and bugfixes, see GitHub release notes: + https://github.com/tarantool/tarantool/releases/tag/2.2.3 + +* Mon Apr 20 2020 Kirill Yukhin <kyukhin@tarantool.org> 1.10.6.0-1 +- fiber.storage is cleaned between requests. +- tuple/space/index:update()/upsert() were fixed not to turn a value + into an infinity when a float value was added to or subtracted from + a float column and exceeded the float value range. +- Make RTREE indexes handle the out of memory error. +- Add cancellation guard to avoid WAL thread stuck. +- Fix the rebootstrap procedure not working if the replica itself + is listed in box.cfg.replication. +- Fix possible user password leaking via replication logs. +- Local space operations are now counted in 0th vclock component. +- Gc consumers are now ordered by their vclocks and not by vclock + signatures. +- json: :decode() doesn't spoil instance's options with per-call ones. +- os.environ() is now changed when os.setenv() is called. +- netbox.self:call/eval() now returns the same types as + netbox_connection:call/eval. +- __pairs/__ipairs metamethods handling is removed. +- Introduce luajit-gdb.py extension with commands for inspecting + LuaJIT internals. +- Fix string to number conversion. +- "FFI sandwich" detection is introduced. +- luaJIT_setmode call is prohibited while mcode execution and leads + to the platform panic. +- Fix assertion fault due to triggered dump process during secondary + index build. +- Fix crashes at attempts to use -e and -l command line options + concatenated with their values. +- Update libopenssl version to 1.1.1f. + +* Tue Jan 14 2020 Kirill Yukhin <kyukhin@tarantool.org> 1.10.5.0-1 +- Exit gracefully when a main script throws an error. +- Enable __pairs and __ipairs metamethods from Lua 5.2. +- A lof of bugfixes, see GitHub release notes: + https://github.com/tarantool/tarantool/releases/tag/1.10.5 + +* Tue Dec 31 2019 Alexander Turenko <alexander.turenko@tarantool.org> 2.3.1.0-1 +- Field name and JSON path updates. +- Anonymous replica. +- New DOUBLE SQL type (and new 'double' box field type). +- Stored and indexed decimals (and new 'decimal' field type). +- fiber.top() +- Feed data from a memory during replica initial join. +- SQL prepared statements. +- Sessions settings service space. +- Many other features and bugfixes, see GitHub release notes: + https://github.com/tarantool/tarantool/releases/tag/2.3.1 + +* Tue Dec 31 2019 Alexander Turenko <alexander.turenko@tarantool.org> 2.2.2.0-1 +- Drop rows_per_wal box.cfg() option in favor of wal_max_size. +- json and msgpack serializers now raise an error when a depth of + data nesting exceeds encode_max_depth option value. +- Show line and column in json.decode() errors. +- Exit gracefully when a main script throws an error. +- key_def: accept both field and fieldno in key_def.new(<...>). +- Enable __pairs and __ipairs metamethods from Lua 5.2. +- tarantoolctl: allow to start instances with delayed box.cfg{}. +- Dozens of bugfixes, see GitHub release notes: + https://github.com/tarantool/tarantool/releases/tag/2.2.2 + +* Wed Nov 06 2019 Kirill Yukhin <kyukhin@tarantool.org> 2.1.3.0-1 +- Various improvements and bugfixes, see GitHub release notes: + https://github.com/tarantool/tarantool/releases/tag/2.1.3 + +* Thu Sep 26 2019 Kirill Yukhin <kyukhin@tarantool.org> 1.10.4.0-1 +- Improve dump start/stop logging. +- Look up key in reader thread. +- Improve box.stat.net. +- Add idle to downstream status in box.info. +- Deprecate rows_per_wal in favor of wal_max_size. +- Print corrupted rows on decoding error. +- Add type of operation to space trigger parameters. +- Add debug.sourcefile() and debug.sourcedir() helpers to determine + the location of a current Lua source file. +- Add max_total_connections option in addition to total_connection + to allow more fine-grained tuning of libcurl connection cache. +- A lof of bugfixes, see GitHub release notes: + https://github.com/tarantool/tarantool/releases/tag/1.10.4 + +* Fri Aug 02 2019 Kirill Yukhin <kyukhin@tarantool.org> 2.2.1.0-1 +- New fixed point type (DECIMAL) was introduced to Tarantool. +- Multikey index support. +- Now it is possible to make functions persistent. +- Functional indexes implemented. +- Partial core dumps, which are now on by default. +- Data definition statements, which do not yield, can now be used + in a transaction. +- It is now possible to set a sequence not only for the first part + of the index. +- Allow to call box.session.exists() and box.session.fd() without + any arguments. +- New function introduced to get index key from tuple. +- New protocol called SWIM implemented to keep a table + of cluster members. +- Provide type of operation inside before_replace() trigger. +- Remove yields from Vinyl DDL on commit triggers. +- Improved performance of SELECT-s on memtx spaces. +- Indexes of memtx spaces are now built in background fibers. +- Hand over key lookup in a page to vinyl reader thread. +- Replication applier now can apply transactions which were + concurrent on the master concurrently on replica. +- Transaction boundaries introduced to replication protocol. +- Tuple access by field name for net.box. +- It is now possible to set the output format to Lua instead of YAML + in the interactive console. +- Multiple new collations added. +- New function touch introduced to fio module. +- Merger for tuples streams added. +- Default collation strength is explicit tertiary now. +- Improve box.stat.net. +- Tarantool now uses luarocks 3. +- New module key_def introduced to Lua. +- SQL ALTER now allows to add a constraint. +- SQL CHECK constraints are also validated during DML operations + performed from Lua land. +- New SQL types VARBINARY, UNSIGNED and BOOLEAN. +- CREATE TABLE SQL statement (and all other data definition statements) + are now truly transactional. +- SQL now uses Tarantool diagnostics API to set errors. +- Multiple improvements to SQL type system to make it more consistent. +- Added aliases for LENGTH() from ANSI SQL. +- It is possible to use HAVING without GROUP BY in SQL. +- A lot of bugfixes, see GitHub release notes: + https://github.com/tarantool/tarantool/releases/tag/2.2.1 + +* Fri Apr 05 2019 Kirill Yukhin <kyukhin@tarantool.org> 2.1.2.0-1 +- Index based on JSON path. +- In case of ENOSPC delete WALs not needed for recovery + from the last checkpoint. +- Add support for "tarantoolctl rocks pack" subcommand. +- string.rstrip and string.lstrip should accept symbols to strip. +- on shutdown trigger added. +- on_schema_init trigger added. +- snapshot daemon: limit the maximum disk size of maintained WALs. +- Permissions to create, alter and drop space. +- Replace box.sql.execute() with box.execute(). +- SQL Type system was significantly refactored. +- Do not use SQL delete+insert for updates. +- Improve value comparison of different SQL types. +- Allow constraints to appear along with column definitions in SQL. +- Improve pragma index_info syntax. +- Dozens of bugfixes, see GitHub release notes: + https://github.com/tarantool/tarantool/releases/tag/2.1.2 + +* Mon Apr 1 2019 Kirill Yukhin <kyukhin@tarantool.org> 1.10.3.0-1 +- Randomize vinyl index compaction. +- Throttle tx thread if compaction doesn't keep up with dumps. +- Do not apply run_count_per_level to the last level. +- Report the number of active iproto connections. +- Never keep a dead replica around if running out of disk space. +- Report join progress to the replica log. +- Expose snapshot status in box.info.gc(). +- Show names of Lua functions in backtraces in fiber.info(). +- Check if transaction opened. +- A lof of bugfixes, see GitHub release notes: + https://github.com/tarantool/tarantool/releases/tag/1.10.3 + +* Thu Nov 15 2018 Kirill Yukhin <kyukhin@tarantool.org> 2.1.1.0-1 +- Add function box.sql.execute() to query Tarantool database + using SQL statements. +- Added support for SQL collations by incorporating libICU + character set and collation library. +- IPROTO interface was extended to support SQL queries. +- net.box subsystem was extended to support SQL queries. +- Enabled ANALYZE statement to produce correct results, + necessary for efficient query plans. +- Enabled savepoints functionality. SAVEPOINT statement works w/o issues. +- Enabled ALTER TABLE … RENAME statement. +- Improved rules for identifier names: now fully consistent + with Lua frontend. +- Enabled support for triggers; trigger bodies now persist in Tarantool + snapshots and survive server restart. +- Significant performance improvements. +- Functions in SQL. +- Introduce new SQL wire protocol. +- Is nullable type attribute wanted by API in IPROTO. +- Add collation field to tuple format. +- Add string.fromhex() method. +- Select input language in tarantoolctl. +- Use Tarantool's structs for metadata during query compilation. +- Resolve names for VIEW right after its creation. +- Various SQL features and bugfixes, see GitHub release notes: + https://github.com/tarantool/tarantool/releases/tag/2.1.1 + +* Sat Oct 13 2018 Kirill Yukhin <kyukhin@tarantool.org> 1.10.2.0-1 +- Configurable syslog destination. +- Allow different nullability in indexes and format. +- Allow to back up any checkpoint. +- A way to detect that a Tarantool process was started or + restarted by tarantoolctl. +- `TARANTOOLCTL` and `TARANTOOL_RESTARTED` env vars. +- New configuration parameter net_msg_max to restrict + the number of allocated fibers; +- Automatic replication rebootstrap. +- Replica-local space. +- Display the connection status if the downstream gets + disconnected from the upstream. +- New option replication_skip_conflict. +- Remove old snapshots which are not needed by replicas. +- New function fiber.join(). +- New option `names_only` in tuple:tomap(). +- Support custom rock servers in tarantoolctl. +- Expose on_commit/on_rollback triggers to Lua. +- New function box.is_in_txn() to check if a transaction is open. +- Tuple field access via a json path. +- New function space:frommap() to convert a map to a tuple instance + or to a table. +- New module utf8 that implements libicu's bindings for use in Lua. +- Support ALTER for non-empty vinyl spaces. +- Tuples stored in the vinyl cache are not shared among the indexes + of the same space. +- Keep a stack of UPSERTS in `vy_read_iterator`. +- New function `box.ctl.reset_stat()` to reset vinyl statistics. +- A lof of bugfixes, see GitHub release notes: + https://github.com/tarantool/tarantool/releases/tag/1.10.2 + +* Wed Sep 05 2018 Kirill Yukhin <kyukhin@tarantool.org> 1.9.2.0-1 +- Dozens of bugfixes, see GitHub release notes: + https://github.com/tarantool/tarantool/releases/tag/1.9.1 + https://github.com/tarantool/tarantool/releases/tag/1.9.2 + +* Mon Feb 26 2018 Konstantin Osipov <kostja@tarantool.org> 1.9.0.4-1 +- It is now possible to block/unblock users. +- New function `box.session.euid()` to return effective user. +- New 'super' role, with superuser access. +- `on_auth` trigger is now fired in case of both successful and + failed authentication. +- New replication configuration algorithm. +- After replication connect at startup, the server + does not start processing write requests before syncing up + with all connected peers. +- It is now possible to explicitly set instance and replica set + uuid via database configuration. +- `box.once()` no longer fails on a read-only replica but waits. +- `force_recovery` can now skip a corrupted xlog file. +- Improved replication monitoring. +- New 'BEFORE' triggers which can be used for conflict resolution + in master-master replication. +- http client now correctly parses cookies and supports + http+unix:// paths. +- `fio` rock now supports `file_exists()`, `rename()` works across + filesystems, and `read()` without arguments reads the whole file. +- `fio` rock errors now follow Tarantool function call conventions + and always return an error message in addition to the error flag. +- `digest` rock now supports pbkdf2 password hashing algorithm, + useful in PCI/DSS compliant applications. +- `box.info.memory()` provides a high-level overview of + server memory usage, including networking, Lua, transaction + and index memory. +- It is now possible to add missing tuple fields to an index. +- Lots of improvements in field type support when creating or + altering spaces and indexes. +- It is now possible to turn on `is_nullable` property on a field + even if the space is not empty. +- Several logging improvements. +- It is now possible to make a unique vinyl index non-unique + without index rebuild. +- Improved vynil UPDATE, REPLACE and recovery performance in presence of + secondary keys. +- `space:len()` and `space:bsize()` now work for vinyl. +- Vinyl recovery speed has improved in presence of secondary keys. + +* Tue Nov 07 2017 Roman Tsisyk <roman@tarantool.org> 1.7.6.0-1 +- Hybrid schema-less + schema-full data model. +- Collation and Unicode Support. +- NULL values in unique and non-unique indexes. +- Sequences and a new implementation of auto_increment(). +- Add gap locks in Vinyl transaction manager. +- on_connect/on_disconnect triggers for net.box. +- Structured logging in JSON format. +- Several Lua features and various bugfixes, see GitHub release notes + for details: https://github.com/tarantool/tarantool/releases/tag/1.7.6 + +* Tue Sep 12 2017 Roman Tsisyk <roman@tarantool.org> 1.7.5.46-1 +- Stabilization of Vinyl storage engine. +- Improved MemTX TREE iterators. +- Better replication monitoring. +- WAL tracking for remote replicas on master. +- Automatic checkpoints every hour. +- Lua API to create consistent backups. +- Hot code reload for stored C procedures. +- New built-in rocks: 'http.client', 'iconv' and 'pwd'. +- Lua 5.1 command line options. +- LuaRocks-based package manager. +- Stack traces support in fiber.info(). +- New names for box.cfg() options. +- Hot standby mode is now off by default. +- Support for UNIX pipes in tarantoolctl. +- Non-blocking syslog logger. +- Improved systemd integration. +- Hundrends of bugs fixed, see GitHub release notes for details: + https://github.com/tarantool/tarantool/releases/tag/1.7.5 + +* Fri Dec 16 2016 Roman Tsisyk <roman@tarantool.org> 1.7.2.385-1 +- Add `tarantoolctl cat/play` commands and `xlog` Lua module. +- Add Lua library to manipulate environment variables. +- Allow DML requests from on_replace triggers. +- Allow UPSERT without operations. +- Improve support for the large number of active network clients. +- Fix race conditions during automatic cluster bootstrap. +- Fix calculation of periods in snapshot daemon. +- Fix handling of iterator type in space:pairs() and space:select(). +- Fix CVE-2016-9036 and CVE-2016-9037. +- Dozens of bug fixes to Vinyl storage engine. +- Remove broken coredump() Lua function. + +* Thu Sep 29 2016 Roman Tsisyk <roman@tarantool.org> 1.7.2.1-1 +- Vinyl - a new write-optimized storage engine, allowing the amount of + data stored to exceed the amount of available RAM 10-100x times. +- A new binary protocol command for CALL, which no more restricts a function + to returning an array of tuples and allows returning an arbitrary + MsgPack/JSON result, including scalars, nil and void (nothing). +- Automatic replication cluster bootstrap; it's now much easier to configure + a new replication cluster. +- New indexable data types: unsigned, integer, number and scalar. +- memtx snapshots and xlog files are now compressed on the fly using the + fast ZStandard compression algorithm. Compression options are configured + automatically to get an optimal trade-off between CPU utilization and disk + throughput. +- fiber.cond() - a new synchronization mechanism for fibers. +- Tab-based autocompletion in the interactive console. +- A new implementation of net.box improving performance and solving + problems with the garbage collection of dead connections. +- Native systemd integration alongside sysvinit. +- A ready-to-use 'example.lua' instance enable by default. +- Dozens of bugfixes diff --git a/tools/Dockerfile b/tools/Dockerfile new file mode 100644 index 0000000000..11adc69025 --- /dev/null +++ b/tools/Dockerfile @@ -0,0 +1,43 @@ +FROM ubuntu:20.04 + +ENV TZ=Europe/Moscow + +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +RUN apt update && \ + apt upgrade -y && \ + apt install -y \ + git \ + build-essential \ + cmake \ + make \ + zlib1g-dev \ + libreadline-dev \ + libncurses5-dev \ + libssl-dev \ + libunwind-dev \ + libicu-dev \ + libyaml-dev \ + libcurl4-openssl-dev \ + python3 \ + python3-yaml \ + python3-six \ + python3-gevent \ + python3-pip \ + python3-dev \ + python3-setuptools \ + luarocks \ + coreutils \ + sed \ + lcov \ + ruby \ + clang \ + llvm \ + llvm-dev \ + zlib1g-dev \ + autoconf \ + automake \ + libtool \ + ninja-build + +RUN luarocks install luacheck -- GitLab