From a897c498036319735f1e718e0c285db75dfae1b3 Mon Sep 17 00:00:00 2001 From: Ashay Rane Date: Fri, 6 Jan 2023 20:41:43 -0600 Subject: [PATCH] CI: miscellaneous fixes for Release builds (#1781) - Use v3 of actions/checkout, since the version we use (v2) uses Node.js 12, which is deprecated by GitHub. - Source the PowerShell venv sctipt (instead of the bash sript) since the calling script is a PowerShell script. Without this, the build doesn't use venv at all. - Make the build dependencies in whl-requirements.txt (used by setup.py) match those in requirements.txt. To that end, this patch creates a build-requirements.txt that is referenced by requirements.txt and whl-requirements.txt. --- .github/workflows/buildRelease.yml | 6 +++--- build-requirements.txt | 12 ++++++++++++ build_tools/python_deploy/build_windows.ps1 | 2 +- requirements.txt | 15 +-------------- utils/bazel/docker/Dockerfile | 1 + whl-requirements.txt | 10 ++-------- 6 files changed, 20 insertions(+), 26 deletions(-) create mode 100644 build-requirements.txt diff --git a/.github/workflows/buildRelease.yml b/.github/workflows/buildRelease.yml index adaae2a81..9c8cc488b 100644 --- a/.github/workflows/buildRelease.yml +++ b/.github/workflows/buildRelease.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Get torch-mlir - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: 'true' - uses: ./.github/actions/setup-build @@ -72,7 +72,7 @@ jobs: runs-on: macos-latest steps: - name: Get torch-mlir - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: 'true' - uses: ./.github/actions/setup-build @@ -129,7 +129,7 @@ jobs: runs-on: windows-latest steps: - name: Get torch-mlir - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: 'true' - uses: ./.github/actions/setup-build diff --git a/build-requirements.txt b/build-requirements.txt new file mode 100644 index 000000000..16f7da636 --- /dev/null +++ b/build-requirements.txt @@ -0,0 +1,12 @@ +-r pytorch-requirements.txt + +numpy +pybind11 +wheel +setuptools +cmake +ninja + +# Workaround for what should be a torch dep +# See discussion in #1174 +pyyaml diff --git a/build_tools/python_deploy/build_windows.ps1 b/build_tools/python_deploy/build_windows.ps1 index e3372ee43..2c934ccf3 100644 --- a/build_tools/python_deploy/build_windows.ps1 +++ b/build_tools/python_deploy/build_windows.ps1 @@ -12,7 +12,7 @@ Write-Host "Installing Build Dependencies" python -m venv .\mlir_venv\ -.\mlir_venv\Scripts\activate +.\mlir_venv\Scripts\Activate.PS1 pip install -r .\requirements.txt Write-Host "Build Deps installation completed successfully" diff --git a/requirements.txt b/requirements.txt index 2e78b5958..01478ee1f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,17 +1,4 @@ --r pytorch-requirements.txt - -numpy - -# Build requirements. -pybind11 -wheel -setuptools -cmake -ninja - -# Workaround for what should be a torch dep -# See discussion in #1174 -pyyaml +-r build-requirements.txt # Test Requirements pillow diff --git a/utils/bazel/docker/Dockerfile b/utils/bazel/docker/Dockerfile index 07d86ba9c..2382b6100 100644 --- a/utils/bazel/docker/Dockerfile +++ b/utils/bazel/docker/Dockerfile @@ -28,6 +28,7 @@ RUN wget -q https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSIO # Install torch-mlir requirements COPY requirements.txt /opt/app/requirements.txt +COPY build-requirements.txt /opt/app/build-requirements.txt COPY pytorch-requirements.txt /opt/app/pytorch-requirements.txt WORKDIR /opt/app RUN python3 -m pip install --upgrade pip diff --git a/whl-requirements.txt b/whl-requirements.txt index 6ed0881f2..554744257 100644 --- a/whl-requirements.txt +++ b/whl-requirements.txt @@ -1,10 +1,4 @@ --f pytorch-requirements.txt +-f build-requirements.txt -setuptools>=42 -wheel -cmake==3.22.2 -ninja==1.10.2 +# Packaging requirements. packaging -pybind11>=2.6.0,!=2.7.0 -PyYAML -numpy