Skip to content

Commit 13e6a01

Browse files
authored
Set up the 2.4 branch of the yugabyte-db-thirdparty repo (#64)
- Branch off of the commit 45c97f4, which is the thirdparty commit used in the 2.4 branch of yugabyte/yugabyte-db ( https://github.com/yugabyte/yugabyte-db/tree/2.4 ), which is at the commit yugabyte/yugabyte-db@bcf406c as of this writing. - GitHub Actions setup similar to the master branch of the yugabyte-db-thirdparty repo (as of the 6a4d8d4 commit). - Downgrade gperftools to 2.7. - Fix the Boost source tarball download URL. - Remove the unused multi_build.py / MultiBuilder functionality. - Add various possible checksums that we might later need to thirdparty_src_checksums.txt. - Use the codecheck tool for running mypy on Python code and shellcheck on Bash code.
1 parent 45c97f4 commit 13e6a01

18 files changed

+212
-392
lines changed

.circleci/config.yml

Lines changed: 0 additions & 112 deletions
This file was deleted.

.github/workflows/linux_build.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
df -H .
6+
checkout_dir=$PWD
7+
echo "Building in directory: $checkout_dir"
8+
docker run -t \
9+
--cap-add=SYS_PTRACE \
10+
-e GITHUB_TOKEN \
11+
-e YB_BUILD_THIRDPARTY_ARGS \
12+
-e YB_THIRDPARTY_ARCHIVE_NAME_SUFFIX \
13+
"--mount=type=bind,src=$checkout_dir,dst=/opt/yb-build/thirdparty/checkout" \
14+
"$YB_DOCKER_IMAGE" \
15+
bash -c "
16+
set -euo pipefail
17+
cd /opt/yb-build/thirdparty/checkout
18+
./build_and_release.sh
19+
"

.github/workflows/linux_build.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: Linux
2+
3+
# TODO: deduplicate this across multiple workflow files.
4+
on:
5+
push:
6+
branches:
7+
- master
8+
- 2.4
9+
10+
paths-ignore:
11+
- README.md
12+
13+
# Run tests for any PRs.
14+
pull_request:
15+
branches:
16+
- master
17+
- 2.4
18+
19+
paths-ignore:
20+
- README.md
21+
22+
jobs:
23+
build:
24+
name: ${{ matrix.archive_name_suffix }}
25+
runs-on: ubuntu-20.04
26+
if: >
27+
(github.event_name == 'push' &&
28+
!contains(github.event.head_commit.message, 'skip ci') &&
29+
!contains(github.event.head_commit.message, 'ci skip')) ||
30+
github.event_name == 'pull_request'
31+
strategy:
32+
# To avoid terminating all jobs when one job fails.
33+
fail-fast: false
34+
matrix:
35+
include:
36+
- name: centos7-linuxbrew-gcc5
37+
archive_name_suffix: centos7-linuxbrew
38+
docker_image: yugabyteci/yb_build_infra_centos7:v2021-03-26T05_02_29
39+
build_thirdparty_args: "--toolchain=linuxbrew"
40+
41+
- name: centos7-gcc-devtoolset-8
42+
archive_name_suffix: centos7-devtoolset-8
43+
docker_image: yugabyteci/yb_build_infra_centos7:v2021-03-26T05_02_29
44+
build_thirdparty_args: "--devtoolset=8"
45+
46+
- name: centos7-gcc-devtoolset-9
47+
archive_name_suffix: centos7-devtoolset-9
48+
docker_image: yugabyteci/yb_build_infra_centos7:v2021-03-26T05_02_29
49+
build_thirdparty_args: "--devtoolset=9"
50+
51+
- name: centos7-clang11
52+
archive_name_suffix: centos7-clang11
53+
docker_image: yugabyteci/yb_build_infra_centos7:v2021-03-26T05_02_29
54+
build_thirdparty_args: --toolchain=llvm11
55+
56+
- name: ubuntu1804-gcc7
57+
archive_name_suffix: ubuntu1804-gcc7
58+
docker_image: yugabyteci/yb_build_infra_ubuntu1804:v2021-03-26T05_02_28
59+
build_thirdparty_args: >-
60+
--compiler-prefix=/usr
61+
--single-compiler-type=gcc
62+
--compiler-suffix=-7
63+
64+
- name: ubuntu1804-gcc8
65+
archive_name_suffix: ubuntu1804-gcc8
66+
docker_image: yugabyteci/yb_build_infra_ubuntu1804:v2021-03-26T05_02_28
67+
build_thirdparty_args: >-
68+
--compiler-prefix=/usr
69+
--single-compiler-type=gcc
70+
--compiler-suffix=-8
71+
72+
- name: ubuntu1804-clang10
73+
archive_name_suffix: ubuntu1804-clang10
74+
docker_image: yugabyteci/yb_build_infra_ubuntu1804:v2021-03-26T05_02_28
75+
build_thirdparty_args: >-
76+
--single-compiler-type=clang
77+
--compiler-prefix=/usr
78+
--compiler-suffix=-10
79+
80+
- name: ubuntu1804-clang11
81+
archive_name_suffix: ubuntu1804-clang11
82+
docker_image: yugabyteci/yb_build_infra_ubuntu1804:v2021-03-26T05_02_28
83+
build_thirdparty_args: >-
84+
--single-compiler-type=clang
85+
--compiler-prefix=/usr
86+
--compiler-suffix=-11
87+
88+
steps:
89+
- name: Clone repository
90+
uses: actions/checkout@v1
91+
92+
- name: Build
93+
run: ./.github/workflows/linux_build.sh
94+
env:
95+
YB_DOCKER_IMAGE: ${{ matrix.docker_image }}
96+
YB_THIRDPARTY_ARCHIVE_NAME_SUFFIX: ${{ matrix.archive_name_suffix }}
97+
YB_BUILD_THIRDPARTY_ARGS: ${{ matrix.build_thirdparty_args }}

.github/workflows/macos_build.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
brew install autoconf automake pkg-config shellcheck
6+
dirs=( /opt/yb-build/{thirdparty,brew,tmp} )
7+
sudo mkdir -p "${dirs[@]}"
8+
sudo chmod 777 "${dirs[@]}"
9+
./build_and_release.sh

.github/workflows/macos_build.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
name: macOS
22

3+
# TODO: deduplicate this across multiple workflow files.
34
on:
45
push:
56
branches:
6-
- '*'
7+
- master
8+
- 2.4
79

810
paths-ignore:
911
- README.md
@@ -12,10 +14,12 @@ on:
1214
pull_request:
1315
branches:
1416
- master
17+
- 2.4
1518

1619
paths-ignore:
1720
- README.md
1821

22+
1923
env:
2024
GITHUB_ORG_AND_REPO: "${{ github.repository }}"
2125

@@ -33,8 +37,6 @@ jobs:
3337
- name: Build YugabyteDB third-party dependencies
3438
env:
3539
GITHUB_TOKEN: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
40+
YB_THIRDPARTY_ARCHIVE_NAME_SUFFIX: x86_64-macos
3641
run: |
37-
brew install autoconf automake pkg-config
38-
sudo mkdir -p /opt/yb-build/{thirdparty,brew,tmp}
39-
sudo chmod 777 /opt/yb-build/{thirdparty,brew,tmp}
40-
./build_and_release.sh
42+
./.github/workflows/macos_build.sh

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,6 @@ prebuilt_downloads/
2828
src/
2929
venv/
3030
.pyre
31+
archive.tar.gz
32+
archive.tar.gz.sha256
33+
fossa_modules.yml

branch.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2.4

build_and_release.sh

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,6 @@ log "YB_BUILD_THIRDPARTY_ARGS: ${YB_BUILD_THIRDPARTY_ARGS:-undefined}"
8080
YB_BUILD_THIRDPARTY_EXTRA_ARGS=${YB_BUILD_THIRDPARTY_EXTRA_ARGS:-}
8181
log "YB_BUILD_THIRDPARTY_EXTRA_ARGS: ${YB_BUILD_THIRDPARTY_EXTRA_ARGS:-undefined}"
8282

83-
log "CIRCLE_PULL_REQUEST: ${CIRCLE_PULL_REQUEST:-undefined}"
84-
8583
# -------------------------------------------------------------------------------------------------
8684
# Installed tools
8785
# -------------------------------------------------------------------------------------------------
@@ -128,14 +126,11 @@ fi
128126
# Check for errors in Python code of this repository
129127
# -------------------------------------------------------------------------------------------------
130128

131-
( set -x; "$YB_THIRDPARTY_DIR/check_python_code.sh" )
129+
( set -x; "$YB_THIRDPARTY_DIR/check_code.sh" )
132130

133131
# -------------------------------------------------------------------------------------------------
134132

135-
if [[ -n ${CIRCLE_PULL_REQUEST:-} ]]; then
136-
echo "CIRCLE_PULL_REQUEST is set: $CIRCLE_PULL_REQUEST. Will not upload artifacts."
137-
unset GITHUB_TOKEN
138-
elif [[ -z ${GITHUB_TOKEN:-} || $GITHUB_TOKEN == *githubToken* ]]; then
133+
if [[ -z ${GITHUB_TOKEN:-} || $GITHUB_TOKEN == *githubToken* ]]; then
139134
echo "This must be a pull request build. Will not upload artifacts."
140135
GITHUB_TOKEN=""
141136
else
@@ -146,16 +141,16 @@ fi
146141

147142
original_repo_dir=$PWD
148143
git_sha1=$( git rev-parse HEAD )
149-
tag=v$( date +%Y%m%d%H%M%S )-${git_sha1:0:10}
144+
branch_name=$(<"$YB_THIRDPARTY_DIR/branch.txt")
145+
tag=v${branch_name}-$( date +%Y%m%d%H%M%S )-${git_sha1:0:10}
150146

151147
archive_dir_name=yugabyte-db-thirdparty-$tag
152-
if [[ -n $YB_THIRDPARTY_ARCHIVE_NAME_SUFFIX ]]; then
153-
effective_suffix="-$YB_THIRDPARTY_ARCHIVE_NAME_SUFFIX"
154-
else
155-
effective_suffix="-$os_name"
148+
if [[ -z ${YB_THIRDPARTY_ARCHIVE_NAME_SUFFIX:-} ]]; then
149+
fatal "YB_THIRDPARTY_ARCHIVE_NAME_SUFFIX is not specified."
156150
fi
157-
archive_dir_name+=$effective_suffix
158-
tag+=$effective_suffix
151+
to_append="-$YB_THIRDPARTY_ARCHIVE_NAME_SUFFIX"
152+
archive_dir_name+=$to_append
153+
tag+=$to_append
159154

160155
build_dir_parent=/opt/yb-build/thirdparty
161156
repo_dir=$build_dir_parent/$archive_dir_name

build_thirdparty.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ set -euo pipefail
1818
# shellcheck source=./yb-thirdparty-common.sh
1919
. "${BASH_SOURCE[0]%/*}/yb-thirdparty-common.sh"
2020

21-
check_bash_scripts
22-
2321
echo "YB_THIRDPARTY_DIR=$YB_THIRDPARTY_DIR"
2422

2523
activate_virtualenv

check_bash_scripts.sh renamed to check_code.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,7 @@ set -euo pipefail
55
# shellcheck source=./yb-thirdparty-common.sh
66
. "${BASH_SOURCE%/*}/yb-thirdparty-common.sh"
77

8-
check_bash_scripts
8+
activate_virtualenv
9+
10+
set -x
11+
codecheck --verbose "$@"

0 commit comments

Comments
 (0)