-
Notifications
You must be signed in to change notification settings - Fork 1
Use new upstream software development container #340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
colluca
wants to merge
9
commits into
main
Choose a base branch
from
colluca/snitch-sw-container
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+34
−129
Draft
Changes from 5 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
854b23a
Use llvm-mc instead of spike-dasm
colluca d45efa2
Use new slim Snitch software-dev container
colluca 4702444
Merge branch 'main' into colluca/snitch-sw-container
colluca bf8094d
Fix Snitch container version
colluca 24bf085
Bump Snitch version to latest
colluca 70696a9
Upstream python-dev installation and reinstall uv
colluca 8d9fdec
Merge remote-tracking branch 'origin/main' into colluca/snitch-sw-con…
colluca da28856
Remove COPY of xdsl
colluca baaadc1
Bump SHAs after Snitch merge
colluca File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,59 +1,16 @@ | ||
| #------------------------------------------------------------------------------- | ||
| # Stage 1: Builder | ||
| # Clones the repository and builds the necessary artifacts. | ||
| #------------------------------------------------------------------------------- | ||
| FROM ghcr.io/pulp-platform/snitch_cluster:main AS builder | ||
| FROM ghcr.io/pulp-platform/snitch_cluster-sw@sha256:290416751224ccb0a5bf5a583dbad6bc60c985f8fd4a2577775a4af43f2abf6a AS toolchain | ||
| ARG VIRTUAL_ENV="/root/.venvs/snitch_cluster" | ||
| ARG PYTHON_VERSION=3.11 | ||
|
|
||
| # Patch .gitmodules to replace SSH URLs with HTTPS | ||
| # Clone the snitch_cluster repository into /repo | ||
| # If the repo URL or commit hash doesn't change, this layer remains cached. | ||
| RUN git config --global url."https://github".insteadOf "git://github" \ | ||
| && git config --global url."https://github.com/".insteadOf "[email protected]:" \ | ||
| && git clone --recursive https://github.com/pulp-platform/snitch_cluster /repo \ | ||
| && cd /repo \ | ||
| && git reset --hard 7f430f2 \ | ||
| # Build the verilator model and software in the same layer | ||
| && make -C target/snitch_cluster verilator \ | ||
| && make -C target/snitch_cluster DEBUG=ON sw \ | ||
| && cd /repo/target/snitch_cluster/work-vlt/riscv-isa-sim \ | ||
| && ./configure --prefix=/opt/snitch-spike \ | ||
| && make install | ||
|
|
||
| WORKDIR /src | ||
|
|
||
| RUN curl -L -o riscv32-snitch-llvm-ubuntu2204-15.0.0-snitch-0.2.0.tar.gz https://github.com/pulp-platform/llvm-project/releases/download/15.0.0-snitch-0.2.0/riscv32-snitch-llvm-ubuntu2204-15.0.0-snitch-0.2.0.tar.gz \ | ||
| && tar -xzf riscv32-snitch-llvm-ubuntu2204-15.0.0-snitch-0.2.0.tar.gz -C /src | ||
|
|
||
| #------------------------------------------------------------------------------- | ||
| # Stage 2: Final Toolchain Image | ||
| # Creates the final, lean image by copying artifacts from the builder | ||
| # and installing only necessary runtime dependencies. | ||
| #------------------------------------------------------------------------------- | ||
| FROM ubuntu:22.04 AS toolchain | ||
|
|
||
| # Set this environment variable early. | ||
| ENV DEBIAN_FRONTEND=noninteractive | ||
|
|
||
| # Combine related COPY commands to reduce image layers. | ||
| # Copying parent directories is more efficient than many individual sub-directories. | ||
|
|
||
| COPY --from=builder /repo/target/snitch_cluster/bin/snitch_cluster_bin.vlt /opt/snitch-rtl/bin/snitch_cluster.vlt | ||
|
|
||
| COPY --from=builder /opt/snitch-spike /opt/snitch-spike | ||
|
|
||
| COPY --from=builder /src/riscv32-snitch-llvm-ubuntu2204-15.0.0-snitch-0.2.0 /opt/snitch-llvm | ||
|
|
||
| # Copy the entire 'sw' directory at once instead of its individual sub-directories. | ||
| COPY --from=builder /repo/sw /opt/snitch_cluster/sw | ||
|
|
||
| # Copy the entire runtime directory at once. | ||
| COPY --from=builder /repo/target/snitch_cluster/sw/runtime /opt/snitch_cluster/target/snitch_cluster/sw/runtime | ||
|
|
||
| # Copy Snitch Python package files. | ||
| COPY --from=builder /repo/pyproject.toml /opt/snitch_cluster/ | ||
| COPY --from=builder /repo/util /opt/snitch_cluster/util | ||
| COPY --from=builder /repo/nonfree/util /opt/snitch_cluster/nonfree/util | ||
| COPY --from=builder /repo/target/snitch_cluster/util /opt/snitch_cluster/target/snitch_cluster/util | ||
| && git clone --recursive https://github.com/pulp-platform/snitch_cluster /opt/snitch_cluster \ | ||
| && cd /opt/snitch_cluster \ | ||
| && git reset --hard 742fbe3259125fc182fba11f756fd0af4d87404f \ | ||
| && make DEBUG=ON sn-runtime -j | ||
|
|
||
| # === Optimized Package Installation === | ||
| # Split apt commands into logical, cacheable layers. | ||
|
|
@@ -74,7 +31,8 @@ RUN wget -O /etc/apt/keyrings/llvm-snapshot.gpg.key https://apt.llvm.org/llvm-sn | |
| # 3. Update package lists and install final packages. | ||
| # This is the layer that will most likely change. | ||
| # Using --no-install-recommends reduces bloat. | ||
| RUN apt-get -y update \ | ||
| RUN apt-add-repository ppa:deadsnakes/ppa \ | ||
| && apt-get -y update \ | ||
| && apt-get -y install --no-install-recommends \ | ||
| # python runtime dependencies | ||
| zlib1g \ | ||
|
|
@@ -92,16 +50,10 @@ RUN apt-get -y update \ | |
| # misc | ||
| make \ | ||
| git \ | ||
| python${PYTHON_VERSION}-dev \ | ||
| # 4. Clean up in the SAME RUN command to reduce final image size. | ||
| && rm -rf /var/lib/apt/lists/* /var/tmp/* /tmp/* | ||
|
|
||
| # Install uv and Python in a single layer, and ensure uv is in PATH | ||
| RUN wget -qO- https://astral.sh/uv/install.sh | sh \ | ||
| && ln -s /root/.local/bin/uv /usr/local/bin/uv \ | ||
| && /root/.local/bin/uv python install | ||
|
|
||
| COPY docker/entrypoint.sh /entrypoint.sh | ||
| # Ensure the entrypoint is executable | ||
| RUN chmod +x /entrypoint.sh | ||
|
|
||
| ENTRYPOINT ["/entrypoint.sh"] | ||
| COPY requirements.txt ./requirements.txt | ||
| COPY xdsl ./xdsl | ||
colluca marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| RUN . ${VIRTUAL_ENV}/bin/activate && pip install -r ./requirements.txt | ||
superlopuh marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,4 +3,4 @@ pandas | |
| seaborn | ||
| numpy | ||
| snakemake==8.14.0 | ||
| -e /src/xdsl | ||
| -e xdsl | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.