-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'mainline' into jack/issue-206
- Loading branch information
Showing
33 changed files
with
3,262 additions
and
95 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# When setting up a new runner AMI, paste these commands in to install the necessary software | ||
# Then create an AMI from your instance | ||
|
||
# Install and enable docker | ||
sudo apt-get remove docker docker-engine docker.io containerd runc | ||
sudo apt-get update | ||
sudo apt-get install ca-certificates curl gnupg lsb-release | ||
sudo mkdir -p /etc/apt/keyrings | ||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg | ||
|
||
echo \ | ||
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ | ||
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null | ||
sudo apt-get update | ||
|
||
sudo chmod a+r /etc/apt/keyrings/docker.gpg | ||
sudo apt-get update | ||
|
||
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin | ||
|
||
sudo systemctl enable docker.service | ||
sudo systemctl enable containerd.service | ||
|
||
# Install git | ||
sudo apt-get install git | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# When setting up a new runner AMI, paste these commands in to install the necessary software | ||
# Then create an AMI from your instance | ||
|
||
# Run the AMD setup commands first | ||
# Then these: | ||
|
||
sudo apt-get update | ||
distribution=$(. /etc/os-release;echo $ID$VERSION_ID) && curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg && curl -s -L https://nvidia.github.io/libnvidia-container/$distribution/libnvidia-container.list | sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list | ||
sudo apt-get install -y nvidia-docker2 | ||
|
||
# Check if drivers are properly installed with nvidia-smi | ||
nvidia-smi | ||
|
||
# If GPU not find, try installing drivers | ||
sudo apt install nvidia-utils-520 | ||
sudo apt install nvidia-driver-515 nvidia-dkms-515 | ||
sudo reboot |
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
name: unit_test_200gb_CI | ||
# runs unit tests on AMD64 machine | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
mainline | ||
paths-ignore: | ||
- '**.md' | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
Start-Runner: | ||
name: Start self-hosted EC2 runner | ||
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@v1 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: ${{ secrets.AWS_REGION }} | ||
- name: Start EC2 runner | ||
id: start-ec2-runner | ||
uses: machulav/ec2-github-runner@v2 | ||
with: | ||
mode: start | ||
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} | ||
ec2-image-id: ${{ secrets.AMD_200GB_EC2_IMAGE_ID }} | ||
ec2-instance-type: t3.xlarge | ||
subnet-id: ${{ secrets.AMD_SUBNET_ID }} | ||
security-group-id: ${{ secrets.AMD_SECURITY_GROUP_ID }} | ||
|
||
Test-Marqo: | ||
name: Run Marqo Test Suite | ||
needs: Start-Runner # required to start the main job when the runner is ready | ||
runs-on: ${{ needs.start-runner.outputs.label }} # run the job on the newly created runner | ||
|
||
environment: marqo-test-suite | ||
|
||
steps: | ||
|
||
- name: Checkout marqo repo | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: "3.8" | ||
cache: "pip" | ||
|
||
- name: Install Dependencies | ||
run: | | ||
#pip install -r requirements.txt | ||
pip install tox==3.26 | ||
pip install flake8 | ||
# TODO: Figure out how to make linting work on self-hosted runner | ||
# usual error: $HOME not set | ||
#- name: Get Changed Directories | ||
# id: changed-dir | ||
# uses: tj-actions/changed-files@v29.0.1 | ||
# with: | ||
# dir_names: true | ||
# run: | | ||
# export HOME=$pwd | ||
|
||
#- name: Lint Changed Directories with flake8 | ||
# run: | | ||
# for dir in ${{ steps.changed-dir.outputs.all_changed_files }}; do | ||
# echo "$dir was changed" | ||
# stop the build if there are Python syntax errors or undefined names | ||
# flake8 $dir --count --select=E9,F63,F7,F82 --show-source --statistics --filename *.py | ||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | ||
# flake8 $dir --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --filename *.py | ||
# done | ||
|
||
- name: Checkout marqo-api-tests repo | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: marqo-ai/marqo-api-tests | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Set up Environment | ||
run: | | ||
# Set up conf file | ||
echo 'export MARQO_API_TESTS_ROOT="${{ github.workspace }}"' >> conf | ||
- name: Run Unit Tests | ||
run: | | ||
export MQ_API_TEST_BRANCH=$(echo "${GITHUB_REF}" | cut -d'/' -f3-) | ||
tox -e py3-local_os_unit_tests_w_requirements | ||
Stop-Runner: | ||
name: Stop self-hosted EC2 runner | ||
needs: | ||
- Start-Runner # required to get output from the start-runner job | ||
- Test-Marqo # required to wait when the main job is done | ||
runs-on: ubuntu-latest | ||
if: ${{ always() }} # required to stop the runner even if the error happened in the previous jobs | ||
steps: | ||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: ${{ secrets.AWS_REGION }} | ||
- name: Stop EC2 runner | ||
uses: machulav/ec2-github-runner@v2 | ||
with: | ||
mode: stop | ||
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} | ||
label: ${{ needs.start-runner.outputs.label }} | ||
ec2-instance-id: ${{ needs.start-runner.outputs.ec2-instance-id }} |
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
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
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
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
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
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
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
Oops, something went wrong.