-
Notifications
You must be signed in to change notification settings - Fork 7
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
[RFC + PR] Use TCP for {LLVM / Torch-MLIR / StableHLO} Green Commit Sync #11
Changes from all commits
e571818
947637a
d7cdc4a
550f141
ee4ef13
d837214
7a20a4b
ac4a48f
6282b9c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Licensed under the Apache License v2.0 with LLVM Exceptions. | ||
# See https://llvm.org/LICENSE.txt for license information. | ||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
# Also available under a BSD-style license. See LICENSE. | ||
|
||
third_party/ | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
# Licensed under the Apache License v2.0 with LLVM Exceptions. | ||
# See https://llvm.org/LICENSE.txt for license information. | ||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
# Also available under a BSD-style license. See LICENSE. | ||
|
||
name: Bazel Build and Test (llvm-project) | ||
|
||
# Only run when llvm-project hash changes (deps.bzl) | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- 'deps.bzl' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is so the workflow is triggered only when change is made to |
||
push: | ||
branches: | ||
- main | ||
paths: | ||
- 'deps.bzl' | ||
workflow_dispatch: | ||
|
||
# Ensure that only a single job or workflow using the same | ||
# concurrency group will run at a time. This would cancel | ||
# any in-progress jobs in the same github workflow and github | ||
# ref (e.g. refs/heads/main or refs/pull/<pr_number>/merge). | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
|
||
jobs: | ||
ubuntu-build: | ||
name: ubuntu-x86_64 / llvm-project | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout mlir-tcp | ||
uses: actions/checkout@v3 | ||
|
||
# Continually update cache even if there's a "hit" during | ||
# restore to avoid the cache going stale over time | ||
# https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache | ||
- name: Setup cache for bazel | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.cache/bazel | ||
key: llvm-project-bazel-build-cache-${{ runner.os }}-${{ github.sha }} | ||
restore-keys: | | ||
llvm-project-bazel-build-cache-${{ runner.os }} | ||
|
||
# Change bazel cache directory to root ownership | ||
# to allow writing to it from within the docker container. | ||
# If no cache hits, this directory is not present | ||
# so don't run chown (will error otherwise). | ||
- name: Set bazel cache permissions | ||
run: | | ||
if [ -d "${HOME}/.cache/bazel" ]; then | ||
sudo chown -R root:root "${HOME}/.cache/bazel" | ||
fi | ||
|
||
- name: Build docker image | ||
run: | | ||
docker build -f docker/Dockerfile \ | ||
-t mlir-tcp:ci \ | ||
. | ||
|
||
- name: Bazel build and test llvm-project | ||
run: | | ||
docker run --rm \ | ||
-v "$(pwd)":"/opt/src/mlir-tcp" \ | ||
-v "${HOME}/.cache/bazel":"/root/.cache/bazel" \ | ||
mlir-tcp:ci \ | ||
bazel test --config=clang_linux @llvm-project//mlir/... | ||
|
||
# Switch back bazel cache directory to user ownership | ||
# to allow GHA post-cache step to save cache without | ||
# permissions issue. | ||
- name: Switch bazel cache permissions | ||
run: | | ||
if [ -d "${HOME}/.cache/bazel" ]; then | ||
sudo chown -R "$USER":"$USER" "${HOME}/.cache/bazel" | ||
fi |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
# Licensed under the Apache License v2.0 with LLVM Exceptions. | ||
# See https://llvm.org/LICENSE.txt for license information. | ||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
# Also available under a BSD-style license. See LICENSE. | ||
|
||
name: Bazel Build and Test (stablehlo) | ||
|
||
# Only run when stablehlo hash changes (deps.bzl) | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- 'deps.bzl' | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- 'deps.bzl' | ||
workflow_dispatch: | ||
|
||
# Ensure that only a single job or workflow using the same | ||
# concurrency group will run at a time. This would cancel | ||
# any in-progress jobs in the same github workflow and github | ||
# ref (e.g. refs/heads/main or refs/pull/<pr_number>/merge). | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
|
||
jobs: | ||
ubuntu-build: | ||
name: ubuntu-x86_64 / stablehlo | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout mlir-tcp | ||
uses: actions/checkout@v3 | ||
|
||
# Continually update cache even if there's a "hit" during | ||
# restore to avoid the cache going stale over time | ||
# https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache | ||
- name: Setup cache for bazel | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.cache/bazel | ||
key: stablehlo-bazel-build-cache-${{ runner.os }}-${{ github.sha }} | ||
restore-keys: | | ||
stablehlo-bazel-build-cache-${{ runner.os }} | ||
|
||
# Change bazel cache directory to root ownership | ||
# to allow writing to it from within the docker container. | ||
# If no cache hits, this directory is not present | ||
# so don't run chown (will error otherwise). | ||
- name: Set bazel cache permissions | ||
run: | | ||
if [ -d "${HOME}/.cache/bazel" ]; then | ||
sudo chown -R root:root "${HOME}/.cache/bazel" | ||
fi | ||
|
||
- name: Build docker image | ||
run: | | ||
docker build -f docker/Dockerfile \ | ||
-t mlir-tcp:ci \ | ||
. | ||
|
||
- name: Bazel build and test stablehlo | ||
run: | | ||
docker run --rm \ | ||
-v "$(pwd)":"/opt/src/mlir-tcp" \ | ||
-v "${HOME}/.cache/bazel":"/root/.cache/bazel" \ | ||
mlir-tcp:ci \ | ||
bazel test --config=clang_linux @stablehlo//... | ||
|
||
# Switch back bazel cache directory to user ownership | ||
# to allow GHA post-cache step to save cache without | ||
# permissions issue. | ||
- name: Switch bazel cache permissions | ||
run: | | ||
if [ -d "${HOME}/.cache/bazel" ]; then | ||
sudo chown -R "$USER":"$USER" "${HOME}/.cache/bazel" | ||
fi |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,13 +3,15 @@ | |
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
# Also available under a BSD-style license. See LICENSE. | ||
|
||
name: Bazel Build and Test | ||
name: Bazel Build and Test (mlir-tcp) | ||
|
||
on: | ||
pull_request: | ||
branches: [ main ] | ||
branches: | ||
- main | ||
push: | ||
branches: [ main ] | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
# Ensure that only a single job or workflow using the same | ||
|
@@ -23,7 +25,7 @@ concurrency: | |
|
||
jobs: | ||
ubuntu-build: | ||
name: ubuntu-x86_64 | ||
name: ubuntu-x86_64 / mlir-tcp | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the name change allows selectively making certain workflows merge gating |
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
@@ -32,7 +34,7 @@ jobs: | |
|
||
# Continually update cache even if there's a "hit" during | ||
# restore to avoid the cache going stale over time | ||
# https://github.com/actions/cache/blob/main/workarounds.md#update-a-cache | ||
# https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache | ||
- name: Setup cache for bazel | ||
uses: actions/cache@v3 | ||
with: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
# Licensed under the Apache License v2.0 with LLVM Exceptions. | ||
# See https://llvm.org/LICENSE.txt for license information. | ||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
# Also available under a BSD-style license. See LICENSE. | ||
|
||
name: Bazel Build and Test (torch-mlir) | ||
|
||
# Only run when torch-mlir hash changes (deps.bzl) | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- 'deps.bzl' | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- 'deps.bzl' | ||
workflow_dispatch: | ||
|
||
# Ensure that only a single job or workflow using the same | ||
# concurrency group will run at a time. This would cancel | ||
# any in-progress jobs in the same github workflow and github | ||
# ref (e.g. refs/heads/main or refs/pull/<pr_number>/merge). | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
|
||
jobs: | ||
ubuntu-build: | ||
name: ubuntu-x86_64 / torch-mlir | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout mlir-tcp | ||
uses: actions/checkout@v3 | ||
|
||
# Continually update cache even if there's a "hit" during | ||
# restore to avoid the cache going stale over time | ||
# https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache | ||
- name: Setup cache for bazel | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.cache/bazel | ||
key: torch-mlir-bazel-build-cache-${{ runner.os }}-${{ github.sha }} | ||
restore-keys: | | ||
torch-mlir-bazel-build-cache-${{ runner.os }} | ||
|
||
# Change bazel cache directory to root ownership | ||
# to allow writing to it from within the docker container. | ||
# If no cache hits, this directory is not present | ||
# so don't run chown (will error otherwise). | ||
- name: Set bazel cache permissions | ||
run: | | ||
if [ -d "${HOME}/.cache/bazel" ]; then | ||
sudo chown -R root:root "${HOME}/.cache/bazel" | ||
fi | ||
|
||
- name: Build docker image | ||
run: | | ||
docker build -f docker/Dockerfile \ | ||
-t mlir-tcp:ci \ | ||
. | ||
|
||
- name: Bazel build and test torch-mlir | ||
run: | | ||
docker run --rm \ | ||
-v "$(pwd)":"/opt/src/mlir-tcp" \ | ||
-v "${HOME}/.cache/bazel":"/root/.cache/bazel" \ | ||
mlir-tcp:ci \ | ||
bazel test --config=clang_linux @torch-mlir//... | ||
|
||
# Switch back bazel cache directory to user ownership | ||
# to allow GHA post-cache step to save cache without | ||
# permissions issue. | ||
- name: Switch bazel cache permissions | ||
run: | | ||
if [ -d "${HOME}/.cache/bazel" ]; then | ||
sudo chown -R "$USER":"$USER" "${HOME}/.cache/bazel" | ||
fi |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
/bazel-bin | ||
/bazel-out | ||
/bazel-mlir-tcp | ||
/bazel-testlogs | ||
# Licensed under the Apache License v2.0 with LLVM Exceptions. | ||
# See https://llvm.org/LICENSE.txt for license information. | ||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
# Also available under a BSD-style license. See LICENSE. | ||
|
||
bazel-bin | ||
bazel-out | ||
bazel-mlir-tcp | ||
bazel-testlogs | ||
third_party/ |
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.
this is where local repos may be cloned