Skip to content
Snippets Groups Projects
Commit a28ace4a authored by Ismael Posada Trobo's avatar Ismael Posada Trobo
Browse files

Merge branch 'fix_exdev' into 'master'

Bump version from v2.5.0.beta1 to v2.5.0.beta2

See merge request !20
parents 1af65e7a 4d086abe
No related branches found
No related tags found
1 merge request!20Bump version from v2.5.0.beta1 to v2.5.0.beta2
...@@ -69,51 +69,40 @@ WORKDIR $HOME ...@@ -69,51 +69,40 @@ WORKDIR $HOME
### Plugins ### Plugins
# #
# - OAuth # - OAuth
RUN git clone --depth=1 https://github.com/discourse/discourse-oauth2-basic.git /discourse/plugins/discourse-oauth2-basic RUN \
git clone --depth=1 https://github.com/discourse/discourse-oauth2-basic.git /discourse/plugins/discourse-oauth2-basic && \
# - Chat Integration # - Chat Integration
RUN git clone --depth=1 https://github.com/discourse/discourse-chat-integration.git /discourse/plugins/discourse-chat-integration git clone --depth=1 https://github.com/discourse/discourse-chat-integration.git /discourse/plugins/discourse-chat-integration && \
# - Discourse Solved # - Discourse Solved
RUN git clone --depth=1 https://github.com/discourse/discourse-solved.git /discourse/plugins/discourse-solved git clone --depth=1 https://github.com/discourse/discourse-solved.git /discourse/plugins/discourse-solved && \
# - Trade buttons (used on Marketplace) # - Trade buttons (used on Marketplace)
RUN git clone --depth=1 https://github.com/jannolii/discourse-topic-trade-buttons.git /discourse/plugins/discourse-topic-trade-buttons git clone --depth=1 https://github.com/jannolii/discourse-topic-trade-buttons.git /discourse/plugins/discourse-topic-trade-buttons && \
# - Saved Searches # - Saved Searches
RUN git clone --depth=1 https://github.com/discourse/discourse-saved-searches.git /discourse/plugins/discourse-saved-searches git clone --depth=1 https://github.com/discourse/discourse-saved-searches.git /discourse/plugins/discourse-saved-searches && \
# - Migrate Password # - Migrate Password
RUN git clone --depth=1 https://github.com/discoursehosting/discourse-migratepassword.git /discourse/plugins/discourse-migratepassword git clone --depth=1 https://github.com/discoursehosting/discourse-migratepassword.git /discourse/plugins/discourse-migratepassword && \
# - Discourse Math # - Discourse Math
RUN git clone --depth=1 https://github.com/discourse/discourse-math.git /discourse/plugins/discourse-math git clone --depth=1 https://github.com/discourse/discourse-math.git /discourse/plugins/discourse-math && \
# - Discourse Askimet # - Discourse Askimet
RUN git clone --depth=1 https://github.com/discourse/discourse-akismet.git /discourse/plugins/discourse-akismet git clone --depth=1 https://github.com/discourse/discourse-akismet.git /discourse/plugins/discourse-akismet && \
# - Canned replies # - Canned replies
RUN git clone --depth=1 https://github.com/discourse/discourse-canned-replies.git /discourse/plugins/discourse-canned-replies git clone --depth=1 https://github.com/discourse/discourse-canned-replies.git /discourse/plugins/discourse-canned-replies && \
# - Discourse JIRA # - Discourse JIRA
RUN git clone --depth=1 https://github.com/karies/discourse-jira.git /discourse/plugins/discourse-jira git clone --depth=1 https://github.com/karies/discourse-jira.git /discourse/plugins/discourse-jira && \
# - Prometheus # - Prometheus
RUN git clone --depth=1 https://github.com/discourse/discourse-prometheus.git /discourse/plugins/discourse-prometheus git clone --depth=1 https://github.com/discourse/discourse-prometheus.git /discourse/plugins/discourse-prometheus && \
# - Calendar # - Calendar
RUN git clone --depth=1 https://github.com/discourse/discourse-calendar.git /discourse/plugins/discourse-calendar git clone --depth=1 https://github.com/discourse/discourse-calendar.git /discourse/plugins/discourse-calendar && \
# - Assign # - Assign
RUN git clone --depth=1 https://github.com/discourse/discourse-assign.git /discourse/plugins/discourse-assign git clone --depth=1 https://github.com/discourse/discourse-assign.git /discourse/plugins/discourse-assign
### Gem installation ### Gem installation
RUN exec bundle install --deployment --jobs 4 --without test --without development && \ RUN exec bundle install --deployment --jobs 4 --without test --without development && \
exec bundle exec rake maxminddb:get && \ exec bundle exec rake maxminddb:get && \
find /discourse/vendor/bundle -name tmp -type d -exec rm -rf {} + find /discourse/vendor/bundle -name tmp -type d -exec rm -rf {} +
COPY ["cgroup-limits","init-assets.sh","init-dbmigration.sh","run-discourse.sh","run-nginx.sh","run-redis.sh","./"] COPY ["cgroup-limits","init-dbmigration.sh","run-discourse.sh","run-nginx.sh","run-redis.sh","./"]
RUN chmod +x ./run-discourse.sh ./run-nginx.sh ./run-redis.sh ./init-assets.sh ./init-dbmigration.sh && \ RUN chmod +x ./run-discourse.sh ./run-nginx.sh ./run-redis.sh ./init-dbmigration.sh && \
chgrp -R 0 /discourse && chmod -R g=u /discourse && \ chgrp -R 0 /discourse && chmod -R g=u /discourse && \
chmod +x /discourse/config/unicorn_launcher chmod +x /discourse/config/unicorn_launcher
......
#!/bin/bash
# Replace environment variables
# This is mandatory as at the time of doing the migration, discourse needs to know redis IP,
# which is set thanks to discourse.conf file.
echo "--> Overwritting env variables ..."
envsubst < /tmp/discourse-configmap/discourse.conf > /discourse/config/discourse.conf
echo "--> DONE"
# Always precompile assets
exec env RAILS_ENV="production" bundle exec rake assets:precompile
\ No newline at end of file
...@@ -6,11 +6,14 @@ envsubst < /tmp/discourse-configmap/discourse.conf > /discourse/config/discourse ...@@ -6,11 +6,14 @@ envsubst < /tmp/discourse-configmap/discourse.conf > /discourse/config/discourse
envsubst < /tmp/discourse-configmap/sidekiq.yml > /discourse/config/sidekiq.yml envsubst < /tmp/discourse-configmap/sidekiq.yml > /discourse/config/sidekiq.yml
echo "--> DONE" echo "--> DONE"
# Puma is installed, so get memory information # Get memory information
export_vars=$(python cgroup-limits) ; export $export_vars export_vars=$(python cgroup-limits) ; export $export_vars
export RAILS_ENV="production" export RAILS_ENV="production"
echo "--> Running Unicorn ..." if bundle exec rake assets:precompile;
# Run discourse with Unicorn then
exec env LD_PRELOAD=$RUBY_ALLOCATOR thpoff bundle exec config/unicorn_launcher -E production -c config/unicorn.conf.rb echo "--> Running Unicorn ..."
\ No newline at end of file # Run discourse with Unicorn
exec env LD_PRELOAD=$RUBY_ALLOCATOR thpoff bundle exec config/unicorn_launcher -E production -c config/unicorn.conf.rb
fi
\ No newline at end of file
#!/bin/bash #!/bin/bash
echo "--> Running nginx ..." # Replace environment variables
exec nginx -g "daemon off;" echo "--> Overwritting env variables ..."
\ No newline at end of file envsubst < /tmp/discourse-configmap/discourse.conf > /discourse/config/discourse.conf
echo "--> DONE"
# Get memory information
export_vars=$(python cgroup-limits) ; export $export_vars
export RAILS_ENV="production"
# Precompile assets. If succees, proceed with Nginx.
if bundle exec rake assets:precompile;
then
echo "--> Running nginx ..."
exec nginx -g "daemon off;"
fi
...@@ -108,6 +108,54 @@ objects: ...@@ -108,6 +108,54 @@ objects:
name: nginx name: nginx
command: command:
- ./run-nginx.sh - ./run-nginx.sh
env:
- name: NAMESPACE
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
- name: HOSTNAME
value: $(NAMESPACE).web.cern.ch
- name: DISCOURSE_CONFIG_DB_HOST
valueFrom:
configMapKeyRef:
key: DISCOURSE_DB_HOST_KEY
name: env-configmap
- name: DISCOURSE_CONFIG_DB_PORT
valueFrom:
configMapKeyRef:
key: DISCOURSE_DB_PORT_KEY
name: env-configmap
- name: DISCOURSE_CONFIG_DB_NAME
valueFrom:
configMapKeyRef:
key: DISCOURSE_DB_NAME_KEY
name: env-configmap
- name: DISCOURSE_CONFIG_DB_USERNAME
valueFrom:
configMapKeyRef:
key: DISCOURSE_DB_USERNAME_KEY
name: env-configmap
- name: DISCOURSE_CONFIG_DB_PASSWORD
valueFrom:
configMapKeyRef:
key: DISCOURSE_DB_PASSWORD_KEY
name: env-configmap
- name: DISCOURSE_CONFIG_DEVELOPER_EMAILS
valueFrom:
configMapKeyRef:
key: DISCOURSE_DEVELOPER_EMAILS_KEY
name: env-configmap
- name: DISCOURSE_CONFIG_DB_POOL
valueFrom:
configMapKeyRef:
key: DISCOURSE_DB_POOL_KEY
name: env-configmap
- name: LANG
valueFrom:
configMapKeyRef:
key: LANG
name: env-configmap
image: gitlab-registry.cern.ch/webservices/discourse-cern:stable image: gitlab-registry.cern.ch/webservices/discourse-cern:stable
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
ports: ports:
...@@ -115,35 +163,33 @@ objects: ...@@ -115,35 +163,33 @@ objects:
protocol: TCP protocol: TCP
resources: resources:
limits: limits:
memory: 400Mi memory: 1Gi
cpu: 200m cpu: 1
requests: requests:
memory: 20Mi memory: 320Mi
cpu: 50m cpu: 150m
terminationMessagePath: /dev/termination-log terminationMessagePath: /dev/termination-log
volumeMounts: volumeMounts:
- mountPath: /discourse/public/uploads - mountPath: /discourse/public/uploads
name: discourse-uploads name: discourse-uploads
- mountPath: /discourse/public/assets - mountPath: /discourse/public/assets
name: discourse-public-assets name: discourse-public-assets
- mountPath: /discourse/public/plugins
name: discourse-public-plugins
- mountPath: /discourse/public/backups - mountPath: /discourse/public/backups
name: discourse-backups name: discourse-backups
- mountPath: /var/cache/nginx - mountPath: /var/cache/nginx
name: var-cache-nginx name: var-cache-nginx
readinessProbe: readinessProbe:
failureThreshold: 3 failureThreshold: 10
initialDelaySeconds: 30 initialDelaySeconds: 180
periodSeconds: 10 periodSeconds: 20
successThreshold: 1 successThreshold: 1
tcpSocket: tcpSocket:
port: 8080 port: 8080
timeoutSeconds: 10 timeoutSeconds: 10
livenessProbe: livenessProbe:
failureThreshold: 3 failureThreshold: 5
initialDelaySeconds: 10 initialDelaySeconds: 900
periodSeconds: 10 periodSeconds: 20
successThreshold: 1 successThreshold: 1
tcpSocket: tcpSocket:
port: 8080 port: 8080
...@@ -171,16 +217,12 @@ objects: ...@@ -171,16 +217,12 @@ objects:
name: discourse-backups name: discourse-backups
- mountPath: /discourse/public/assets - mountPath: /discourse/public/assets
name: discourse-public-assets name: discourse-public-assets
- mountPath: /discourse/public/plugins
name: discourse-public-plugins
- mountPath: /discourse/tmp
name: discourse-tmp
- mountPath: /discourse/logs - mountPath: /discourse/logs
name: discourse-logs name: discourse-logs
readinessProbe: readinessProbe:
failureThreshold: 3 failureThreshold: 10
initialDelaySeconds: 30 initialDelaySeconds: 180
periodSeconds: 10 periodSeconds: 20
successThreshold: 1 successThreshold: 1
tcpSocket: tcpSocket:
port: 3000 port: 3000
...@@ -188,7 +230,7 @@ objects: ...@@ -188,7 +230,7 @@ objects:
livenessProbe: livenessProbe:
failureThreshold: 3 failureThreshold: 3
initialDelaySeconds: 900 initialDelaySeconds: 900
periodSeconds: 10 periodSeconds: 20
successThreshold: 1 successThreshold: 1
tcpSocket: tcpSocket:
port: 3000 port: 3000
...@@ -286,7 +328,6 @@ objects: ...@@ -286,7 +328,6 @@ objects:
configMapKeyRef: configMapKeyRef:
key: LANG key: LANG
name: env-configmap name: env-configmap
dnsPolicy: ClusterFirst dnsPolicy: ClusterFirst
restartPolicy: Always restartPolicy: Always
securityContext: securityContext:
...@@ -357,80 +398,9 @@ objects: ...@@ -357,80 +398,9 @@ objects:
volumeMounts: volumeMounts:
- mountPath: /discourse/public/uploads - mountPath: /discourse/public/uploads
name: discourse-uploads name: discourse-uploads
- name: init-assets
command:
- ./init-assets.sh
env:
- name: NAMESPACE
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
- name: HOSTNAME
value: $(NAMESPACE).web.cern.ch
- name: DISCOURSE_CONFIG_DB_HOST
valueFrom:
configMapKeyRef:
key: DISCOURSE_DB_HOST_KEY
name: env-configmap
- name: DISCOURSE_CONFIG_DB_PORT
valueFrom:
configMapKeyRef:
key: DISCOURSE_DB_PORT_KEY
name: env-configmap
- name: DISCOURSE_CONFIG_DB_NAME
valueFrom:
configMapKeyRef:
key: DISCOURSE_DB_NAME_KEY
name: env-configmap
- name: DISCOURSE_CONFIG_DB_USERNAME
valueFrom:
configMapKeyRef:
key: DISCOURSE_DB_USERNAME_KEY
name: env-configmap
- name: DISCOURSE_CONFIG_DB_PASSWORD
valueFrom:
configMapKeyRef:
key: DISCOURSE_DB_PASSWORD_KEY
name: env-configmap
- name: DISCOURSE_CONFIG_DEVELOPER_EMAILS
valueFrom:
configMapKeyRef:
key: DISCOURSE_DEVELOPER_EMAILS_KEY
name: env-configmap
- name: DISCOURSE_CONFIG_DB_POOL
valueFrom:
configMapKeyRef:
key: DISCOURSE_DB_POOL_KEY
name: env-configmap
- name: LANG
valueFrom:
configMapKeyRef:
key: LANG
name: env-configmap
image: gitlab-registry.cern.ch/webservices/discourse-cern:stable
imagePullPolicy: IfNotPresent
resources:
limits:
cpu: '1'
memory: 1Gi
requests:
cpu: 200m
memory: 320Mi
volumeMounts:
- mountPath: /discourse/public/assets
name: discourse-public-assets
- mountPath: /discourse/public/plugins
name: discourse-public-plugins
volumes: volumes:
- name: discourse-public-assets - name: discourse-public-assets
emptyDir: {} emptyDir: {}
- name: discourse-public-plugins
emptyDir: {}
- name: discourse-tmp
emptyDir: {}
- name: discourse-logs - name: discourse-logs
emptyDir: {} emptyDir: {}
- name: var-cache-nginx - name: var-cache-nginx
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment