@@ -78,11 +78,7 @@ RUN apt-get update && \
7878 rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
7979
8080# Copy all needed files to install the package
81- # (.dockerignore is used to filter only the necessary files)
82- COPY pyproject.toml .
83- COPY sw ./sw
84- COPY util ./util
85- COPY nonfree/util ./nonfree/util
81+ COPY . /repo
8682
8783# Create and activate virtual environment
8884ENV VIRTUAL_ENV="/root/.venvs/snitch_cluster"
@@ -108,7 +104,7 @@ ENV PATH="/repo/target/sim/build/bin:${PATH}"
108104ARG PIP_NO_CACHE_DIR=1
109105RUN pip install --upgrade pip && \
110106 pip install torch --index-url https://download.pytorch.org/whl/cpu && \
111- pip install . [all]
107+ pip install /repo [all]
112108
113109# -------------------------------------------------------------------------------
114110# Stage 3: Hardware build
@@ -117,15 +113,10 @@ RUN pip install --upgrade pip && \
117113
118114FROM snitch_cluster-hw AS hw-builder
119115
120- # Patch .gitmodules to replace SSH URLs with HTTPS
121- # Clone the snitch_cluster repository into /repo
122- # If the repo URL or commit hash doesn't change, this layer remains cached.
123- RUN git config --global url."https://github" .insteadOf "git://github" \
124- && git config --global url.
"https://github.com/" .insteadOf
"[email protected] :" \
125- && git clone --recursive https://github.com/pulp-platform/snitch_cluster /repo \
126- && cd /repo \
127- # Build the verilator model
128- && make verilator
116+ # Copy the snitch_cluster repository from the build context into /repo
117+ COPY . /repo
118+ # Build the verilator model
119+ RUN cd /repo && make verilator
129120
130121# -------------------------------------------------------------------------------
131122# Stage 4: Software development stage
@@ -153,11 +144,7 @@ RUN apt-get update && \
153144 rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
154145
155146# Copy all needed files to install the package
156- # (.dockerignore is used to filter only the necessary files)
157- COPY pyproject.toml /snitch_cluster/pyproject.toml
158- COPY sw /snitch_cluster/sw
159- COPY util /snitch_cluster/util
160- COPY nonfree/util /snitch_cluster/nonfree/util
147+ COPY . /repo
161148
162149# Create and activate virtual environment
163150ENV VIRTUAL_ENV="/root/.venvs/snitch_cluster"
@@ -182,4 +169,4 @@ ENV PATH="/tools/riscv-llvm/bin:${PATH}"
182169ARG PIP_NO_CACHE_DIR=1
183170RUN pip install --upgrade pip && \
184171 pip install torch --index-url https://download.pytorch.org/whl/cpu && \
185- pip install /snitch_cluster [all]
172+ pip install /repo [all]
0 commit comments