-
Notifications
You must be signed in to change notification settings - Fork 5
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
Adding GitHub Pipeline for TT-Forge #54
Merged
Merged
Changes from 12 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
7f856ab
Build docker image
vmilosevic 6b1dc5d
Adding build workflow
vmilosevic d51abba
Add output workdir
vmilosevic b049f16
Build image on self hosted
vmilosevic 49c5084
Print user
vmilosevic 8f41eec
Run docker build
vmilosevic 2d72d4f
Mount device and volumes to docker
vmilosevic b8c8538
Fix docker options
vmilosevic 5388672
Move ttmlir env build to forge env build
vmilosevic 37139c5
Only run specified test
vmilosevic ec0106d
Run basic tests
vmilosevic 800a8ba
Skip failing test
vmilosevic 95b3ea7
Renamed test report
vmilosevic 1c051ab
Revert cmake change
vmilosevic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
FROM ubuntu:22.04 | ||
SHELL ["/bin/bash", "-c"] | ||
|
||
# Set environment variables | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
ENV TTMLIR_TOOLCHAIN_DIR=/opt/ttmlir-toolchain | ||
ENV TTFORGE_TOOLCHAIN_DIR=/opt/ttforge-toolchain | ||
ENV PROJECT_NAME=tt-forge | ||
ARG GITHUB_TOKEN | ||
|
||
# Install dependencies | ||
RUN apt-get update && apt-get install -y \ | ||
software-properties-common \ | ||
build-essential \ | ||
python3-dev \ | ||
python3-venv \ | ||
python3-pip \ | ||
git \ | ||
git-lfs \ | ||
libhwloc-dev \ | ||
pandoc \ | ||
libtbb-dev \ | ||
libcapstone-dev \ | ||
pkg-config \ | ||
linux-tools-generic \ | ||
ninja-build \ | ||
wget \ | ||
cmake \ | ||
ccache \ | ||
doxygen \ | ||
libgtest-dev \ | ||
libgmock-dev \ | ||
graphviz \ | ||
patchelf \ | ||
libyaml-cpp-dev \ | ||
libboost-all-dev | ||
|
||
# Install clang 17 | ||
RUN wget https://apt.llvm.org/llvm.sh && \ | ||
chmod u+x llvm.sh && \ | ||
./llvm.sh 17 && \ | ||
apt install -y libc++-17-dev libc++abi-17-dev && \ | ||
ln -s /usr/bin/clang-17 /usr/bin/clang && \ | ||
ln -s /usr/bin/clang++-17 /usr/bin/clang++ | ||
|
||
# Install python packages | ||
RUN pip install cmake \ | ||
pytest | ||
|
||
# Create a directory for the build and toolchain | ||
ARG BUILD_DIR=/home/build | ||
RUN mkdir -p $BUILD_DIR && \ | ||
mkdir -p $TTMLIR_TOOLCHAIN_DIR && \ | ||
mkdir -p $TTFORGE_TOOLCHAIN_DIR | ||
|
||
# Clone the project and update submodules | ||
# Pass in PAT to clone private repositories | ||
RUN git clone https://[email protected]/tenstorrent/tt-forge.git $BUILD_DIR/$PROJECT_NAME && \ | ||
cd $BUILD_DIR/$PROJECT_NAME && \ | ||
git submodule update --init --recursive -f | ||
|
||
# Build the toolchain | ||
WORKDIR $BUILD_DIR/$PROJECT_NAME | ||
RUN source env/activate && \ | ||
cmake -B env/build env && \ | ||
cmake --build env/build | ||
|
||
# Build project to test the container | ||
RUN source env/activate && \ | ||
cmake -G Ninja -B build . && \ | ||
cmake --build build | ||
|
||
# Clean up the build directory | ||
RUN cd .. && \ | ||
rm -rf $BUILD_DIR/$PROJECT_NAME && \ | ||
unset GITHUB_TOKEN |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Build and Publish Docker Image | ||
|
||
on: | ||
workflow_dispatch: | ||
workflow_call: | ||
|
||
jobs: | ||
build: | ||
runs-on: self-hosted # Github runners dont have enough storage space to build this image | ||
|
||
steps: | ||
|
||
- run: | | ||
echo Pwd: $(pwd) | ||
echo User: $(whoami) | ||
ls -la /home/ubuntu/actions-runner/_work/tt-forge/tt-forge | ||
shell: bash | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
sparse-checkout: | | ||
.github/Dockerfile | ||
sparse-checkout-cone-mode: false | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Log in to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: .github | ||
file: .github/Dockerfile | ||
push: true | ||
tags: | | ||
ghcr.io/${{ github.repository }}/tt-forge-ubuntu-22-04:${{ github.sha }} | ||
ghcr.io/${{ github.repository }}/tt-forge-ubuntu-22-04:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: Build in Docker | ||
|
||
on: | ||
workflow_dispatch: | ||
workflow_call: | ||
|
||
jobs: | ||
|
||
build-and-test: | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
build: | ||
- runs-on: self-hosted | ||
|
||
runs-on: ${{ matrix.build.runs-on }} | ||
|
||
container: | ||
image: ghcr.io/${{ github.repository }}/tt-forge-ubuntu-22-04:latest | ||
options: --user root --device /dev/tenstorrent/0 | ||
volumes: | ||
- /dev/hugepages:/dev/hugepages | ||
- /dev/hugepages-1G:/dev/hugepages-1G | ||
- /etc/udev/rules.d:/etc/udev/rules.d | ||
- /lib/modules:/lib/modules | ||
- /opt/tt_metal_infra/provisioning/provisioning_env:/opt/tt_metal_infra/provisioning/provisioning_env | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
fetch-depth: 0 # Fetch all history and tags | ||
|
||
- name: Set reusable strings | ||
id: strings | ||
shell: bash | ||
run: | | ||
echo "work-dir=$(pwd)" >> "$GITHUB_OUTPUT" | ||
echo "build-output-dir=$(pwd)/build" >> "$GITHUB_OUTPUT" | ||
|
||
- name: Git safe dir | ||
run: git config --global --add safe.directory ${{ steps.strings.outputs.work-dir }} | ||
|
||
- name: ccache | ||
uses: hendrikmuhs/[email protected] | ||
with: | ||
create-symlink: true | ||
key: ${{ matrix.build.runs-on }}-runtime-${{ matrix.build.enable_runtime }}-${{ env.SDK_VERSION }} | ||
|
||
- name: Build | ||
shell: bash | ||
run: | | ||
source env/activate | ||
cmake -G Ninja -B build . | ||
cmake --build build | ||
|
||
- name: Run Test | ||
shell: bash | ||
run: | | ||
source env/activate | ||
pytest | ||
continue-on-error: true | ||
|
||
- name: Upload Test Report | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: test-reports-${{ matrix.build.runs-on }} | ||
path: reports/report.xml | ||
|
||
- name: Show Test Report | ||
uses: mikepenz/action-junit-report@v4 | ||
if: success() || failure() | ||
with: | ||
report_paths: reports/report.xml | ||
check_name: MLIR Tests | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
name: On PR | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
docker-build: | ||
uses: ./.github/workflows/docker-build.yml | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
name: On push | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
docker-build: | ||
uses: ./.github/workflows/docker-build.yml | ||
secrets: inherit |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TT-Forge Tests
orTT-Forge E2E Tests
...