-
Notifications
You must be signed in to change notification settings - Fork 279
[ci] Organizing TheRock build_linux_packages
#782
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 13 commits
e77ba12
5f4b85d
36dec84
dd3ad68
1ce5b42
6412545
53b66f6
6fbbc6d
95a275e
1745543
b5d340d
af11297
868ac3d
19f168b
bdeed2e
612c14a
394824d
acad16d
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,52 @@ | ||
| name: "Artifact Upload" | ||
|
|
||
| inputs: | ||
| build_directory: | ||
| type: string | ||
| amdgpu_families: | ||
| type: string | ||
|
|
||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - name: Configure AWS Credentials | ||
| if: always() | ||
| uses: aws-actions/configure-aws-credentials@ececac1a45f3b08a01d2dd070d28d111c5fe6722 # v4.1.0 | ||
| with: | ||
| aws-region: us-east-2 | ||
| role-to-assume: arn:aws:iam::692859939525:role/therock-artifacts | ||
|
|
||
| - name: Create Logs index Files | ||
| shell: bash | ||
| if: always() | ||
| run: | | ||
| python3 build_tools/github_actions/create_log_index.py \ | ||
| --build-dir=${{ inputs.build_directory }} \ | ||
| --amdgpu-family=${{ inputs.amdgpu_families }} | ||
|
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. (Not in this PR, but relating to the positioning of this as a composite workflow) This should be moved to server-side |
||
|
|
||
| - name: Upload artifacts | ||
| shell: bash | ||
| if: always() | ||
| run: | | ||
| python build_tools/github_actions/upload_build_artifacts.py \ | ||
| --run-id ${{ github.run_id }} \ | ||
| --amdgpu-family ${{ inputs.amdgpu_families }} \ | ||
| --build-dir ${{ inputs.build_directory }} | ||
|
|
||
| - name: Upload Logs | ||
| shell: bash | ||
| if: always() | ||
| run: | | ||
| python3 build_tools/github_actions/upload_build_logs_to_s3.py \ | ||
| --build-dir=${{ inputs.build_directory }} \ | ||
| --run-id ${{ github.run_id }} \ | ||
| --amdgpu-family ${{ inputs.amdgpu_families }} | ||
|
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. (Not in this PR, but relating to the positioning of this as a composite workflow) This should be moved to teatime.py: #648 |
||
|
|
||
| - name: Add Links to Job Summary | ||
| shell: bash | ||
| if: always() | ||
| run: | | ||
| python build_tools/github_actions/upload_build_summary.py \ | ||
| --run-id ${{ github.run_id }} \ | ||
| --amdgpu-family ${{ inputs.amdgpu_families }} \ | ||
| --build-dir ${{ inputs.build_directory }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| name: "Build Linux Package Action" | ||
|
|
||
| inputs: | ||
| package_version: | ||
| type: string | ||
| amdgpu_families: | ||
| type: string | ||
| extra_cmake_options: | ||
| type: string | ||
|
|
||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - name: Fetch sources | ||
| shell: bash | ||
| run: | | ||
| ./build_tools/fetch_sources.py --jobs 12 | ||
|
|
||
| - name: Install python deps | ||
| shell: bash | ||
| run: | | ||
| pip install -r requirements.txt | ||
|
|
||
| - name: Configure Projects | ||
| shell: bash | ||
| run: | | ||
| # Generate a new build id. | ||
| package_version="${{ inputs.package_version }}" | ||
| extra_cmake_options="${{ inputs.extra_cmake_options }}" | ||
| echo "Building package ${package_version}" | ||
|
|
||
| # Build. | ||
| cmake -B build -GNinja . \ | ||
| -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ | ||
| -DTHEROCK_AMDGPU_FAMILIES=${{env.AMDGPU_FAMILIES}} \ | ||
| -DTHEROCK_PACKAGE_VERSION="${package_version}" \ | ||
| -DTHEROCK_VERBOSE=ON \ | ||
| -DBUILD_TESTING=ON \ | ||
| ${extra_cmake_options} | ||
|
|
||
| - name: Build therock-dist | ||
| shell: bash | ||
| run: cmake --build build --target therock-dist | ||
|
|
||
| - name: Build therock-archives | ||
| shell: bash | ||
| run: cmake --build build --target therock-archives | ||
|
|
||
| - name: Test Packaging | ||
| shell: bash | ||
| if: ${{ github.event.repository.name == 'TheRock' }} | ||
| run: | | ||
| ctest --test-dir build --output-on-failure | ||
|
|
||
| - name: Report | ||
| shell: bash | ||
| if: ${{ !cancelled() }} | ||
| run: | | ||
| echo "Full SDK du:" | ||
| echo "------------" | ||
| du -h -d 1 build/dist/rocm | ||
| echo "Artifact Archives:" | ||
| echo "------------------" | ||
| ls -lh build/artifacts/*.tar.xz | ||
| echo "Artifacts:" | ||
| echo "----------" | ||
| du -h -d 1 build/artifacts | ||
| echo "CCache Stats:" | ||
| echo "-------------" | ||
| ccache -s | ||
|
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. (Not in this PR, but relating to the positioning of this as a composite workflow) This should be moved to a script - we can run a "check environment before building" script for #762 and a "check environment after building" script here |
||
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 have some conflicting feelings about adding this and
build_linux_actionas composite actions. My original suggestion was to extract the repository setup into an action and not the building.Pros:
Cons:
I'm happy to unblock the monorepo testing work, so I can put aside some of the concerns. We can remove code from these files as they move to scripts or get more naturally integrated into the build system, then eventually maybe move back into inlined workflow steps to get back the benefits of having fine-grained logging and timing.
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 was going to follow your initial suggestion, but it felt weird to include checkout steps for
rocm-librarieswhenTheRocknever even uses it. For me, it felt better to keepbuild_linux_packagesas a reusable workflow.I agree that it does bunch it up :( so this makes debugging a bit more difficult
In that case, I'll actually move these to scripts (s3 artifact upload practically does this), so it can be reusable, better visibility in steps and easily implemented
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.
Honestly... the more I am working on this, I think it may be best to just re-create this yml file inside of
rocm-libraries, and the only new custom step would be checking outrocm-libraries.But, this is still good organization and cleanup, so I will keep this PR
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.
Yeah, it's good to explore the convince ourselves that the direction makes sense. This is also highlighting some of the areas that should be streamlined regardless of which repository the code is running from (or running locally).