Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 28 additions & 12 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
name: Upload Docker image
name: Build Docker image

on:
release:
types: [created]
push:
branches:
- main
pull_request:
paths:
- setup.py
- Cargo.toml
- Cargo.lock
- pyproject.toml
- docker/**
- .github/workflows/docker.yml

# When this workflow is queued, automatically cancel any previous running
# or pending jobs from the same branch
Expand All @@ -17,15 +25,16 @@ jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
if: github.repository == 'dask-contrib/dask-sql'
env:
DOCKER_PUSH: ${{ github.event_name == 'push' && github.repository == 'dask-contrib/dask-sql' }}
strategy:
fail-fast: false
matrix:
platform: ["linux/amd64", "linux/arm64", "linux/386"]
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- uses: actions/checkout@v3
- name: Login to DockerHub
if: ${{ fromJSON(env.DOCKER_PUSH) }}
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
Expand All @@ -41,10 +50,16 @@ jobs:
context: .
file: ./docker/main.dockerfile
build-args: DOCKER_META_VERSION=${{ steps.docker_meta_main.outputs.version }}
platforms: linux/amd64,linux/arm64,linux/386
platforms: ${{ matrix.platform }}
tags: ${{ steps.docker_meta_main.outputs.tags }}
labels: ${{ steps.docker_meta_main.outputs.labels }}
push: true
push: ${{ fromJSON(env.DOCKER_PUSH) }}
load: ${{ !fromJSON(env.DOCKER_PUSH) }}
- name: Check images
run: |
df -h
docker image ls
docker image inspect ${{ steps.docker_meta_main.outputs.tags }}
- name: Docker meta for cloud image
id: docker_meta_cloud
uses: crazy-max/ghaction-docker-meta@v4
Expand All @@ -56,7 +71,8 @@ jobs:
context: .
file: ./docker/cloud.dockerfile
build-args: DOCKER_META_VERSION=${{ steps.docker_meta_main.outputs.version }}
platforms: linux/amd64,linux/arm64,linux/386
platforms: ${{ matrix.platform }}
tags: ${{ steps.docker_meta_cloud.outputs.tags }}
labels: ${{ steps.docker_meta_cloud.outputs.labels }}
push: true
push: ${{ fromJSON(env.DOCKER_PUSH) }}
load: ${{ !fromJSON(env.DOCKER_PUSH) }}
2 changes: 1 addition & 1 deletion docker/main.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ COPY .git /opt/dask_sql/.git
COPY src /opt/dask_sql/src
COPY dask_sql /opt/dask_sql/dask_sql
RUN cd /opt/dask_sql/ \
&& pip install -e . -vv
&& CONDA_PREFIX="/opt/conda/" maturin develop

# Set the script to execute
COPY scripts/startup_script.py /opt/dask_sql/startup_script.py
Expand Down