Skip to content

Commit

Permalink
Use fixed alpine version and fix shellcheck
Browse files Browse the repository at this point in the history
Not specifying alpine version causes libssl version
to change, which in turn cause error in downgrade tests
as well as ABI tests.
This commit also fixes shellcheck failures.

Co-authored-by: Lakshmi Narayanan Sreethar <lakshmi@timescale.com>
Co-authored-by: Alexander Kuzmenkov <akuzmenkov@timescale.com>
Signed-off-by: Sachin <sachin@timescale.com>
  • Loading branch information
3 people committed Dec 5, 2022
1 parent 1a806e2 commit 3095124
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 11 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/abi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ jobs:
- name: Build extension
run: |
BUILDER_IMAGE="postgres:${{matrix.builder}}-alpine"
if [[ "${{matrix.test}}" == *backward ]]; then
# Alpine v3.17 updated its default libssl version to 3.0 but the older
# images use 1.0. Ensure that the builder image uses the same libssl version
# as the one used by the older test image by using Alpine 3.16.
BUILDER_IMAGE+="3.16"
fi
docker run -i --rm -v $(pwd):/mnt ${BUILDER_IMAGE} bash <<"EOF"
apk add cmake gcc make build-base krb5-dev openssl-dev git > /dev/null
Expand All @@ -90,6 +96,12 @@ jobs:
- name: Run tests
run: |
TEST_IMAGE="postgres:${{ matrix.tester }}-alpine"
if [[ "${{matrix.test}}" == *forward ]]; then
# Alpine v3.17 updated its default libssl version to 3.0 but the older
# images use 1.0. Ensure that the test image uses the same libssl version
# as the one used by the older build image by using Alpine 3.16.
TEST_IMAGE+="3.16"
fi
docker run -i --rm -v $(pwd):/mnt ${TEST_IMAGE} bash <<"EOF"
apk add cmake gcc make build-base krb5-dev openssl-dev sudo > /dev/null
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/update-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ jobs:
PG_MAJOR=$(echo "${{ matrix.pg }}" | sed -e 's![.].*!!')
UPDATE_FROM_TAG=${DOWNGRADE_TO}-pg${PG_MAJOR}
export UPDATE_FROM_TAG
scripts/test_downgrade_from_tag.sh
# We need to use same libssl version used in the latest official TimescaleDB container images.
# So we will use the fixed alpine version, this will guarantee that libssl version wont change.
PG_IMAGE_TAG="${PG_VERSION}-alpine3.16" scripts/test_downgrade_from_tag.sh
- name: Downgrade diff
if: failure()
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows-build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
build_type: ${{ fromJson(needs.config.outputs.build_type) }}
ignores: ["chunk_adaptive metadata"]
tsl_ignores: ["compression_algos remote_connection"]
tsl_skips: ["bgw_db_scheduler bgw_db_scheduler_fixed cagg_ddl_dist_ht data_fetcher dist_compression dist_move_chunk dist_remote_error remote_txn"]
tsl_skips: ["bgw_db_scheduler bgw_db_scheduler_fixed cagg_ddl_dist_ht data_fetcher dist_compression dist_move_chunk dist_remote_error remote_txn dist_grant dist_param"]
pg_config: ["-cfsync=off -cstatement_timeout=60s"]
include:
- pg: 12
Expand Down
10 changes: 5 additions & 5 deletions scripts/docker-run-restore-points-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -e
set -o pipefail

SCRIPT_DIR=$(dirname $0)
SCRIPT_DIR=$(dirname "$0")
BASE_DIR=${PWD}/${SCRIPT_DIR}/..
DO_CLEANUP=true

Expand All @@ -24,7 +24,7 @@ done

shift $((OPTIND-1))

if "$DO_CLEANUP" = "true"; then
if [ "$DO_CLEANUP" == "true" ] ; then
trap cleanup EXIT
fi

Expand All @@ -42,16 +42,16 @@ cleanup() {
docker_exec() {
# Echo to stderr
>&2 echo -e "\033[1m$1\033[0m: $2"
docker exec $1 /bin/bash -c "$2"
docker exec "$1" /bin/bash -c "$2"
}

docker rm -f timescaledb-rp 2>/dev/null || true
IMAGE_NAME=rp_test TAG_NAME=latest bash ${SCRIPT_DIR}/docker-build.sh
IMAGE_NAME=rp_test TAG_NAME=latest bash "${SCRIPT_DIR}/docker-build.sh"

# The odd contortion with the BASE_DIR is necessary since SCRIPT_DIR
# is relative and --volume requires an absolute path.
docker run --env TIMESCALEDB_TELEMETRY=off -d \
--volume ${BASE_DIR}/scripts:/mnt/scripts \
--volume "${BASE_DIR}/scripts":/mnt/scripts \
--name timescaledb-rp rp_test:latest

echo "**** Testing ****"
Expand Down
8 changes: 4 additions & 4 deletions scripts/test_sanitizers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e
set -o pipefail

DO_CLEANUP=true
SCRIPT_DIR=${SCRIPT_DIR:-$(dirname $0)}
SCRIPT_DIR=${SCRIPT_DIR:-$(dirname "$0")}
EXCLUDE_PATTERN=${EXCLUDE_PATTERN:-'^$'} # tests matching regex pattern will be excluded
INCLUDE_PATTERN=${INCLUDE_PATTERN:-'.*'} # tests matching regex pattern will be included
TEST_MAX=${TEST_MAX:-$((2**16))}
Expand Down Expand Up @@ -33,7 +33,7 @@ done

shift $((OPTIND-1))

if "$DO_CLEANUP" = "true"; then
if [ "$DO_CLEANUP" == "true" ] ; then
trap cleanup EXIT
fi

Expand Down Expand Up @@ -61,12 +61,12 @@ cleanup() {
docker_exec() {
# Echo to stderr
>&2 echo -e "\033[1m$1\033[0m: $2"
docker exec $1 /bin/bash -c "$2"
docker exec "$1" /bin/bash -c "$2"
}

docker rm -f timescaledb-san 2>/dev/null || true

docker run -d --privileged --name timescaledb-san --env POSTGRES_HOST_AUTH_METHOD=trust -v ${TIMESCALE_DIR}:/timescaledb ${REMOTE_ORG}/${REMOTE_NAME}:${REMOTE_TAG}
docker run -d --privileged --name timescaledb-san --env POSTGRES_HOST_AUTH_METHOD=trust -v "${TIMESCALE_DIR}":/timescaledb "${REMOTE_ORG}/${REMOTE_NAME}":"${REMOTE_TAG}"

# Run these commands as root to copy the source into the
# container. Make sure that all files in the copy is owned by user
Expand Down

0 comments on commit 3095124

Please sign in to comment.