@@ -15,10 +15,16 @@ local platforms_arm = {
1515 "stable-23.10" : ["rockylinux:8" , "rockylinux:9" , "debian:12" , "ubuntu:20.04" , "ubuntu:22.04" , "ubuntu:24.04" ],
1616};
1717
18+ local rewrite_ubuntu_mirror = @"sed -i 's|//\\(us\\.\\)\\?archive\\.ubuntu\\.com|//us.archive.ubuntu.com|g' /etc/apt/sources.list || true; " +
19+ @"sed -i 's|//\\(us\\.\\)\\?archive\\.ubuntu\\.com|//us.archive.ubuntu.com|g' /etc/apt/sources.list.d/ubuntu.sources || true; " +
20+ "cat /etc/apt/sources.list.d/ubuntu.sources /etc/apt/sources.list | grep archive || true; " ;
21+
1822local customEnvCommandsMap = {
1923 // 'clang-18': ['apt install -y clang-18', 'export CC=/usr/bin/clang-18', 'export CXX=/usr/bin/clang++-18'],
2024 "clang-20" : [
21- "apt install -y wget curl lsb-release software-properties-common gnupg" ,
25+ rewrite_ubuntu_mirror,
26+ "apt-get clean && apt-get update" ,
27+ "apt-get install -y wget curl lsb-release software-properties-common gnupg" ,
2228 "wget https://apt.llvm.org/llvm.sh" ,
2329 "bash llvm.sh 20" ,
2430 "export CC=/usr/bin/clang" ,
@@ -114,7 +120,7 @@ local rockylinux9_deps = "dnf install -y 'dnf-command(config-manager)' " +
114120
115121local rockylinux_common_deps = " && dnf install -y git lz4 lz4-devel cppunit-devel cmake3 boost-devel snappy-devel pcre2-devel" ;
116122
117- local deb_deps = "apt update && apt install --yes git libboost-all-dev libcppunit-dev libsnappy-dev cmake libpcre2-dev" ;
123+ local deb_deps = rewrite_ubuntu_mirror + "apt-get clean && apt-get update && apt-get install --yes git libboost-all-dev libcppunit-dev libsnappy-dev cmake libpcre2-dev" ;
118124
119125local testPreparation(platform) =
120126 local platform_map = {
@@ -127,6 +133,10 @@ local testPreparation(platform) =
127133 };
128134 platform_map[platform];
129135
136+ local make_clickable_link(link) = "echo -e '\\ e]8;;" + link + "\\ e\\\\ " + link + "\\ e]8;;\\ e\\\\ '" ;
137+ local echo_running_on = ["echo running on ${DRONE_STAGE_MACHINE}" ,
138+ make_clickable_link("https://us-east-1.console.aws.amazon.com/ec2/home?region=us-east-1#Instances:search=:${DRONE_STAGE_MACHINE};v=3;$case=tags:true%5C,client:false;$regex=tags:false%5C,client:false;sort=desc:launchTime" )];
139+
130140local Pipeline(branch, platform, event, arch="amd64" , server="10.6-enterprise" , customBootstrapParams="" , customBuildEnvCommandsMapKey="" ) = {
131141 local pkg_format = if (std.split (platform, ":" )[0 ] == "rockylinux" ) then "rpm" else "deb" ,
132142 local init = if (pkg_format == "rpm" ) then "/usr/lib/systemd/systemd" else "systemd" ,
@@ -154,10 +164,12 @@ local Pipeline(branch, platform, event, arch="amd64", server="10.6-enterprise",
154164 local server_remote = if (std.endsWith (server, "enterprise" )) then "https://github.com/mariadb-corporation/MariaDBEnterprise" else "https://github.com/MariaDB/server" ,
155165
156166 local sccache_arch = if (arch == "amd64" ) then "x86_64" else "aarch64" ,
157- local get_sccache = "echo getting sccache... && (apt update -y && apt install -y curl || yum install -y curl || true) " +
158- "&& curl -L -o sccache.tar.gz https://github.com/mozilla/sccache/releases/download/v0.10.0/sccache-v0.10.0-" + sccache_arch + "-unknown-linux-musl.tar.gz " +
159- "&& tar xzf sccache.tar.gz " +
160- "&& install sccache*/sccache /usr/local/bin/ && echo sccache installed" ,
167+ local get_sccache = ["echo getting sccache..." ,
168+ rewrite_ubuntu_mirror,
169+ "(apt-get clean && apt-get update -y && apt-get install -y curl || yum install -y curl || true)" ,
170+ "curl -L -o sccache.tar.gz https://github.com/mozilla/sccache/releases/download/v0.10.0/sccache-v0.10.0-" + sccache_arch + "-unknown-linux-musl.tar.gz &&" ,
171+ "tar xzf sccache.tar.gz" ,
172+ "install sccache*/sccache /usr/local/bin/ && echo sccache installed" ],
161173
162174 local pipeline = self ,
163175
@@ -175,14 +187,16 @@ local Pipeline(branch, platform, event, arch="amd64", server="10.6-enterprise",
175187 AWS_SECRET_ACCESS_KEY: {
176188 from_secret: "aws_secret_access_key" ,
177189 },
190+ AWS_REGION: "us-east-1" ,
191+ AWS_DEFAULT_REGION: "us-east-1" ,
178192 },
179193 commands: [
180194 "ls " + result,
181195 '[ -z "$(ls -A "' + result + '")" ] && echo Nothing to publish! && exit 1' ,
182196
183197 "aws s3 sync " + result + " s3://cspkg/" + branchp + eventp + "/" + server + "/" + arch + "/" + result + " --only-show-errors" ,
184198 'echo "Data uploaded to: ' + publish_pkg_url + '"' ,
185-
199+ make_clickable_link(publish_pkg_url),
186200 "rm -rf " + result + "/*" ,
187201 ],
188202 },
@@ -231,7 +245,7 @@ local Pipeline(branch, platform, event, arch="amd64", server="10.6-enterprise",
231245 local getContainerName(stepname) = stepname + "$${DRONE_BUILD_NUMBER}" ,
232246
233247 local installCmapi(containerName, pkg_format) =
234- if (pkg_format == "deb" ) then execInnerDocker('bash -c "apt update -y && apt install -y mariadb-columnstore-cmapi"' , containerName)
248+ if (pkg_format == "deb" ) then execInnerDocker('bash -c "apt-get clean && apt-get update -y && apt-get install -y mariadb-columnstore-cmapi"' , containerName)
235249 else execInnerDocker('bash -c "yum update -y && yum install -y MariaDB-columnstore-cmapi"' , containerName),
236250
237251 local prepareTestStage(containerName, result, do_setup) =
@@ -606,8 +620,9 @@ local Pipeline(branch, platform, event, arch="amd64", server="10.6-enterprise",
606620 SERVER_REMOTE: "${SERVER_REMOTE:-" + server_remote + "}" ,
607621 SERVER_SHA: "${SERVER_SHA:-" + server + "}" ,
608622 },
609- commands: [
610- "echo $$SERVER_REF" ,
623+ commands: echo_running_on +
624+ [
625+ "echo $$SERVER_REF" ,
611626 "echo $$SERVER_REMOTE" ,
612627 "mkdir -p /mdb/" + builddir + " && cd /mdb/" + builddir,
613628 'git config --global url."https://github.com/".insteadOf [email protected] :' ,
@@ -626,15 +641,14 @@ local Pipeline(branch, platform, event, arch="amd64", server="10.6-enterprise",
626641 volumes: [pipeline._volumes.mdb],
627642 environment: {
628643 DEBIAN_FRONTEND: "noninteractive" ,
629- DEB_BUILD_OPTIONS: "parallel=4" ,
630- DH_BUILD_DDEBS: "1" ,
631- BUILDPACKAGE_FLAGS: "-b" , // Save time and produce only binary packages, not source
632644 AWS_ACCESS_KEY_ID: {
633645 from_secret: "aws_access_key_id" ,
634646 },
635647 AWS_SECRET_ACCESS_KEY: {
636648 from_secret: "aws_secret_access_key" ,
637649 },
650+ AWS_REGION: "us-east-1" ,
651+ AWS_DEFAULT_REGION: "us-east-1" ,
638652 SCCACHE_BUCKET: "cs-sccache" ,
639653 SCCACHE_REGION: "us-east-1" ,
640654 SCCACHE_S3_USE_SSL: "true" ,
@@ -644,14 +658,14 @@ local Pipeline(branch, platform, event, arch="amd64", server="10.6-enterprise",
644658 },
645659 commands: [
646660 "mkdir /mdb/" + builddir + "/" + result,
647- get_sccache,
648661 ]
662+ + get_sccache
649663 + customEnvCommands(customBuildEnvCommandsMapKey, builddir) +
650664 [
651- 'bash -c "set -o pipefail && bash /mdb/' + builddir + "/storage/columnstore/columnstore/build/bootstrap_mcs.sh " +
665+ 'bash -c "set -o pipefail && bash /mdb/' + builddir + "/storage/columnstore/columnstore/build/bootstrap_mcs.sh " +
652666 "--build-type RelWithDebInfo " +
653667 "--distro " + platform + " " +
654- "--build-packages --sccache " +
668+ "--build-packages --install-deps -- sccache " +
655669 " " + customBootstrapParams +
656670 " " + customBootstrapParamsForExisitingPipelines(platform) + " | " +
657671 "/mdb/" + builddir + "/storage/columnstore/columnstore/build/ansi2txt.sh " +
@@ -728,19 +742,6 @@ local Pipeline(branch, platform, event, arch="amd64", server="10.6-enterprise",
728742 ] +
729743 [pipeline.publish("cmapi build" )] +
730744 [pipeline.publish()] +
731- [
732- {
733- name: "publish pkg url" ,
734- depends_on: ["publish pkg" ],
735- image: "alpine/git" ,
736- commands: [
737- "echo -e '\\ e]8;;" + publish_pkg_url + "\\ e\\\\ " + publish_pkg_url + "\\ e]8;;\\ e\\\\ '" ,
738- "echo 'for installation run:'" ,
739- "echo 'export OS=" + result + "'" ,
740- "echo 'export PACKAGES_URL=" + packages_url + "'" ,
741- ],
742- },
743- ] +
744745 (if (event == "cron" ) then [pipeline.publish("pkg latest" , "latest" )] else []) +
745746 [pipeline.smoke] +
746747 [pipeline.smokelog] +
0 commit comments