Skip to content

Commit

Permalink
all the bananas
Browse files Browse the repository at this point in the history
  • Loading branch information
steveri committed Sep 24, 2023
1 parent 73575bd commit adbdbc1
Showing 1 changed file with 87 additions and 91 deletions.
178 changes: 87 additions & 91 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -64,37 +64,31 @@ RUN apt-get update && \
# Switch shell to bash
SHELL ["/bin/bash", "--login", "-c"]


# FIXME What?? How is it that we are only just now setting up venv?
# FIXME Where did pono/coreir/lake etc. install???
# Install AHA and AHA Tools
RUN printf -- "--- TIME %s %s\n" `date +%H:%M` tools
# Install top-level AHA and AHA Tools
# Seems like this should happen *first*, no?
RUN printf -- "--- TIME %s SPACE %s %s\n" `date +%H:%M` `du -hs|cut -f 1` tools
COPY . /aha
WORKDIR /aha
RUN python -m venv .

# If I'm right, this should force a new build from here down, when aha branch changes
RUN git branch && git log | head -1


# # Pono
# RUN printf -- "--- TIME %s %s\n" `date +%H:%M` pono
# COPY ./pono /aha/pono
# COPY ./aha/bin/setup-smt-switch.sh /aha/pono/contrib/
# WORKDIR /aha/pono
# RUN pip install Cython==0.29 pytest toml scikit-build==0.13.0
# RUN ./contrib/setup-bison.sh && ./contrib/setup-flex.sh && ./contrib/setup-smt-switch.sh --python && ./contrib/setup-btor2tools.sh
# RUN ./configure.sh --python
# WORKDIR /aha/pono/build
# RUN make -j4 && pip install -e ./python
# # Clean up because pono build leaves 2G intermediate files in "dep" subdir
# WORKDIR /aha/pono
# # RUN git clean -ffxdq
# # Dang whaat? Need pono/build/python later, see "pip install -e pono/build/python" below :(
# RUN /bin/rm -rf build/tests/ build/CMakefiles/ CMakeTmp/
# Pono
RUN printf -- "--- TIME %s SPACE %s %s\n" `date +%H:%M` `du -hs|cut -f 1` pono
COPY ./pono /aha/pono
COPY ./aha/bin/setup-smt-switch.sh /aha/pono/contrib/
WORKDIR /aha/pono
RUN pip install Cython==0.29 pytest toml scikit-build==0.13.0
RUN ./contrib/setup-bison.sh && ./contrib/setup-flex.sh && ./contrib/setup-smt-switch.sh --python && ./contrib/setup-btor2tools.sh
RUN ./configure.sh --python
WORKDIR /aha/pono/build
RUN make -j4 && pip install -e ./python
WORKDIR /aha/pono
# Clean up. Need build/lib and build/python later (WHY???)
# Need pono/build/python later, see "pip install -e pono/build/python" below :(
RUN /bin/rm -rf build/tests/ build/CMakefiles/ CMakeTmp/

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

RUN du -hs /aha/coreir || echo no coreir
Expand Down Expand Up @@ -124,86 +118,88 @@ RUN /bin/rm -rf build/bin
RUN du -hs /aha/coreir
RUN du -hs /aha/coreir/build

