Docker build #128
Workflow file for this run
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
name: Docker build | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- '.github/workflows/docker-build.yml' | |
- 'docker/**' | |
pull_request: | |
branches: | |
- '*' | |
paths: | |
- '.github/workflows/docker-build.yml' | |
- 'docker/**' | |
env: | |
MAVEN_OPTS: -Dmaven.wagon.httpconnectionManager.ttlSeconds=60 | |
permissions: | |
contents: read | |
jobs: | |
build: | |
strategy: | |
fail-fast: true | |
matrix: | |
os: ['ubuntu-latest', 'macos-13'] | |
spark: ['3.5.1', '3.4.3', '3.3.4'] | |
include: | |
- spark: 3.5.1 | |
sedona: "latest" | |
geotools: "auto" | |
- spark: 3.4.3 | |
sedona: 1.6.0 | |
geotools: 28.2 | |
- spark: 3.3.4 | |
sedona: 1.6.0 | |
geotools: 28.2 | |
exclude: | |
- os: macos-13 | |
spark: 3.4.3 | |
- os: macos-13 | |
spark: 3.3.4 | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: 11 | |
- name: Cache Maven packages | |
uses: actions/cache@v3 | |
with: | |
path: ~/.m2 | |
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | |
restore-keys: ${{ runner.os }}-m2 | |
- name: Setup docker (missing on macOS) - install QEMU 9.0.2 | |
if: runner.os == 'macos' | |
run: | | |
wget https://raw.githubusercontent.com/Homebrew/homebrew-core/f1a9cf104a9a51779c7a532b658c490f69974839/Formula/q/qemu.rb | |
brew install qemu.rb 2>&1 | |
continue-on-error: true | |
- name: Setup tmate session | |
uses: mxschmitt/action-tmate@v3 | |
- name: Setup docker (missing on macOS) - install Colima and Docker | |
if: runner.os == 'macos' | |
run: | | |
brew install colima | |
brew install docker | |
n=0 | |
max_retries=3 | |
until [ "$n" -ge "$max_retries" ] | |
do | |
colima start || exit_code=$? | |
if [ "$exit_code" -eq 1 ]; then | |
echo "Command failed with exit code 1. Retrying... ($((n+1))/$max_retries)" | |
n=$((n+1)) | |
sleep 5 | |
else | |
exit $exit_code # Exit on any code other than 1 | |
fi | |
done | |
if [ "$n" -eq "$max_retries" ]; then | |
echo "Max retries reached. Failing the step." | |
exit 1 | |
fi | |
DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker} | |
mkdir -p $DOCKER_CONFIG/cli-plugins | |
curl -SL https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.darwin-amd64 -o $DOCKER_CONFIG/cli-plugins/docker-buildx | |
chmod +x $DOCKER_CONFIG/cli-plugins/docker-buildx | |
- env: | |
SPARK_VERSION: ${{ matrix.spark }} | |
SEDONA_VERSION: ${{ matrix.sedona }} | |
GEOTOOLS_VERSION: ${{ matrix.geotools }} | |
run: ./docker/sedona-spark-jupyterlab/build.sh ${SPARK_VERSION} ${SEDONA_VERSION} local ${GEOTOOLS_VERSION} |