Skip to content
Snippets Groups Projects
Commit 305613ce authored by Simon Kindhauser's avatar Simon Kindhauser
Browse files

helper update; move to minikube registry

parent 70863fc3
Branches
Tags
No related merge requests found
#!/bin/bash
OCI_CLIENT="${OCI_CLIENT:-podman}"
BASE_TAG="localhost:5000/amygdala"
SERVICES=(cnc ltm memorize remember stt tts vis)
function build {
tag="$BASE_TAG/$1/$1";
$OCI_CLIENT build -t "$tag" -f "../$1/deployment/dockerfile" "../$1/" || exit;
$OCI_CLIENT push "$tag";
}
function build_service {
if [ -f "../$1/deployment/dockerfile" ];
then
build "$1"
else
echo Unknown image to build;
fi
}
case "$1" in
up )
kubectl apply -f amygdala.yaml;
kubectl create -f elastic_search/elastic-resources.yaml;
kubectl apply -f elastic_search/elastic-operator.yaml;
kubectl apply -f elastic_search/elastic-cluster.yaml;
kubectl apply -f templates/ltm.yaml;
kubectl apply -f templates/stt.yaml;
kubectl apply -f templates/tts.yaml;
kubectl apply -f templates/cnc.yaml;
kubectl apply -f templates/memorize.yaml;
kubectl apply -f templates/remember.yaml;
kubectl apply -f templates/vis.yaml;;
helm install amygdala . --values values.yaml;;
restart )
for service in "${SERVICES[@]}";
do
kubectl -n amygdala rollout restart "deployment/$service-dep"
done;;
down )
kubectl delete -f templates/vis.yaml;
kubectl delete -f templates/remember.yaml;
kubectl delete -f templates/memorize.yaml;
kubectl delete -f templates/cnc.yaml;
kubectl delete -f templates/tts.yaml;
kubectl delete -f templates/stt.yaml;
kubectl delete -f templates/ltm.yaml;
kubectl delete -f templates/elastic_search/elastic-cluster.yaml;
kubectl delete -f templates/elastic_search/elastic-operator.yaml;
kubectl delete -f templates/elastic_search/elastic-resources.yaml;;
helm uninstall amygdala;
kubectl delete namespace amygdala;;
build )
case "$2" in
cnc )
docker build -t amygdala/cnc/cnc -f ../cnc/deployment/dockerfile ../cnc/ $3;
minikube cache delete amygdala/cnc/cnc;
minikube cache add amygdala/cnc/cnc;;
ltm )
docker build -t amygdala/ltm/ltm -f ../ltm/deployment/dockerfile ../ltm/ $3;
minikube cache delete amygdala/ltm/ltm;
minikube cache add amygdala/ltm/ltm;;
memorize )
docker build -t amygdala/memorize/memorize -f ../memorize/deployment/dockerfile ../memorize/ $3;
minikube cache delete amygdala/memorize/memorize;
minikube cache add amygdala/memorize/memorize;;
remember )
docker build -t amygdala/remember/remember -f ../remember/deployment/dockerfile ../remember/ $3;
minikube cache delete amygdala/remember/remember;
minikube cache add amygdala/remember/remember;;
stt )
docker build -t amygdala/stt/stt -f ../stt/deployment/dockerfile ../stt/ $3;
minikube cache delete amygdala/stt/stt;
minikube cache add amygdala/stt/stt;;
tts )
docker build -t amygdala/tts/tts -f ../tts/deployment/dockerfile ../tts/ $3;
minikube cache delete amygdala/tts/tts;
minikube cache add amygdala/tts/tts;;
vis )
docker build -t amygdala/vis/vis -f ../vis/deployment/dockerfile ../vis/ $3;
minikube cache delete amygdala/vis/vis;
minikube cache add amygdala/vis/vis;;
all )
docker build -t amygdala/cnc/cnc -f ../cnc/deployment/dockerfile ../cnc/ $3;
minikube cache delete amygdala/cnc/cnc;
minikube cache add amygdala/cnc/cnc;
docker build -t amygdala/ltm/ltm -f ../ltm/deployment/dockerfile ../ltm/ $3;
minikube cache delete amygdala/ltm/ltm;
minikube cache add amygdala/ltm/ltm;
docker build -t amygdala/memorize/memorize -f ../memorize/deployment/dockerfile ../memorize/ $3;
minikube cache delete amygdala/memorize/memorize;
minikube cache add amygdala/memorize/memorize;
docker build -t amygdala/remember/remember -f ../remember/deployment/dockerfile ../remember/ $3;
minikube cache delete amygdala/remember/remember;
minikube cache add amygdala/remember/remember;
docker build -t amygdala/stt/stt -f ../stt/deployment/dockerfile ../stt/ $3;
minikube cache delete amygdala/stt/stt;
minikube cache add amygdala/stt/stt;
docker build -t amygdala/tts/tts -f ../tts/deployment/dockerfile ../tts/ $3;
minikube cache delete amygdala/tts/tts;
minikube cache add amygdala/tts/tts;
docker build -t amygdala/vis/vis -f ../vis/deployment/dockerfile ../vis/ $3;
minikube cache delete amygdala/vis/vis;
minikube cache add amygdala/vis/vis;;
for service in "${SERVICES[@]}";
do
build_service "$service";
done;;
* )
echo Unknown image to build;;
build_service "$2";;
esac;;
* )
echo Unknown Option;;
......
File mode changed from 100644 to 100755
......@@ -3,8 +3,9 @@
# Declare variables to be passed into your templates.
#containerRegistry: registry.gitlab.ost.ch:45023
containerRegistry: localhost:5000/
version: latest
imagePullPolicy: Never
imagePullPolicy: Always
#imagePullSecrets:
# - name: regcred
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment