feat: update Dockerfile and Makefile for ARM support; add new Helm configuration files for ARM deployments
All checks were successful
Build and Push to Private Registry101 / build (push) Successful in 11s

This commit is contained in:
stephen schuresko
2025-02-20 12:03:11 -05:00
parent e3a1f00430
commit 9eae98b0a0
4 changed files with 55 additions and 9 deletions

View File

@@ -1,9 +1,13 @@
ENV=dev
VER=0.0.6
VER=0.0.11
TAG=${ENV}-${VER}
TAG_ARM=${ENV}-arm-${VER}
REGISTRY=kube-reg.fairfaxmedia.net
#REGISTRY=direct.fairfaxmedia.net:1529
SVC=papi/svc1
DOCK_IMG=${REGISTRY}/${SVC}:${TAG}
DOCK_ARM=${REGISTRY}/${SVC}:${TAG_ARM}
LIVE_HOST:="http://localhost:8912"
clean:
@@ -15,19 +19,40 @@ clean:
install:
pip3 install -r requirements.txt
coverage: clean install
report.xml: *.py
pytest --cov=papi --cov=posts --cov=users test_papi.py test_posts.py test_users.py --junitxml=report.xml --cov-report=html --cov-report=xml --cov-report=term --cov-fail-under 90
docker-img: coverage
docker build -t ${DOCK_IMG} .
docker-img: report.xml
docker build -t ${DOCK_IMG} --push .
arm-builder:
docker buildx create --name mybuilder --use --bootstrap --platform arm64
docker-img-arm: report.xml
docker buildx build --builder mybuilder --platform linux/arm64 -t ${DOCK_ARM} --push . -f Dockerfile
docker-push: docker-img
docker push ${DOCK_IMG}
ideploy: docker-img
helm --kube-context microk8s install papi-${ENV} ./papi-helm/ -f ./papi-helm/v.${ENV}.yaml --set image.tag=${TAG} --set env.VERSION=${VER} --set name=papi-${ENV}
deploy: docker-push
helm upgrade papi ./papi-helm/ -f ./papi-helm/v.${ENV}.yaml --set image.tag=${TAG} --set env.VERSION=${VER}
integration: install
deploy: docker-img
helm --kube-context microk8s upgrade papi-${ENV} ./papi-helm/ -f ./papi-helm/v.${ENV}.yaml --set image.tag=${TAG} --set env.VERSION=${VER} --set name=papi-${ENV}
ideploy-arm: docker-img-arm
helm --kube-context arm-k3s install papi-${ENV} ./papi-helm/ -f ./papi-helm/v.arm.${ENV}.yaml --set image.tag=${TAG_ARM} --set env.VERSION=${VER} --set name=papi-${ENV}
deploy-arm: docker-img-arm
helm --kube-context arm-k3s upgrade papi-${ENV} ./papi-helm/ -f ./papi-helm/v.arm.${ENV}.yaml --set image.tag=${TAG_ARM} --set env.VERSION=${VER} --set name=papi-${ENV}
integration:
pyresttest ${LIVE_HOST} integration.pyrest.yaml
arm-tok:
kubectl --context arm-k3s create token serviceaccounts-cluster-admin
echo login at https://k3a.fairfaxmedia.net
k8s-tok:
kubectl --context microk8s create token serviceaccounts-cluster-admin
echo login at https://kube.fairfaxmedia.net
run: install
uvicorn papi:app --reload --port 8912 --host 0.0.0.0

7
papi-helm/v.arm.dev.yaml Normal file
View File

@@ -0,0 +1,7 @@
ingress:
enabled: true
hosts:
- host: papi-arm-dev.fairfaxmedia.net
paths:
- path: /
pathType: ImplementationSpecific

View File

@@ -0,0 +1,7 @@
ingress:
enabled: true
hosts:
- host: papi-arm.fairfaxmedia.net
paths:
- path: /
pathType: ImplementationSpecific

7
papi-helm/v.arm.qa.yaml Normal file
View File

@@ -0,0 +1,7 @@
ingress:
enabled: true
hosts:
- host: papi-arm-qa.fairfaxmedia.net
paths:
- path: /
pathType: ImplementationSpecific