-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Configure CI and do some general cleanup (#20)
Add CI workflows and improve testing - Implement CI workflows for linting, testing, and deployment - lint-and-test.yml: Runs on dispatch or pull request - build-and-push.yml: Runs on dispatch or push to main - Add unit tests for predictor.setup and predictor.predict - Create requirements-dev.txt for development dependencies - Fix lint and unit test failures - Add global pylint settings - Implement build-and-push job using Cog to build and push to r8.im/replicate/vllm
- Loading branch information
Showing
10 changed files
with
386 additions
and
99 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,58 @@ | ||
name: CI | ||
|
||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
# Ensure only one workflow instance runs at a time. For branches other than the | ||
# default branch, cancel the pending jobs in the group. For the default branch, | ||
# queue them up. This avoids cancelling jobs that are in the middle of deploying | ||
# to production. | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: ${{ github.ref != format('refs/heads/{0}', github.event.repository.default_branch) }} | ||
|
||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install dependencies | ||
run: pip install -r requirements-dev.txt | ||
- name: Run pylint | ||
run: | | ||
pylint --recursive y tests/**/*.py | ||
pylint --recursive y ./*.py | ||
unit-tests: | ||
name: Unit tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install dependencies | ||
run: pip install -r requirements-dev.txt | ||
- name: Run unit tests | ||
run: pytest tests/unit | ||
|
||
build-and-push: | ||
name: Build and push | ||
permissions: | ||
contents: 'read' | ||
id-token: 'write' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install Cog | ||
run: | | ||
sudo curl -o /usr/local/bin/cog -L "https://github.com/replicate/cog/releases/latest/download/cog_$(uname -s)_$(uname -m)" | ||
sudo chmod +x /usr/local/bin/cog | ||
- name: Build and push | ||
env: | ||
REPLICATE_API_TOKEN: ${{ secrets.REPLICATE_API_TOKEN }} | ||
run: | | ||
cog build | ||
cog push r8.im/replicate/vllm |
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,37 @@ | ||
name: CI | ||
|
||
|
||
on: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
# Ensure only one workflow instance runs at a time. For branches other than the | ||
# default branch, cancel the pending jobs in the group. For the default branch, | ||
# queue them up. This avoids cancelling jobs that are in the middle of deploying | ||
# to production. | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: ${{ github.ref != format('refs/heads/{0}', github.event.repository.default_branch) }} | ||
|
||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install dependencies | ||
run: pip install -r requirements-dev.txt | ||
- name: Run pylint | ||
run: | | ||
pylint --recursive y tests/**/*.py | ||
pylint --recursive y ./*.py | ||
unit-tests: | ||
name: Unit tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install dependencies | ||
run: pip install -r requirements-dev.txt | ||
- name: Run unit tests | ||
run: pytest tests/unit |
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,14 @@ | ||
[MESSAGES CONTROL] | ||
disable=C0114, # Missing module docstring | ||
E0611, # No name in module | ||
W0201, # Attribute defined outside init | ||
C0116, # Missing function docstring | ||
W0621, # Redefined outer name | ||
E0401, # Import error | ||
R0903, # Too few public methods | ||
R0913, # Too many arguments | ||
R0914, # Too many local variables | ||
C0115, # Missing class docstring | ||
|
||
[REPORTS] | ||
output-format=colorized |
Oops, something went wrong.