forked from containers/podman-desktop-extension-ai-lab
-
Notifications
You must be signed in to change notification settings - Fork 0
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 containers#197 from rhatdan/codegen
Use Makefile.common
- Loading branch information
Showing
1 changed file
with
1 addition
and
53 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 |
---|---|---|
@@ -1,55 +1,3 @@ | ||
APP ?= codegen | ||
MODELIMAGE ?= quay.io/ai-lab/mistral-7b-instruct:latest | ||
APPIMAGE ?= quay.io/ai-lab/${APP}:latest | ||
SERVERIMAGE ?= quay.io/ai-lab/llamacpp-python:latest | ||
SSHPUBKEY ?= $(shell cat ${HOME}/.ssh/id_rsa.pub;) | ||
BOOTCIMAGE ?= quay.io/ai-lab/${APP}-bootc:latest | ||
FROM ?= | ||
|
||
.PHONY: build | ||
build: | ||
podman build -f builds/Containerfile -t ${APPIMAGE} . | ||
|
||
.PHONY: bootc | ||
bootc: | ||
podman build $${FROM:+--from $${FROM}} --cap-add SYS_ADMIN --build-arg "SSHPUBKEY=$(SSHPUBKEY)" -f bootc/Containerfile -t ${BOOTCIMAGE} . | ||
|
||
.PHONY: quadlet | ||
quadlet: | ||
# Modify quadlet files to match the server, model and app image | ||
mkdir -p build | ||
sed -e "s|SERVERIMAGE|${SERVERIMAGE}|" \ | ||
-e "s|APPIMAGE|${APPIMAGE}|g" \ | ||
-e "s|MODELIMAGE|${MODELIMAGE}|g" \ | ||
quadlet/${APP}.image \ | ||
> build/${APP}.image | ||
sed -e "s|SERVERIMAGE|${SERVERIMAGE}|" \ | ||
-e "s|APPIMAGE|${APPIMAGE}|g" \ | ||
-e "s|MODELIMAGE|${MODELIMAGE}|g" \ | ||
quadlet/${APP}.yaml \ | ||
> build/${APP}.yaml | ||
cp quadlet/${APP}.kube build/${APP}.kube | ||
|
||
.PHONY: install | ||
install: | ||
wget https://www.slimjetbrowser.com/chrome/files/103.0.5060.53/google-chrome-stable_current_amd64.deb | ||
sudo dpkg -i google-chrome-stable_current_amd64.deb | ||
wget https://chromedriver.storage.googleapis.com/103.0.5060.53/chromedriver_linux64.zip | ||
unzip chromedriver_linux64.zip | ||
pip install -r tests/requirements.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/${APP} | ||
|
||
.PHONY: functional_tests | ||
functional_tests: | ||
python3 -m pytest -vvv --driver=Chrome --driver-path=./chromedriver tests/functional | ||
|
||
.PHONY: integration_test | ||
integration_tests: | ||
URL=${URL} python3 -m pytest -vvv --driver=Chrome --driver-path=./chromedriver tests/integration | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -rf build | ||
include ../../common/Makefile.common |