From a38942b6ebf27df5faa0f55b07c825d027d5a9f2 Mon Sep 17 00:00:00 2001 From: Oskar Hahn Date: Sun, 27 Jun 2021 16:02:50 +0200 Subject: [PATCH] Add ICC Service --- .gitmodules | 3 +++ docker/docker-compose.dev.yml | 26 ++++++++++++++++++++++++++ docker/docker-compose.yml.m4 | 20 ++++++++++++++++++++ docker/docker-stack.yml.m4 | 21 +++++++++++++++++++++ docker/services.env | 2 ++ openslides-icc-service | 1 + proxy/Caddyfile | 3 +++ proxy/Caddyfile.dev | 3 +++ 8 files changed, 79 insertions(+) create mode 160000 openslides-icc-service diff --git a/.gitmodules b/.gitmodules index b65e85bc3..b28a81731 100644 --- a/.gitmodules +++ b/.gitmodules @@ -29,3 +29,6 @@ path = openslides-manage-service url = https://github.com/OpenSlides/openslides-manage-service.git branch = main +[submodule "openslides-icc-service"] + path = openslides-icc-service + url = https://github.com/OpenSlides/openslides-icc-service.git diff --git a/docker/docker-compose.dev.yml b/docker/docker-compose.dev.yml index 77216cde5..0454fb6e6 100644 --- a/docker/docker-compose.dev.yml +++ b/docker/docker-compose.dev.yml @@ -14,6 +14,7 @@ services: - ../openslides-datastore-service/reader/reader:/app/reader ports: - 9010:9010 + datastore-writer: image: openslides-datastore-writer-dev depends_on: @@ -31,12 +32,14 @@ services: - OPENSLIDES_DEVELOPMENT=1 ports: - 9011:9011 + postgres: image: postgres:11 environment: - POSTGRES_USER=openslides - POSTGRES_PASSWORD=openslides - POSTGRES_DB=openslides + client: image: openslides-client-dev depends_on: @@ -47,6 +50,7 @@ services: - OPENSLIDES_DEVELOPMENT=1 volumes: - ../openslides-client/client/src:/app/src + backend: image: openslides-backend-dev depends_on: @@ -59,6 +63,7 @@ services: - OPENSLIDES_DEVELOPMENT=1 volumes: - ../openslides-backend/openslides_backend:/app/openslides_backend + autoupdate: image: openslides-autoupdate-dev depends_on: @@ -70,6 +75,21 @@ services: volumes: - ../openslides-autoupdate-service/cmd:/root/cmd - ../openslides-autoupdate-service/internal:/root/internal + - ../openslides-autoupdate-service/pkg:/root/pkg + + icc: + image: openslides-icc-dev + depends_on: + - datastore-reader + - message-bus + - auth + env_file: services.env + environment: + - OPENSLIDES_DEVELOPMENT=1 + volumes: + - ../openslides-icc-service/cmd:/root/cmd + - ../openslides-icc-service/internal:/root/internal + permission: image: openslides-permission-dev depends_on: @@ -81,6 +101,7 @@ services: - ../openslides-permission-service/cmd:/app/cmd - ../openslides-permission-service/internal:/app/internal - ../openslides-permission-service/pkg:/app/pkg + auth: image: openslides-auth-dev depends_on: @@ -91,8 +112,10 @@ services: - OPENSLIDES_DEVELOPMENT=1 volumes: - ../openslides-auth-service/auth/src:/app/src + cache: image: redis:latest + media: image: openslides-media-dev depends_on: @@ -103,6 +126,7 @@ services: - OPENSLIDES_DEVELOPMENT=1 volumes: - ../openslides-media-service/src:/app/src + manage: image: openslides-manage-dev depends_on: @@ -113,8 +137,10 @@ services: - OPENSLIDES_DEVELOPMENT=1 ports: - "9008:9008" + message-bus: image: redis:latest + proxy: image: openslides-proxy-dev depends_on: diff --git a/docker/docker-compose.yml.m4 b/docker/docker-compose.yml.m4 index d7a3b0646..fcc78163c 100644 --- a/docker/docker-compose.yml.m4 +++ b/docker/docker-compose.yml.m4 @@ -31,6 +31,10 @@ define(`AUTOUPDATE_IMAGE', ifenvelse(`DEFAULT_DOCKER_REGISTRY', openslides)/dnl ifenvelse(`DOCKER_OPENSLIDES_AUTOUPDATE_NAME', openslides-autoupdate):dnl ifenvelse(`DOCKER_OPENSLIDES_AUTOUPDATE_TAG', latest-4)) +define(`ICC_IMAGE', +ifenvelse(`DEFAULT_DOCKER_REGISTRY', openslides)/dnl +ifenvelse(`DOCKER_OPENSLIDES_ICC_NAME', openslides-icc):dnl +ifenvelse(`DOCKER_OPENSLIDES_ICC_TAG', latest-4)) define(`DATASTORE_READER_IMAGE', ifenvelse(`DEFAULT_DOCKER_REGISTRY', openslides)/dnl ifenvelse(`DOCKER_OPENSLIDES_DATASTORE_READER_NAME', openslides-datastore-reader):dnl @@ -140,6 +144,7 @@ services: depends_on: - datastore-reader - message-bus + - auth env_file: services.env networks: - frontend @@ -149,6 +154,21 @@ services: - auth_token_key - auth_cookie_key + icc: + image: ICC_IMAGE + depends_on: + - datastore-reader + - message-bus + - auth + enc_file: services.env + networks: + - frontend + - backend + - message-bus + secrets: + - auth_token_key + - auth_cookie_key + auth: image: AUTH_IMAGE depends_on: diff --git a/docker/docker-stack.yml.m4 b/docker/docker-stack.yml.m4 index 9c7528c5f..fa4284b89 100644 --- a/docker/docker-stack.yml.m4 +++ b/docker/docker-stack.yml.m4 @@ -31,6 +31,10 @@ define(`AUTOUPDATE_IMAGE', ifenvelse(`DEFAULT_DOCKER_REGISTRY', openslides)/dnl ifenvelse(`DOCKER_OPENSLIDES_AUTOUPDATE_NAME', openslides-autoupdate):dnl ifenvelse(`DOCKER_OPENSLIDES_AUTOUPDATE_TAG', latest-4)) +define(`ICC_IMAGE', +ifenvelse(`DEFAULT_DOCKER_REGISTRY', openslides)/dnl +ifenvelse(`DOCKER_OPENSLIDES_ICC_NAME', openslides-icc):dnl +ifenvelse(`DOCKER_OPENSLIDES_ICC_TAG', latest-4)) define(`DATASTORE_READER_IMAGE', ifenvelse(`DEFAULT_DOCKER_REGISTRY', openslides)/dnl ifenvelse(`DOCKER_OPENSLIDES_DATASTORE_READER_NAME', openslides-datastore-reader):dnl @@ -162,6 +166,23 @@ services: - auth_token_key - auth_cookie_key + icc: + image: ICC_IMAGE + enc_file: services.env + networks: + - frontend + - backend + - message-bus + deploy: + restart_policy: + condition: on-failure + delay: 5s + replicas: ifenvelse(`OPENSLIDES_ICC_REPLICAS', 1) + secrets: + - auth_token_key + - auth_cookie_key + + auth: image: AUTH_IMAGE env_file: services.env diff --git a/docker/services.env b/docker/services.env index 08b5c8c5d..1755ac55d 100644 --- a/docker/services.env +++ b/docker/services.env @@ -22,6 +22,8 @@ AUTH_HOST=auth AUTH_PORT=9004 CACHE_HOST=cache CACHE_PORT=6379 +ICC_REDIS_HOST=message-bus +ICC_REDIS_PORT=6379 MEDIA_HOST=media MEDIA_PORT=9006 diff --git a/openslides-icc-service b/openslides-icc-service new file mode 160000 index 000000000..cd1e4b5ab --- /dev/null +++ b/openslides-icc-service @@ -0,0 +1 @@ +Subproject commit cd1e4b5abfae76670af9cb44b7533a7918fab382 diff --git a/proxy/Caddyfile b/proxy/Caddyfile index b9113a306..0fe36e60d 100644 --- a/proxy/Caddyfile +++ b/proxy/Caddyfile @@ -5,6 +5,9 @@ import endpoint reverse_proxy /system/autoupdate* autoupdate:9012 { flush_interval -1 } + reverse_proxy /system/icc* icc:9013 { + flush_interval -1 + } reverse_proxy /system/auth* auth:9004 reverse_proxy /system/media* media:9006 diff --git a/proxy/Caddyfile.dev b/proxy/Caddyfile.dev index d33a170a1..c049d9e51 100644 --- a/proxy/Caddyfile.dev +++ b/proxy/Caddyfile.dev @@ -6,6 +6,9 @@ https://:8000 { reverse_proxy /system/autoupdate* autoupdate:9012 { flush_interval -1 } + reverse_proxy /system/icc* icc:9013 { + flush_interval -1 + } reverse_proxy /system/auth* auth:9004 reverse_proxy /system/media* media:9006