Skip to content

Commit

Permalink
wip: docker container for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lukamac committed Dec 17, 2024
1 parent 246b8da commit 7ce0973
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 1 deletion.
34 changes: 34 additions & 0 deletions test/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
########## Stage 1: Large image to build toolchains and emulator ##########
FROM ubuntu:22.04 AS builder

RUN DEBIAN_FRONTEND=noninteractive \
apt-get update && \
apt-get upgrade && \
apt-get install -y --no-install-recommends \
bzip2 \
ca-certificates \
cmake \
curl \
gcc \
git \
git-lfs \
g++ \
make \
python3 \
python3-pip \
python-is-python3 \
zlib1g-dev \
&& apt-get clean && \
rm -rf /var/lib/apt/lists/*

COPY requirements-pip.txt requirements-pulp-sdk.txt ./
RUN pip3 install --no-cache-dir -r requirements-pip.txt -r requirements-pulp-sdk.txt --extra-index-url https://download.pytorch.org/whl/cpu

ENV PULP_SDK_HOME="/pulp-sdk"
ENV PULP_RISCV_GCC_TOOLCHAIN="/toolchains/pulp-riscv-gnu-toolchain"

COPY docker/get_pulp_riscv_gnu_toolchain.sh ./
RUN ./get_pulp_riscv_gnu_toolchain.sh

COPY docker/get_pulp_sdk.sh ./
RUN ./get_pulp_sdk.sh
9 changes: 9 additions & 0 deletions test/docker/get_pulp_riscv_gnu_toolchain.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

set -euo pipefail

curl -L https://github.com/pulp-platform/pulp-riscv-gnu-toolchain/releases/download/v1.0.16/v1.0.16-pulp-riscv-gcc-ubuntu-18.tar.bz2 > pulp-riscv-gnu-toolchain.tar.bz2
mkdir toolchains
tar -xvjf ./pulp-riscv-gnu-toolchain.tar.bz2 -C ./toolchains
mv ./toolchains/v1.0.16-pulp-riscv-gcc-ubuntu-18 ./toolchains/pulp-riscv-gnu-toolchain
rm ./pulp-riscv-gnu-toolchain.tar.bz2
10 changes: 10 additions & 0 deletions test/docker/get_pulp_sdk.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

set -eo pipefail

git clone https://github.com/Scheremo/pulp-sdk.git --branch scheremo --depth=1 && rm -rf pulp-sdk/.git

cd pulp-sdk

source configs/siracusa.sh
make all
2 changes: 1 addition & 1 deletion test/requirements.txt → test/requirements-conda.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
numpy
numpy==1.26.4
pydantic
pytest
pytorch==1.11.0
Expand Down
6 changes: 6 additions & 0 deletions test/requirements-pip.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
numpy==1.26.4
pydantic
pytest
torch==1.11.0
toml
ninja
4 changes: 4 additions & 0 deletions test/requirements-pulp-sdk.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
argcomplete
pyelftools
scons
six

0 comments on commit 7ce0973

Please sign in to comment.