-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #108 from lmilbaum/chatbot-workflow
chatbot GHA workflow
- Loading branch information
Showing
3 changed files
with
68 additions
and
0 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,51 @@ | ||
name: chatbot | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
push: | ||
branches: | ||
- main | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository_owner }}/chatbot | ||
|
||
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: ./chatbot/builds/Containerfile | ||
context: chatbot | ||
|
||
- name: Set up Python | ||
uses: actions/[email protected] | ||
|
||
- name: Install python dependencies | ||
run: make -f chatbot/Makefile install | ||
|
||
- name: Run tests | ||
run: make -f chatbot/Makefile test |
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,15 @@ | ||
.PHONY: build | ||
build: | ||
podman build -f chatbot/Containerfile -t ghcr.io/ai-lab-recipes/chatbot . | ||
|
||
.PHONY: install | ||
install: | ||
pip install -r requirements-test.txt | ||
|
||
.PHONY: run | ||
run: | ||
podman run -it -p 8501:8501 -e MODEL_SERVICE_ENDPOINT=http://10.88.0.1:8001/v1 ghcr.io/ai-lab-recipes/chatbot | ||
|
||
.PHONY: test | ||
test: | ||
pytest --collect-only chatbot/tests --log-cli-level NOTSET |
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,2 @@ | ||
def test_placeholder(): | ||
assert 1 == 1 |