riscv-opcodes
riscv-opcodes copied to clipboard
Containerization for Consistent Artifact Generation
To improve the consistency, reproducibility, and ease of deployment for the riscv-opcodes project, I propose containerizing the project using Docker. Containerization will ensure that the environment for generating artifacts such as encoding.h, LaTeX tables, and other outputs is consistent across different development, testing, and production environments.
Proposed Solution:
# Use an official Python runtime as a parent image
ARG PYTHON_VERSION=3.9-slim
FROM python:${PYTHON_VERSION}
# Set the working directory in the container
WORKDIR /app
# Copy the current directory contents into the container at /app
COPY . /app
# Install additional dependencies
RUN apt-get update && apt-get install -y \
make \
git \
cpp \
&& rm -rf /var/lib/apt/lists/*
# Configure Git to treat the directory as safe
RUN git config --global --add safe.directory /app
# Install Python dependencies
RUN pip install --no-cache-dir pre-commit coverage
# Run pre-commit to ensure code quality
RUN pre-commit run --all-files
# Default command to run the parse.py script
CMD ["./parse.py", "-pseudo", "-c", "-go", "-chisel", "-sverilog", "-rust", "-latex", "-spinalhdl", "rv*", "unratified/rv*"]