Note: The Docker image generated by this repository is being used by DuckDB's CI, and mention in DuckDB PR#16549
A containerized environment for building and testing DuckDB on RISC-V architecture using QEMU emulation.
This project provides the infrastructure to:
- Set up a RISC-V emulation environment using QEMU
- Build DuckDB for RISC-V architecture
- Run tests to verify DuckDB functionality on RISC-V
- Docker Container: Debian-based environment with QEMU(Base on DQIB) and RISC-V tools
- QEMU Script: Configures and launches a RISC-V virtual machine
- CI/CD Pipeline: Automates building and publishing the container image
- Docker
- GitHub account (for using the pre-built container)
# Pull the image
docker pull ghcr.io/mocusez/duckdb-riscv-ci/duckdb-riscv-ci:latest
# Run the container on DuckDB repo
docker run -i --rm -v $(pwd):/duckdb --workdir /duckdb ghcr.io/mocusez/duckdb-riscv-ci/duckdb-riscv-ci <<< "apt-get install -y cmake ninja-build libssl-dev g++-riscv64-linux-gnu && GEN=ninja CC='riscv64-linux-gnu-gcc -march=rv64gcv_zicsr_zifencei_zihintpause_zvl256b' CXX='riscv64-linux-gnu-g++ -march=rv64gcv_zicsr_zifencei_zihintpause_zvl256b' DUCKDB_PLATFORM=linux_riscv make && cd / && ./start_qemu.sh && cd /duckdb && make clean && echo 'DOCKER TEST RESULT: SUCCESS' || (echo 'DOCKER TEST RESULT: FAILURE' && make clean)" 2>&1
# Clone the repository
git clone https://github.com/mocusez/duckdb-riscv-ci.git
cd duckdb-riscv-ci
# Build the Docker image
docker build -t duckdb-riscv-ci .
# Run the container
docker run -it --rm duckdb-riscv-ci
# Inside container, run the QEMU script
./start_qemu.sh
The QEMU environment is configured with:
- RV64GCV CPU with Vector extensions (RVV)
- 4GB RAM
- 4 CPU cores
- Network access with port forwarding for SSH
GitHub Actions automatically builds and pushes the Docker image on commits to the main branch. The workflow:
- Checks out the code
- Logs in to GitHub Container Registry
- Builds the Docker image
- Tags and pushes the image to ghcr.io