Skip to content

Commit

Permalink
better space tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
steveri committed Sep 24, 2023
1 parent adbdbc1 commit ef82e0d
Showing 1 changed file with 11 additions and 24 deletions.
35 changes: 11 additions & 24 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ RUN python -m venv .
RUN git branch && git log | head -1

# Pono
RUN printf -- "--- TIME %s SPACE %s %s\n" `date +%H:%M` `du -hs|cut -f 1` pono
RUN printf -- "--- TIME %s SPACE %s %s\n" `date +%H:%M` `du -hs /aha|cut -f 1` pono
COPY ./pono /aha/pono
COPY ./aha/bin/setup-smt-switch.sh /aha/pono/contrib/
WORKDIR /aha/pono
Expand All @@ -88,14 +88,9 @@ WORKDIR /aha/pono
RUN /bin/rm -rf build/tests/ build/CMakefiles/ CMakeTmp/

# CoreIR
RUN printf -- "--- TIME %s SPACE %s %s\n" `date +%H:%M` `du -hs|cut -f 1` CoreIR
RUN printf -- "--- TIME %s SPACE %s %s\n" `date +%H:%M` `du -hs /aha|cut -f 1` CoreIR
WORKDIR /aha

RUN du -hs /aha/coreir || echo no coreir
RUN du -hs /aha/clockwork || echo no clockwork



COPY ./coreir /aha/coreir
WORKDIR /aha/coreir/build
RUN cmake .. && make && make install
Expand All @@ -110,16 +105,8 @@ WORKDIR /aha/coreir
# I guess we need build/lib (51M) but hopefully not src (111M) or tests (59M) or maybe even bin (51M)
# FIXME/TODO could probably delete coreir/build/lib and replace with a symlink to coreir/lib? To save 34M.

RUN du -hs /aha/coreir
RUN du -hs /aha/coreir/build
RUN /bin/rm -rf build/src
RUN /bin/rm -rf build/tests
RUN /bin/rm -rf build/bin
RUN du -hs /aha/coreir
RUN du -hs /aha/coreir/build

# Lake
RUN printf -- "--- TIME %s SPACE %s %s\n" `date +%H:%M` `du -hs|cut -f 1` lake
RUN printf -- "--- TIME %s SPACE %s %s\n" `date +%H:%M` `du -hs /aha|cut -f 1` lake
COPY ./BufferMapping /aha/BufferMapping
WORKDIR /aha/BufferMapping/cfunc
RUN export COREIR_DIR=/aha/coreir && make lib
Expand All @@ -129,7 +116,7 @@ ENV GARNET_HOME=/aha/garnet
ENV MFLOWGEN=/aha/mflowgen

# clockwork
RUN printf -- "--- TIME %s SPACE %s %s\n" `date +%H:%M` `du -hs|cut -f 1` clockwork
RUN printf -- "--- TIME %s SPACE %s %s\n" `date +%H:%M` `du -hs /aha|cut -f 1` clockwork
COPY clockwork /aha/clockwork
WORKDIR /aha/clockwork
ENV COREIR_PATH=/aha/coreir
Expand All @@ -148,20 +135,20 @@ RUN /bin/rm -rf barvinok-0.41/ bin/soda_codes/
RUN du -hs /aha/clockwork

# Halide-to-Hardware
RUN printf -- "--- TIME %s SPACE %s %s\n" `date +%H:%M` `du -hs|cut -f 1` H2H
RUN printf -- "--- TIME %s SPACE %s %s\n" `date +%H:%M` `du -hs /aha|cut -f 1` H2H
COPY ./Halide-to-Hardware /aha/Halide-to-Hardware
WORKDIR /aha/Halide-to-Hardware
RUN export COREIR_DIR=/aha/coreir && make -j2 && make distrib && \
rm -rf lib/*

# Sam
RUN printf -- "--- TIME %s SPACE %s %s\n" `date +%H:%M` `du -hs|cut -f 1` sam
RUN printf -- "--- TIME %s SPACE %s %s\n" `date +%H:%M` `du -hs /aha|cut -f 1` sam
WORKDIR /aha/sam
RUN make sam
RUN source /aha/bin/activate && pip install scipy numpy pytest && pip install -e .

# Install torch (need big tmp folder)
RUN printf -- "--- TIME %s SPACE %s %s\n" `date +%H:%M` `du -hs|cut -f 1` torch
RUN printf -- "--- TIME %s SPACE %s %s\n" `date +%H:%M` `du -hs /aha|cut -f 1` torch
WORKDIR /aha
RUN mkdir -p /aha/tmp/torch_install/
# Save (and later restore) existing value for TMPDIR, if any
Expand All @@ -172,7 +159,7 @@ RUN rm -rf $TMPDIR
ENV TMPDIR=$TMPTMPDIR

WORKDIR /aha
RUN printf -- "--- TIME %s SPACE %s %s\n" `date +%H:%M` `du -hs|cut -f 1` misc
RUN printf -- "--- TIME %s SPACE %s %s\n" `date +%H:%M` `du -hs /aha|cut -f 1` misc
# FIXME/TODO why not install pono/build/python earlier, i.e. just after pono setup?
RUN source bin/activate && \
pip install urllib3==1.26.15 && \
Expand All @@ -188,16 +175,16 @@ WORKDIR /aha
ENV OA_UNSUPPORTED_PLAT=linux_rhel60
ENV USER=docker

RUN printf -- "--- TIME %s SPACE %s %s\n" `date +%H:%M` `du -hs|cut -f 1` bashrc
RUN printf -- "--- TIME %s SPACE %s %s\n" `date +%H:%M` `du -hs /aha|cut -f 1` bashrc
RUN echo "source /aha/bin/activate" >> /root/.bashrc && \
echo "source /cad/modules/tcl/init/sh" >> /root/.bashrc

# Maybe don't need to deinit everything if we just clean up after ourselves
# RUN printf -- "--- TIME %s SPACE %s %s\n" `date +%H:%M` `du -hs|cut -f 1` deinit
# RUN printf -- "--- TIME %s SPACE %s %s\n" `date +%H:%M` `du -hs /aha|cut -f 1` deinit
# WORKDIR /aha
# RUN git submodule deinit -f --all

RUN printf -- "+++ TIME %s SPACE %s %s\n" `date +%H:%M` `du -hs|cut -f 1` end
RUN printf -- "+++ TIME %s SPACE %s %s\n" `date +%H:%M` `du -hs /aha|cut -f 1` end
RUN du -bhx --max-depth=1 / | grep G | sort -rn
RUN du -bhx --max-depth=1 /aha | grep G | sort -rn
RUN du -hs /aha/clockwork
Expand Down

0 comments on commit ef82e0d

Please sign in to comment.