From f3f293c24dd642ba6ea330356dc85c26553fe35d Mon Sep 17 00:00:00 2001 From: Parth Chandra Date: Tue, 3 Sep 2024 16:33:17 -0700 Subject: [PATCH 1/9] feat: implement scripts for binary release build --- Makefile | 18 ++ dev/release/README.md | 35 ++++ dev/release/build-release-comet.sh | 168 ++++++++++++++++++ dev/release/comet-rm/Dockerfile | 89 ++++++++++ .../comet-rm/build-comet-native-libs.sh | 52 ++++++ pom.xml | 5 + 6 files changed, 367 insertions(+) create mode 100755 dev/release/build-release-comet.sh create mode 100644 dev/release/comet-rm/Dockerfile create mode 100755 dev/release/comet-rm/build-comet-native-libs.sh diff --git a/Makefile b/Makefile index d4e2887f7..f27c2c68b 100644 --- a/Makefile +++ b/Makefile @@ -46,6 +46,24 @@ format: ./mvnw compile test-compile scalafix:scalafix -Psemanticdb $(PROFILES) ./mvnw spotless:apply $(PROFILES) +# build native libs for amd64 architecture Linux/MacOS on a Linux/amd64 machine/container +core-amd64-libs: + rustup target add x86_64-apple-darwin + # if the environment variable HAS_OSXCROSS is defined +ifdef $(HAS_OSXCROSS) + cd native && RUSTFLAGS="-Ctarget-cpu=skylake" CC=o64-clang CXX=o64-clang++ cargo build -j 2 --target x86_64-apple-darwin --release +endif + cd native && cargo build -j 2 --release + +# build native libs for arm64 architecture Linux/MacOS on a Linux/arm64 machine/container +core-arm64-libs: + rustup target add aarch64-apple-darwin + # if the environment variable HAS_OSXCROSS is defined +ifdef $(HAS_OSXCROSS) + cd native && RUSTFLAGS="-Ctarget-cpu=apple-m1" CC=arm64-apple-darwin21.4-clang CXX=arm64-apple-darwin21.4-clang++ CARGO_FEATURE_NEON=1 cargo build -j 2 --target aarch64-apple-darwin --release +endif + cd native && cargo build -j 2 --release + core-amd64: rustup target add x86_64-apple-darwin cd native && RUSTFLAGS="-Ctarget-cpu=skylake -Ctarget-feature=-prefer-256-bit" CC=o64-clang CXX=o64-clang++ cargo build --target x86_64-apple-darwin --release diff --git a/dev/release/README.md b/dev/release/README.md index 62291b51b..6fe934ee9 100644 --- a/dev/release/README.md +++ b/dev/release/README.md @@ -81,6 +81,32 @@ python3 generate-changelog.py 0.0.0 HEAD 0.1.0 > ../changelog/0.1.0.md Create a PR against the _main_ branch to add this change log and once this is approved and merged, cherry-pick the commit into the release branch. +### Build the jars + +#### Setup to do the build + The build process requires Docker. Download the latest Docker Desktop from https://www.docker.com/products/docker-desktop/. + + In Docker Desktop -> Settings -> General -> Enable 'Use containerd for pulling and storing images' + + (when the build process is done, you can disable the above setting) + + If you have multiple docker contexts running switch to the context of the Docker Desktop. For example - + + ```shell +$ docker context ls +NAME DESCRIPTION DOCKER ENDPOINT ERROR +default Current DOCKER_HOST based configuration unix:///var/run/docker.sock +desktop-linux Docker Desktop unix:///Users/parth/.docker/run/docker.sock +my_custom_context * tcp://192.168.64.2:2376 + +$ docker context use desktop-linux + ``` +#### Run the build script +```shell +./mvnw clean +cd dev/release && ./build-release-comet.sh && cd ../.. +``` + ### Tag the Release Candidate Tag the release branch with `0.1.0-rc1` and push to the `apache` repo @@ -105,6 +131,15 @@ Run the create-tarball script on the release candidate tag (`0.1.0-rc1`) to crea GH_TOKEN= ./dev/release/create-tarball.sh 0.1.0 1 ``` +### Publish the maven artifacts +#### Setup maven +##### One time project setup +Setting up your project in the ASF Nexus Repository from here: https://infra.apache.org/publishing-maven-artifacts.html +##### Release Manager Setup +Set up your development environment from here: https://infra.apache.org/publishing-maven-artifacts.html + +TODO: build and publish a release candidate to nexus. + ### Start an Email Voting Thread Send the email that is generated in the previous step to `dev@datafusion.apache.org`. diff --git a/dev/release/build-release-comet.sh b/dev/release/build-release-comet.sh new file mode 100755 index 000000000..ea23630b5 --- /dev/null +++ b/dev/release/build-release-comet.sh @@ -0,0 +1,168 @@ +#!/bin/bash +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)" + +function usage { + local NAME=$(basename $0) + cat </dev/null && pwd)" + +echo "Building architecture: ${ARCH} for ${REPO}/${BRANCH}" +rm -fr comet +git clone "$REPO" comet +cd comet +git checkout "$BRANCH" + +# build comet binaries + +make core-${ARCH}-libs \ No newline at end of file diff --git a/pom.xml b/pom.xml index 21f32f8cc..353413882 100644 --- a/pom.xml +++ b/pom.xml @@ -23,6 +23,11 @@ under the License. 4.0.0 + + org.apache + apache + 23 + org.apache.comet comet-parent-spark${spark.version.short}_${scala.binary.version} 0.3.0-SNAPSHOT From c98f15ef7f4d295edba5e921e71d76ad547622fe Mon Sep 17 00:00:00 2001 From: Parth Chandra Date: Wed, 11 Sep 2024 20:23:05 -0700 Subject: [PATCH 2/9] Install to temp local maven repo and updates for MacOS --- Makefile | 4 ++-- dev/release/build-release-comet.sh | 29 +++++++++++++++++++++++++---- dev/release/comet-rm/Dockerfile | 12 +++++++++++- 3 files changed, 38 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index f27c2c68b..cc09e8678 100644 --- a/Makefile +++ b/Makefile @@ -51,7 +51,7 @@ core-amd64-libs: rustup target add x86_64-apple-darwin # if the environment variable HAS_OSXCROSS is defined ifdef $(HAS_OSXCROSS) - cd native && RUSTFLAGS="-Ctarget-cpu=skylake" CC=o64-clang CXX=o64-clang++ cargo build -j 2 --target x86_64-apple-darwin --release + cd native && cargo zigbuild -j 2 --target x86_64-apple-darwin --release endif cd native && cargo build -j 2 --release @@ -60,7 +60,7 @@ core-arm64-libs: rustup target add aarch64-apple-darwin # if the environment variable HAS_OSXCROSS is defined ifdef $(HAS_OSXCROSS) - cd native && RUSTFLAGS="-Ctarget-cpu=apple-m1" CC=arm64-apple-darwin21.4-clang CXX=arm64-apple-darwin21.4-clang++ CARGO_FEATURE_NEON=1 cargo build -j 2 --target aarch64-apple-darwin --release + cd native && cargo zigbuild -j 2 --target aarch64-apple-darwin --release endif cd native && cargo build -j 2 --release diff --git a/dev/release/build-release-comet.sh b/dev/release/build-release-comet.sh index ea23630b5..ee464b0ec 100755 --- a/dev/release/build-release-comet.sh +++ b/dev/release/build-release-comet.sh @@ -19,6 +19,7 @@ # SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)" +COMET_HOME_DIR=$SCRIPT_DIR/../.. function usage { local NAME=$(basename $0) @@ -120,6 +121,12 @@ docker run \ --platform linux/amd64 \ $BUILDER_IMAGE "${REPO}" "${BRANCH}" amd64 +if [ $? != 0 ] +then + echo "Building amd64 binary failed." + exit 1 +fi + # ARM64 echo "Building arm64 binary" docker run \ @@ -130,10 +137,16 @@ docker run \ --platform linux/arm64 \ $BUILDER_IMAGE "${REPO}" "${BRANCH}" arm64 +if [ $? != 0 ] +then + echo "Building arm64 binary failed." + exit 1 +fi + echo "Building binaries completed" echo "Copying to java build directories" -JVM_TARGET_DIR=$SCRIPT_DIR/../../common/target/classes/org/apache/comet +JVM_TARGET_DIR=$COMET_HOME_DIR/common/target/classes/org/apache/comet mkdir -p $JVM_TARGET_DIR mkdir -p $JVM_TARGET_DIR/linux/amd64 @@ -163,6 +176,14 @@ then fi # Build final jar -echo "Building uber jar" -cd $SCRIPT_DIR/../.. -./mvnw package -DskipTests \ No newline at end of file +echo "Building uber jar and publishing it locally" +pushd $COMET_HOME_DIR + +GIT_HASH=$(git rev-parse --short HEAD) +LOCAL_REPO=$(mktemp -d /tmp/comet-staging-repo-XXXXX) + +./mvnw "-Dmaven.repo.local=${LOCAL_REPO}" -DskipTests install + +echo "Installed to local repo: ${LOCAL_REPO}" + +popd \ No newline at end of file diff --git a/dev/release/comet-rm/Dockerfile b/dev/release/comet-rm/Dockerfile index 8958a2a2c..b9c1d6454 100644 --- a/dev/release/comet-rm/Dockerfile +++ b/dev/release/comet-rm/Dockerfile @@ -49,7 +49,6 @@ RUN export LC_ALL=C \ libbz2-dev \ zlib1g-dev -# libbz2 \ # Install rust RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y @@ -64,6 +63,17 @@ ARG MACOS_SDK COPY workdir/$MACOS_SDK /opt/xcode/ +RUN export LC_ALL=C \ + && apt-get update \ + && apt-get install --no-install-recommends -y pip \ + && pip install cargo-zigbuild + +RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then \ + rustup target add aarch64-apple-darwin; \ +elif [ "$TARGETPLATFORM" = "linux/amd64" ]; then \ + rustup target add x86_64-apple-darwin; \ +fi + # Build OSXCross RUN cd /opt && git clone --depth 1 https://github.com/tpoechtrager/osxcross.git \ && cd /opt/osxcross \ From 1bb419677a7dd9e4c42c2f0b8a75b76318e4ec0f Mon Sep 17 00:00:00 2001 From: Parth Chandra Date: Wed, 11 Sep 2024 20:50:34 -0700 Subject: [PATCH 3/9] newline --- dev/release/build-release-comet.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/release/build-release-comet.sh b/dev/release/build-release-comet.sh index ee464b0ec..a0027b72d 100755 --- a/dev/release/build-release-comet.sh +++ b/dev/release/build-release-comet.sh @@ -186,4 +186,4 @@ LOCAL_REPO=$(mktemp -d /tmp/comet-staging-repo-XXXXX) echo "Installed to local repo: ${LOCAL_REPO}" -popd \ No newline at end of file +popd From 87e61be1be60e0ccd4fc38e83c82e5bd2d115f85 Mon Sep 17 00:00:00 2001 From: Parth Chandra Date: Thu, 12 Sep 2024 17:26:32 -0700 Subject: [PATCH 4/9] Use independent docker images for different architectures instead of a multi-arch image --- Makefile | 22 ++++--- dev/release/README.md | 21 +++++- dev/release/build-release-comet.sh | 66 +++++++++++++------ dev/release/comet-rm/Dockerfile | 12 ++-- .../comet-rm/build-comet-native-libs.sh | 2 +- 5 files changed, 89 insertions(+), 34 deletions(-) diff --git a/Makefile b/Makefile index cc09e8678..1cef593fc 100644 --- a/Makefile +++ b/Makefile @@ -46,23 +46,29 @@ format: ./mvnw compile test-compile scalafix:scalafix -Psemanticdb $(PROFILES) ./mvnw spotless:apply $(PROFILES) -# build native libs for amd64 architecture Linux/MacOS on a Linux/amd64 machine/container -core-amd64-libs: - rustup target add x86_64-apple-darwin +# build native libs for arm64 architecture Linux/MacOS on a Linux/arm64 machine/container +core-arm64-libs: # if the environment variable HAS_OSXCROSS is defined ifdef $(HAS_OSXCROSS) - cd native && cargo zigbuild -j 2 --target x86_64-apple-darwin --release + cd native && cargo zigbuild -j 1 --target aarch64-apple-darwin --release endif cd native && cargo build -j 2 --release +# build native libs for amd64 architecture Linux/MacOS on a Linux/amd64 machine/container +core-amd64-libs: + cd native && cargo build -j 2 --release +ifdef HAS_OSXCROSS + rustup target add x86_64-apple-darwin + cd native && cargo build -j 2 --target x86_64-apple-darwin --release +endif + # build native libs for arm64 architecture Linux/MacOS on a Linux/arm64 machine/container core-arm64-libs: + cd native && cargo build -j 2 --release +ifdef HAS_OSXCROSS rustup target add aarch64-apple-darwin - # if the environment variable HAS_OSXCROSS is defined -ifdef $(HAS_OSXCROSS) - cd native && cargo zigbuild -j 2 --target aarch64-apple-darwin --release + cd native && cargo build -j 2 --target aarch64-apple-darwin --release endif - cd native && cargo build -j 2 --release core-amd64: rustup target add x86_64-apple-darwin diff --git a/dev/release/README.md b/dev/release/README.md index 6fe934ee9..6a6cb1ec1 100644 --- a/dev/release/README.md +++ b/dev/release/README.md @@ -102,8 +102,27 @@ my_custom_context * tcp://192.168.64.2:2 $ docker context use desktop-linux ``` #### Run the build script + The build-release-comet.sh script will create a docker image with multi-arch support and use the image +to build the platform specific binaries. The image is created every time this script is run. +The script optionally allows overriding of the repository and branch to build the binaries from (Note that + the local git repo is not used in the building of the binaries, but it is used to build the final uber jar). + +```shell +Usage: build-release-comet.sh [options] + +This script builds comet native binaries inside a docker image. The image is named +"comet-rm" and will be generated by this script + +Options are: + +-r [repo] : git repo (default: https://github.com/apache/datafusion-comet.git) +-b [branch] : git branch (default: release) +-t [tag] : tag for the spark-rm docker image to use for building (default: "latest"). +``` + +Example: + ```shell -./mvnw clean cd dev/release && ./build-release-comet.sh && cd ../.. ``` diff --git a/dev/release/build-release-comet.sh b/dev/release/build-release-comet.sh index a0027b72d..31f98fb0c 100755 --- a/dev/release/build-release-comet.sh +++ b/dev/release/build-release-comet.sh @@ -18,6 +18,8 @@ # under the License. # +set -e + SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)" COMET_HOME_DIR=$SCRIPT_DIR/../.. @@ -31,9 +33,8 @@ This script builds comet native binaries inside a docker image. The image is nam Options are: - -r [repo] : git repo - -b [branch] : git branch - -x : XCode sdk file name + -r [repo] : git repo (default: ${REPO}) + -b [branch] : git branch (default: ${BRANCH}) -t [tag] : tag for the spark-rm docker image to use for building (default: "latest"). EOF exit 1 @@ -44,9 +45,22 @@ function cleanup() if [ $CLEANUP != 0 ] then echo Cleaning up ... - docker rm comet-arm64-builder-container - docker rm comet-amd64-builder-container - docker buildx rm --keep-state comet-builder + + + if [ "$(docker ps -a | grep comet-arm64-builder-container)" != "" ] + then + docker rm comet-arm64-builder-container + fi + if [ "$(docker ps -a | grep comet-amd64-builder-container)" != "" ] + then + docker rm comet-amd64-builder-container + fi +# if [ "$(docker ps -a | grep comet-builder-registry)" != "" ] +# then +# docker container stop comet-builder-registry +# docker rm comet-builder-registry +# fi +# docker buildx rm --keep-state comet-builder CLEANUP=0 fi # exit @@ -62,11 +76,10 @@ MACOS_SDK= HAS_MACOS_SDK="false" IMGTAG=latest -while getopts "b:hr:t:x:" opt; do +while getopts "b:hr:t:" opt; do case $opt in r) REPO="$OPTARG";; b) BRANCH="$OPTARG";; - x) MACOS_SDK="$OPTARG" ;; t) IMGTAG="$OPTARG" ;; h) usage ;; \?) error "Invalid option. Run with -h for help." ;; @@ -92,22 +105,37 @@ then HAS_MACOS_SDK="true" fi + +# start a local docker registry for buildx +#docker run -d -p 49157:49157 --name comet-builder-registry registry:2 +# docker login localhost:49157 + # Create docker builder context -docker buildx create \ - --name comet-builder \ - --driver docker-container \ - --use --bootstrap +#docker buildx create \ +# --name comet-builder \ +# --driver docker-container \ +# --use --bootstrap + +BUILDER_IMAGE_ARM64="comet-rm-arm64:$IMGTAG" +BUILDER_IMAGE_AMD64="comet-rm-amd64:$IMGTAG" # Build the docker image in which we will do the build -docker buildx build \ - --platform linux/amd64,linux/arm64 \ - -t "comet-rm:$IMGTAG" \ +docker build \ + --platform=linux/arm64 \ + -t "$BUILDER_IMAGE_ARM64" \ + --build-arg HAS_MACOS_SDK=${HAS_MACOS_SDK} \ + --build-arg MACOS_SDK=${MACOS_SDK} \ + "$SCRIPT_DIR/comet-rm" + +docker build \ + --platform=linux/amd64 \ + -t "$BUILDER_IMAGE_AMD64" \ --build-arg HAS_MACOS_SDK=${HAS_MACOS_SDK} \ --build-arg MACOS_SDK=${MACOS_SDK} \ - --load \ "$SCRIPT_DIR/comet-rm" -BUILDER_IMAGE="comet-rm:$IMGTAG" +# Clean previous Java build +pushd $COMET_HOME_DIR && ./mvnw clean && popd # Run the builder container for each architecture. The entrypoint script will build the binaries @@ -119,7 +147,7 @@ docker run \ --cpus 6 \ -it \ --platform linux/amd64 \ - $BUILDER_IMAGE "${REPO}" "${BRANCH}" amd64 + $BUILDER_IMAGE_AMD64 "${REPO}" "${BRANCH}" amd64 if [ $? != 0 ] then @@ -135,7 +163,7 @@ docker run \ --cpus 6 \ -it \ --platform linux/arm64 \ - $BUILDER_IMAGE "${REPO}" "${BRANCH}" arm64 + $BUILDER_IMAGE_ARM64 "${REPO}" "${BRANCH}" arm64 if [ $? != 0 ] then diff --git a/dev/release/comet-rm/Dockerfile b/dev/release/comet-rm/Dockerfile index b9c1d6454..4ed97c4d3 100644 --- a/dev/release/comet-rm/Dockerfile +++ b/dev/release/comet-rm/Dockerfile @@ -57,17 +57,19 @@ ENV PATH="/root/.cargo/bin:${PATH}" #RUN rustup install nightly && cargo +nightly install cargo2junit RUN cargo install cargo2junit +#RUN apt-get update \ +# && apt-get install --no-install-recommends -y pip \ +# && pip install cargo-zigbuild + +#RUN rustup target add x86_64-unknown-linux-gnu \ +# && rustup target add aarch64-unknown-linux-gnu + # Stage to add OSXCross if MacOSSDK is provided FROM base AS with-macos-sdk-true ARG MACOS_SDK COPY workdir/$MACOS_SDK /opt/xcode/ -RUN export LC_ALL=C \ - && apt-get update \ - && apt-get install --no-install-recommends -y pip \ - && pip install cargo-zigbuild - RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then \ rustup target add aarch64-apple-darwin; \ elif [ "$TARGETPLATFORM" = "linux/amd64" ]; then \ diff --git a/dev/release/comet-rm/build-comet-native-libs.sh b/dev/release/comet-rm/build-comet-native-libs.sh index 20d2d9947..58c655052 100755 --- a/dev/release/comet-rm/build-comet-native-libs.sh +++ b/dev/release/comet-rm/build-comet-native-libs.sh @@ -49,4 +49,4 @@ git checkout "$BRANCH" # build comet binaries -make core-${ARCH}-libs \ No newline at end of file +make core-${ARCH}-libs From 77c8df2eef459c33854ff3205eb5fe6c48d42cf2 Mon Sep 17 00:00:00 2001 From: Parth Chandra Date: Fri, 13 Sep 2024 09:25:21 -0700 Subject: [PATCH 5/9] update docs and cleanup --- dev/release/README.md | 13 ++++++------- dev/release/comet-rm/Dockerfile | 10 ---------- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/dev/release/README.md b/dev/release/README.md index 6a6cb1ec1..d11345294 100644 --- a/dev/release/README.md +++ b/dev/release/README.md @@ -85,11 +85,6 @@ commit into the release branch. #### Setup to do the build The build process requires Docker. Download the latest Docker Desktop from https://www.docker.com/products/docker-desktop/. - - In Docker Desktop -> Settings -> General -> Enable 'Use containerd for pulling and storing images' - - (when the build process is done, you can disable the above setting) - If you have multiple docker contexts running switch to the context of the Docker Desktop. For example - ```shell @@ -102,8 +97,8 @@ my_custom_context * tcp://192.168.64.2:2 $ docker context use desktop-linux ``` #### Run the build script - The build-release-comet.sh script will create a docker image with multi-arch support and use the image -to build the platform specific binaries. The image is created every time this script is run. + The `build-release-comet.sh` script will create a docker image for each architecture and use the image +to build the platform specific binaries. These builder images are created every time this script is run. The script optionally allows overriding of the repository and branch to build the binaries from (Note that the local git repo is not used in the building of the binaries, but it is used to build the final uber jar). @@ -126,6 +121,10 @@ Example: cd dev/release && ./build-release-comet.sh && cd ../.. ``` +#### Build output + The build output is installed to a temporary local maven repository. The build script will print the name of the repository +location at the end. This location will be required at the time of deploying the artifacts to a staging repository + ### Tag the Release Candidate Tag the release branch with `0.1.0-rc1` and push to the `apache` repo diff --git a/dev/release/comet-rm/Dockerfile b/dev/release/comet-rm/Dockerfile index 4ed97c4d3..9b430d2a9 100644 --- a/dev/release/comet-rm/Dockerfile +++ b/dev/release/comet-rm/Dockerfile @@ -25,7 +25,6 @@ ENV DEBIAN_FRONTEND=noninteractive ENV DEBCONF_NONINTERACTIVE_SEEN=true ENV LC_ALL=C -# RUN apt-get update \ # Install pr-requisites for rust RUN export LC_ALL=C \ && apt-get update \ @@ -52,18 +51,9 @@ RUN export LC_ALL=C \ # Install rust RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y -#RUN cd /tmp && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh ENV PATH="/root/.cargo/bin:${PATH}" -#RUN rustup install nightly && cargo +nightly install cargo2junit RUN cargo install cargo2junit -#RUN apt-get update \ -# && apt-get install --no-install-recommends -y pip \ -# && pip install cargo-zigbuild - -#RUN rustup target add x86_64-unknown-linux-gnu \ -# && rustup target add aarch64-unknown-linux-gnu - # Stage to add OSXCross if MacOSSDK is provided FROM base AS with-macos-sdk-true ARG MACOS_SDK From fb9f3617c5773632f9bcd467a923f543b944c8ad Mon Sep 17 00:00:00 2001 From: Parth Chandra Date: Fri, 13 Sep 2024 14:39:48 -0700 Subject: [PATCH 6/9] remove unused code --- dev/release/build-release-comet.sh | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/dev/release/build-release-comet.sh b/dev/release/build-release-comet.sh index 31f98fb0c..9c07e2c2e 100755 --- a/dev/release/build-release-comet.sh +++ b/dev/release/build-release-comet.sh @@ -45,8 +45,6 @@ function cleanup() if [ $CLEANUP != 0 ] then echo Cleaning up ... - - if [ "$(docker ps -a | grep comet-arm64-builder-container)" != "" ] then docker rm comet-arm64-builder-container @@ -55,15 +53,8 @@ function cleanup() then docker rm comet-amd64-builder-container fi -# if [ "$(docker ps -a | grep comet-builder-registry)" != "" ] -# then -# docker container stop comet-builder-registry -# docker rm comet-builder-registry -# fi -# docker buildx rm --keep-state comet-builder CLEANUP=0 fi -# exit } trap cleanup SIGINT SIGTERM EXIT @@ -105,17 +96,6 @@ then HAS_MACOS_SDK="true" fi - -# start a local docker registry for buildx -#docker run -d -p 49157:49157 --name comet-builder-registry registry:2 -# docker login localhost:49157 - -# Create docker builder context -#docker buildx create \ -# --name comet-builder \ -# --driver docker-container \ -# --use --bootstrap - BUILDER_IMAGE_ARM64="comet-rm-arm64:$IMGTAG" BUILDER_IMAGE_AMD64="comet-rm-amd64:$IMGTAG" From 6973a86a302e073e0b611a347983ba64f7b7507b Mon Sep 17 00:00:00 2001 From: Parth Chandra Date: Mon, 16 Sep 2024 10:50:39 -0700 Subject: [PATCH 7/9] fail build script on error --- dev/release/comet-rm/build-comet-native-libs.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dev/release/comet-rm/build-comet-native-libs.sh b/dev/release/comet-rm/build-comet-native-libs.sh index 58c655052..78f1ae12d 100755 --- a/dev/release/comet-rm/build-comet-native-libs.sh +++ b/dev/release/comet-rm/build-comet-native-libs.sh @@ -19,6 +19,9 @@ # # builds a comet binary + +set -e + REPO=$1 BRANCH=$2 ARCH=$3 From 9ae5083a814822e609e315af5e104e75c4728865 Mon Sep 17 00:00:00 2001 From: Parth Chandra Date: Mon, 16 Sep 2024 13:31:14 -0700 Subject: [PATCH 8/9] Build all profiles --- dev/release/build-release-comet.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dev/release/build-release-comet.sh b/dev/release/build-release-comet.sh index 9c07e2c2e..07466bf16 100755 --- a/dev/release/build-release-comet.sh +++ b/dev/release/build-release-comet.sh @@ -190,7 +190,12 @@ pushd $COMET_HOME_DIR GIT_HASH=$(git rev-parse --short HEAD) LOCAL_REPO=$(mktemp -d /tmp/comet-staging-repo-XXXXX) -./mvnw "-Dmaven.repo.local=${LOCAL_REPO}" -DskipTests install +./mvnw "-Dmaven.repo.local=${LOCAL_REPO}" -P spark-3.4 -P scala-2.12 -DskipTests install +./mvnw "-Dmaven.repo.local=${LOCAL_REPO}" -P spark-3.4 -P scala-2.13 -DskipTests install +./mvnw "-Dmaven.repo.local=${LOCAL_REPO}" -P spark-3.3 -P scala-2.12 -DskipTests install +./mvnw "-Dmaven.repo.local=${LOCAL_REPO}" -P spark-3.3 -P scala-2.13 -DskipTests install +./mvnw "-Dmaven.repo.local=${LOCAL_REPO}" -P spark-3.5 -P scala-2.12 -DskipTests install +./mvnw "-Dmaven.repo.local=${LOCAL_REPO}" -P spark-3.5 -P scala-2.13 -DskipTests install echo "Installed to local repo: ${LOCAL_REPO}" From 5103f73d8a7f6d1f291b824309881a36feed10e5 Mon Sep 17 00:00:00 2001 From: Parth Chandra Date: Tue, 17 Sep 2024 14:59:04 -0700 Subject: [PATCH 9/9] remove duplicate target from makefile --- Makefile | 8 -------- 1 file changed, 8 deletions(-) diff --git a/Makefile b/Makefile index 1cef593fc..80f334a34 100644 --- a/Makefile +++ b/Makefile @@ -46,14 +46,6 @@ format: ./mvnw compile test-compile scalafix:scalafix -Psemanticdb $(PROFILES) ./mvnw spotless:apply $(PROFILES) -# build native libs for arm64 architecture Linux/MacOS on a Linux/arm64 machine/container -core-arm64-libs: - # if the environment variable HAS_OSXCROSS is defined -ifdef $(HAS_OSXCROSS) - cd native && cargo zigbuild -j 1 --target aarch64-apple-darwin --release -endif - cd native && cargo build -j 2 --release - # build native libs for amd64 architecture Linux/MacOS on a Linux/amd64 machine/container core-amd64-libs: cd native && cargo build -j 2 --release