docs: auto build the docs website #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SPDX-License-Identifier: Apache-2.0 | |
name: E2E (NVIDIA L4 x1) | |
on: | |
# run against every merge commit to 'main' and release branches | |
push: | |
branches: | |
- main | |
- release-* | |
# only run on PRs that touch certain regex paths | |
pull_request_target: | |
branches: | |
- main | |
- release-* | |
paths: | |
# note this should match the merging criteria in 'mergify.yml' | |
- '**.py' | |
- 'pyproject.toml' | |
- 'requirements**.txt' | |
- 'scripts/e2e-ci.sh' # Used by this workflow | |
- 'scripts/test-data/**' | |
- 'src/instructlab/profiles/**' | |
- '.github/workflows/e2e-nvidia-l4-x1.yml' # This workflow | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.number || github.ref }} | |
cancel-in-progress: true | |
env: | |
LC_ALL: en_US.UTF-8 | |
defaults: | |
run: | |
shell: bash | |
permissions: | |
contents: read | |
jobs: | |
e2e-medium-workflow-ready: | |
permissions: | |
checks: read | |
uses: ./.github/workflows/status-checks.yml | |
with: | |
job_ids: >- # Space-separated job ids to wait on for status checks | |
DCO | |
actionlint | |
markdown-lint | |
shellcheck | |
spellcheck | |
lint-workflow-complete | |
start-medium-ec2-runner: | |
needs: | |
- e2e-medium-workflow-ready | |
runs-on: ubuntu-latest | |
outputs: | |
label: ${{ steps.start-ec2-runner.outputs.label }} | |
ec2-instance-id: ${{ steps.start-ec2-runner.outputs.ec2-instance-id }} | |
steps: | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: ${{ vars.AWS_REGION }} | |
- name: Start EC2 runner | |
id: start-ec2-runner | |
uses: machulav/ec2-github-runner@fcfb31a5760dad1314a64a0e172b78ec6fc8a17e # v2.3.6 | |
with: | |
mode: start | |
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} | |
ec2-image-id: ${{ vars.AWS_EC2_AMI }} | |
ec2-instance-type: g6.8xlarge | |
subnet-id: subnet-02d230cffd9385bd4 | |
security-group-id: sg-06300447c4a5fbef3 | |
iam-role-name: instructlab-ci-runner | |
aws-resource-tags: > | |
[ | |
{"Key": "Name", "Value": "instructlab-ci-github-medium-runner"}, | |
{"Key": "GitHubRepository", "Value": "${{ github.repository }}"}, | |
{"Key": "GitHubRef", "Value": "${{ github.ref }}"}, | |
{"Key": "GitHubPR", "Value": "${{ github.event.number }}"} | |
] | |
e2e-medium-test: | |
needs: | |
- start-medium-ec2-runner | |
runs-on: ${{ needs.start-medium-ec2-runner.outputs.label }} | |
# It is important that this job has no write permissions and has | |
# no access to any secrets. This part (e2e-test) is where we are running | |
# untrusted code from PRs. | |
permissions: {} | |
steps: | |
- name: Install Packages | |
run: | | |
cat /etc/os-release | |
sudo dnf install -y gcc gcc-c++ make git python3.11 python3.11-devel | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
# https://github.com/actions/checkout/issues/249 | |
fetch-depth: 0 | |
- name: Fetch and checkout PR | |
if: ${{ github.event_name == 'pull_request_target' }} | |
run: | | |
git fetch origin pull/${{ github.event.number }}/head:pr-${{ github.event.number }} | |
git checkout pr-${{ github.event.number }} | |
- name: Install ilab | |
run: | | |
export CUDA_HOME="/usr/local/cuda" | |
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64" | |
export PATH="$PATH:$CUDA_HOME/bin" | |
python3.11 -m venv --upgrade-deps venv | |
. venv/bin/activate | |
nvidia-smi | |
python3.11 -m pip cache remove llama_cpp_python | |
CMAKE_ARGS="-DLLAMA_CUDA=on" python3.11 -m pip install -v . | |
# https://github.com/instructlab/instructlab/issues/1821 | |
# install with Torch and build dependencies installed | |
python3.11 -m pip install -v packaging wheel setuptools-scm | |
python3.11 -m pip install -v .[cuda] -r requirements-vllm-cuda.txt | |
- name: Check disk before tests | |
run: | | |
df -h | |
- name: Run e2e test | |
env: | |
HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
run: | | |
. venv/bin/activate | |
./scripts/e2e-ci.sh -m | |
- name: Check disk after tests | |
run: | | |
df -h | |
stop-medium-ec2-runner: | |
needs: | |
- start-medium-ec2-runner | |
- e2e-medium-test | |
runs-on: ubuntu-latest | |
if: ${{ always() }} | |
steps: | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: ${{ vars.AWS_REGION }} | |
- name: Stop EC2 runner | |
uses: machulav/ec2-github-runner@fcfb31a5760dad1314a64a0e172b78ec6fc8a17e # v2.3.6 | |
with: | |
mode: stop | |
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} | |
label: ${{ needs.start-medium-ec2-runner.outputs.label }} | |
ec2-instance-id: ${{ needs.start-medium-ec2-runner.outputs.ec2-instance-id }} | |
e2e-medium-workflow-complete: | |
# we don't want to block PRs on failed EC2 cleanup | |
# so not requiring "stop-medium-ec2-runner" as well | |
permissions: | |
checks: read | |
uses: ./.github/workflows/status-checks.yml | |
with: | |
job_ids: >- # Space-separated job ids to wait on for status checks | |
e2e-medium-workflow-ready | |
start-medium-ec2-runner | |
e2e-medium-test |