Skip to content
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

[GHA] Update End-to-End Nightly Build Process #2304

Merged
merged 38 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
6e0bece
trigger nightly workflow
dsikka May 24, 2024
fe449b5
update condition
dsikka May 24, 2024
0072b06
update
dsikka May 24, 2024
8db5995
update condition
dsikka May 28, 2024
3cbc3a1
skip actual tests to speed up testing
dsikka May 28, 2024
5b2b0a7
try true conditions
dsikka May 28, 2024
a36775c
try agin
dsikka May 28, 2024
ebf78f8
try again
dsikka May 28, 2024
357117d
clean-up
dsikka May 28, 2024
dc86fd8
update condiitions
dsikka May 28, 2024
5c941bd
try again
dsikka May 28, 2024
6a78113
try again
dsikka May 28, 2024
0aa5e17
try fil case
dsikka May 28, 2024
930fc46
update
dsikka May 28, 2024
cc274f9
try new condition
dsikka May 28, 2024
c60e35d
try again
dsikka May 28, 2024
cc22961
try again
dsikka May 28, 2024
00b0b75
try again
dsikka May 28, 2024
a63ee25
revert
dsikka May 28, 2024
125ca84
try new conditions
dsikka May 28, 2024
116df5f
typo
dsikka May 28, 2024
af95b7f
try again
dsikka May 28, 2024
217b398
try dev workflow
dsikka May 28, 2024
6b39209
try again
dsikka May 28, 2024
e7506a1
update condition
dsikka May 28, 2024
761cb41
update
dsikka May 28, 2024
b2b4d2e
try again
dsikka May 28, 2024
d2ca854
test failure case
dsikka May 28, 2024
0b60a6d
update
dsikka May 28, 2024
221c589
try again
dsikka May 28, 2024
1b7eca5
update
dsikka May 28, 2024
440e3af
try nightly
dsikka May 28, 2024
23ffeae
add publish
dsikka May 28, 2024
bb7478c
Merge branch 'main' into update-nightly-build
dsikka May 29, 2024
bc5180e
Merge branch 'main' into update-nightly-build
dsikka May 29, 2024
8c95176
Merge branch 'main' into update-nightly-build
May 29, 2024
c9d85b5
Merge branch 'main' into update-nightly-build
May 29, 2024
31e808b
Merge branch 'main' into update-nightly-build
dsikka Jun 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .github/workflows/build-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,12 @@ jobs:
build-args: |
BRANCH=${{github.head_ref}}
push: true
tags: ghcr.io/neuralmagic/sparseml-dev:${{ inputs.name }}
tags: ghcr.io/neuralmagic/sparseml-dev:${{ inputs.name }}

- name: Build Nightly Docker Container
if: ${{ inputs.dev == 'false' && inputs.release == 'false'}}
uses: docker/build-push-action@v4
with:
context: ./docker/containers/docker_nightly
push: true
tags: ghcr.io/neuralmagic/sparseml-nightly:latest, ghcr.io/neuralmagic/sparseml-nightly:${{ steps.date.outputs.date }}
22 changes: 0 additions & 22 deletions .github/workflows/build-nightly.yml

This file was deleted.

39 changes: 20 additions & 19 deletions .github/workflows/build-wheel-and-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,8 @@ on:
types: [opened, synchronize, reopened]
branches:
- main
- 'release/[0-9]+.[0-9]+'
push:
branches:
- 'release/[0-9]+.[0-9]+'
- main
release:
types: [created, published]
schedule:
- cron: '0 0 * * *'
- cron: '0 20 * * *'

permissions:
id-token: write
Expand All @@ -23,10 +16,10 @@ concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

# if not dev or release, will create a nightly build
# TODO: do we want to push to nightly everytime we push to main?
# if not dev or release, will create a nightly build; turning off release for now
env:
PRODUCTION: ${{ github.event_name == 'schedule' || github.event_name == 'release'}}
RELEASE: ${{ github.event_name =='release' || startsWith(github.base_ref, 'release/') }}
RELEASE: 'false'
DEV: ${{ github.base_ref == 'main' && github.event_name == 'pull_request'}}

jobs:
Expand All @@ -42,8 +35,14 @@ jobs:
echo "dev=$DEV" >> $GITHUB_OUTPUT
echo "release=$RELEASE" >> $GITHUB_OUTPUT

build-wheel-and-push:
test-nightly:
needs: set-outputs
if: ${{ needs.set-outputs.outputs.dev == 'false' && needs.set-outputs.outputs.release == 'false'}}
uses: ./.github/workflows/test-nightly.yml

