diff --git a/.drone.jsonnet b/.drone.jsonnet index 557867821..b1b995f3d 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -24,18 +24,23 @@ local builddir = 'verylongdirnameforverystrangecpackbehavior'; local Pipeline(branch, platform, event, arch='amd64', server='10.6-enterprise') = { local pkg_format = if (std.split(platform, ':')[0] == 'rockylinux') then 'rpm' else 'deb', local branchp = if (branch == '**') then '' else branch + '/', - local brancht = if (branch == '**') then '' else branch + '-', local result = std.strReplace(std.strReplace(platform, ':', ''), '/', '-'), local img = if (platform == 'rockylinux:8') then platform else 'detravi/' + std.strReplace(platform, '/', '-'), + local init = if (pkg_format == 'rpm') then '/usr/lib/systemd/systemd' else 'systemd', local packages_url = 'https://cspkg.s3.amazonaws.com/' + branchp + event + '/${DRONE_BUILD_NUMBER}/' + server, local publish_pkg_url = "https://cspkg.s3.amazonaws.com/index.html?prefix=" + branchp + event + "/${DRONE_BUILD_NUMBER}/" + server + "/" + arch + "/" + result + "/", - local repo_pkg_url_no_res = "https://cspkg.s3.amazonaws.com/" + branchp + event + "/${DRONE_BUILD_NUMBER}/" + server + "/" + arch + "/", - local container_tags = if (event == 'cron') then [brancht + std.strReplace(event, '_', '-') + '${DRONE_BUILD_NUMBER}', brancht] else [brancht + std.strReplace(event, '_', '-') + '${DRONE_BUILD_NUMBER}'], - local container_version = branchp + event + '/${DRONE_BUILD_NUMBER}/' + server + '/' + arch, - - local server_remote = if (std.endsWith(server, 'enterprise')) then 'https://github.com/mariadb-corporation/MariaDBEnterprise' else 'https://github.com/MariaDB/server', + local smoke_docker_name = 'fdb_smoke_$${DRONE_BUILD_NUMBER}', local pipeline = self, + local execInnerDocker(command, dockerImage, flags = '') = + 'docker exec ' + flags + ' -t ' + dockerImage + ' ' + command, + + local installRpmDeb(pkg_format, rpmpackages, debpackages) = + if (pkg_format == 'rpm') + then ' bash -c "yum install -y ' + rpmpackages + '"' + else ' bash -c "apt update --yes && apt install -y ' + debpackages + '"', + + publish(step_prefix='pkg', eventp=event + '/${DRONE_BUILD_NUMBER}'):: { name: 'publish ' + step_prefix, depends_on: [std.strReplace(step_prefix, ' latest', '')], @@ -84,6 +89,7 @@ local Pipeline(branch, platform, event, arch='amd64', server='10.6-enterprise') if (pkg_format == 'rpm') then 'yum install -y -q wget' else 'apt update --yes && apt install -q -y wget', 'wget https://raw.githubusercontent.com/mariadb-corporation/mariadb-columnstore-engine/fdb_build/tests/scripts/fdb_build.sh', 'bash fdb_build.sh', + 'mkdir -p /drone/src/' + result, if (pkg_format == 'rpm') then 'cp /fdb_build/packages/*.rpm /drone/src/' + result else 'cp /fdb_build/packages/*.rpm /drone/src/' + result, ], @@ -102,6 +108,26 @@ local Pipeline(branch, platform, event, arch='amd64', server='10.6-enterprise') "echo 'export PACKAGES_URL="+packages_url+"'", ], }, + ] + + [ + { + name: 'smoke check installation', + depends_on: ['publish build_fdb'], + image: 'docker', + volumes: [pipeline._volumes.docker], + commands: [ + 'docker run --memory 3g --env OS=' + result + ' --env PACKAGES_URL=' + packages_url + ' --env DEBIAN_FRONTEND=noninteractive --name ' + smoke_docker_name + ' --ulimit core=-1 --privileged --detach ' + img + ' ' + init + ' --unit=basic.target', + 'wget https://raw.githubusercontent.com/mariadb-corporation/mariadb-columnstore-engine/develop/setup-repo.sh', + 'docker cp setup-repo.sh ' + smoke_docker_name + ':/', + execInnerDocker('bash /setup-repo.sh', smoke_docker_name), + execInnerDocker('sysctl -w kernel.core_pattern="/core/%E_' + result + '_core_dump.%p"', smoke_docker_name), + execInnerDocker(installRpmDeb(pkg_format, 'foundationdb*', 'foundationdb*'), smoke_docker_name), + execInnerDocker(installRpmDeb(pkg_format, 'jq', 'jq'), smoke_docker_name), + execInnerDocker('service foundationdb status', smoke_docker_name), + execInnerDocker("fdbcli --exec 'status json' | jq .client", smoke_docker_name), + execInnerDocker("fdbcli --exec 'writemode on; set foo bar; get foo", smoke_docker_name) + ], + }, ] , diff --git a/tests/scripts/fdb_build.sh b/tests/scripts/fdb_build.sh index b5312f202..457ec9637 100644 --- a/tests/scripts/fdb_build.sh +++ b/tests/scripts/fdb_build.sh @@ -25,6 +25,23 @@ print_env() message "PACKAGES_SUFFIX=${PACKAGES_SUFFIX}" } +make_openssl() +{ + message "Compiling static openssl" + curl -Ls https://www.openssl.org/source/openssl-1.1.1m.tar.gz -o openssl.tar.gz && \ + echo "f89199be8b23ca45fc7cb9f1d8d3ee67312318286ad030f5316aca6462db6c96 openssl.tar.gz" > openssl-sha.txt && \ + sha256sum --quiet -c openssl-sha.txt && \ + mkdir openssl && \ + tar --strip-components 1 --no-same-owner --directory openssl -xf openssl.tar.gz && \ + cd openssl && \ + ./config CFLAGS="-fPIC -O3" --prefix=/usr/local && \ + make -j`nproc` && \ + make -j1 install && \ + ln -sv /usr/local/lib64/lib*.so.1.1 /usr/lib64/ && \ + cd ../ && \ + rm -rf /tmp/* +} + make_lz4() { message "Compiling static lz4" @@ -55,6 +72,8 @@ elif [[ ${ID} == "rocky" ]]; then OS_SHORTCUT=$(echo $PLATFORM_ID | cut -f2 -d ':') PACKAGES_SUFFIX="-DRPM=${OS_SHORTCUT}" PACKAGES_TYPE='rpm' + GENERATOR='RPM' + dnf -y update dnf install -y -q ncurses @@ -71,7 +90,8 @@ elif [[ ${ID} == "rocky" ]]; then curl https://download.mono-project.com/repo/centos8-stable.repo | tee /etc/yum.repos.d/mono-centos8-stable.repo fi - dnf install -y -q --allowerasing automake cmake curl dnf gcc git jemalloc-devel jq mono-devel openssl-devel patch python3-devel unzip + dnf install -y -q --allowerasing automake cmake curl dnf gcc git jemalloc-devel jq mono-devel openssl-devel patch perl python3-devel unzip + make_openssl else echo "Unsupported distribution. This script only supports Rocky[8|9], Ubuntu [20.04|22.04|24.04] Debian[11|12]" @@ -98,17 +118,16 @@ cmake -DWITH_PYTHON=ON \ -DWITH_JAVA_BINDING=OFF \ -DWITH_GO_BINDING=OFF \ -DWITH_RUBY_BINDING=IFF \ - -DWITH_TLS=OFF \ + -DWITH_TLS=ON \ + -DDISABLE_TLS=OFF \ -DWITH_DOCUMENTATION=OFF \ -DWITH_ROCKSDB_EXPERIMENTAL=OFF \ - -DWITH_AWS_BACKUP=OFF \ + -DWITH_AWS_BACKUP=ON \ ${PACKAGES_SUFFIX} \ ../foundationdb-${FDB_VERSION} message "Compiling sources" - - message "Compiling fdbserver" cd fdbserver ${BUILD_COMMAND} @@ -130,4 +149,3 @@ message "Installing packages" ${PKG_MANAGER} packages/*.${PACKAGES_TYPE} message "Checking statuses" fdbcli --exec 'status json' | jq .client -service foundationdb status