Celestino Rey 1 неделя назад
Родитель
Сommit
886fa4f60e

+ 8 - 1
deployment/deploy.sh

@@ -7,11 +7,18 @@ kubectl create namespace overleaf
 helm repo add bitnami https://charts.bitnami.com/bitnami
 helm search repo bitnami
 
+# Instala los helm de mongodb y redis
+#
 helm install mongo bitnami/mongodb --namespace overleaf --values ./mongo/values.yaml
 helm install redis bitnami/redis --namespace overleaf --values ./redis/values.yaml
 
-kubectl create -f ./overleaf/reg-secret.yaml
+# El GUI para mongoDB
+#
+kubectl create -f mongo-express/mongo-configmap.yaml -f mongo-express/mongoDB-secret.yaml -f mongo-express/mongo-express.yaml
 
+# Overleaf
+#
+kubectl create -f ./overleaf/reg-secret.yaml
 kubectl apply -n overleaf -f ./overleaf/overleaf-pvc.yaml -f ./overleaf/overleaf-variables.yaml -f ./overleaf/overleaf-deployment.yaml -f ./overleaf/overleaf-service.yaml
 
 ## Uncomment following ling to expose the application via ingress

+ 8 - 0
deployment/mongo-express/mongo-configmap.yaml

@@ -0,0 +1,8 @@
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: mongodb-configmap
+  namespace: overleaf
+data:
+#  database_url: mongo-mongodb-headless.overleaf.svc.cluster.local/sharelatex
+  database_url: mongo-mongodb-headless.overleaf.svc.cluster.local

+ 53 - 0
deployment/mongo-express/mongo-express.yaml

@@ -0,0 +1,53 @@
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: mongo-express
+  labels:
+    app: mongo-express
+  namespace: overleaf
+spec:
+  replicas: 1
+  selector:
+    matchLabels:
+      app: mongo-express
+  template:
+    metadata:
+      labels:
+        app: mongo-express
+    spec:
+      containers:
+      - name: mongo-express
+        image: mongo-express
+        ports:
+        - containerPort: 8081
+        env:
+        - name: ME_CONFIG_MONGODB_ADMINUSERNAME
+          valueFrom:
+            secretKeyRef:
+              name: mongodb-secret
+              key: mongo-root-username
+        - name: ME_CONFIG_MONGODB_ADMINPASSWORD
+          valueFrom:
+            secretKeyRef:
+              name: mongodb-secret
+              key: mongo-root-password
+        - name: ME_CONFIG_MONGODB_SERVER
+          valueFrom:
+            configMapKeyRef:
+              name: mongodb-configmap
+              key: database_url
+---
+apiVersion: v1
+kind: Service
+metadata:
+  name: mongo-express-service
+  namespace: overleaf
+spec:
+  selector:
+    app: mongo-express
+  type: NodePort  
+  ports:
+    - protocol: TCP
+      port: 8081
+      targetPort: 8081
+      nodePort: 30000

+ 11 - 0
deployment/mongo-express/mongoDB-secret.yaml

@@ -0,0 +1,11 @@
+apiVersion: v1
+kind: Secret
+metadata:
+    name: mongodb-secret
+    namespace: overleaf
+type: Opaque
+data:
+#    mongo-root-username: "dXNlcm5hbWU="
+    mongo-root-username: ""
+#    mongo-root-password: "cGFzc3dvcmQ="
+    mongo-root-password: ""

+ 1 - 0
overleaf/.current_version

@@ -0,0 +1 @@
+tex-4

+ 1 - 1
overleaf/.version

@@ -1 +1 @@
-tex-1
+tex-5

+ 2 - 2
overleaf/Dockerfile

@@ -1,5 +1,6 @@
-FROM sharelatex/sharelatex:6.1.2
+#FROM sharelatex/sharelatex:6.1.2
 #FROM sharelatex/sharelatex:latest
+FROM sharelatex/sharelatex:5
 
 RUN rm /etc/my_init.d/000_check_for_old_env_vars_5.sh \
  && rm /etc/my_init.d/100_make_overleaf_data_dirs.sh
@@ -34,7 +35,6 @@ RUN chmod +x /etc/my_init.d/100_make_overleaf_data_dirs.sh \
  /etc/service/spelling-overleaf/run \
  /etc/service/web-api-overleaf/run \
  /etc/service/web-overleaf/run
- 
 
 SHELL ["/bin/bash", "-cx"]
 

+ 32 - 0
overleaf/Dockerfile.full

@@ -0,0 +1,32 @@
+SHELL ["/bin/bash", "-cx"]
+
+# update tlmgr itself
+RUN wget "https://mirror.ctan.org/systems/texlive/tlnet/update-tlmgr-latest.sh" \
+    && sh update-tlmgr-latest.sh \
+    && tlmgr --version
+
+# enable tlmgr to install ctex
+RUN tlmgr update texlive-scripts 
+
+# update packages
+RUN tlmgr update --all
+
+# install all the packages
+RUN tlmgr install scheme-full
+
+# recreate symlinks
+RUN tlmgr path add
+
+# update system packages
+RUN apt-get update && apt-get upgrade -y
+
+# install inkscape for svg support
+RUN apt-get install inkscape -y
+
+# install lilypond
+RUN apt-get install lilypond -y
+
+# enable shell-escape by default:
+RUN TEXLIVE_FOLDER=$(find /usr/local/texlive/ -type d -name '20*') \
+    && echo % enable shell-escape by default >> /$TEXLIVE_FOLDER/texmf.cnf \
+    && echo shell_escape = t >> /$TEXLIVE_FOLDER/texmf.cnf

