Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[image-provider] rename imageprovider to image-provider #1857

Merged
merged 4 commits into from
Dec 22, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -50,6 +50,8 @@ the release.
([#1781](https://github.com/open-telemetry/opentelemetry-demo/pull/1781))
* [chore] Update demo Dependencies (Collector, Grafana, FlagD, Jaeger, Prometheus)
([#1855](https://github.com/open-telemetry/opentelemetry-demo/pull/1855))
* [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
Loading