|
| 1 | +# This workflow will upload a Python Package to Release asset |
| 2 | +# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions |
| 3 | +# Copied from vLLM github actions https://github.com/vllm-project/vllm/blob/main/.github/workflows/publish.yml |
| 4 | +name: flexkv ci |
| 5 | + |
| 6 | +on: |
| 7 | + pull_request: |
| 8 | + branches: [ "main", "dev"] |
| 9 | + push: |
| 10 | + branches: [ "main", "dev"] |
| 11 | + |
| 12 | +# Needed to create wheel and upload assets |
| 13 | +permissions: |
| 14 | + contents: write |
| 15 | + |
| 16 | +jobs: |
| 17 | + build: |
| 18 | + name: Build Wheel |
| 19 | + runs-on: ${{ matrix.os }} |
| 20 | + |
| 21 | + strategy: |
| 22 | + fail-fast: false |
| 23 | + matrix: |
| 24 | + os: ['ubuntu-22.04'] |
| 25 | + python-version: ['3.10'] |
| 26 | + pytorch-version: ['2.6.0'] |
| 27 | + cuda-version: ['12.4'] |
| 28 | + |
| 29 | + steps: |
| 30 | + - name: Checkout |
| 31 | + uses: actions/checkout@v4 |
| 32 | + |
| 33 | + - name: Set up Linux Env |
| 34 | + if: ${{ runner.os == 'Linux' }} |
| 35 | + run: | |
| 36 | + bash -x .github/workflows/scripts/env.sh |
| 37 | +
|
| 38 | + - name: Set up Python |
| 39 | + uses: actions/setup-python@v5 |
| 40 | + with: |
| 41 | + python-version: ${{ matrix.python-version }} |
| 42 | + cache: 'pip' |
| 43 | + |
| 44 | + - name: Install CUDA ${{ matrix.cuda-version }} |
| 45 | + run: | |
| 46 | + bash -x .github/workflows/scripts/cuda-install.sh ${{ matrix.cuda-version }} ${{ matrix.os }} |
| 47 | +
|
| 48 | + - name: Install PyTorch ${{ matrix.pytorch-version }} with CUDA ${{ matrix.cuda-version }} |
| 49 | + run: | |
| 50 | + bash -x .github/workflows/scripts/pytorch-install.sh ${{ matrix.python-version }} ${{ matrix.pytorch-version }} ${{ matrix.cuda-version }} |
| 51 | +
|
| 52 | + - name: Build wheel |
| 53 | + shell: bash |
| 54 | + env: |
| 55 | + TORCH_CUDA_ARCH_LIST: "8.9 9.0+PTX" |
| 56 | + MAX_JOBS: 4 |
| 57 | + run: | |
| 58 | + ./build.sh --release |
| 59 | +
|
| 60 | + - name: Get Date and Time |
| 61 | + run: | |
| 62 | + echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_ENV |
| 63 | + echo "time=$(date +'%H-%M-%S')" >> $GITHUB_ENV |
| 64 | +
|
| 65 | + - name: Upload to cos |
| 66 | + uses: shallwefootball/s3-upload-action@master |
| 67 | + with: |
| 68 | + aws_key_id: ${{ secrets.COS_SECRET_ID }} |
| 69 | + aws_secret_access_key: ${{ secrets.COS_SECRET_KEY }} |
| 70 | + aws_bucket: ${{ secrets.COS_BUCKET }} |
| 71 | + endpoint: ${{ secrets.COS_ENDPOINT }} |
| 72 | + source_dir: dist |
| 73 | + destination_dir: flexkv/${{ env.date }}/${{ env.time }} |
0 commit comments