build-wheel-and-push:
needs: [set-outputs, test-nightly]
if: ${{ always() && needs.set-outputs.outputs.dev == 'false' && needs.test-nightly.result == 'success' || always() && needs.set-outputs.outputs.dev == 'true' && needs.set-outputs.result == 'success' }}
uses: ./.github/workflows/build-wheel.yml
with:
build-label: ubuntu-20.04
Expand All @@ -55,22 +54,24 @@ jobs:
python: '3.10'
secrets: inherit

test-wheel-and-push-internal:
needs: build-wheel-and-push
uses: ./.github/workflows/test-wheel-push-to-internal.yml
test-wheel-and-publish:
needs: [set-outputs, build-wheel-and-push]
if: ${{ always() && !cancelled() && needs.build-wheel-and-push.result == 'success' }}
uses: ./.github/workflows/test-wheel-and-publish.yml
with:
build-label: ubuntu-20.04
whl: ${{ needs.build-wheel-and-push.outputs.wheel }}
python: '3.10'
dev: ${{ needs.set-outputs.outputs.dev }}
release: ${{ needs.set-outputs.outputs.release }}
secrets: inherit

# TODO: add nightly and release container build steps once wheel build push
# to production is automated. Removed until then.
build-container-and-push:
needs: [set-outputs, test-wheel-and-push-internal]
needs: [test-wheel-and-publish, set-outputs]
if: ${{ always() && !cancelled() && needs.test-wheel-and-publish.result == 'success' }}
uses: ./.github/workflows/build-container.yml
with:
build-label: k8s-eng-gpu-64G-v100-32G
build-label: k8s-eng-gpu-16G-t4-32G
dev: ${{ needs.set-outputs.outputs.dev }}
release: ${{ needs.set-outputs.outputs.release }}
name: ${{ github.event.number }}
Expand Down
79 changes: 0 additions & 79 deletions .github/workflows/publish-nightly-docker-images.yaml

This file was deleted.

4 changes: 1 addition & 3 deletions .github/workflows/test-nightly.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: Run Nightly Tests
on:
schedule:
- cron: '0 20 * * *'
workflow_dispatch:
workflow_call:
jobs:
test-nightly-tests:
runs-on: k8s-mle-gpu-12-vcpu-225GB-ram-2-a6000-48G
Expand Down Expand Up @@ -33,6 +32,5 @@ jobs:
run: |
pytest tests/sparseml/transformers/obcq -m integration
dsikka marked this conversation as resolved.
Show resolved Hide resolved
- name: Run finetune tests
if: always()
run: |
pytest tests/sparseml/transformers/finetune -m integration
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test Wheel and Push to Internal PyPi
name: Test Wheel and Publish
on:
workflow_call:
inputs:
Expand All @@ -11,9 +11,15 @@ on:
required: true
python:
type: string
dev:
type: string
required: true
release:
type: string
required: true

jobs:
test-wheel-and-push-internal:
test-wheel-and-publish:
runs-on: ${{ inputs.build-label }}
steps:
- uses: actions/setup-python@v4
Expand All @@ -36,24 +42,37 @@ jobs:
filename: ${{ inputs.whl }}
dst: dist_s3

- name: Set Env
run: |
pip3 install virtualenv
virtualenv venv
source venv/bin/activate

- name: Fetch name of whl
run: |
echo "FILENAME=$(echo dist_s3/*.whl)" >> $GITHUB_ENV

- name: Install whl
run: |
pip3 install $FILENAME[dev]
pip3 install $FILENAME[dev,onnxruntime,torch,torchvision,transformers]

- name: Checkout code
uses: actions/checkout@v3

- name: Remove src files and run tests
run: |
pwd
rm -rf src
make test
make test

- name: Make directory for wheel
run: |
mkdir dist_s3

- name: Pull from s3
dsikka marked this conversation as resolved.
Show resolved Hide resolved
uses: neuralmagic/nm-actions/actions/s3_pull@main
with:
filename: ${{ inputs.whl }}
dst: dist_s3

- name: Publish Nightly Wheel
if: ${{ inputs.DEV == 'false' && inputs.RELEASE == 'false'}}
dsikka marked this conversation as resolved.
Show resolved Hide resolved
uses: neuralmagic/nm-actions/actions/publish-whl@main
with:
username: ${{ secrets.PYPI_PUBLIC_USER }}
password: ${{ secrets.PYPI_PUBLIC_AUTH }}
whl: ./$FILENAME
Loading