mirror of
https://github.com/zama-ai/tfhe-rs.git
synced 2026-01-09 14:47:56 -05:00
130 lines
4.3 KiB
YAML
130 lines
4.3 KiB
YAML
# Publish new release of tfhe-cuda-backend on crates.io.
|
|
name: Publish CUDA release
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
dry_run:
|
|
description: "Dry-run"
|
|
type: boolean
|
|
default: true
|
|
push_to_crates:
|
|
description: "Push to crate"
|
|
type: boolean
|
|
default: true
|
|
|
|
env:
|
|
ACTION_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
|
SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }}
|
|
SLACK_ICON: https://pbs.twimg.com/profile_images/1274014582265298945/OjBKP9kn_400x400.png
|
|
SLACK_USERNAME: ${{ secrets.BOT_USERNAME }}
|
|
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
|
|
|
|
jobs:
|
|
setup-instance:
|
|
name: Setup instance (publish-cuda-release)
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
runner-name: ${{ steps.start-instance.outputs.label }}
|
|
steps:
|
|
- name: Start instance
|
|
id: start-instance
|
|
uses: zama-ai/slab-github-runner@1dced74825027fe3d481392163ed8fc56813fb5d
|
|
with:
|
|
mode: start
|
|
github-token: ${{ secrets.SLAB_ACTION_TOKEN }}
|
|
slab-url: ${{ secrets.SLAB_BASE_URL }}
|
|
job-secret: ${{ secrets.JOB_SECRET }}
|
|
backend: aws
|
|
profile: gpu-test
|
|
|
|
publish-cuda-release:
|
|
name: Publish CUDA Release
|
|
needs: setup-instance
|
|
runs-on: ${{ needs.setup-instance.outputs.runner-name }}
|
|
strategy:
|
|
fail-fast: false
|
|
# explicit include-based build matrix, of known valid options
|
|
matrix:
|
|
include:
|
|
- os: ubuntu-22.04
|
|
cuda: "12.2"
|
|
gcc: 9
|
|
env:
|
|
CUDA_PATH: /usr/local/cuda-${{ matrix.cuda }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Set up home
|
|
run: |
|
|
echo "HOME=/home/ubuntu" >> "${GITHUB_ENV}"
|
|
|
|
- name: Install latest stable
|
|
uses: dtolnay/rust-toolchain@d8352f6b1d2e870bc5716e7a6d9b65c4cc244a1a
|
|
with:
|
|
toolchain: stable
|
|
|
|
- name: Export CUDA variables
|
|
if: ${{ !cancelled() }}
|
|
run: |
|
|
echo "$CUDA_PATH/bin" >> "${GITHUB_PATH}"
|
|
{
|
|
echo "CUDA_PATH=$CUDA_PATH";
|
|
echo "LD_LIBRARY_PATH=$CUDA_PATH/lib:$LD_LIBRARY_PATH";
|
|
echo "CUDACXX=/usr/local/cuda-${{ matrix.cuda }}/bin/nvcc";
|
|
} >> "${GITHUB_ENV}"
|
|
|
|
# Specify the correct host compilers
|
|
- name: Export gcc and g++ variables
|
|
if: ${{ !cancelled() }}
|
|
run: |
|
|
{
|
|
echo "CC=/usr/bin/gcc-${{ matrix.gcc }}";
|
|
echo "CXX=/usr/bin/g++-${{ matrix.gcc }}";
|
|
echo "CUDAHOSTCXX=/usr/bin/g++-${{ matrix.gcc }}";
|
|
echo "HOME=/home/ubuntu";
|
|
} >> "${GITHUB_ENV}"
|
|
|
|
- name: Publish crate.io package
|
|
if: ${{ inputs.push_to_crates }}
|
|
env:
|
|
CRATES_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
|
DRY_RUN: ${{ inputs.dry_run && '--dry-run' || '' }}
|
|
run: |
|
|
cargo publish -p tfhe-cuda-backend --token ${{ env.CRATES_TOKEN }} ${{ env.DRY_RUN }}
|
|
|
|
- name: Slack Notification
|
|
if: ${{ failure() }}
|
|
continue-on-error: true
|
|
uses: rtCamp/action-slack-notify@4e5fb42d249be6a45a298f3c9543b111b02f7907
|
|
env:
|
|
SLACK_COLOR: ${{ job.status }}
|
|
SLACK_MESSAGE: "tfhe-cuda-backend release finished with status: ${{ job.status }}. (${{ env.ACTION_RUN_URL }})"
|
|
|
|
teardown-instance:
|
|
name: Teardown instance (publish-release)
|
|
if: ${{ always() && needs.setup-instance.result != 'skipped' }}
|
|
needs: [ setup-instance, publish-cuda-release ]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Stop instance
|
|
id: stop-instance
|
|
uses: zama-ai/slab-github-runner@1dced74825027fe3d481392163ed8fc56813fb5d
|
|
with:
|
|
mode: stop
|
|
github-token: ${{ secrets.SLAB_ACTION_TOKEN }}
|
|
slab-url: ${{ secrets.SLAB_BASE_URL }}
|
|
job-secret: ${{ secrets.JOB_SECRET }}
|
|
label: ${{ needs.setup-instance.outputs.runner-name }}
|
|
|
|
- name: Slack Notification
|
|
if: ${{ failure() }}
|
|
continue-on-error: true
|
|
uses: rtCamp/action-slack-notify@4e5fb42d249be6a45a298f3c9543b111b02f7907
|
|
env:
|
|
SLACK_COLOR: ${{ job.status }}
|
|
SLACK_MESSAGE: "Instance teardown (publish-cuda-release) finished with status: ${{ job.status }}. (${{ env.ACTION_RUN_URL }})"
|