Skip to content
Merged
73 changes: 72 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,75 @@ jobs:
restore-keys: |
${{ runner.os }}-cargo-target-${{ hashFiles('**/Cargo.lock') }}-
${{ runner.os }}-cargo-target-
- run: cargo test
- run: cargo test

build:
name: Build (${{ matrix.arch }})
needs: [test]
if: github.event_name == 'push' && github.ref == 'refs/heads/main' # only build on main (for now)
strategy:
matrix:
include:
- arch: amd64
runner: ubuntu-latest
- arch: arm64
runner: ubuntu-24.04-arm
runs-on: ${{ matrix.runner }}
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: mozilla-actions/[email protected]
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
cache: false
- name: Cache Cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-${{ matrix.arch }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.arch }}-cargo-registry-
- name: Build release binary
run: cargo build --release --bin server
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
run: |
docker build -t ghcr.io/${{ github.repository }}:${{ github.sha }}-${{ matrix.arch }} .
docker push ghcr.io/${{ github.repository }}:${{ github.sha }}-${{ matrix.arch }}

manifest:
name: Create multi-arch manifest
runs-on: ubuntu-latest
needs: [build]
permissions:
contents: read
packages: write
steps:
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create and push multi-arch manifest
run: |
docker manifest create ghcr.io/${{ github.repository }}:${{ github.sha }} \
ghcr.io/${{ github.repository }}:${{ github.sha }}-amd64 \
ghcr.io/${{ github.repository }}:${{ github.sha }}-arm64
docker manifest push ghcr.io/${{ github.repository }}:${{ github.sha }}

docker manifest create ghcr.io/${{ github.repository }}:latest \
ghcr.io/${{ github.repository }}:${{ github.sha }}-amd64 \
ghcr.io/${{ github.repository }}:${{ github.sha }}-arm64
docker manifest push ghcr.io/${{ github.repository }}:latest
24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM ubuntu:24.04

LABEL org.opencontainers.image.source="https://github.com/hotdata-dev/rivetdb"
LABEL org.opencontainers.image.description="Federated query engine with on-demand caching. Run: docker run -p 3000:3000 ghcr.io/hotdata-dev/rivetdb | Custom config: docker run -p 3000:3000 -v ./config.toml:/app/config.toml ghcr.io/hotdata-dev/rivetdb"
LABEL org.opencontainers.image.licenses="Apache-2.0"

WORKDIR /app

# Install runtime dependencies
RUN apt-get update && apt-get install -y \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*

# Copy pre-built binary and default config
COPY target/release/server ./server
COPY config-docker.toml ./config.toml

# Create directories for cache and state
RUN mkdir -p ./cache ./state

EXPOSE 3000

ENTRYPOINT ["./server"]
CMD ["config.toml"]
13 changes: 13 additions & 0 deletions config-docker.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[server]
host = "0.0.0.0"
port = 3000

[catalog]
type = "duckdb"

[storage]
type = "filesystem"

[paths]
cache_dir = "/app/cache"
state_dir = "/app/state"
Loading