Skip to content

Commit

Permalink
Update outdated dockerfile and add to CI (#372)
Browse files Browse the repository at this point in the history
* update dockerfile

* add docker to ci

* fix docker build dot

* add libszstd
  • Loading branch information
edg-l authored Dec 12, 2023
1 parent 4ac6bb1 commit 2e774cd
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 20 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,30 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
files: lcov.info
fail_ci_if_error: true

dockerfile:
name: dockerfile (linux, amd64)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: check and free hdd space left
run: |
echo "Listing 20 largest packages"
dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -n | tail -n 20
df -h
sudo apt-get update
sudo apt-get remove -y '^llvm-.*'
sudo apt-get remove -y 'php.*'
sudo apt-get remove -y '^dotnet-.*'
sudo apt-get remove -y '^temurin-.*'
sudo apt-get remove -y azure-cli google-cloud-cli microsoft-edge-stable google-chrome-stable firefox powershell mono-devel
sudo apt-get autoremove -y
sudo apt-get clean
df -h
echo "Removing large directories"
# deleting 15GB
sudo rm -rf /usr/share/dotnet/
sudo rm -rf /usr/local/lib/android
df -h
- name: build image
run: docker build .
36 changes: 16 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,29 @@ RUN apt update -y && apt install -y lsb-release \
git \
build-essential \
libclang-dev \
libz-dev
libz-dev \
libzstd-dev

# Install LLVM 16
RUN echo "deb http://apt.llvm.org/bookworm/ llvm-toolchain-bookworm-16 main" > /etc/apt/sources.list.d/llvm-16.list
RUN echo "deb-src http://apt.llvm.org/bookworm/ llvm-toolchain-bookworm-16 main" >> /etc/apt/sources.list.d/llvm-16.list
# Install LLVM 17
RUN echo "deb http://apt.llvm.org/bookworm/ llvm-toolchain-bookworm-17 main" > /etc/apt/sources.list.d/llvm-17.list
RUN echo "deb-src http://apt.llvm.org/bookworm/ llvm-toolchain-bookworm-17 main" >> /etc/apt/sources.list.d/llvm-17.list
RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
RUN apt update -y && apt install -y llvm-16 \
libmlir-16-dev \
mlir-16-tools \
libpolly-16-dev
RUN apt update -y && apt install -y llvm-17 \
libmlir-17-dev \
mlir-17-tools \
libpolly-17-dev

# Install rust nightly-2023-06-19 (1.72.0-nightly)
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y --default-toolchain=nightly-2023-07-29
# Install rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"

# Copy cairo_native code
COPY . /cairo_native/

# Fetch cairo corelibs
RUN git clone --depth 1 \
--branch v2.1.0 \
https://github.com/starkware-libs/cairo.git \
starkware-cairo
RUN cp -r starkware-cairo/corelib /cairo_native
RUN rm -rf starkware-cairo/

# Compile cairo_native
WORKDIR /cairo_native/
ENV MLIR_SYS_160_PREFIX=/usr/lib/llvm-16
RUN cargo +nightly-2023-07-29 build --release --all-features --locked
ENV MLIR_SYS_170_PREFIX=/usr/lib/llvm-17
ENV LLVM_SYS_170_PREFIX=/usr/lib/llvm-17
ENV TABLEGEN_170_PREFIX=/usr/lib/llvm-17
RUN make deps
RUN make build

0 comments on commit 2e774cd

Please sign in to comment.