Skip to content

Commit

Permalink
[image-provider] rename imageprovider to image-provider (#1857)
Browse files Browse the repository at this point in the history
* rename imageprovider to image-provider

* rename imageprovider to image-provider

---------

Co-authored-by: Juliano Costa <julianocosta89@outlook.com>
  • Loading branch information
puckpuck and julianocosta89 authored Dec 22, 2024
1 parent d75a68d commit d5c0efe
Show file tree
Hide file tree
Showing 21 changed files with 28 additions and 26 deletions.
4 changes: 2 additions & 2 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ FRONTEND_PROXY_ADDR=frontend-proxy:${ENVOY_PORT}
FRONTEND_PROXY_DOCKERFILE=./src/frontendproxy/Dockerfile

# Image Provider
IMAGE_PROVIDER_HOST=imageprovider
IMAGE_PROVIDER_HOST=image-provider
IMAGE_PROVIDER_PORT=8081
IMAGE_PROVIDER_DOCKERFILE=./src/imageprovider/Dockerfile
IMAGE_PROVIDER_DOCKERFILE=./src/image-provider/Dockerfile

# Load Generator
LOCUST_WEB_PORT=8089
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/component-build-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ jobs:
tag_suffix: frontend-tests
context: ./
setup-qemu: true
- file: ./src/imageprovider/Dockerfile
tag_suffix: imageprovider
- file: ./src/image-provider/Dockerfile
tag_suffix: image-provider
context: ./
setup-qemu: true
- file: ./src/kafka/Dockerfile
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ the release.
([#1855](https://github.com/open-telemetry/opentelemetry-demo/pull/1855))
* [load-generator] rename loadgenerator to load-generator
([#1856](https://github.com/open-telemetry/opentelemetry-demo/pull/1856))
* [image-provider] rename imageprovider to image-provider
([#1857](https://github.com/open-telemetry/opentelemetry-demo/pull/1857))

## 1.12.0

Expand Down
14 changes: 7 additions & 7 deletions docker-compose.minimal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ services:
condition: service_started
otel-collector:
condition: service_started
imageprovider:
image-provider:
condition: service_started
logging: *logging

Expand Down Expand Up @@ -285,15 +285,15 @@ services:
grafana:
condition: service_started

# Imageprovider
imageprovider:
image: ${IMAGE_NAME}:${DEMO_VERSION}-imageprovider
container_name: imageprovider
# image-provider
image-provider:
image: ${IMAGE_NAME}:${DEMO_VERSION}-image-provider
container_name: image-provider
build:
context: ./
dockerfile: ${IMAGE_PROVIDER_DOCKERFILE}
cache_from:
- ${IMAGE_NAME}:${IMAGE_VERSION}-imageprovider
- ${IMAGE_NAME}:${IMAGE_VERSION}-image-provider
deploy:
resources:
limits:
Expand All @@ -305,7 +305,7 @@ services:
- IMAGE_PROVIDER_PORT
- OTEL_COLLECTOR_HOST
- OTEL_COLLECTOR_PORT_GRPC
- OTEL_SERVICE_NAME=imageprovider
- OTEL_SERVICE_NAME=image-provider
- OTEL_RESOURCE_ATTRIBUTES
depends_on:
otel-collector:
Expand Down
14 changes: 7 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ services:
condition: service_started
otel-collector:
condition: service_started
imageprovider:
image-provider:
condition: service_started
flagd:
condition: service_started
Expand Down Expand Up @@ -361,15 +361,15 @@ services:
flagd-ui:
condition: service_started

# Imageprovider
imageprovider:
image: ${IMAGE_NAME}:${DEMO_VERSION}-imageprovider
container_name: imageprovider
# image-provider
image-provider:
image: ${IMAGE_NAME}:${DEMO_VERSION}-image-provider
container_name: image-provider
build:
context: ./
dockerfile: ${IMAGE_PROVIDER_DOCKERFILE}
cache_from:
- ${IMAGE_NAME}:${IMAGE_VERSION}-imageprovider
- ${IMAGE_NAME}:${IMAGE_VERSION}-image-provider
deploy:
resources:
limits:
Expand All @@ -381,7 +381,7 @@ services:
- IMAGE_PROVIDER_PORT
- OTEL_COLLECTOR_HOST
- OTEL_COLLECTOR_PORT_GRPC
- OTEL_SERVICE_NAME=imageprovider
- OTEL_SERVICE_NAME=image-provider
- OTEL_RESOURCE_ATTRIBUTES
depends_on:
otel-collector:
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/utils/imageLoader.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
/*
* We connect to imageprovider through the envoy proxy, straight from the browser, for this we need to know the current hostname and port.
* We connect to image-provider through the envoy proxy, straight from the browser, for this we need to know the current hostname and port.
* During building and serverside rendering, these are undefined so we use some conditionals and default values.
*/
let hostname = "localhost";
Expand All @@ -15,6 +15,6 @@ if (typeof window !== "undefined" && window.location) {
}

export default function imageLoader({ src, width, quality }) {
// We pass down the optimisation request to the imageprovider service here, without this, nextJs would try to use internal optimiser which is not working with the external imageprovider.
// We pass down the optimisation request to the image-provider service here, without this, nextJs would try to use internal optimiser which is not working with the external image-provider.
return `${protocol}://${hostname}:${port}/${src}?w=${width}&q=${quality || 75}`
}
6 changes: 3 additions & 3 deletions src/frontendproxy/envoy.tmpl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ static_resources:
- match: { prefix: "/grafana" }
route: { cluster: grafana }
- match: { prefix: "/images/" }
route: { cluster: imageprovider, prefix_rewrite: "/" }
route: { cluster: image-provider, prefix_rewrite: "/" }
- match: { prefix: "/flagservice/" }
route: { cluster: flagservice, prefix_rewrite: "/", timeout: 0s }
- match: { prefix: "/feature" }
Expand Down Expand Up @@ -200,11 +200,11 @@ static_resources:
socket_address:
address: ${FRONTEND_HOST}
port_value: ${FRONTEND_PORT}
- name: imageprovider
- name: image-provider
type: STRICT_DNS
lb_policy: ROUND_ROBIN
load_assignment:
cluster_name: imageprovider
cluster_name: image-provider
endpoints:
- lb_endpoints:
- endpoint:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ RUN echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] http://n
RUN apt-get update ; apt-get install nginx-module-otel --no-install-recommends --no-install-suggests -y

RUN mkdir /static
COPY src/imageprovider/static /static
COPY src/image-provider/static /static

EXPOSE ${IMAGE_PROVIDER_PORT}

STOPSIGNAL SIGQUIT

COPY src/imageprovider/nginx.conf.template /nginx.conf.template
COPY src/image-provider/nginx.conf.template /nginx.conf.template

# Start nginx
CMD ["/bin/sh" , "-c" , "envsubst '$OTEL_COLLECTOR_HOST $IMAGE_PROVIDER_PORT $OTEL_COLLECTOR_PORT_GRPC $OTEL_SERVICE_NAME' < /nginx.conf.template > /etc/nginx/nginx.conf && cat /etc/nginx/nginx.conf && exec nginx -g 'daemon off;'"]
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ http {
otel_trace on;
otel_trace_context propagate;
otel_service_name ${OTEL_SERVICE_NAME};
otel_span_name imageprovider;
otel_span_name image-provider;


include mime.types;
Expand Down
File renamed without changes

0 comments on commit d5c0efe

Please sign in to comment.