andygrove commented on code in PR #932:
URL: https://github.com/apache/datafusion-comet/pull/932#discussion_r1755638170


##########
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 <<EOF
+Usage: $NAME [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
+  -b [branch] : git branch
+  -x          : XCode sdk file name
+  -t [tag]    : tag for the spark-rm docker image to use for building 
(default: "latest").
+EOF
+exit 1
+}
+
+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
+    CLEANUP=0
+  fi
+#  exit
+}
+
+trap cleanup SIGINT SIGTERM EXIT
+
+CLEANUP=1
+
+REPO="https://github.com/apache/datafusion-comet.git";
+BRANCH="release"
+MACOS_SDK=
+HAS_MACOS_SDK="false"
+IMGTAG=latest
+
+while getopts "b:hr:t:x:" 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." ;;
+  esac
+done
+
+echo "Building binaries from $REPO/$BRANCH"
+
+WORKING_DIR="$SCRIPT_DIR/comet-rm/workdir"
+cp $SCRIPT_DIR/../cargo.config $WORKING_DIR
+
+# TODO: Search for Xcode (Once building macos binaries works)
+#PS3="Select Xcode:"
+#select xcode_path in  `find . -name "${MACOS_SDK}"`
+#do
+#  echo "found Xcode in $xcode_path"
+#  cp $xcode_path $WORKING_DIR
+#  break
+#done
+
+if [ -f "${WORKING_DIR}/${MACOS_SDK}" ]
+then
+  HAS_MACOS_SDK="true"
+fi
+
+# Create docker builder context
+docker buildx create \
+  --name comet-builder \
+  --driver docker-container \
+  --use --bootstrap
+
+# Build the docker image in which we will do the build
+docker buildx build \
+  --platform linux/amd64,linux/arm64 \
+  -t "comet-rm:$IMGTAG" \
+  --build-arg HAS_MACOS_SDK=${HAS_MACOS_SDK} \
+  --build-arg MACOS_SDK=${MACOS_SDK} \
+  --load \

Review Comment:
   The next issue I hit was:
   
   ```
   ------
    > exporting to image:
   ------
   ERROR: failed to solve: failed to push comet-rm:latest: push access denied, 
repository does not exist or may require authorization: server message: 
insufficient_scope: authorization failed
   Cleaning up ...
   Error response from daemon: No such container: comet-arm64-builder-container
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to