-
Notifications
You must be signed in to change notification settings - Fork 245
Adding monorepo configurations to TheRock #695
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
Changes from all commits
db87699
f01c932
fddb4a2
feca36e
cbce030
88ab67c
d54986f
674463f
f7f9159
7cbf754
1ff06d1
069ad9d
c313c55
2213900
41550b3
07a0d66
0c9cde9
3f14a23
d368ab9
a784c46
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 |
|---|---|---|
|
|
@@ -11,6 +11,8 @@ on: | |
| expect_failure: | ||
| type: boolean | ||
| default: false | ||
| extra_cmake_options: | ||
| type: string | ||
|
|
||
| workflow_call: | ||
| inputs: | ||
|
|
@@ -21,6 +23,8 @@ on: | |
| type: string | ||
| expect_failure: | ||
| type: boolean | ||
| extra_cmake_options: | ||
| type: string | ||
|
|
||
| # See the details regarding permissions from the link: | ||
| # https://github.com/aws-actions/configure-aws-credentials?tab=readme-ov-file#oidc | ||
|
|
@@ -44,9 +48,20 @@ jobs: | |
| CCACHE_MAXSIZE: "700M" | ||
| AMDGPU_FAMILIES: ${{ inputs.amdgpu_families }} | ||
| TEATIME_FORCE_INTERACTIVE: 0 | ||
| BUCKET: ${{ github.event.repository.name == 'TheRock' && 'therock-artifacts' || 'therock-artifacts-external' }} | ||
| steps: | ||
| - name: "Checking out repository" | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
| with: | ||
| repository: "ROCm/TheRock" | ||
|
|
||
| - name: "Checking out repository for rocm-libraries" | ||
| if: ${{ github.repository == 'ROCm/rocm-libraries' }} | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
| with: | ||
| repository: "ROCm/rocm-libraries" | ||
| ref: ${{ github.head_ref || github.ref_name }} | ||
| path: "rocm-libraries" | ||
|
|
||
| - name: Runner Health Settings | ||
| run: | | ||
|
|
@@ -85,6 +100,7 @@ jobs: | |
| run: | | ||
| # Generate a new build id. | ||
| package_version="${{ inputs.package_version }}" | ||
| extra_cmake_options="${{ inputs.extra_cmake_options }}" | ||
| echo "Building package ${package_version}" | ||
|
|
||
| # Build. | ||
|
|
@@ -93,10 +109,13 @@ jobs: | |
| -DTHEROCK_AMDGPU_FAMILIES=${{env.AMDGPU_FAMILIES}} \ | ||
| -DTHEROCK_PACKAGE_VERSION="${package_version}" \ | ||
| -DTHEROCK_VERBOSE=ON \ | ||
| -DBUILD_TESTING=ON | ||
| -DBUILD_TESTING=ON \ | ||
| ${extra_cmake_options} | ||
|
|
||
| cmake --build build --target therock-archives therock-dist | ||
|
|
||
| - name: Test Packaging | ||
| if: ${{ github.event.repository.name == 'TheRock' }} | ||
| run: | | ||
| ctest --test-dir build --output-on-failure | ||
|
|
||
|
|
@@ -145,28 +164,28 @@ jobs: | |
| # TODO: Move to script | ||
| - name: Upload Artifacts | ||
| run: | | ||
| aws s3 cp build/artifacts/ s3://therock-artifacts/${{github.run_id}}-linux/ \ | ||
| aws s3 cp build/artifacts/ s3://${{env.BUCKET}}/${{github.run_id}}-linux/ \ | ||
|
Contributor
Author
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. currently, for external repos (ex: rocm-libraries), this still uploads all to the dir After this PR, I plan to move this upload items into script in another PR and adding
Contributor
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. Thanks for the explanation - def a good thing we need to fix.
Member
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. Would
Contributor
Author
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. Correct! Although |
||
| --recursive --no-follow-symlinks \ | ||
| --exclude "*" \ | ||
| --include "*.tar.xz*" | ||
| aws s3 cp build/artifacts/index.html s3://therock-artifacts/${{github.run_id}}-linux/index-${{env.AMDGPU_FAMILIES}}.html | ||
| aws s3 cp build/artifacts/index.html s3://${{env.BUCKET}}/${{github.run_id}}-linux/index-${{env.AMDGPU_FAMILIES}}.html | ||
|
|
||
| - name: Upload Logs | ||
| if: always() | ||
| run: | | ||
| python3 build_tools/upload_logs_to_s3.py \ | ||
| --build-dir=build \ | ||
| --s3-base-path="s3://therock-artifacts/${{github.run_id}}-linux/logs/${{env.AMDGPU_FAMILIES}}" | ||
| --s3-base-path="s3://${{env.BUCKET}}/${{github.run_id}}-linux/logs/${{env.AMDGPU_FAMILIES}}" | ||
|
|
||
| - name: Add Links to Job Summary | ||
| if: always() | ||
| run: | | ||
| LOG_URL="https://therock-artifacts.s3.us-east-2.amazonaws.com/${{github.run_id}}-linux/logs/${{env.AMDGPU_FAMILIES}}/index.html" | ||
| LOG_URL="https://${{env.BUCKET}}.s3.us-east-2.amazonaws.com/${{github.run_id}}-linux/logs/${{env.AMDGPU_FAMILIES}}/index.html" | ||
| echo "[Build Logs](${LOG_URL})" >> $GITHUB_STEP_SUMMARY | ||
|
|
||
| ARTIFACT_INDEX=build/artifacts/index.html | ||
| if [ -f "${ARTIFACT_INDEX}" ]; then | ||
| ARTIFACT_URL="https://therock-artifacts.s3.us-east-2.amazonaws.com/${{github.run_id}}-linux/index-${{env.AMDGPU_FAMILIES}}.html" | ||
| ARTIFACT_URL="https://${{env.BUCKET}}.s3.us-east-2.amazonaws.com/${{github.run_id}}-linux/index-${{env.AMDGPU_FAMILIES}}.html" | ||
|
|
||
| echo "[Artifacts](${ARTIFACT_URL})" >> $GITHUB_STEP_SUMMARY | ||
| else | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| """ | ||
| This script determines which build flag and tests to run based on SUBTREES | ||
|
|
||
| Required environment variables: | ||
| - SUBTREES | ||
| """ | ||
|
|
||
| from configure_ci import set_github_output | ||
| import json | ||
| from monorepo_map import monorepo_map | ||
| import os | ||
|
|
||
| SUBTREES = os.getenv("SUBTREES", "") | ||
|
|
||
|
|
||
| def run(): | ||
| subtrees = SUBTREES.split("\n") | ||
| jobs = [] | ||
| for subtree in subtrees: | ||
| if subtree in monorepo_map: | ||
| jobs.append(monorepo_map.get(subtree)) | ||
| set_github_output({"jobs": json.dumps(jobs)}) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| run() |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| """ | ||
| This dictionary is used to map specific file directory changes to the corresponding build flag and tests | ||
| """ | ||
| monorepo_map = { | ||
| "projects/rocprim": { | ||
| "flag": "-DTHEROCK_ENABLE_PRIM=ON -DTHEROCK_ENABLE_ALL=OFF", | ||
| "test": "test_rocprim", | ||
| } | ||
| } |
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.
With view on more monorepos we might want to make this more flexible but also need take care of PRs from forks (either to one of the monorepos or TheRock). Maybe add a TODO note for now?
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.
I could actually make it
github.event.repository.name == TheRockin order to work with both forks + normal so I will do that!Uh oh!
There was an error while loading. Please reload this page.
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.
Happy if that works for all the potential use cases. I think we need to cover PRs
I am not familiar enough with GH's event API thus not saying that what you plan doesn't work :)
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.
That should work I expect.