+ 38 - 0
overleaf/Dockerfile.minimal

@@ -0,0 +1,38 @@
+#FROM sharelatex/sharelatex:6.1.2
+#FROM sharelatex/sharelatex:latest
+FROM sharelatex/sharelatex:5
+
+RUN rm /etc/my_init.d/000_check_for_old_env_vars_5.sh \
+ && rm /etc/my_init.d/100_make_overleaf_data_dirs.sh
+
+COPY ./init_scripts/100_make_overleaf_data_dirs.sh /etc/my_init.d/100_make_overleaf_data_dirs.sh
+COPY ./nginx/nginx.conf.template /etc/nginx/templates/nginx.conf.template
+COPY ./runit/chat-overleaf/run /etc/service/chat-overleaf/run
+COPY ./runit/clsi-overleaf/run /etc/service/clsi-overleaf/run
+COPY ./runit/contacts-overleaf/run /etc/service/contacts-overleaf/run
+COPY ./runit/docstore-overleaf/run /etc/service/docstore-overleaf/run
+COPY ./runit/document-updater-overleaf/run /etc/service/document-updater-overleaf/run
+COPY ./runit/filestore-overleaf/run /etc/service/filestore-overleaf/run
+COPY ./runit/history-v1-overleaf/run /etc/service/history-v1-overleaf/run
+COPY ./runit/notifications-overleaf/run /etc/service/notifications-overleaf/run
+COPY ./runit/project-history-overleaf/run /etc/service/project-history-overleaf/run
+COPY ./runit/real-time-overleaf/run /etc/service/real-time-overleaf/run
+COPY ./runit/spelling-overleaf/run /etc/service/spelling-overleaf/run
+COPY ./runit/web-api-overleaf/run /etc/service/web-api-overleaf/run
+COPY ./runit/web-overleaf/run /etc/service/web-overleaf/run
+
+RUN chmod +x /etc/my_init.d/100_make_overleaf_data_dirs.sh \
+ /etc/service/chat-overleaf/run \
+ /etc/service/clsi-overleaf/run \
+ /etc/service/contacts-overleaf/run \
+ /etc/service/docstore-overleaf/run \
+ /etc/service/document-updater-overleaf/run \
+ /etc/service/filestore-overleaf/run \
+ /etc/service/history-v1-overleaf/run \
+ /etc/service/notifications-overleaf/run \
+ /etc/service/project-history-overleaf/run \
+ /etc/service/real-time-overleaf/run \
+ /etc/service/spelling-overleaf/run \
+ /etc/service/web-api-overleaf/run \
+ /etc/service/web-overleaf/run
+

+ 19 - 3
overleaf/Makefile

@@ -8,14 +8,27 @@ IMG_VERSION := $(shell cat $(VERSION_FILE) 2>/dev/null || echo "tex-1")
 BUILT_VERSION := $(shell cat .current_version 2>/dev/null || echo "$(IMG_VERSION)")
 export IMG_VERSION
 
-export OVERLEAF_LATEST ?= $(REGISTRO)/sharelatex:$(BUILT_VERSION)
+export OVERLEAF_LATEST ?= $(REGISTRO)/sharelatex:$(IMG_VERSION)
 
 
 all: build
 
+build-minimal:
+	@echo "Building image with version: $(IMG_VERSION)-minimal"
+	@# Store current version for other targets to use
+	@echo "$(IMG_VERSION)" > .current_version
+	docker build \
+	  --file Dockerfile.minimal \
+	  --tag $(OVERLEAF_LATEST)-minimal \
+	  .
+	@# Increment version for next build
+	@echo "$(IMG_VERSION)" | sed 's/tex-\([0-9]*\)/tex-\1/' | awk -F'-' '{print "tex-" $$2+1}' > $(VERSION_FILE)
+	@echo "Next version will be: $$(cat $(VERSION_FILE))"
+
 build:
 	@echo "Building image with version: $(IMG_VERSION)"
-
+	@# Store current version for other targets to use
+	@echo "$(IMG_VERSION)" > .current_version
 	docker build \
 	  --file Dockerfile \
 	  --tag $(OVERLEAF_LATEST) \
@@ -24,5 +37,8 @@ build:
 	@echo "$(IMG_VERSION)" | sed 's/tex-\([0-9]*\)/tex-\1/' | awk -F'-' '{print "tex-" $$2+1}' > $(VERSION_FILE)
 	@echo "Next version will be: $$(cat $(VERSION_FILE))"
 
+push-minimal:
+	docker push $(REGISTRO)/sharelatex:$(BUILT_VERSION)-minimal
+
 push:
-	docker push $(OVERLEAF_LATEST)
+	docker push $(REGISTRO)/sharelatex:$(BUILT_VERSION)