Skip to content

Commit

Permalink
🌱 dockerimage backend, add *
Browse files Browse the repository at this point in the history
  • Loading branch information
victorjourne committed Oct 26, 2023
1 parent 5b81553 commit 1731ec9
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 17 deletions.
15 changes: 10 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -181,19 +181,24 @@ deploy-k8s-traefik:
@cat ${KUBE_DIR}/traefik/ingress.yaml | envsubst | kubectl apply -f -

deploy-k8s-configmap: create-namespace
kubectl create configmap env-${INDEX_NAME} --from-file=${ENV_FILE} --namespace ridoc -o yaml --dry-run=client | kubectl apply -f -
kubectl create configmap env-${INDEX_NAME} --from-env-file=${ENV_FILE} --namespace ridoc -o yaml --dry-run=client | kubectl apply -f -
kubectl create configmap static-${INDEX_NAME} --from-file=${FRONTEND_STATIC_USER} --namespace ridoc -o yaml --dry-run=client | kubectl apply -f -

deploy-traefik:
helm upgrade --install --values ${KUBE_DIR}/traefik/values.yaml traefik traefik/traefik --namespace traefik

deploy-k8s-elasticsearch: deploy-k8s-namespace
deploy-k8s-ekl: create-namespace
@echo $@
helm upgrade --install es-kb elastic/eck-stack -n elastic-stack --create-namespace
helm upgrade --install --values ${KUBE_DIR}/ekl/elasticsearch.yaml elasticsearch elastic/elasticsearch -n elastic-stack

deploy-k8s-frontend: deploy-k8s-configmap
@echo $@
@cat ${KUBE_DIR}/frontend.yaml | envsubst | kubectl apply -f -


deploy-k8s-backend: deploy-k8s-configmap
@echo $@
@cat ${KUBE_DIR}/backend.yaml | envsubst | kubectl apply -f -

##############
#Test backend#
Expand Down Expand Up @@ -311,9 +316,9 @@ frontend-download-swift: chmod
@echo "Download $(FILE_FRONTEND_DIST_APP_VERSION) from SWIFT to ${APP}-build"
swift/download.sh ${BUCKET_NAME} ${APP}-build/$(FILE_FRONTEND_DIST_APP_VERSION) 'curl'


download: chmod
swift/download.sh $(BUCKET_NAME) $(SRC) 'curl'

upload: chmod
swift/upload.sh $(BUCKET_NAME) $(SRC) 'curl'

Expand Down
8 changes: 8 additions & 0 deletions backend/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.env
tests/**/json
tests/**/meta
benchmark/**/json
benchmark/**/meta
# Byte-compiled / optimized / DLL files
**/__pycache__/
**/*.py[cod]
6 changes: 1 addition & 5 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ FROM python:3.8 as dev

WORKDIR /app

COPY requirements.txt .
COPY ./application .
COPY ./tools .
COPY ./setup.py .
COPY ./start.sh .
COPY . .

RUN [ -f "start.sh" ] && chmod +x start.sh

Expand Down
10 changes: 4 additions & 6 deletions deployments/backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,16 @@ spec:
app: backend
spec:
containers:
- args:
- FLASK_DEBUG=0
command:
- ./start.sh
- command: [ "/bin/bash", "-c", "--" ]
args: [ "while true; do sleep 30; done;" ]
envFrom:
- configMapRef:
name: env-${INDEX_NAME}

image: ghcr.io/datalab-mi/ridoc/backend:${APP_VERSION}
image: ghcr.io/datalab-mi/ridoc-backend:${APP_VERSION}
resources:
requests:
cpu: "1"
cpu: "0.1"
imagePullPolicy: Always
name: backend
ports:
Expand Down
26 changes: 26 additions & 0 deletions deployments/ekl/elasticsearch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
image: "ghcr.io/datalab-mi/ridoc-elasticsearch"
imageTag: "feat-kubernetes"
imagePullPolicy: "IfNotPresent"

replicas: 1
minimumMasterNodes: 1

resources:
requests:
cpu: "500m"
memory: "1Gi"
limits:
cpu: "500m"
memory: "1Gi"


#https://github.com/elastic/helm-charts/issues/1013
clusterHealthCheckParams: "timeout=10s"
#"wait_for_status=green&timeout=1s"
secret:
enabled: true
password: "elastic"
# generated randomly if not defined

protocol: http
createCert: false
1 change: 0 additions & 1 deletion deployments/ekl/values.yaml

This file was deleted.

10 changes: 10 additions & 0 deletions deployments/namespace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,13 @@ metadata:
name: traefik
labels:
name: traefik

---

kind: Namespace
apiVersion: v1
metadata:
name: elastic-stack
labels:
name: elastic-stack

0 comments on commit 1731ec9

Please sign in to comment.