Skip to content

Commit

Permalink
Update versions, merge pydantic tests, reports
Browse files Browse the repository at this point in the history
  • Loading branch information
marius-baseten committed Aug 19, 2024
1 parent 452c030 commit b194b39
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 47 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build-context-builder-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,24 @@ jobs:
- uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3


- name: Login to Docker Hub
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Docker meta
id: meta
uses: docker/metadata-action@v3
uses: docker/metadata-action@v4
with:
images: baseten/truss-context-builder

- name: Docker Build
id: docker_build
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
context: ./
file: ./context_builder.Dockerfile
Expand Down
21 changes: 3 additions & 18 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ jobs:
job_type: ["server"]
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand Down Expand Up @@ -68,22 +68,7 @@ jobs:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-python/
- run: poetry install
- run: poetry run pytest truss/tests --durations=0 -m 'integration' --splits 5 --group ${{ matrix.split_group }} -k "not test_requirements_pydantic[1]"

# Running `test_requirements_pydantic[1]` started failing when running together with the other tests.
# We could pin down the issue to the fact that the built image had v2 installed, despite v1 in `requirements.txt`
# The test passes locally and when running in its own env, suggesting that there is a bug in docker caching / hash
# computation that makes the test falsely run with the wrong version in the image. As a stop gap solution, separating
# this particular test in its own job made it pass again.
integration-tests-pydantic-v1:
needs: [detect-version-changed, build-and-push-truss-base-images-if-needed]
if: ${{ !failure() && !cancelled() && (needs.build-and-push-truss-base-images-if-needed.result == 'success' || needs.build-and-push-truss-base-images-if-needed.result == 'skipped') }}
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-python/
- run: poetry install
- run: poetry run pytest truss/tests/test_model_inference.py::test_requirements_pydantic[1]
- run: poetry run pytest truss/tests --durations=0 -m 'integration' --splits 5 --group ${{ matrix.split_group }}"

chain-integration-tests:
needs: [detect-version-changed, build-and-push-truss-base-images-if-needed]
Expand Down
23 changes: 4 additions & 19 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ jobs:
job_type: ["server"]
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand Down Expand Up @@ -71,22 +71,7 @@ jobs:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-python/
- run: poetry install
- run: poetry run pytest truss/tests --durations=0 -m 'integration' --splits 5 --group ${{ matrix.split_group }} -k "not test_requirements_pydantic[1]"

# Running `test_requirements_pydantic[1]` started failing when running together with the other tests.
# We could pin down the issue to the fact that the built image had v2 installed, despite v1 in `requirements.txt`
# The test passes locally and when running in its own env, suggesting that there is a bug in docker caching / hash
# computation that makes the test falsely run with the wrong version in the image. As a stop gap solution, separating
# this particular test in its own job made it pass again.
integration-tests-pydantic-v1:
needs: [detect-version-changed, build-and-push-truss-base-images-if-needed]
if: ${{ !failure() && !cancelled() && (needs.build-and-push-truss-base-images-if-needed.result == 'success' || needs.build-and-push-truss-base-images-if-needed.result == 'skipped') }}
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-python/
- run: poetry install
- run: poetry run pytest truss/tests/test_model_inference.py::test_requirements_pydantic[1]
- run: poetry run pytest truss/tests --durations=0 -m 'integration' --splits 5 --group ${{ matrix.split_group }}

chain-integration-tests:
needs: [detect-version-changed, build-and-push-truss-base-images-if-needed]
Expand Down Expand Up @@ -126,7 +111,7 @@ jobs:
run: poetry build

- name: Create Release
uses: ncipollo/release-action@v1.12.0
uses: ncipollo/release-action@v1
with:
artifacts: "dist/*"
token: ${{ secrets.BASETENBOT_GITHUB_TOKEN }}
Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,20 @@ jobs:
- uses: ./.github/actions/setup-python/
- run: poetry install
- name: run tests (poetry run pytest...)
run: poetry run pytest -v --cov=truss -m 'not integration'
run: poetry run pytest -v --cov=truss -m 'not integration' --junitxml=report.xml

- name: Store Test Report
uses: actions/upload-artifact@v4
with:
name: report.xml
path: report.xml

- name: Publish Test Report # Not sure how to display this in the UI for non PRs.
uses: mikepenz/action-junit-report@v4
if: always()
with:
commit: ${{github.event.workflow_run.head_sha}} # Doest that work outside PR?
report_paths: "report.xml"

markdown-link-check:
runs-on: ubuntu-20.04
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,23 @@ jobs:
- uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Docker meta
id: meta
uses: docker/metadata-action@v3
uses: docker/metadata-action@v4
with:
images: baseten/truss-context-builder

- name: Docker Build
id: docker_build
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
context: ./
file: ./context_builder.Dockerfile
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
run: poetry build

- name: Create Release
uses: ncipollo/release-action@v1.12.0
uses: ncipollo/release-action@v1
with:
artifacts: "dist/*"
token: ${{ secrets.BASETENBOT_GITHUB_TOKEN }}
Expand Down

0 comments on commit b194b39

Please sign in to comment.