This is an automated email from the ASF dual-hosted git repository. riemer pushed a commit to branch 1327-failed-to-start-local-backend-enviroment in repository https://gitbox.apache.org/repos/asf/streampipes.git
commit b1e23640ede344149c0dea102e18e1ddd81b0200 Author: Dominik Riemer <[email protected]> AuthorDate: Tue Feb 21 17:25:15 2023 +0100 Support backend-only development mode (#1327) --- .../extensions-all-jvm/docker-compose.dev.yml | 4 +- .../extensions-all-jvm/docker-compose.yml | 4 +- .../deploy/standalone/ui-custom-conf/default.conf | 47 ++++++++++++++++++++++ .../ui-custom-conf/docker-compose.dev.yml} | 13 +++--- .../docker-compose.yml | 14 +++---- installer/cli/environments/backend | 2 +- installer/cli/environments/backend-nats | 2 +- 7 files changed, 65 insertions(+), 21 deletions(-) diff --git a/installer/cli/deploy/standalone/extensions-all-jvm/docker-compose.dev.yml b/installer/cli/deploy/standalone/extensions-all-jvm/docker-compose.dev.yml index 9dea6293e..1c7453269 100644 --- a/installer/cli/deploy/standalone/extensions-all-jvm/docker-compose.dev.yml +++ b/installer/cli/deploy/standalone/extensions-all-jvm/docker-compose.dev.yml @@ -18,5 +18,5 @@ services: extensions-all-jvm: labels: org.apache.streampipes.dev.extensions-all-jvm.service.description: "Dev extensions-all-jvm service" -# ports: -# - "8098:8090" + ports: + - "8090:8090" diff --git a/installer/cli/deploy/standalone/extensions-all-jvm/docker-compose.yml b/installer/cli/deploy/standalone/extensions-all-jvm/docker-compose.yml index f8662641b..531e1754f 100644 --- a/installer/cli/deploy/standalone/extensions-all-jvm/docker-compose.yml +++ b/installer/cli/deploy/standalone/extensions-all-jvm/docker-compose.yml @@ -19,10 +19,12 @@ services: image: ${SP_DOCKER_REGISTRY}/extensions-all-jvm:${SP_VERSION} depends_on: - consul - - backend - couchdb volumes: - files:/spImages +# Set SP_HOST to an IP or hostname that can be resolved from the Docker container and local-running backend +# environment: +# - SP_HOST=host.docker.internal logging: driver: "json-file" options: diff --git a/installer/cli/deploy/standalone/ui-custom-conf/default.conf b/installer/cli/deploy/standalone/ui-custom-conf/default.conf new file mode 100644 index 000000000..3ba0a7803 --- /dev/null +++ b/installer/cli/deploy/standalone/ui-custom-conf/default.conf @@ -0,0 +1,47 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +server { + listen 80 default_server; + resolver 127.0.0.11; + + root /usr/share/nginx/html; + + # Enable gzip compression + gzip on; + gzip_static on; + gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; + gzip_proxied any; + gzip_vary on; + gzip_comp_level 6; + gzip_buffers 16 8k; + gzip_http_version 1.1; + + # StreamPipes + + location /streampipes-backend { + +# When running the backend locally and the UI in Docker, change the upstream to an IP resolvable from within Docker + set $upstream host.docker.internal:8030; + + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-NginX-Proxy true; + proxy_pass http://$upstream; + proxy_ssl_session_reuse off; + proxy_set_header Host $http_host; + proxy_redirect off; + } +} diff --git a/installer/cli/environments/backend b/installer/cli/deploy/standalone/ui-custom-conf/docker-compose.dev.yml similarity index 85% copy from installer/cli/environments/backend copy to installer/cli/deploy/standalone/ui-custom-conf/docker-compose.dev.yml index 175482356..51fe0bc7f 100644 --- a/installer/cli/environments/backend +++ b/installer/cli/deploy/standalone/ui-custom-conf/docker-compose.dev.yml @@ -13,11 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -[environment:backend] -kafka -consul -zookeeper -couchdb -influxdb -extensions-all-jvm -ui +version: "3.4" +services: + ui-custom-conf: + labels: + org.apache.streampipes.dev.ui.service.description: "Dev UI service" diff --git a/installer/cli/deploy/standalone/extensions-all-jvm/docker-compose.yml b/installer/cli/deploy/standalone/ui-custom-conf/docker-compose.yml similarity index 84% copy from installer/cli/deploy/standalone/extensions-all-jvm/docker-compose.yml copy to installer/cli/deploy/standalone/ui-custom-conf/docker-compose.yml index f8662641b..917e90b54 100644 --- a/installer/cli/deploy/standalone/extensions-all-jvm/docker-compose.yml +++ b/installer/cli/deploy/standalone/ui-custom-conf/docker-compose.yml @@ -15,14 +15,15 @@ version: "3.4" services: - extensions-all-jvm: - image: ${SP_DOCKER_REGISTRY}/extensions-all-jvm:${SP_VERSION} + ui-custom-conf: + image: ${SP_DOCKER_REGISTRY}/ui:${SP_VERSION} + ports: + - "80:80" depends_on: + - couchdb - consul - - backend - - couchdb volumes: - - files:/spImages + - "../ui-custom-conf/default.conf:/etc/nginx/conf.d/default.conf" logging: driver: "json-file" options: @@ -31,9 +32,6 @@ services: networks: spnet: -volumes: - files: - networks: spnet: external: true diff --git a/installer/cli/environments/backend b/installer/cli/environments/backend index 175482356..0807ade25 100644 --- a/installer/cli/environments/backend +++ b/installer/cli/environments/backend @@ -20,4 +20,4 @@ zookeeper couchdb influxdb extensions-all-jvm -ui +ui-custom-conf diff --git a/installer/cli/environments/backend-nats b/installer/cli/environments/backend-nats index 2abf3dee5..930a6ee9c 100644 --- a/installer/cli/environments/backend-nats +++ b/installer/cli/environments/backend-nats @@ -19,4 +19,4 @@ couchdb influxdb nats extensions-all-jvm -ui +ui-custom-conf
