Skip to content

Commit

Permalink
Add script to run upgrade test in Docker container (#21)
Browse files Browse the repository at this point in the history
Run script concourse/scripts/upgrade_test_diskquota.sh in Docker
to run upgrade test of diskquota.
Before starting upgrade test new script build version 1.0.3 (from tag
1.0.3_arenadata2).

Check of minor in version of diskquota was removed from diskquota
worker process, because we use symlinks from ealier versions (since 2.0)
diskquota to the latest version (commit 472eb06).
  • Loading branch information
red1452 committed Oct 3, 2023
1 parent 87b5dc3 commit c6f3a37
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 1 deletion.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ BuildInfo_Create(${build_info_PATH}

# Add installcheck targets
add_subdirectory(tests)
add_subdirectory(upgrade_test)

# NOTE: keep install part at the end of file, to overwrite previous binary
install(PROGRAMS "cmake/install_gpdb_component" DESTINATION ".")
Expand Down
11 changes: 11 additions & 0 deletions arenadata/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,14 @@ docker run --rm -it --sysctl 'kernel.sem=500 1024000 200 4096' \
-v <PATH_TO_CMAKE_INSTALL_SCRIPT>:/home/gpadmin/bin_cmake/cmake-3.20.0-linux-x86_64.sh \
hub.adsw.io/library/gpdb6_regress:latest diskquota_src/concourse/scripts/entry.sh test
```

4. Run upgrade test.
Change <PATH_TO_DISKQUOTA_SRC> and <PATH_TO_CMAKE_INSTALL_SCRIPT> to the appropriate paths on your local machine.
```
sudo docker run --rm -it -e DISKQUOTA_OS=rhel7 --cap-add=SYS_PTRACE --security-opt seccomp=unconfined \
--sysctl 'kernel.sem=500 1024000 200 4096' \
-v /tmp/diskquota_artifacts:/home/gpadmin/bin_diskquota \
-v <PATH_TO_DISKQUOTA_SRC>:/home/gpadmin/diskquota_src \
-v <PATH_TO_CMAKE_INSTALL_SCRIPT>:/home/gpadmin/bin_cmake/cmake-3.20.0-linux-x86_64.sh \
hub.adsw.io/library/gpdb6_regress:latest diskquota_src/concourse/scripts/upgrade_test_diskquota.sh
```
46 changes: 46 additions & 0 deletions concourse/scripts/upgrade_test_diskquota.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash

# Install cmake
cd bin_cmake/
./cmake-3.20.0-linux-x86_64.sh --skip-license --exclude-subdir
export PATH="/home/gpadmin/bin_cmake/bin:$PATH"
cmake --version
cd ..

# Build and start GPDB
source gpdb_src/concourse/scripts/common.bash
install_and_configure_gpdb
gpdb_src/concourse/scripts/setup_gpadmin_user.bash
make_cluster
source /usr/local/greenplum-db-devel/greenplum_path.sh;
source gpdb_src/gpAux/gpdemo/gpdemo-env.sh;

# Build diskquota-1.0.3 (last tag 1.0.3_arenadata2)
cp -r diskquota_src/ diskquota_src_tmp
cd diskquota_src_tmp
git checkout -- ./
git checkout 1.0.3_arenadata2
git clean -xf
make
make install
cd ..
rm -rf diskquota_src_tmp

# Build test version of diskquota
cd diskquota_src/
rm -rf build
mkdir build
cd build
cmake ..
make install

# Add permissions
chown gpadmin:gpadmin -R /usr/local/greenplum-db-devel/
chown gpadmin:gpadmin -R /home/gpadmin/

# Run tests
# To make fly debug easier
echo "source /usr/local/greenplum-db-devel/greenplum_path.sh" >> /home/gpadmin/.bashrc
su gpadmin -c \
"source /home/gpadmin/.bashrc && \
make upgradecheck"
2 changes: 1 addition & 1 deletion src/diskquota.c
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ disk_quota_worker_main(Datum main_arg)
int major = -1, minor = -1;
int has_error = worker_spi_get_extension_version(&major, &minor) != 0;

if (major == DISKQUOTA_MAJOR_VERSION && minor == DISKQUOTA_MINOR_VERSION) break;
if (major == DISKQUOTA_MAJOR_VERSION) break;
#if GP_VERSION_NUM < 70000
/* MemoryAccount has been removed on gpdb7 */
MemoryAccounting_Reset();
Expand Down

0 comments on commit c6f3a37

Please sign in to comment.