- Infrastructure Setup
- Building Docker Images
- Deployment in Kubernetes (K8S)
- Development and Iteration
- Future Implementation
- Collaboration Rules
Navigate to the production infrastructure directory:
cd infrastructure/prod
export GOOGLE_APPLICATION_CREDENTIALS=.json
terraform plan -out=plan.tfplan
terraform apply "plan.tfplan"
Set the version:
export VERSION=$(cat ./VERSION)
docker build -t zahidgalea/powered-chatbot-app:$VERSION ./chatbot
docker build -t zahidgalea/powered-chatbot-app:latest ./chatbot
docker push zahidgalea/powered-chatbot-app:$VERSION
docker push zahidgalea/powered-chatbot-app:latest
docker build -t zahidgalea/chatbot-ui:$VERSION ./ui
docker build -t zahidgalea/chatbot-ui:latest ./ui
docker push zahidgalea/chatbot-ui:$VERSION
docker push zahidgalea/chatbot-ui:latest
Navigate to the helm folder and set up the app cluster:
export VERSION=$(cat ./VERSION)
cd helm
gcloud container clusters get-credentials chatbot-llm-gke --region us-east1 --project chatbot-llm-395402
helm upgrade powered-chatbot . --namespace powered-chatbot --install --create-namespace --debug --set app_version=$VERSION
kubectl config set-context --current --namespace=powered-chatbot
kubectl apply -f ./secrets/
To forward from kubernetes to localhost
kubectl port-forward service/powered-chatbot-app-service 5001:5001 &
kubectl port-forward service/ui-service 80:80 &
export VERSION=$(cat ./VERSION)
docker build -t zahidgalea/chatbot-ui:$VERSION ./ui
docker run -v ${pwd}/ui:/app/ zahidgalea/chatbot-ui:$VERSION
Build, push, and deploy changes quickly:
export VERSION=$(cat ./VERSION)
docker build -t zahidgalea/powered-chatbot-app:$VERSION ./chatbot
docker push zahidgalea/powered-chatbot-app:$VERSION
cd helm
helm upgrade powered-chatbot . --namespace powered-chatbot --install --create-namespace --debug --set app_version=$VERSION
View the future implementations here.
- Branching: Always create a feature branch for any new feature or fix. Do not push directly to the
main
branch. - Commit Messages: Ensure your commit messages are meaningful and follow best practices.
- Code Reviews: Every pull request should be reviewed by at least one other developer before merging into the
main
branch. - Testing: Ensure that all unit tests pass before submitting a pull request. Add new tests for new features.
- Documentation: Update the documentation as needed when adding or modifying features.