-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Add GitHub workflow to publish Docker image #847
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
85e6e13
Add workflow to publish Docker images
andygrove 2c52741
update workflow name
andygrove 073d202
remove regex check
andygrove 342ae84
improve
andygrove e7f7c5d
fix
andygrove 91203b4
use maven to get project version
andygrove f2b0a76
add scalastyle config
andygrove d6a3979
fix
andygrove 68be564
remove java distro name
andygrove ec6d0e5
add dev folder
andygrove 005f137
save progress
andygrove 19e2ba3
docker build works
andygrove 0565cd6
Update kube/Dockerfile
andygrove 51f70a7
Update .github/workflows/docker-publish.yml
andygrove 70dbd93
address feedback
andygrove 3cddf4b
Merge branch 'docker-publish' of github.com:andygrove/datafusion-come…
andygrove File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
.git | ||
.github | ||
.idea | ||
bin | ||
conf | ||
docs/build | ||
docs/temp | ||
docs/venv | ||
metastore_db | ||
target | ||
common/target | ||
spark-integration/target | ||
fuzz-testing/target | ||
spark/target | ||
native/target | ||
core/target | ||
spark-warehouse | ||
venv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# 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*' | ||
- 'test-docker-publish-*' | ||
|
||
docker: | ||
name: Docker | ||
runs-on: ubuntu-22.04 | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: Set up Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
- name: Extract Comet version | ||
id: extract_version | ||
run: | | ||
COMET_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) | ||
echo "COMET_VERSION=$COMET_VERSION" >> $GITHUB_ENV | ||
- name: Echo Comet version | ||
run: echo "The current Comet version is ${{ env.COMET_VERSION }}" | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build and push | ||
uses: docker/build-push-action@v6 | ||
with: | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
tags: apache/datafusion-comet:spark-3.4-scala-2.12-${{ env.COMET_VERSION }} | ||
file: kube/Dockerfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,6 @@ USER root | |
|
||
# Installing JDK11 as the image comes with JRE | ||
RUN apt update \ | ||
&& apt install -y git \ | ||
&& apt install -y curl \ | ||
&& apt install -y openjdk-11-jdk \ | ||
&& apt clean | ||
|
@@ -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 | ||
|
||
# ntoe the use of a wildcard in the file name so that this works with both snapshot and final release versions | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Newline at EOF |
||
COPY --from=builder /comet/spark/target/comet-spark-spark${SPARK_VERSION}_$SCALA_VERSION-0.2.0*.jar $SPARK_HOME/jars |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the
-Ctarget-cpu=native
a good idea? My guess would have been that github runners might use a range of different generations of cpus and therefore have different features? If that is the case different runs here might for example enable different simd instructions and cause varying performance.Would it not be better to target some specific set of features and document that? And user what something else they should build from source.