Skip to content

Commit 2210b5b

Browse files
authored
[recommendation] rename recommendationservice to recommendation (#1865)
1 parent 4c8e43f commit 2210b5b

26 files changed

+50
-48
lines changed

.env

+3-3
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,9 @@ QUOTE_ADDR=http://quote:${QUOTE_PORT}
117117
QUOTE_DOCKERFILE=./src/quote/Dockerfile
118118

119119
# Recommendation Service
120-
RECOMMENDATION_SERVICE_PORT=9001
121-
RECOMMENDATION_SERVICE_ADDR=recommendationservice:${RECOMMENDATION_SERVICE_PORT}
122-
RECOMMENDATION_SERVICE_DOCKERFILE=./src/recommendationservice/Dockerfile
120+
RECOMMENDATION_PORT=9001
121+
RECOMMENDATION_ADDR=recommendation:${RECOMMENDATION_PORT}
122+
RECOMMENDATION_DOCKERFILE=./src/recommendation/Dockerfile
123123

124124
# Shipping Service
125125
SHIPPING_PORT=50050

.github/workflows/component-build-images.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ jobs:
115115
tag_suffix: quote
116116
context: ./
117117
setup-qemu: true
118-
- file: ./src/recommendationservice/Dockerfile
119-
tag_suffix: recommendationservice
118+
- file: ./src/recommendation/Dockerfile
119+
tag_suffix: recommendation
120120
context: ./
121121
setup-qemu: true
122122
- file: ./src/shipping/Dockerfile

.licenserc.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@
5151
"src/react-native-app/android/.gradle/",
5252
"src/react-native-app/.expo/",
5353
"src/react-native-app/expo-env.d.ts",
54-
"src/recommendationservice/demo_pb2.py",
55-
"src/recommendationservice/demo_pb2_grpc.py",
54+
"src/recommendation/demo_pb2.py",
55+
"src/recommendation/demo_pb2_grpc.py",
5656
"internal/tools/"
5757
]
5858
}

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ the release.
6262
([#1862](https://github.com/open-telemetry/opentelemetry-demo/pull/1862))
6363
* [payment] rename paymentservice to payment
6464
([#1863](https://github.com/open-telemetry/opentelemetry-demo/pull/1863))
65+
* [recommendation] rename recommendationservice to recommendation
66+
([#1865](https://github.com/open-telemetry/opentelemetry-demo/pull/1865))
6567

6668
## 1.12.0
6769

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ docker-generate-protobuf:
140140
.PHONY: clean
141141
clean:
142142
rm -rf ./src/{checkoutservice,productcatalogservice}/genproto/oteldemo/
143-
rm -rf ./src/recommendationservice/{demo_pb2,demo_pb2_grpc}.py
143+
rm -rf ./src/recommendation/{demo_pb2,demo_pb2_grpc}.py
144144

145145
.PHONY: check-clean-work-tree
146146
check-clean-work-tree:

docker-compose-tests.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ services:
4545
- FRONTEND_ADDR
4646
- PAYMENT_ADDR
4747
- PRODUCT_CATALOG_SERVICE_ADDR
48-
- RECOMMENDATION_SERVICE_ADDR
48+
- RECOMMENDATION_ADDR
4949
- SHIPPING_ADDR
5050
- KAFKA_SERVICE_ADDR
5151
extra_hosts:
@@ -79,7 +79,7 @@ services:
7979
condition: service_started
8080
quote:
8181
condition: service_started
82-
recommendationservice:
82+
recommendation:
8383
condition: service_started
8484
shipping:
8585
condition: service_started

docker-compose.minimal.yml

+9-9
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ services:
204204
- CHECKOUT_SERVICE_ADDR
205205
- CURRENCY_ADDR
206206
- PRODUCT_CATALOG_SERVICE_ADDR
207-
- RECOMMENDATION_SERVICE_ADDR
207+
- RECOMMENDATION_ADDR
208208
- SHIPPING_ADDR
209209
- OTEL_EXPORTER_OTLP_ENDPOINT
210210
- OTEL_RESOURCE_ATTRIBUTES=${OTEL_RESOURCE_ATTRIBUTES}
@@ -229,7 +229,7 @@ services:
229229
condition: service_started
230230
quote:
231231
condition: service_started
232-
recommendationservice:
232+
recommendation:
233233
condition: service_started
234234
shipping:
235235
condition: service_started
@@ -435,30 +435,30 @@ services:
435435
logging: *logging
436436

437437
# Recommendation service
438-
recommendationservice:
439-
image: ${IMAGE_NAME}:${DEMO_VERSION}-recommendationservice
438+
recommendation:
439+
image: ${IMAGE_NAME}:${DEMO_VERSION}-recommendation
440440
container_name: recommendation-service
441441
build:
442442
context: ./
443-
dockerfile: ${RECOMMENDATION_SERVICE_DOCKERFILE}
443+
dockerfile: ${RECOMMENDATION_DOCKERFILE}
444444
cache_from:
445-
- ${IMAGE_NAME}:${IMAGE_VERSION}-recommendationservice
445+
- ${IMAGE_NAME}:${IMAGE_VERSION}-recommendation
446446
deploy:
447447
resources:
448448
limits:
449449
memory: 50M
450450
restart: unless-stopped
451451
ports:
452-
- "${RECOMMENDATION_SERVICE_PORT}"
452+
- "${RECOMMENDATION_PORT}"
453453
environment:
454454
- FLAGD_HOST
455-
- RECOMMENDATION_SERVICE_PORT
455+
- RECOMMENDATION_PORT
456456
- PRODUCT_CATALOG_SERVICE_ADDR
457457
- OTEL_PYTHON_LOG_CORRELATION=true
458458
- OTEL_EXPORTER_OTLP_ENDPOINT
459459
- OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE
460460
- OTEL_RESOURCE_ATTRIBUTES
461-
- OTEL_SERVICE_NAME=recommendationservice
461+
- OTEL_SERVICE_NAME=recommendation
462462
- PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
463463
depends_on:
464464
productcatalogservice:

docker-compose.yml

+9-9
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ services:
276276
- CHECKOUT_SERVICE_ADDR
277277
- CURRENCY_ADDR
278278
- PRODUCT_CATALOG_SERVICE_ADDR
279-
- RECOMMENDATION_SERVICE_ADDR
279+
- RECOMMENDATION_ADDR
280280
- SHIPPING_ADDR
281281
- OTEL_EXPORTER_OTLP_ENDPOINT
282282
- OTEL_RESOURCE_ATTRIBUTES=${OTEL_RESOURCE_ATTRIBUTES}
@@ -301,7 +301,7 @@ services:
301301
condition: service_started
302302
quote:
303303
condition: service_started
304-
recommendationservice:
304+
recommendation:
305305
condition: service_started
306306
shipping:
307307
condition: service_started
@@ -517,31 +517,31 @@ services:
517517
logging: *logging
518518

519519
# Recommendation service
520-
recommendationservice:
521-
image: ${IMAGE_NAME}:${DEMO_VERSION}-recommendationservice
520+
recommendation:
521+
image: ${IMAGE_NAME}:${DEMO_VERSION}-recommendation
522522
container_name: recommendation-service
523523
build:
524524
context: ./
525-
dockerfile: ${RECOMMENDATION_SERVICE_DOCKERFILE}
525+
dockerfile: ${RECOMMENDATION_DOCKERFILE}
526526
cache_from:
527-
- ${IMAGE_NAME}:${IMAGE_VERSION}-recommendationservice
527+
- ${IMAGE_NAME}:${IMAGE_VERSION}-recommendation
528528
deploy:
529529
resources:
530530
limits:
531531
memory: 500M # This is high to enable supporting the recommendationCache feature flag use case
532532
restart: unless-stopped
533533
ports:
534-
- "${RECOMMENDATION_SERVICE_PORT}"
534+
- "${RECOMMENDATION_PORT}"
535535
environment:
536-
- RECOMMENDATION_SERVICE_PORT
536+
- RECOMMENDATION_PORT
537537
- PRODUCT_CATALOG_SERVICE_ADDR
538538
- FLAGD_HOST
539539
- FLAGD_PORT
540540
- OTEL_PYTHON_LOG_CORRELATION=true
541541
- OTEL_EXPORTER_OTLP_ENDPOINT
542542
- OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE
543543
- OTEL_RESOURCE_ATTRIBUTES
544-
- OTEL_SERVICE_NAME=recommendationservice
544+
- OTEL_SERVICE_NAME=recommendation
545545
- PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
546546
depends_on:
547547
productcatalogservice:

docker-gen-proto.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@ gen_proto_go checkoutservice
3131
#gen_proto_js payment
3232
gen_proto_go productcatalogservice
3333
#gen_proto_php quote
34-
gen_proto_python recommendationservice
34+
gen_proto_python recommendation
3535
#gen_proto_rust shipping

ide-gen-proto.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,5 @@ gen_proto_ts react-native-app
7676
gen_proto_js payment
7777
gen_proto_go productcatalogservice
7878
# gen_proto_php quote
79-
gen_proto_python recommendationservice
79+
gen_proto_python recommendation
8080
gen_proto_rust shipping

renovate.json5

+2-2
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@
8787
"groupName": "quote",
8888
},
8989
{
90-
"matchFileNames": ["src/recommendationservice/**"],
91-
"groupName": "recommendationservice",
90+
"matchFileNames": ["src/recommendation/**"],
91+
"groupName": "recommendation",
9292
},
9393
{
9494
"matchFileNames": ["src/shipping/**"],

src/flagd/demo.flagd.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
},
1111
"defaultVariant": "off"
1212
},
13-
"recommendationServiceCacheFailure": {
13+
"recommendationCacheFailure": {
1414
"description": "Fail recommendation service cache",
1515
"state": "ENABLED",
1616
"variants": {

src/frontend/gateways/rpc/Recommendations.gateway.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
import { ChannelCredentials } from '@grpc/grpc-js';
55
import { ListRecommendationsResponse, RecommendationServiceClient } from '../../protos/demo';
66

7-
const { RECOMMENDATION_SERVICE_ADDR = '' } = process.env;
7+
const { RECOMMENDATION_ADDR = '' } = process.env;
88

9-
const client = new RecommendationServiceClient(RECOMMENDATION_SERVICE_ADDR, ChannelCredentials.createInsecure());
9+
const client = new RecommendationServiceClient(RECOMMENDATION_ADDR, ChannelCredentials.createInsecure());
1010

1111
const RecommendationsGateway = () => ({
1212
listRecommendations(userId: string, productIds: string[]) {

src/frontend/next.config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const {
1818
CHECKOUT_SERVICE_ADDR = '',
1919
CURRENCY_ADDR = '',
2020
PRODUCT_CATALOG_SERVICE_ADDR = '',
21-
RECOMMENDATION_SERVICE_ADDR = '',
21+
RECOMMENDATION_ADDR = '',
2222
SHIPPING_ADDR = '',
2323
ENV_PLATFORM = '',
2424
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT = '',
@@ -50,7 +50,7 @@ const nextConfig = {
5050
CHECKOUT_SERVICE_ADDR,
5151
CURRENCY_ADDR,
5252
PRODUCT_CATALOG_SERVICE_ADDR,
53-
RECOMMENDATION_SERVICE_ADDR,
53+
RECOMMENDATION_ADDR,
5454
SHIPPING_ADDR,
5555
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT,
5656
NEXT_PUBLIC_PLATFORM: ENV_PLATFORM,

src/recommendationservice/Dockerfile src/recommendation/Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ RUN apt-get -qq update \
1313
&& rm -rf /var/lib/apt/lists/*
1414

1515
WORKDIR /usr/src/app/
16-
COPY ./src/recommendationservice/requirements.txt ./
16+
COPY ./src/recommendation/requirements.txt ./
1717

1818
RUN pip install --upgrade pip
1919
RUN pip install --prefix="/reqs" -r requirements.txt
@@ -24,9 +24,9 @@ RUN pip install --prefix="/reqs" -r requirements.txt
2424
FROM base AS runtime
2525
WORKDIR /usr/src/app/
2626
COPY --from=builder /reqs /usr/local
27-
COPY ./src/recommendationservice/ ./
27+
COPY ./src/recommendation/ ./
2828

2929
RUN opentelemetry-bootstrap -a install
3030

31-
EXPOSE ${RECOMMENDATION_SERVICE_PORT}
31+
EXPOSE ${RECOMMENDATION_PORT}
3232
ENTRYPOINT [ "opentelemetry-instrument", "python", "recommendation_server.py" ]

src/recommendationservice/README.md src/recommendation/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ make docker-generate-protobuf
1616
From the root directory, run:
1717

1818
```sh
19-
docker compose build recommendationservice
19+
docker compose build recommendation
2020
```
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/recommendationservice/recommendation_server.py src/recommendation/recommendation_server.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def get_product_list(request_product_ids):
7575
request_product_ids = request_product_ids_str.split(',')
7676

7777
# Feature flag scenario - Cache Leak
78-
if check_feature_flag("recommendationServiceCacheFailure"):
78+
if check_feature_flag("recommendationCacheFailure"):
7979
span.set_attribute("app.recommendation.cache_enabled", True)
8080
if random.random() < 0.5 or first_run:
8181
first_run = False
@@ -123,7 +123,7 @@ def must_map_env(key: str):
123123
def check_feature_flag(flag_name: str):
124124
# Initialize OpenFeature
125125
client = api.get_client()
126-
return client.get_boolean_value("recommendationServiceCacheFailure", False)
126+
return client.get_boolean_value("recommendationCacheFailure", False)
127127

128128

129129
if __name__ == "__main__":
@@ -166,7 +166,7 @@ def check_feature_flag(flag_name: str):
166166
health_pb2_grpc.add_HealthServicer_to_server(service, server)
167167

168168
# Start server
169-
port = must_map_env('RECOMMENDATION_SERVICE_PORT')
169+
port = must_map_env('RECOMMENDATION_PORT')
170170
server.add_insecure_port(f'[::]:{port}')
171171
server.start()
172172
logger.info(f'Recommendation service started, listening on port {port}')
File renamed without changes.

test/tracetesting/recommendationservice/list.yaml test/tracetesting/recommendation/list.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ spec:
1010
type: grpc
1111
grpc:
1212
protobufFile: ../../../pb/demo.proto
13-
address: ${var:RECOMMENDATION_SERVICE_ADDR}
13+
address: ${var:RECOMMENDATION_ADDR}
1414
method: oteldemo.RecommendationService.ListRecommendations
1515
request: |-
1616
{

test/tracetesting/run.bash

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
set -e
99

1010
# Availalble services to test
11-
ALL_SERVICES=("ad" "cart" "currency" "checkoutservice" "frontend" "email" "payment" "productcatalogservice" "recommendationservice" "shipping")
11+
ALL_SERVICES=("ad" "cart" "currency" "checkoutservice" "frontend" "email" "payment" "productcatalogservice" "recommendation" "shipping")
1212

1313
## Script variables
1414
# Will contain the list of services to test
@@ -50,8 +50,8 @@ spec:
5050
value: $PAYMENT_ADDR
5151
- key: PRODUCT_CATALOG_SERVICE_ADDR
5252
value: $PRODUCT_CATALOG_SERVICE_ADDR
53-
- key: RECOMMENDATION_SERVICE_ADDR
54-
value: $RECOMMENDATION_SERVICE_ADDR
53+
- key: RECOMMENDATION_ADDR
54+
value: $RECOMMENDATION_ADDR
5555
- key: SHIPPING_ADDR
5656
value: $SHIPPING_ADDR
5757
- key: KAFKA_SERVICE_ADDR

0 commit comments

Comments
 (0)