Skip to content

Commit

Permalink
Merge pull request containers#193 from containers/release-to-quay
Browse files Browse the repository at this point in the history
Release to quay after tests pass
  • Loading branch information
lmilbaum authored Apr 9, 2024
2 parents 056c2db + 31fc59a commit c79f806
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 11 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/chatbot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository_owner }}/chatbot
IMAGE_NAME: chatbot

jobs:
build-and-push-image:
Expand All @@ -43,25 +43,25 @@ jobs:
id: build_image
uses: redhat-actions/[email protected]
with:
image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
image: ${{ env.REGISTRY }}/containers/${{ env.IMAGE_NAME }}
tags: latest
platforms: linux/amd64, linux/arm64
containerfiles: ./recipes/natural_language_processing/chatbot/builds/Containerfile
context: recipes/natural_language_processing/chatbot
containerfiles: ./recipes/natural_language_processing/${{ env.IMAGE_NAME }}/builds/Containerfile
context: recipes/natural_language_processing/${{ env.IMAGE_NAME }}

- name: Set up Python
uses: actions/[email protected]
with:
python-version: '3.11'

- name: Install Dependencies
working-directory: ./recipes/natural_language_processing/chatbot
working-directory: ./recipes/natural_language_processing/${{ env.IMAGE_NAME }}
run: make install

- name: Run Functional Tests
working-directory: ./recipes/natural_language_processing/chatbot
shell: bash
run: make functional-tests
working-directory: ./recipes/natural_language_processing/${{ env.IMAGE_NAME }}

- name: Login to Registry
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/model_servers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
id: build_image
uses: redhat-actions/[email protected]
with:
image: ${{ env.REGISTRY }}/${{ matrix.image_name }}
image: ${{ env.REGISTRY }}/${{ github.repository_owner}}/${{ matrix.image_name }}
platforms: linux/amd64, linux/arm64
tags: latest
containerfiles: ./model_servers/${{ matrix.image_name }}/base/Containerfile
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/testing-framework.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,44 @@ jobs:
if: always()
run: terraform destroy -auto-approve -lock=false
working-directory: terraform-test-environment-module

- name: Publish Job Results to Slack
id: slack
if: always()
uses: slackapi/[email protected]
with:
payload: |
{
"text": "${{ github.workflow }} workflow status: ${{ job.status }}\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

release-images:
runs-on: ubuntu-latest
needs: integration-tests
if: success()
strategy:
fail-fast: false
matrix:
include:
- image: llamacpp_python
- image: whispercpp
- image: chatbot
steps:
- name: Login to registry
uses: redhat-actions/[email protected]
with:
registry: quay.io
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}

- name: Copy image from one registry to another one
run: skopeo copy --all docker://${{ env.SOURCE_REGISTRY }}/${{ matrix.image }} docker://${{ env.TARGET_REGISTRY }}/${{ matrix.image }}
env:
SOURCE_REGISTRY: ghcr.io/containers
TARGET_REGISTRY: quay.io/ai-lab

- name: Publish Job Results to Slack
id: slack
if: always()
Expand Down
2 changes: 1 addition & 1 deletion model_servers/llamacpp_python/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os

MS = pytest_container.Container(
url=f"containers-storage:{os.environ['REGISTRY']}/{os.environ['IMAGE_NAME']}",
url=f"containers-storage:{os.environ['REGISTRY']}/containers/{os.environ['IMAGE_NAME']}",
volume_mounts=[
pytest_container.container.BindMount(
container_path="/locallm/models/model.gguf",
Expand Down
2 changes: 1 addition & 1 deletion model_servers/whispercpp/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os

MS = pytest_container.Container(
url=f"containers-storage:{os.environ['REGISTRY']}/{os.environ['IMAGE_NAME']}",
url=f"containers-storage:{os.environ['REGISTRY']}/containers/{os.environ['IMAGE_NAME']}",
volume_mounts=[
pytest_container.container.BindMount(
container_path="/locallm/models/model.gguf",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


MS = pytest_container.Container(
url=f"containers-storage:{os.environ['REGISTRY']}/llamacpp_python",
url=f"containers-storage:{os.environ['REGISTRY']}/containers/llamacpp_python",
volume_mounts=[
pytest_container.container.BindMount(
container_path="/locallm/models",
Expand All @@ -26,7 +26,7 @@
)

CB = pytest_container.Container(
url=f"containers-storage:{os.environ['REGISTRY']}/{os.environ['IMAGE_NAME']}",
url=f"containers-storage:{os.environ['REGISTRY']}/containers/{os.environ['IMAGE_NAME']}",
extra_environment_variables={
"MODEL_SERVICE_ENDPOINT": "http://10.88.0.1:8001/v1"
},
Expand Down

0 comments on commit c79f806

Please sign in to comment.