# # Lake
# RUN printf -- "--- TIME %s %s\n" `date +%H:%M` lake
# COPY ./BufferMapping /aha/BufferMapping
# WORKDIR /aha/BufferMapping/cfunc
# RUN export COREIR_DIR=/aha/coreir && make lib
#
# # mflowgen
# ENV GARNET_HOME=/aha/garnet
# ENV MFLOWGEN=/aha/mflowgen
#
# # clockwork
# RUN printf -- "--- TIME %s %s\n" `date +%H:%M` clockwork
# COPY clockwork /aha/clockwork
# WORKDIR /aha/clockwork
# ENV COREIR_PATH=/aha/coreir
# ENV LAKE_PATH=/aha/lake
# RUN ./misc/install_deps_ahaflow.sh && \
# source user_settings/aha_settings.sh && \
# make all -j4 && \
# source misc/copy_cgralib.sh && \
# rm -rf ntl*
# # Clean up because clockwork build leaves 1.5G intermediate files in "dep" subdir
# WORKDIR /aha/clockwork
# # Okay who knew maybe h2h needs contents of e.g. clockwork/lib
# # RUN git clean -ffxdq
# RUN du -hs /aha/clockwork
# RUN /bin/rm -rf barvinok-0.41/ bin/soda_codes/
# RUN du -hs /aha/clockwork
#
# # Halide-to-Hardware
# RUN printf -- "--- TIME %s %s\n" `date +%H:%M` 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 %s\n" `date +%H:%M` 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 %s\n" `date +%H:%M` torch
# WORKDIR /aha
# RUN mkdir -p /aha/tmp/torch_install/
# # Save (and later restore) existing value for TMPDIR, if any
# ENV TMPTMPDIR=$TMPDIR
# ENV TMPDIR=/aha/tmp/torch_install/
# RUN source /aha/bin/activate && pip install --cache-dir=$TMPDIR --build=$TMPDIR torch==1.7.1+cpu -f https://download.pytorch.org/whl/torch_stable.html
# RUN rm -rf $TMPDIR
# ENV TMPDIR=$TMPTMPDIR
#
# WORKDIR /aha
# RUN printf -- "--- TIME %s %s\n" `date +%H:%M` 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 && \
# pip install wheel six && \
# pip install systemrdl-compiler peakrdl-html && \
# pip install -e . && pip install packaging==21.3 && \
# pip install -e ./pono/deps/smt-switch/build/python && \
# pip install -e pono/build/python/ && \
# aha deps install
# Lake
RUN printf -- "--- TIME %s SPACE %s %s\n" `date +%H:%M` `du -hs|cut -f 1` lake
COPY ./BufferMapping /aha/BufferMapping
WORKDIR /aha/BufferMapping/cfunc
RUN export COREIR_DIR=/aha/coreir && make lib

# mflowgen
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
COPY clockwork /aha/clockwork
WORKDIR /aha/clockwork
ENV COREIR_PATH=/aha/coreir
ENV LAKE_PATH=/aha/lake
RUN ./misc/install_deps_ahaflow.sh && \
source user_settings/aha_settings.sh && \
make all -j4 && \
source misc/copy_cgralib.sh && \
rm -rf ntl*
# Clean up because clockwork build leaves 1.5G intermediate files in "dep" subdir
WORKDIR /aha/clockwork
# Okay who knew maybe h2h needs contents of e.g. clockwork/lib
# RUN git clean -ffxdq
RUN du -hs /aha/clockwork
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
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
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
WORKDIR /aha
RUN mkdir -p /aha/tmp/torch_install/
# Save (and later restore) existing value for TMPDIR, if any
ENV TMPTMPDIR=$TMPDIR
ENV TMPDIR=/aha/tmp/torch_install/
RUN source /aha/bin/activate && pip install --cache-dir=$TMPDIR --build=$TMPDIR torch==1.7.1+cpu -f https://download.pytorch.org/whl/torch_stable.html
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
# 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 && \
pip install wheel six && \
pip install systemrdl-compiler peakrdl-html && \
pip install -e . && pip install packaging==21.3 && \
pip install -e ./pono/deps/smt-switch/build/python && \
pip install -e pono/build/python/ && \
aha deps install

WORKDIR /aha

ENV OA_UNSUPPORTED_PLAT=linux_rhel60
ENV USER=docker

RUN printf -- "--- TIME %s %s\n" `date +%H:%M` bashrc
RUN printf -- "--- TIME %s SPACE %s %s\n" `date +%H:%M` `du -hs|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 %s\n" `date +%H:%M` deinit
# RUN printf -- "--- TIME %s SPACE %s %s\n" `date +%H:%M` `du -hs|cut -f 1` deinit
# WORKDIR /aha
# RUN git submodule deinit -f --all

RUN printf -- "+++ TIME %s %s\n" `date +%H:%M` end
RUN printf -- "+++ TIME %s SPACE %s %s\n" `date +%H:%M` `du -hs|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

# LATER: delete pono/build, coreir/build etc.?

0 comments on commit adbdbc1

Please sign in to comment.