Skip to content

Commit

Permalink
we use a new option to control the proton_local build. (#266)
Browse files Browse the repository at this point in the history
* we use a new option to control the proton_local build. called `proton_enable_local`
  • Loading branch information
yokofly authored Nov 10, 2023
1 parent cc7215c commit 4436e32
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/manual_trigger_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
rm cache${SANITIZER:+_}$SANITIZER${ARCH:+_}$ARCH.tar.gz
# compiling
./docker/packager/packager --package-type binary --docker-image-version clang-16 --sanitizer $SANITIZER --proton-build --cache ccache --ccache_dir $GITHUB_WORKSPACE/ccache --output-dir $GITHUB_WORKSPACE/output
./docker/packager/packager --package-type binary --docker-image-version clang-16 --sanitizer $SANITIZER --proton-build --enable-proton-local --cache ccache --ccache_dir $GITHUB_WORKSPACE/ccache --output-dir $GITHUB_WORKSPACE/output
# clear compiling footprint
rm -rf $GITHUB_WORKSPACE/ccache
Expand Down Expand Up @@ -90,7 +90,7 @@ jobs:
rm cache${ARCH:+_}$ARCH.tar.gz
# compiling
./docker/packager/packager --package-type binary --docker-image-version clang-16 --build-type release --proton-build --cache ccache --ccache_dir $GITHUB_WORKSPACE/ccache --output-dir $GITHUB_WORKSPACE/output
./docker/packager/packager --package-type binary --docker-image-version clang-16 --build-type release --proton-build --enable-proton-local --cache ccache --ccache_dir $GITHUB_WORKSPACE/ccache --output-dir $GITHUB_WORKSPACE/output
# release doesn't build unit_tests_dbms
# clear compiling footprint
rm -rf $GITHUB_WORKSPACE/ccache
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/nightly_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
mkdir $GITHUB_WORKSPACE/ccache
echo "max_size = 100.0G" > $GITHUB_WORKSPACE/ccache/ccache.conf
./docker/packager/packager --package-type binary --docker-image-version clang-16 ${SANITIZER:+--sanitizer} $SANITIZER --proton-build --cache ccache --ccache_dir $GITHUB_WORKSPACE/ccache --output-dir $GITHUB_WORKSPACE/output
./docker/packager/packager --package-type binary --docker-image-version clang-16 ${SANITIZER:+--sanitizer} $SANITIZER --proton-build --enable-proton-local --cache ccache --ccache_dir $GITHUB_WORKSPACE/ccache --output-dir $GITHUB_WORKSPACE/output
if [ ! -f "$GITHUB_WORKSPACE/output/proton" ]; then
echo "Compiling proton Failed"
Expand Down Expand Up @@ -166,7 +166,7 @@ jobs:
mkdir $GITHUB_WORKSPACE/ccache
echo "max_size = 100.0G" > $GITHUB_WORKSPACE/ccache/ccache.conf
./docker/packager/packager --package-type binary --docker-image-version clang-16 --build-type release --proton-build --cache ccache --ccache_dir $GITHUB_WORKSPACE/ccache --output-dir $GITHUB_WORKSPACE/output
./docker/packager/packager --package-type binary --docker-image-version clang-16 --build-type release --proton-build --enable-proton-local --cache ccache --ccache_dir $GITHUB_WORKSPACE/ccache --output-dir $GITHUB_WORKSPACE/output
if [ ! -f "$GITHUB_WORKSPACE/output/proton" ]; then
echo "Compiling proton Failed"
Expand Down Expand Up @@ -277,7 +277,7 @@ jobs:
mkdir $GITHUB_WORKSPACE/ccache
echo "max_size = 100.0G" > $GITHUB_WORKSPACE/ccache/ccache.conf
./docker/packager/packager --package-type binary --docker-image-version clang-16 ${SANITIZER:+--sanitizer} $SANITIZER --proton-build --cache ccache --ccache_dir $GITHUB_WORKSPACE/ccache --output-dir $GITHUB_WORKSPACE/output
./docker/packager/packager --package-type binary --docker-image-version clang-16 ${SANITIZER:+--sanitizer} $SANITIZER --proton-build --enable-proton-local --cache ccache --ccache_dir $GITHUB_WORKSPACE/ccache --output-dir $GITHUB_WORKSPACE/output
if [ ! -f "$GITHUB_WORKSPACE/output/proton" ]; then
echo "Compiling proton Failed"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/proton_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
rm cache${SANITIZER:+_}$SANITIZER${ARCH:+_}$ARCH.tar.gz
# compiling
./docker/packager/packager --package-type binary --docker-image-version clang-16 --sanitizer $SANITIZER --proton-build --cache ccache --ccache_dir $GITHUB_WORKSPACE/ccache --output-dir $GITHUB_WORKSPACE/output
./docker/packager/packager --package-type binary --docker-image-version clang-16 --sanitizer $SANITIZER --proton-build --enable-proton-local --cache ccache --ccache_dir $GITHUB_WORKSPACE/ccache --output-dir $GITHUB_WORKSPACE/output
# clear compiling footprint
rm -rf $GITHUB_WORKSPACE/ccache
Expand Down
2 changes: 1 addition & 1 deletion BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
### Build with docker container

```sh
./docker/packager/packager --package-type binary --docker-image-version clang-16 --proton-build --output-dir `pwd`/build_output
./docker/packager/packager --package-type binary --docker-image-version clang-16 --proton-build --enable_proton_local --output-dir `pwd`/build_output
```

### Bare metal build
Expand Down
13 changes: 11 additions & 2 deletions docker/packager/packager
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def run_docker_image_with_env(image_name, output, env_variables, ch_root, ccache

subprocess.check_call(cmd, shell=True)

def parse_env_variables(build_type, compiler, sanitizer, package_type, image_type, cache, clang_tidy, version, author, official, alien_pkgs, with_coverage, with_binaries, proton_build):
def parse_env_variables(build_type, compiler, sanitizer, package_type, image_type, cache, clang_tidy, version, author, official, alien_pkgs, with_coverage, with_binaries, proton_build, enable_proton_local):
DARWIN_SUFFIX = "-darwin"
DARWIN_ARM_SUFFIX = "-darwin-aarch64"
ARM_SUFFIX = "-aarch64"
Expand Down Expand Up @@ -226,7 +226,14 @@ def parse_env_variables(build_type, compiler, sanitizer, package_type, image_typ
cmake_flags.append('-DENABLE_THINLTO=ON')
else:
cmake_flags.append('-DENABLE_TESTS=ON')

# Use this option to control the proton_local whether need to build
if enable_proton_local:
logging.info("Enable proton-local")
cmake_flags.append('-DENABLE_PROTON_LOCAL=ON')
else:
logging.info("Disable proton-local")

# proton: ends.

result.append('CMAKE_FLAGS="' + ' '.join(cmake_flags) + '"')
Expand All @@ -240,6 +247,7 @@ if __name__ == "__main__":
parser.add_argument("--proton-repo-path", default=os.path.join(os.path.dirname(os.path.abspath(__file__)), os.pardir, os.pardir))
parser.add_argument("--build-type", choices=("debug", "release", ""), default="")
parser.add_argument("--proton-build", action="store_true")
parser.add_argument('--enable-proton-local', action='store_true', default=False)
# proton: ends.
# 'performance' creates a combined .tgz with server and configs to be used for performance test.
parser.add_argument("--package-type", choices=['deb', 'binary', 'performance'], required=True)
Expand Down Expand Up @@ -309,7 +317,8 @@ if __name__ == "__main__":
env_prepared = parse_env_variables(
args.build_type, args.compiler, args.sanitizer, args.package_type, image_type,
args.cache, args.clang_tidy,
args.version, args.author, args.official, args.alien_pkgs, args.with_coverage, args.with_binaries, args.proton_build)
args.version, args.author, args.official, args.alien_pkgs, args.with_coverage, args.with_binaries, args.proton_build,
args.enable_proton_local)
# proton: ends.

run_docker_image_with_env(image_name, args.output_dir, env_prepared, ch_root, args.ccache_dir, args.docker_image_version)
Expand Down

0 comments on commit 4436e32

Please sign in to comment.