Skip to content
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

#7944 add dockerfile and installation steps #7949

Merged
merged 3 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -181,3 +181,6 @@ tests/python_api_testing/conv/ @tt-nshanker
tests/python_api_testing/unit_testing/fallback_ops @tt-aho
scripts/profiler/ @mo-tenstorrent
scripts/install @tapspatel
scripts/docker @ttmchiou @TT-billteng @tt-rkim

dockerfile @ttmchiou @TT-billteng @tt-rkim
40 changes: 40 additions & 0 deletions dockerfile/ubuntu-20.04-x86.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Second stage: the actual image
FROM ubuntu:20.04

ARG DEBIAN_FRONTEND=noninteractive
ENV GTEST_VERSION=1.13.0
ENV DOXYGEN_VERSION=1.9.6

# Install build and runtime deps
COPY /scripts/docker/requirements.txt /opt/tt_metal_infra/scripts/docker/requirements.txt
RUN apt-get -y update \
&& xargs -a /opt/tt_metal_infra/scripts/docker/requirements.txt apt-get install -y --no-install-recommends \
&& rm -rf /var/lib/apt/lists/*

# Install dev deps
COPY /scripts/docker/requirements_dev.txt /opt/tt_metal_infra/scripts/docker/requirements_dev.txt
RUN apt-get -y update \
&& xargs -a /opt/tt_metal_infra/scripts/docker/requirements_dev.txt apt-get install -y --no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why delete this cache? IS it for something later?

Copy link
Contributor Author

@ttmchiou ttmchiou May 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keeps the docker layer smaller.


## Test Related Dependencies
COPY /scripts/docker/install_test_deps.sh /opt/tt_metal_infra/scripts/docker/install_test_deps.sh
RUN /bin/bash /opt/tt_metal_infra/scripts/docker/install_test_deps.sh ${GTEST_VERSION} ${DOXYGEN_VERSION}

# Copy remaining convenience scripts
COPY /scripts /opt/tt_metal_infra/scripts
COPY build_metal.sh /scripts/build_metal.sh

# ENV TT_METAL_INFRA_DIR=/opt/tt_metal_infra
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we delete this extra commented stuff?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be for future work in including Virtual Env in Docker. This will be integrated but just disabled for future reference

# ENV PYTHON_ENV_DIR=${TT_METAL_INFRA_DIR}/tt-metal/python_env
# RUN python3 -m venv $PYTHON_ENV_DIR

# COPY /docs/requirements-docs.txt ${TT_METAL_INFRA_DIR}/tt-metal/docs/.
# COPY /tt_metal/python_env/* ${TT_METAL_INFRA_DIR}/tt-metal/tt_metal/python_env/.
# ENV PATH="$PYTHON_ENV_DIR/bin:$PATH"
# RUN python3 -m pip config set global.extra-index-url https://download.pytorch.org/whl/cpu \
# && python3 -m pip install setuptools wheel

# RUN python3 -m pip install -r ${TT_METAL_INFRA_DIR}/tt-metal/tt_metal/python_env/requirements-dev.txt

CMD ["tail", "-f", "/dev/null"]
28 changes: 28 additions & 0 deletions scripts/docker/install_test_deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

# Check if two arguments are provided
if [ "$#" -ne 2 ]; then
echo "Usage: $0 <gtest_version> <doxygen_version>"
exit 1
fi

GTEST_VERSION=$1
DOXYGEN_VERSION=$2

# Installs Google test
mkdir -p /opt/tt_metal_infra/googletest
chmod ugo+w /opt/tt_metal_infra/googletest
wget -O /opt/tt_metal_infra/googletest/googletest-release-${GTEST_VERSION}.tar.gz https://github.com/google/googletest/archive/refs/tags/v${GTEST_VERSION}.tar.gz
tar -xzf /opt/tt_metal_infra/googletest/googletest-release-${GTEST_VERSION}.tar.gz -C /opt/tt_metal_infra/googletest/
cd /opt/tt_metal_infra/googletest/googletest-${GTEST_VERSION}
cmake -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_SHARED_LIBS=ON .
make
make install

# Install doxygen
mkdir -p /opt/tt_metal_infra/doxygen
wget -O /opt/tt_metal_infra/doxygen/doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz "https://www.doxygen.nl/files/doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz"
tar -xzf /opt/tt_metal_infra/doxygen/doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz -C /opt/tt_metal_infra/doxygen/
rm /opt/tt_metal_infra/doxygen/doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz
cd /opt/tt_metal_infra/doxygen/doxygen-${DOXYGEN_VERSION}
make install
27 changes: 27 additions & 0 deletions scripts/docker/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apt-utils
dialog
software-properties-common=0.99.9.12
build-essential=12.8ubuntu1.1
libgoogle-glog-dev=0.4.0-1build1
libyaml-cpp-dev=0.6.2-4ubuntu1
git
git-lfs
clang-6.0=1:6.0.1-14
libboost-all-dev=1.71.0.0ubuntu2
libsndfile1=1.0.28-7ubuntu0.2
pandoc
libtbb-dev
libcapstone-dev
pkg-config
cmake=3.16.3-1ubuntu1.20.04.1
curl
wget
python3-pip
libhwloc-dev

libhdf5-serial-dev
ruby=1:2.7+1
python3.8-venv=3.8.10-0ubuntu1~20.04.9

cargo
ninja-build
6 changes: 6 additions & 0 deletions scripts/docker/requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
sudo
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Damn sudo is a requirement?

Also, can we add vim?

Copy link
Contributor Author

@ttmchiou ttmchiou May 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added vim to requirements

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now I know why vim was in my docker container LOL!

nano
acl
jq
openssh-server
vim
Loading