edmondop commented on code in PR #847: URL: https://github.com/apache/datafusion-comet/pull/847#discussion_r1722226882
########## .github/workflows/docker-publish.yml: ########## @@ -0,0 +1,59 @@ +# 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. + +name: Publish Docker images + +concurrency: + group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }} + cancel-in-progress: true + +on: + push: + tags: + - '*.*.*' + - '*.*.*-rc*' + +docker: + name: Docker + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v3 + - name: Set up Java + uses: actions/setup-java@v3 + with: + java-version: '17' + - name: Extract Maven version + id: extract_version + run: | + COMET_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) + echo "COMET_VERSION=$COMET_VERSION" >> $GITHUB_ENV + - name: Echo Maven version + run: echo "The current Maven version is ${{ env.COMET_VERSION }}" + - name: Build and push Docker image + run: | + docker build -t datafusion-comet:spark-3.4-scala-2.12-${{ env.COMET_VERSION }} -f kube/Dockerfile . + export DOCKER_TAG="$(git describe --exact-match --tags $(git log -n1 --pretty='%h') || echo '')" + echo "publishing docker tag $DOCKER_TAG" + docker tag datafusion-comet:spark-3.4-scala-2.12t-${{ env.COMET_VERSION }} ghcr.io/apache/datafusion-comet:$DOCKER_TAG + docker login ghcr.io -u $DOCKER_USER -p "$DOCKER_PASS" + docker push ghcr.io/apache/datafusion-comet:$DOCKER_TAG + env: + DOCKER_USER: ${{ github.actor }} + DOCKER_PASS: ${{ secrets.GITHUB_TOKEN }} Review Comment: Missing newline here ########## kube/Dockerfile: ########## @@ -32,14 +31,38 @@ ENV RUSTFLAGS="-C debuginfo=line-tables-only -C incremental=false" ENV SPARK_VERSION=3.4 ENV SCALA_VERSION=2.12 +# copy source files to Docker image +RUN mkdir /comet +WORKDIR /comet + +# build native code first so that this layer can be re-used +# if only Scala code gets modified +COPY rust-toolchain.toml /comet/rust-toolchain.toml +COPY native /comet/native +RUN cd native && RUSTFLAGS="-Ctarget-cpu=native" cargo build --release + +# copy the rest of the project +COPY .mvn /comet/.mvn +COPY mvnw /comet/mvnw +COPY common /comet/common +COPY dev /comet/dev +COPY docs /comet/docs +COPY fuzz-testing /comet/fuzz-testing +COPY spark /comet/spark +COPY spark-integration /comet/spark-integration +COPY scalafmt.conf /comet/scalafmt.conf +COPY .scalafix.conf /comet/.scalafix.conf +COPY Makefile /comet/Makefile +COPY pom.xml /comet/pom.xml + # Pick the JDK instead of JRE to compile Comet -RUN cd /opt \ - && git clone https://github.com/apache/datafusion-comet.git \ - && cd datafusion-comet \ - && JAVA_HOME=$(readlink -f $(which javac) | sed "s/\/bin\/javac//") make release PROFILES="-Pspark-$SPARK_VERSION -Pscala-$SCALA_VERSION" +RUN cd /comet \ + && JAVA_HOME=$(readlink -f $(which javac) | sed "s/\/bin\/javac//") make release-nogit PROFILES="-Pspark-$SPARK_VERSION -Pscala-$SCALA_VERSION" FROM apache/spark:3.4.2 ENV SPARK_VERSION=3.4 ENV SCALA_VERSION=2.12 USER root -COPY --from=builder /opt/datafusion-comet/spark/target/comet-spark-spark${SPARK_VERSION}_$SCALA_VERSION-0.1.0-SNAPSHOT.jar $SPARK_HOME/jars \ No newline at end of file + +# ntoe the use of a wildcard in the file name so that this works with both snapshot and final release versions +COPY --from=builder /comet/spark/target/comet-spark-spark${SPARK_VERSION}_$SCALA_VERSION-0.2.0*.jar $SPARK_HOME/jars Review Comment: Newline at EOF ########## .github/workflows/docker-publish.yml: ########## @@ -0,0 +1,59 @@ +# 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. + +name: Publish Docker images + +concurrency: + group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }} + cancel-in-progress: true + +on: + push: + tags: + - '*.*.*' + - '*.*.*-rc*' + +docker: + name: Docker + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v3 + - name: Set up Java + uses: actions/setup-java@v3 + with: + java-version: '17' + - name: Extract Maven version + id: extract_version + run: | + COMET_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) + echo "COMET_VERSION=$COMET_VERSION" >> $GITHUB_ENV + - name: Echo Maven version + run: echo "The current Maven version is ${{ env.COMET_VERSION }}" + - name: Build and push Docker image + run: | + docker build -t datafusion-comet:spark-3.4-scala-2.12-${{ env.COMET_VERSION }} -f kube/Dockerfile . Review Comment: I think also it might be important here to use docker buildx to create images that are compatible with arm if comet supports it ########## .github/workflows/docker-publish.yml: ########## @@ -0,0 +1,59 @@ +# 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. + +name: Publish Docker images + +concurrency: + group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }} + cancel-in-progress: true + +on: + push: + tags: + - '*.*.*' + - '*.*.*-rc*' + +docker: + name: Docker + runs-on: ubuntu-latest Review Comment: ```suggestion runs-on: ubuntu-22.04 ``` -- 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: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org