Skip to content

Commit

Permalink
Merge pull request containers#112 from lmilbaum/model_servers-workflow
Browse files Browse the repository at this point in the history
model_servers workflow renamed
  • Loading branch information
rhatdan authored Mar 28, 2024
2 parents ca10229 + e85b06d commit 876425a
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/chatbot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:

- name: Install python dependencies
working-directory: ./recipes/natural_language_processing/chatbot
run: make install
run: make install

- name: Run tests
working-directory: ./recipes/natural_language_processing/chatbot
Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/model_servers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: model_servers

on:
pull_request:
branches:
- main
push:
branches:
- main

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

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
services:
registry:
image: registry:2.8.3
ports:
- 5000:5000
steps:
- uses: actions/[email protected]

- name: Login to ghcr
uses: docker/[email protected]
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Buildah Action
uses: redhat-actions/[email protected]
with:
image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: latest
containerfiles: ./model_servers/llamacpp_python/base/Containerfile
context: model_servers/llamacpp_python/

- name: Download model
working-directory: ./model_servers/llamacpp_python/
run: make models/llama-2-7b-chat.Q5_K_S.gguf

- name: Set up Python
uses: actions/[email protected]

- name: Install python dependencies
working-directory: ./model_servers/llamacpp_python/
run: make install

- name: Run tests
working-directory: ./model_servers/llamacpp_python/
run: make test
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ install:
pip install -r tests/requirements-test.txt

.PHONY: run
run: models/llama-2-7b-chat.Q5_K_S.gguf install
run:
podman run -it -d -p 8001:8001 -v ./models:/locallm/models:ro,Z -e MODEL_PATH=models/llama-2-7b-chat.Q5_K_S.gguf -e HOST=0.0.0.0 -e PORT=8001 --net=host ghcr.io/redhat-et/model_servers

.PHONY: test
test: models/llama-2-7b-chat.Q5_K_S.gguf install
pytest --log-cli-level NOTSET
test:
pytest --collect-only tests --log-cli-level NOTSET

This file was deleted.

1 change: 1 addition & 0 deletions model_servers/llamacpp_python/tests/requirements-test.txt

0 comments on commit 876425a

Please sign in to comment.