Skip to content

Commit

Permalink
This is an automated cherry-pick of pingcap#11023
Browse files Browse the repository at this point in the history
Signed-off-by: ti-chi-bot <[email protected]>
  • Loading branch information
CharlesCheung96 authored and ti-chi-bot committed May 7, 2024
1 parent 71c4e3d commit 21736ca
Showing 1 changed file with 98 additions and 0 deletions.
98 changes: 98 additions & 0 deletions scripts/download-integration-test-binaries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,26 @@
# it downloads files for linux platform. We only use it in docker-compose.

set -o errexit
<<<<<<< HEAD
=======
set -o pipefail

# Specify which branch to be utilized for executing the test, which is
# exclusively accessible when obtaining binaries from
# http://fileserver.pingcap.net.
branch=${1:-master}
# Specify whether to download the community version of binaries, the following
# four arguments are applicable only when utilizing the community version of
# binaries.
community=${2:-false}
# Specify which version of the community binaries that will be utilized.
ver=${3:-v8.1.0}
# Specify which os that will be used to pack the binaries.
os=${4:-linux}
# Specify which architecture that will be used to pack the binaries.
arch=${5:-amd64}

>>>>>>> 894b36f00f (test(ticdc): enable sequence test (#11023))
set -o nounset
set -o pipefail

Expand All @@ -40,6 +60,7 @@ tikv_sha1=$(curl "${file_server_url}/download/refs/pingcap/tikv/${branch}/sha1")
pd_sha1=$(curl "${file_server_url}/download/refs/pingcap/pd/${branch}/sha1")
tiflash_sha1=$(curl "${file_server_url}/download/refs/pingcap/tiflash/${branch}/sha1")

<<<<<<< HEAD
# All download links.
tidb_download_url="${file_server_url}/download/builds/pingcap/tidb/${tidb_sha1}/centos7/tidb-server.tar.gz"
tikv_download_url="${file_server_url}/download/builds/pingcap/tikv/${tikv_sha1}/centos7/tikv-server.tar.gz"
Expand All @@ -50,6 +71,83 @@ go_ycsb_download_url="${file_server_url}/download/builds/pingcap/go-ycsb/test-br
etcd_download_url="${file_server_url}/download/builds/pingcap/cdc/etcd-v3.4.7-linux-amd64.tar.gz"
sync_diff_inspector_url="${file_server_url}/download/builds/pingcap/cdc/sync_diff_inspector_hash-00998a9a_linux-amd64.tar.gz"
jq_download_url="${file_server_url}/download/builds/pingcap/test/jq-1.6/jq-linux64"
=======
# ycsb
local ycsb_file_name="go-ycsb-${os}-${arch}"
local ycsb_tar_name="${ycsb_file_name}.tar.gz"
local ycsb_url="https://github.com/pingcap/go-ycsb/releases/download/v1.0.0/${ycsb_tar_name}"
wget -O "tmp/$ycsb_tar_name" "$ycsb_url"
tar -xz -C third_bin -f tmp/$ycsb_tar_name

# minio
local minio_url="https://dl.min.io/server/minio/release/${os}-${arch}/minio"
download "$minio_url" "minio" "third_bin/minio"

# jq
local os_name=$([ "$os" == "darwin" ] && echo -n "macos" || echo -n "$os")
local jq_url="https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-${os_name}-${arch}"
wget -O third_bin/jq "$jq_url"

chmod a+x third_bin/*
}

function download_binaries() {
color-green "Download binaries..."
# PingCAP file server URL.
file_server_url="http://fileserver.pingcap.net"

# Get sha1 based on branch name.
tidb_sha1=$(curl "${file_server_url}/download/refs/pingcap/tidb/${branch}/sha1")
tikv_sha1=$(curl "${file_server_url}/download/refs/pingcap/tikv/${branch}/sha1")
pd_sha1=$(curl "${file_server_url}/download/refs/pingcap/pd/${branch}/sha1")
tiflash_sha1=$(curl "${file_server_url}/download/refs/pingcap/tiflash/${branch}/sha1")

# All download links.
tidb_download_url="${file_server_url}/download/builds/pingcap/tidb/${tidb_sha1}/centos7/tidb-server.tar.gz"
tikv_download_url="${file_server_url}/download/builds/pingcap/tikv/${tikv_sha1}/centos7/tikv-server.tar.gz"
pd_download_url="${file_server_url}/download/builds/pingcap/pd/${pd_sha1}/centos7/pd-server.tar.gz"
tiflash_download_url="${file_server_url}/download/builds/pingcap/tiflash/${branch}/${tiflash_sha1}/centos7/tiflash.tar.gz"
minio_download_url="${file_server_url}/download/minio.tar.gz"
go_ycsb_download_url="${file_server_url}/download/builds/pingcap/go-ycsb/test-br/go-ycsb"
etcd_download_url="${file_server_url}/download/builds/pingcap/cdc/etcd-v3.4.7-linux-amd64.tar.gz"
sync_diff_inspector_url="${file_server_url}/download/builds/pingcap/cdc/sync_diff_inspector_hash-79f1fd1e_linux-amd64.tar.gz"
jq_download_url="${file_server_url}/download/builds/pingcap/test/jq-1.6/jq-linux64"
schema_registry_url="${file_server_url}/download/builds/pingcap/cdc/schema-registry.tar.gz"

download "$tidb_download_url" "tidb-server.tar.gz" "tmp/tidb-server.tar.gz"
tar -xz -C third_bin bin/tidb-server -f tmp/tidb-server.tar.gz && mv third_bin/bin/tidb-server third_bin/

download "$pd_download_url" "pd-server.tar.gz" "tmp/pd-server.tar.gz"
tar -xz -C third_bin 'bin/*' -f tmp/pd-server.tar.gz && mv third_bin/bin/* third_bin/

download "$tikv_download_url" "tikv-server.tar.gz" "tmp/tikv-server.tar.gz"
tar -xz -C third_bin bin/tikv-server -f tmp/tikv-server.tar.gz && mv third_bin/bin/tikv-server third_bin/

download "$tiflash_download_url" "tiflash.tar.gz" "tmp/tiflash.tar.gz"
tar -xz -C third_bin -f tmp/tiflash.tar.gz
mv third_bin/tiflash third_bin/_tiflash
mv third_bin/_tiflash/* third_bin && rm -rf third_bin/_tiflash

download "$minio_download_url" "minio.tar.gz" "tmp/minio.tar.gz"
tar -xz -C third_bin -f tmp/minio.tar.gz

download "$go_ycsb_download_url" "go-ycsb" "third_bin/go-ycsb"
download "$jq_download_url" "jq" "third_bin/jq"
download "$etcd_download_url" "etcd.tar.gz" "tmp/etcd.tar.gz"
tar -xz -C third_bin etcd-v3.4.7-linux-amd64/etcdctl -f tmp/etcd.tar.gz
mv third_bin/etcd-v3.4.7-linux-amd64/etcdctl third_bin/ && rm -rf third_bin/etcd-v3.4.7-linux-amd64

download "$sync_diff_inspector_url" "sync_diff_inspector.tar.gz" "tmp/sync_diff_inspector.tar.gz"
tar -xz -C third_bin -f tmp/sync_diff_inspector.tar.gz

download "$schema_registry_url" "schema-registry.tar.gz" "tmp/schema-registry.tar.gz"
tar -xz -C third_bin -f tmp/schema-registry.tar.gz
mv third_bin/schema-registry third_bin/_schema_registry
mv third_bin/_schema_registry/* third_bin && rm -rf third_bin/_schema_registry

chmod a+x third_bin/*
}
>>>>>>> 894b36f00f (test(ticdc): enable sequence test (#11023))

# Some temporary dir.
rm -rf tmp
Expand Down

0 comments on commit 21736ca

Please sign in to comment.