From 69eb514dfed828d0a4ef89d410f9866c73891026 Mon Sep 17 00:00:00 2001 From: Vladimir Milosevic Date: Tue, 10 Sep 2024 06:32:42 +0000 Subject: [PATCH] Stable SLO source --- .github/Dockerfile.ci | 3 +- .github/workflows/build-image.yml | 95 ++++++++++++++++--------------- env/CMakeLists.txt | 9 ++- 3 files changed, 54 insertions(+), 53 deletions(-) diff --git a/.github/Dockerfile.ci b/.github/Dockerfile.ci index d96206b29..9380da77a 100644 --- a/.github/Dockerfile.ci +++ b/.github/Dockerfile.ci @@ -21,7 +21,8 @@ RUN git clone https://github.com/tenstorrent/$PROJECT_NAME.git $BUILD_DIR/$PROJE # Build the toolchain WORKDIR $BUILD_DIR/$PROJECT_NAME -RUN cmake -B env/build env && \ +RUN source env/activate && \ + cmake -B env/build env && \ cmake --build env/build # Self-test diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index b5719a5af..37b54ae21 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -3,6 +3,7 @@ name: Build and Publish Docker Image on: workflow_dispatch: workflow_call: + push: jobs: build: @@ -83,50 +84,50 @@ jobs: tags: | ${{ env.IRD_IMAGE_NAME}}:${{ github.sha }} - # Tag images as latest - - - name: Build and push base Docker image - uses: docker/build-push-action@v6 - with: - context: .github - file: .github/Dockerfile.base - push: true - build-args: | - GIT_SHA=${{ github.sha }} - tags: | - ${{ env.BASE_IMAGE_NAME}}:latest - - - name: Build and push base IRD Docker image - uses: docker/build-push-action@v6 - with: - context: .github - file: .github/Dockerfile.ird - push: true - build-args: | - GIT_SHA=${{ github.sha }} - FROM_IMAGE=base - tags: | - ${{ env.BASE_IRD_IMAGE_NAME}}:latest - - - name: Build and push CI Docker image - uses: docker/build-push-action@v6 - with: - context: .github - file: .github/Dockerfile.ci - push: true - build-args: | - GIT_SHA=${{ github.sha }} - tags: | - ${{ env.CI_IMAGE_NAME}}:latest - - - name: Build and push IRD Docker image - uses: docker/build-push-action@v6 - with: - context: .github - file: .github/Dockerfile.ird - push: true - build-args: | - GIT_SHA=${{ github.sha }} - FROM_IMAGE=ci - tags: | - ${{ env.IRD_IMAGE_NAME}}:latest + # # Tag images as latest + + # - name: Build and push base Docker image + # uses: docker/build-push-action@v6 + # with: + # context: .github + # file: .github/Dockerfile.base + # push: true + # build-args: | + # GIT_SHA=${{ github.sha }} + # tags: | + # ${{ env.BASE_IMAGE_NAME}}:latest + + # - name: Build and push base IRD Docker image + # uses: docker/build-push-action@v6 + # with: + # context: .github + # file: .github/Dockerfile.ird + # push: true + # build-args: | + # GIT_SHA=${{ github.sha }} + # FROM_IMAGE=base + # tags: | + # ${{ env.BASE_IRD_IMAGE_NAME}}:latest + + # - name: Build and push CI Docker image + # uses: docker/build-push-action@v6 + # with: + # context: .github + # file: .github/Dockerfile.ci + # push: true + # build-args: | + # GIT_SHA=${{ github.sha }} + # tags: | + # ${{ env.CI_IMAGE_NAME}}:latest + + # - name: Build and push IRD Docker image + # uses: docker/build-push-action@v6 + # with: + # context: .github + # file: .github/Dockerfile.ird + # push: true + # build-args: | + # GIT_SHA=${{ github.sha }} + # FROM_IMAGE=ci + # tags: | + # ${{ env.IRD_IMAGE_NAME}}:latest diff --git a/env/CMakeLists.txt b/env/CMakeLists.txt index 72dc18ddd..8ff43cea1 100644 --- a/env/CMakeLists.txt +++ b/env/CMakeLists.txt @@ -21,7 +21,6 @@ add_custom_target(python-venv ALL COMMAND TTMLIR_TOOLCHAIN=${TTMLIR_TOOLCHAIN_DI ExternalProject_Add( flatbuffers - PREFIX ${TTMLIR_TOOLCHAIN_DIR} CMAKE_GENERATOR Ninja CMAKE_ARGS -DCMAKE_BUILD_TYPE=Release @@ -36,15 +35,15 @@ ExternalProject_Add( # -DMLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS=ON set if debug ExternalProject_Add( llvm-project - PREFIX ${TTMLIR_TOOLCHAIN_DIR} # Super hacky way to install the python dependencies before the build - PATCH_COMMAND bash -c "source ${CMAKE_CURRENT_SOURCE_DIR}/activate && pip install -r ${TTMLIR_TOOLCHAIN_DIR}/src/llvm-project/mlir/python/requirements.txt" + PATCH_COMMAND bash -c "source ${CMAKE_CURRENT_SOURCE_DIR}/activate && pip install -r mlir/python/requirements.txt" CMAKE_GENERATOR Ninja CMAKE_ARGS -DPython3_FIND_VIRTUALENV=ONLY -DPython3_EXECUTABLE=${TTMLIR_TOOLCHAIN_DIR}/venv/bin/python -DCMAKE_INSTALL_PREFIX=${TTMLIR_TOOLCHAIN_DIR} - -DLLVM_ENABLE_PROJECTS=mlir + # Projects: bolt;clang;clang-tools-extra;compiler-rt;cross-project-tests;libc;libclc;lld;lldb;mlir;openmp;polly;pstl;flang + -DLLVM_ENABLE_PROJECTS=mlir;clang;clang-tools-extra -DLLVM_INSTALL_UTILS=ON # Build shared libraries # ====================== @@ -77,4 +76,4 @@ ExternalProject_Add(stablehlo INSTALL_COMMAND "" ) -add_custom_target(llvm-lit ALL COMMAND cp ${TTMLIR_TOOLCHAIN_DIR}/src/llvm-project-build/bin/llvm-lit ${TTMLIR_TOOLCHAIN_DIR}/bin/llvm-lit DEPENDS llvm-project) +add_custom_target(llvm-lit ALL COMMAND cp llvm-project-prefix/src/llvm-project-build/bin/llvm-lit ${TTMLIR_TOOLCHAIN_DIR}/bin/llvm-lit DEPENDS llvm-project)