Build and use our own etherpad image

We need to install the ep_headings plugin. We've got a hack in place
to do it in prod, but it seems like every time we npm install the
plugin in ansible, we need to restart the etherpad container
for $reasons.

It's cleaner to just build an image based on upstream with ep_headings
installed.

Change-Id: Id3b31bbabbbc5f6dcfe56486e48916384292f693
This commit is contained in:
Monty Taylor 2020-04-13 08:07:09 -05:00
parent 95184b5454
commit 7657b69387
4 changed files with 84 additions and 18 deletions

View File

@ -145,6 +145,34 @@
vars: *gitea_vars vars: *gitea_vars
files: *gitea_files files: *gitea_files
# Etherpad jobs
- job:
name: system-config-build-image-etherpad
description: Build a etherpad image.
provides: etherpad-container-image
parent: system-config-build-image
vars: &etherpad_vars
docker_images:
- context: docker/etherpad
repository: opendevorg/etherpad
files: &etherpad_files
- docker/etherpad/.*
- job:
name: system-config-upload-image-etherpad
description: Build and upload a etherpad image.
provides: etherpad-container-image
parent: system-config-upload-image
vars: *etherpad_vars
files: *etherpad_files
- job:
name: system-config-promote-image-etherpad
description: Promote a previously published etherpad image to latest.
parent: system-config-promote-image
vars: *etherpad_vars
files: *etherpad_files
# Jitsi-meet jobs # Jitsi-meet jobs
- job: - job:
name: system-config-build-image-jitsi-meet name: system-config-build-image-jitsi-meet
@ -1215,10 +1243,11 @@
- job: - job:
name: system-config-run-etherpad name: system-config-run-etherpad
parent: system-config-run parent: system-config-run-containers
description: | description: |
Run the playbook for the etherpad servers. Run the playbook for the etherpad servers.
timeout: 3600 timeout: 3600
requires: etherpad-container-image
nodeset: nodeset:
nodes: nodes:
- name: bridge.openstack.org - name: bridge.openstack.org
@ -2078,7 +2107,11 @@
- system-config-run-mirror-update - system-config-run-mirror-update
- system-config-run-static - system-config-run-static
- system-config-run-docker-registry - system-config-run-docker-registry
- system-config-run-etherpad - system-config-run-etherpad:
dependencies:
- name: opendev-buildset-registry
- name: system-config-build-image-etherpad
soft: true
- system-config-run-gitea: - system-config-run-gitea:
dependencies: dependencies:
- name: opendev-buildset-registry - name: opendev-buildset-registry
@ -2103,6 +2136,7 @@
- name: opendev-buildset-registry - name: opendev-buildset-registry
- name: system-config-build-image-jinja-init - name: system-config-build-image-jinja-init
soft: true soft: true
- system-config-build-image-etherpad
- system-config-build-image-gitea - system-config-build-image-gitea
- system-config-build-image-jitsi-meet - system-config-build-image-jitsi-meet
- system-config-build-image-haproxy-statsd: - system-config-build-image-haproxy-statsd:
@ -2136,7 +2170,11 @@
- system-config-run-mirror-update - system-config-run-mirror-update
- system-config-run-static - system-config-run-static
- system-config-run-docker-registry - system-config-run-docker-registry
- system-config-run-etherpad - system-config-run-etherpad:
dependencies:
- name: opendev-buildset-registry
- name: system-config-upload-image-etherpad
soft: true
- system-config-run-gitea: - system-config-run-gitea:
dependencies: dependencies:
- name: opendev-buildset-registry - name: opendev-buildset-registry
@ -2161,6 +2199,7 @@
- name: opendev-buildset-registry - name: opendev-buildset-registry
- name: system-config-upload-image-jinja-init - name: system-config-upload-image-jinja-init
soft: true soft: true
- system-config-upload-image-etherpad
- system-config-upload-image-gitea - system-config-upload-image-gitea
- system-config-upload-image-jitsi-meet - system-config-upload-image-jitsi-meet
- system-config-upload-image-haproxy-statsd: - system-config-upload-image-haproxy-statsd:
@ -2177,6 +2216,7 @@
- system-config-promote-image-jinja-init - system-config-promote-image-jinja-init
- system-config-promote-image-gitea-init - system-config-promote-image-gitea-init
- system-config-promote-image-gitea - system-config-promote-image-gitea
- system-config-promote-image-etherpad
- system-config-promote-image-jitsi-meet - system-config-promote-image-jitsi-meet
- system-config-promote-image-haproxy-statsd - system-config-promote-image-haproxy-statsd
- system-config-promote-image-python-base-3.7 - system-config-promote-image-python-base-3.7
@ -2208,7 +2248,17 @@
- infra-prod-service-gitea-lb - infra-prod-service-gitea-lb
- infra-prod-service-nameserver - infra-prod-service-nameserver
- infra-prod-service-nodepool - infra-prod-service-nodepool
- infra-prod-service-etherpad - infra-prod-service-etherpad:
dependencies:
- name: infra-prod-update-system-config
- name: infra-prod-install-ansible
soft: true
- name: infra-prod-base
soft: true
- name: infra-prod-service-letsencrypt
soft: true
- name: system-config-promote-image-etherpad
soft: true
- infra-prod-service-meetpad - infra-prod-service-meetpad
- infra-prod-service-mirror-update - infra-prod-service-mirror-update
- infra-prod-service-mirror - infra-prod-service-mirror

View File

@ -0,0 +1,20 @@
# Copyright (c) 2020 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM docker.io/etherpad/etherpad:1.8.0
LABEL maintainer="infra-root@openstack.org"
RUN cd /opt/etherpad-lite && npm install ep_headings

View File

@ -80,21 +80,18 @@
package: package:
name: name:
- docker-compose - docker-compose
- npm
state: present state: present
- name: Install ep_headings plugin - name: Clean up from old ep_headings hack
shell:
cmd: npm install ep_headings
chdir: /etc/etherpad
- name: Touch ep_initialize file
file: file:
path: /etc/etherpad/node_modules/ep_headings/.ep_initialized path: /etc/etherpad/node_modules
# 5001 is the etherpad user in the container state: absent
owner: 5001
group: 5001 - name: Remove npm
state: touch package:
name:
- npm
state: absent
- name: Run docker-compose pull - name: Run docker-compose pull
shell: shell:

View File

@ -17,10 +17,9 @@ services:
- /etc/etherpad/mysql:/etc/mysql/conf.d - /etc/etherpad/mysql:/etc/mysql/conf.d
etherpad: etherpad:
restart: always restart: always
image: docker.io/etherpad/etherpad:1.8.0 image: docker.io/opendevorg/etherpad
network_mode: host network_mode: host
environment: environment:
NODE_ENV: production NODE_ENV: production
volumes: volumes:
- /etc/etherpad/settings.json:/opt/etherpad-lite/settings.json - /etc/etherpad/settings.json:/opt/etherpad-lite/settings.json
- /etc/etherpad/node_modules/ep_headings:/opt/etherpad-lite/node_modules/ep_headings