From 0f27d9f3bc3549f59390816f1058e1faf0bbc010 Mon Sep 17 00:00:00 2001 From: Pierre Tessier Date: Sun, 22 Dec 2024 23:09:20 -0500 Subject: [PATCH 1/4] rename productcatalogservice to product-catalog --- .env | 6 ++--- .github/dependabot.yml | 2 +- .github/workflows/component-build-images.yml | 4 +-- .licenserc.json | 2 +- Makefile | 2 +- docker-compose-tests.yml | 4 +-- docker-compose.minimal.yml | 24 ++++++++--------- docker-compose.yml | 24 ++++++++--------- docker-gen-proto.sh | 2 +- ide-gen-proto.sh | 2 +- renovate.json5 | 4 +-- src/checkoutservice/main.go | 2 +- .../gateways/rpc/ProductCatalog.gateway.ts | 4 +-- src/frontend/next.config.js | 4 +-- src/product-catalog/Dockerfile | 27 +++++++++++++++++++ .../README.md | 4 +-- .../genproto/Dockerfile | 0 .../genproto/oteldemo/demo.pb.go | 0 .../genproto/oteldemo/demo_grpc.pb.go | 0 .../go.mod | 2 +- .../go.sum | 0 .../main.go | 10 +++---- .../products/products.json | 0 .../tools.go | 0 src/productcatalogservice/Dockerfile | 27 ------------------- .../recommendation_server.py | 2 +- .../all.yaml | 2 +- .../get.yaml | 2 +- .../list.yaml | 2 +- .../search.yaml | 2 +- test/tracetesting/run.bash | 6 ++--- 31 files changed, 86 insertions(+), 86 deletions(-) create mode 100644 src/product-catalog/Dockerfile rename src/{productcatalogservice => product-catalog}/README.md (88%) rename src/{productcatalogservice => product-catalog}/genproto/Dockerfile (100%) rename src/{productcatalogservice => product-catalog}/genproto/oteldemo/demo.pb.go (100%) rename src/{productcatalogservice => product-catalog}/genproto/oteldemo/demo_grpc.pb.go (100%) rename src/{productcatalogservice => product-catalog}/go.mod (97%) rename src/{productcatalogservice => product-catalog}/go.sum (100%) rename src/{productcatalogservice => product-catalog}/main.go (95%) rename src/{productcatalogservice => product-catalog}/products/products.json (100%) rename src/{productcatalogservice => product-catalog}/tools.go (100%) delete mode 100644 src/productcatalogservice/Dockerfile rename test/tracetesting/{productcatalogservice => product-catalog}/all.yaml (88%) rename test/tracetesting/{productcatalogservice => product-catalog}/get.yaml (96%) rename test/tracetesting/{productcatalogservice => product-catalog}/list.yaml (94%) rename test/tracetesting/{productcatalogservice => product-catalog}/search.yaml (95%) diff --git a/.env b/.env index b011c764dc..8c25ce13ad 100644 --- a/.env +++ b/.env @@ -107,9 +107,9 @@ PAYMENT_SERVICE_ADDR=paymentservice:${PAYMENT_SERVICE_PORT} PAYMENT_SERVICE_DOCKERFILE=./src/paymentservice/Dockerfile # Product Catalog Service -PRODUCT_CATALOG_SERVICE_PORT=3550 -PRODUCT_CATALOG_SERVICE_ADDR=productcatalogservice:${PRODUCT_CATALOG_SERVICE_PORT} -PRODUCT_CATALOG_DOCKERFILE=./src/productcatalogservice/Dockerfile +PRODUCT_CATALOG_PORT=3550 +PRODUCT_CATALOG_ADDR=product-catalog:${PRODUCT_CATALOG_PORT} +PRODUCT_CATALOG_DOCKERFILE=./src/product-catalog/Dockerfile # Quote Service QUOTE_PORT=8090 diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 7b52d100f8..6553a4bd5c 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -11,7 +11,7 @@ updates: - package-ecosystem: "gomod" directories: - "/src/checkoutservice" - - "/src/productcatalogservice" + - "/src/product-catalog" groups: go-production-dependencies: dependency-type: "production" diff --git a/.github/workflows/component-build-images.yml b/.github/workflows/component-build-images.yml index 1ebd177346..a9f4e73b7a 100644 --- a/.github/workflows/component-build-images.yml +++ b/.github/workflows/component-build-images.yml @@ -107,8 +107,8 @@ jobs: tag_suffix: paymentservice context: ./ setup-qemu: true - - file: ./src/productcatalogservice/Dockerfile - tag_suffix: productcatalogservice + - file: ./src/product-catalog/Dockerfile + tag_suffix: product-catalog context: ./ setup-qemu: true - file: ./src/quote/Dockerfile diff --git a/.licenserc.json b/.licenserc.json index 6c3d85a679..fc7e80fc5d 100644 --- a/.licenserc.json +++ b/.licenserc.json @@ -44,7 +44,7 @@ "src/checkoutservice/genproto/", "src/featureflagservice/assets/vendor/", "src/featureflagservice/priv/", - "src/productcatalogservice/genproto/", + "src/product-catalog/genproto/", "src/react-native-app/ios/Pods/", "src/react-native-app/ios/build/", "src/react-native-app/android/app/build/", diff --git a/Makefile b/Makefile index 7f6e6640b7..5e09dd7ea4 100644 --- a/Makefile +++ b/Makefile @@ -139,7 +139,7 @@ docker-generate-protobuf: .PHONY: clean clean: - rm -rf ./src/{checkoutservice,productcatalogservice}/genproto/oteldemo/ + rm -rf ./src/{checkoutservice,product-catalog}/genproto/oteldemo/ rm -rf ./src/recommendationservice/{demo_pb2,demo_pb2_grpc}.py .PHONY: check-clean-work-tree diff --git a/docker-compose-tests.yml b/docker-compose-tests.yml index 31fd9a80ab..6ec09eac04 100644 --- a/docker-compose-tests.yml +++ b/docker-compose-tests.yml @@ -44,7 +44,7 @@ services: - EMAIL_SERVICE_ADDR - FRONTEND_ADDR - PAYMENT_SERVICE_ADDR - - PRODUCT_CATALOG_SERVICE_ADDR + - PRODUCT_CATALOG_ADDR - RECOMMENDATION_SERVICE_ADDR - SHIPPING_ADDR - KAFKA_SERVICE_ADDR @@ -75,7 +75,7 @@ services: condition: service_started paymentservice: condition: service_started - productcatalogservice: + product-catalog: condition: service_started quote: condition: service_started diff --git a/docker-compose.minimal.yml b/docker-compose.minimal.yml index 0c0b868462..ea7f7afaff 100644 --- a/docker-compose.minimal.yml +++ b/docker-compose.minimal.yml @@ -103,7 +103,7 @@ services: - EMAIL_SERVICE_ADDR - FLAGD_HOST - PAYMENT_SERVICE_ADDR - - PRODUCT_CATALOG_SERVICE_ADDR + - PRODUCT_CATALOG_ADDR - SHIPPING_ADDR - OTEL_EXPORTER_OTLP_ENDPOINT - OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE @@ -118,7 +118,7 @@ services: condition: service_started paymentservice: condition: service_started - productcatalogservice: + product-catalog: condition: service_started shipping: condition: service_started @@ -203,7 +203,7 @@ services: - CART_ADDR - CHECKOUT_SERVICE_ADDR - CURRENCY_ADDR - - PRODUCT_CATALOG_SERVICE_ADDR + - PRODUCT_CATALOG_ADDR - RECOMMENDATION_SERVICE_ADDR - SHIPPING_ADDR - OTEL_EXPORTER_OTLP_ENDPOINT @@ -225,7 +225,7 @@ services: condition: service_started currency: condition: service_started - productcatalogservice: + product-catalog: condition: service_started quote: condition: service_started @@ -379,28 +379,28 @@ services: logging: *logging # Product Catalog service - productcatalogservice: - image: ${IMAGE_NAME}:${DEMO_VERSION}-productcatalogservice + product-catalog: + image: ${IMAGE_NAME}:${DEMO_VERSION}-product-catalog container_name: product-catalog-service build: context: ./ dockerfile: ${PRODUCT_CATALOG_DOCKERFILE} cache_from: - - ${IMAGE_NAME}:${IMAGE_VERSION}-productcatalogservice + - ${IMAGE_NAME}:${IMAGE_VERSION}-product-catalog deploy: resources: limits: memory: 20M restart: unless-stopped ports: - - "${PRODUCT_CATALOG_SERVICE_PORT}" + - "${PRODUCT_CATALOG_PORT}" environment: - FLAGD_HOST - - PRODUCT_CATALOG_SERVICE_PORT + - PRODUCT_CATALOG_PORT - OTEL_EXPORTER_OTLP_ENDPOINT - OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE - OTEL_RESOURCE_ATTRIBUTES - - OTEL_SERVICE_NAME=productcatalogservice + - OTEL_SERVICE_NAME=product-catalog depends_on: otel-collector: condition: service_started @@ -453,7 +453,7 @@ services: environment: - FLAGD_HOST - RECOMMENDATION_SERVICE_PORT - - PRODUCT_CATALOG_SERVICE_ADDR + - PRODUCT_CATALOG_ADDR - OTEL_PYTHON_LOG_CORRELATION=true - OTEL_EXPORTER_OTLP_ENDPOINT - OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE @@ -461,7 +461,7 @@ services: - OTEL_SERVICE_NAME=recommendationservice - PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python depends_on: - productcatalogservice: + product-catalog: condition: service_started otel-collector: condition: service_started diff --git a/docker-compose.yml b/docker-compose.yml index 722afe90dc..8a8bf7cfca 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -136,7 +136,7 @@ services: - CURRENCY_ADDR - EMAIL_SERVICE_ADDR - PAYMENT_SERVICE_ADDR - - PRODUCT_CATALOG_SERVICE_ADDR + - PRODUCT_CATALOG_ADDR - SHIPPING_ADDR - KAFKA_SERVICE_ADDR - OTEL_EXPORTER_OTLP_ENDPOINT @@ -152,7 +152,7 @@ services: condition: service_started paymentservice: condition: service_started - productcatalogservice: + product-catalog: condition: service_started shipping: condition: service_started @@ -275,7 +275,7 @@ services: - CART_ADDR - CHECKOUT_SERVICE_ADDR - CURRENCY_ADDR - - PRODUCT_CATALOG_SERVICE_ADDR + - PRODUCT_CATALOG_ADDR - RECOMMENDATION_SERVICE_ADDR - SHIPPING_ADDR - OTEL_EXPORTER_OTLP_ENDPOINT @@ -297,7 +297,7 @@ services: condition: service_started currency: condition: service_started - productcatalogservice: + product-catalog: condition: service_started quote: condition: service_started @@ -458,29 +458,29 @@ services: logging: *logging # Product Catalog service - productcatalogservice: - image: ${IMAGE_NAME}:${DEMO_VERSION}-productcatalogservice + product-catalog: + image: ${IMAGE_NAME}:${DEMO_VERSION}-product-catalog container_name: product-catalog-service build: context: ./ dockerfile: ${PRODUCT_CATALOG_DOCKERFILE} cache_from: - - ${IMAGE_NAME}:${IMAGE_VERSION}-productcatalogservice + - ${IMAGE_NAME}:${IMAGE_VERSION}-product-catalog deploy: resources: limits: memory: 20M restart: unless-stopped ports: - - "${PRODUCT_CATALOG_SERVICE_PORT}" + - "${PRODUCT_CATALOG_PORT}" environment: - - PRODUCT_CATALOG_SERVICE_PORT + - PRODUCT_CATALOG_PORT - FLAGD_HOST - FLAGD_PORT - OTEL_EXPORTER_OTLP_ENDPOINT - OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE - OTEL_RESOURCE_ATTRIBUTES - - OTEL_SERVICE_NAME=productcatalogservice + - OTEL_SERVICE_NAME=product-catalog depends_on: otel-collector: condition: service_started @@ -534,7 +534,7 @@ services: - "${RECOMMENDATION_SERVICE_PORT}" environment: - RECOMMENDATION_SERVICE_PORT - - PRODUCT_CATALOG_SERVICE_ADDR + - PRODUCT_CATALOG_ADDR - FLAGD_HOST - FLAGD_PORT - OTEL_PYTHON_LOG_CORRELATION=true @@ -544,7 +544,7 @@ services: - OTEL_SERVICE_NAME=recommendationservice - PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python depends_on: - productcatalogservice: + product-catalog: condition: service_started otel-collector: condition: service_started diff --git a/docker-gen-proto.sh b/docker-gen-proto.sh index 80fa1f8634..1515c2ab21 100755 --- a/docker-gen-proto.sh +++ b/docker-gen-proto.sh @@ -29,7 +29,7 @@ gen_proto_go checkoutservice #gen_proto_ruby emailservice #gen_proto_ts frontend #gen_proto_js paymentservice -gen_proto_go productcatalogservice +gen_proto_go product-catalog #gen_proto_php quote gen_proto_python recommendationservice #gen_proto_rust shipping diff --git a/ide-gen-proto.sh b/ide-gen-proto.sh index 14649b8517..aba2545a8d 100755 --- a/ide-gen-proto.sh +++ b/ide-gen-proto.sh @@ -74,7 +74,7 @@ gen_proto_go checkoutservice gen_proto_ts frontend gen_proto_ts react-native-app gen_proto_js paymentservice -gen_proto_go productcatalogservice +gen_proto_go product-catalog # gen_proto_php quote gen_proto_python recommendationservice gen_proto_rust shipping diff --git a/renovate.json5 b/renovate.json5 index de6ac5c52a..3017f884c8 100644 --- a/renovate.json5 +++ b/renovate.json5 @@ -75,8 +75,8 @@ "groupName": "paymentservice", }, { - "matchFileNames": ["src/productcatalogservice/**"], - "groupName": "productcatalogservice", + "matchFileNames": ["src/product-catalog/**"], + "groupName": "product-catalog", }, { "matchFileNames": ["src/prometheus/**"], diff --git a/src/checkoutservice/main.go b/src/checkoutservice/main.go index d4c7bfadc9..2b5909c068 100644 --- a/src/checkoutservice/main.go +++ b/src/checkoutservice/main.go @@ -172,7 +172,7 @@ func main() { svc.shippingSvcClient = pb.NewShippingServiceClient(c) defer c.Close() - mustMapEnv(&svc.productCatalogSvcAddr, "PRODUCT_CATALOG_SERVICE_ADDR") + mustMapEnv(&svc.productCatalogSvcAddr, "PRODUCT_CATALOG_ADDR") c = mustCreateClient(svc.productCatalogSvcAddr) svc.productCatalogSvcClient = pb.NewProductCatalogServiceClient(c) defer c.Close() diff --git a/src/frontend/gateways/rpc/ProductCatalog.gateway.ts b/src/frontend/gateways/rpc/ProductCatalog.gateway.ts index 8b0783ec5f..18d83053ed 100644 --- a/src/frontend/gateways/rpc/ProductCatalog.gateway.ts +++ b/src/frontend/gateways/rpc/ProductCatalog.gateway.ts @@ -4,9 +4,9 @@ import { ChannelCredentials } from '@grpc/grpc-js'; import { ListProductsResponse, Product, ProductCatalogServiceClient } from '../../protos/demo'; -const { PRODUCT_CATALOG_SERVICE_ADDR = '' } = process.env; +const { PRODUCT_CATALOG_ADDR = '' } = process.env; -const client = new ProductCatalogServiceClient(PRODUCT_CATALOG_SERVICE_ADDR, ChannelCredentials.createInsecure()); +const client = new ProductCatalogServiceClient(PRODUCT_CATALOG_ADDR, ChannelCredentials.createInsecure()); const ProductCatalogGateway = () => ({ listProducts() { diff --git a/src/frontend/next.config.js b/src/frontend/next.config.js index eac4615be9..6ad27eb37d 100755 --- a/src/frontend/next.config.js +++ b/src/frontend/next.config.js @@ -17,7 +17,7 @@ const { CART_ADDR = '', CHECKOUT_SERVICE_ADDR = '', CURRENCY_ADDR = '', - PRODUCT_CATALOG_SERVICE_ADDR = '', + PRODUCT_CATALOG_ADDR = '', RECOMMENDATION_SERVICE_ADDR = '', SHIPPING_ADDR = '', ENV_PLATFORM = '', @@ -49,7 +49,7 @@ const nextConfig = { CART_ADDR, CHECKOUT_SERVICE_ADDR, CURRENCY_ADDR, - PRODUCT_CATALOG_SERVICE_ADDR, + PRODUCT_CATALOG_ADDR, RECOMMENDATION_SERVICE_ADDR, SHIPPING_ADDR, OTEL_EXPORTER_OTLP_TRACES_ENDPOINT, diff --git a/src/product-catalog/Dockerfile b/src/product-catalog/Dockerfile new file mode 100644 index 0000000000..9c7219d1ad --- /dev/null +++ b/src/product-catalog/Dockerfile @@ -0,0 +1,27 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 + + +FROM golang:1.22-alpine AS builder + +WORKDIR /usr/src/app/ + +RUN --mount=type=cache,target=/go/pkg/mod/ \ + --mount=type=bind,source=./src/product-catalog/go.sum,target=go.sum \ + --mount=type=bind,source=./src/product-catalog/go.mod,target=go.mod \ + go mod download + +RUN --mount=type=cache,target=/go/pkg/mod/ \ + --mount=type=cache,target=/root/.cache/go-build \ + --mount=type=bind,rw,source=./src/product-catalog,target=. \ + go build -ldflags "-s -w" -o /go/bin/product-catalog/ ./ + +FROM alpine AS release + +WORKDIR /usr/src/app/ + +COPY ./src/product-catalog/products/ ./products/ +COPY --from=builder /go/bin/product-catalog/ ./ + +EXPOSE ${PRODUCT_SERVICE_PORT} +ENTRYPOINT [ "./product-catalog" ] diff --git a/src/productcatalogservice/README.md b/src/product-catalog/README.md similarity index 88% rename from src/productcatalogservice/README.md rename to src/product-catalog/README.md index 99b3d7c1bf..ca4970d623 100644 --- a/src/productcatalogservice/README.md +++ b/src/product-catalog/README.md @@ -12,7 +12,7 @@ When this service is run the output should be similar to the following To build the service binary, run: ```sh -go build -o /go/bin/productcatalogservice/ +go build -o /go/bin/product-catalog/ ``` ## Docker Build @@ -20,7 +20,7 @@ go build -o /go/bin/productcatalogservice/ From the root directory, run: ```sh -docker compose build productcatalogservice +docker compose build product-catalog ``` ## Regenerate protos diff --git a/src/productcatalogservice/genproto/Dockerfile b/src/product-catalog/genproto/Dockerfile similarity index 100% rename from src/productcatalogservice/genproto/Dockerfile rename to src/product-catalog/genproto/Dockerfile diff --git a/src/productcatalogservice/genproto/oteldemo/demo.pb.go b/src/product-catalog/genproto/oteldemo/demo.pb.go similarity index 100% rename from src/productcatalogservice/genproto/oteldemo/demo.pb.go rename to src/product-catalog/genproto/oteldemo/demo.pb.go diff --git a/src/productcatalogservice/genproto/oteldemo/demo_grpc.pb.go b/src/product-catalog/genproto/oteldemo/demo_grpc.pb.go similarity index 100% rename from src/productcatalogservice/genproto/oteldemo/demo_grpc.pb.go rename to src/product-catalog/genproto/oteldemo/demo_grpc.pb.go diff --git a/src/productcatalogservice/go.mod b/src/product-catalog/go.mod similarity index 97% rename from src/productcatalogservice/go.mod rename to src/product-catalog/go.mod index 341dfe61e5..cb18952f3b 100644 --- a/src/productcatalogservice/go.mod +++ b/src/product-catalog/go.mod @@ -1,4 +1,4 @@ -module github.com/opentelemetry/opentelemetry-demo/src/productcatalogservice +module github.com/opentelemetry/opentelemetry-demo/src/product-catalog go 1.22.7 diff --git a/src/productcatalogservice/go.sum b/src/product-catalog/go.sum similarity index 100% rename from src/productcatalogservice/go.sum rename to src/product-catalog/go.sum diff --git a/src/productcatalogservice/main.go b/src/product-catalog/main.go similarity index 95% rename from src/productcatalogservice/main.go rename to src/product-catalog/main.go index 12cfd4b53f..ae6393d994 100644 --- a/src/productcatalogservice/main.go +++ b/src/product-catalog/main.go @@ -36,7 +36,7 @@ import ( otelhooks "github.com/open-feature/go-sdk-contrib/hooks/open-telemetry/pkg" flagd "github.com/open-feature/go-sdk-contrib/providers/flagd/pkg" "github.com/open-feature/go-sdk/openfeature" - pb "github.com/opentelemetry/opentelemetry-demo/src/productcatalogservice/genproto/oteldemo" + pb "github.com/opentelemetry/opentelemetry-demo/src/product-catalog/genproto/oteldemo" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/credentials/insecure" @@ -141,9 +141,9 @@ func main() { svc := &productCatalog{} var port string - mustMapEnv(&port, "PRODUCT_CATALOG_SERVICE_PORT") + mustMapEnv(&port, "PRODUCT_CATALOG_PORT") - log.Infof("ProductCatalogService gRPC server started on port: %s", port) + log.Infof("Product Catalog gRPC server started on port: %s", port) ln, err := net.Listen("tcp", fmt.Sprintf(":%s", port)) if err != nil { @@ -171,7 +171,7 @@ func main() { <-ctx.Done() srv.GracefulStop() - log.Println("ProductCatalogService gRPC server stopped") + log.Println("Product Catalog gRPC server stopped") } type productCatalog struct { @@ -252,7 +252,7 @@ func (p *productCatalog) GetProduct(ctx context.Context, req *pb.GetProductReque // GetProduct will fail on a specific product when feature flag is enabled if p.checkProductFailure(ctx, req.Id) { - msg := fmt.Sprintf("Error: ProductCatalogService Fail Feature Flag Enabled") + msg := fmt.Sprintf("Error: Product Catalog Fail Feature Flag Enabled") span.SetStatus(otelcodes.Error, msg) span.AddEvent(msg) return nil, status.Errorf(codes.Internal, msg) diff --git a/src/productcatalogservice/products/products.json b/src/product-catalog/products/products.json similarity index 100% rename from src/productcatalogservice/products/products.json rename to src/product-catalog/products/products.json diff --git a/src/productcatalogservice/tools.go b/src/product-catalog/tools.go similarity index 100% rename from src/productcatalogservice/tools.go rename to src/product-catalog/tools.go diff --git a/src/productcatalogservice/Dockerfile b/src/productcatalogservice/Dockerfile deleted file mode 100644 index f954743401..0000000000 --- a/src/productcatalogservice/Dockerfile +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright The OpenTelemetry Authors -# SPDX-License-Identifier: Apache-2.0 - - -FROM golang:1.22-alpine AS builder - -WORKDIR /usr/src/app/ - -RUN --mount=type=cache,target=/go/pkg/mod/ \ - --mount=type=bind,source=./src/productcatalogservice/go.sum,target=go.sum \ - --mount=type=bind,source=./src/productcatalogservice/go.mod,target=go.mod \ - go mod download - -RUN --mount=type=cache,target=/go/pkg/mod/ \ - --mount=type=cache,target=/root/.cache/go-build \ - --mount=type=bind,rw,source=./src/productcatalogservice,target=. \ - go build -ldflags "-s -w" -o /go/bin/productcatalogservice/ ./ - -FROM alpine AS release - -WORKDIR /usr/src/app/ - -COPY ./src/productcatalogservice/products/ ./products/ -COPY --from=builder /go/bin/productcatalogservice/ ./ - -EXPOSE ${PRODUCT_SERVICE_PORT} -ENTRYPOINT [ "./productcatalogservice" ] diff --git a/src/recommendationservice/recommendation_server.py b/src/recommendationservice/recommendation_server.py index 1a6826d80d..9f19f4e785 100644 --- a/src/recommendationservice/recommendation_server.py +++ b/src/recommendationservice/recommendation_server.py @@ -153,7 +153,7 @@ def check_feature_flag(flag_name: str): logger = logging.getLogger('main') logger.addHandler(handler) - catalog_addr = must_map_env('PRODUCT_CATALOG_SERVICE_ADDR') + catalog_addr = must_map_env('PRODUCT_CATALOG_ADDR') pc_channel = grpc.insecure_channel(catalog_addr) product_catalog_stub = demo_pb2_grpc.ProductCatalogServiceStub(pc_channel) diff --git a/test/tracetesting/productcatalogservice/all.yaml b/test/tracetesting/product-catalog/all.yaml similarity index 88% rename from test/tracetesting/productcatalogservice/all.yaml rename to test/tracetesting/product-catalog/all.yaml index d52c24142a..6cf06409f2 100644 --- a/test/tracetesting/productcatalogservice/all.yaml +++ b/test/tracetesting/product-catalog/all.yaml @@ -3,7 +3,7 @@ type: TestSuite spec: - id: product-catalog-service-all + id: product-catalog-all name: 'Product Catalog Service' description: Run all Product Catalog Service tests enabled in sequence steps: diff --git a/test/tracetesting/productcatalogservice/get.yaml b/test/tracetesting/product-catalog/get.yaml similarity index 96% rename from test/tracetesting/productcatalogservice/get.yaml rename to test/tracetesting/product-catalog/get.yaml index 297f1a51b4..a1e26c4c3a 100644 --- a/test/tracetesting/productcatalogservice/get.yaml +++ b/test/tracetesting/product-catalog/get.yaml @@ -10,7 +10,7 @@ spec: type: grpc grpc: protobufFile: ../../../pb/demo.proto - address: ${var:PRODUCT_CATALOG_SERVICE_ADDR} + address: ${var:PRODUCT_CATALOG_ADDR} method: oteldemo.ProductCatalogService.GetProduct request: |- { diff --git a/test/tracetesting/productcatalogservice/list.yaml b/test/tracetesting/product-catalog/list.yaml similarity index 94% rename from test/tracetesting/productcatalogservice/list.yaml rename to test/tracetesting/product-catalog/list.yaml index 1b124d2dfc..92adadb78e 100644 --- a/test/tracetesting/productcatalogservice/list.yaml +++ b/test/tracetesting/product-catalog/list.yaml @@ -10,7 +10,7 @@ spec: type: grpc grpc: protobufFile: ../../../pb/demo.proto - address: ${var:PRODUCT_CATALOG_SERVICE_ADDR} + address: ${var:PRODUCT_CATALOG_ADDR} method: oteldemo.ProductCatalogService.ListProducts request: "" specs: diff --git a/test/tracetesting/productcatalogservice/search.yaml b/test/tracetesting/product-catalog/search.yaml similarity index 95% rename from test/tracetesting/productcatalogservice/search.yaml rename to test/tracetesting/product-catalog/search.yaml index 50d925375c..fe211b8e7c 100644 --- a/test/tracetesting/productcatalogservice/search.yaml +++ b/test/tracetesting/product-catalog/search.yaml @@ -10,7 +10,7 @@ spec: type: grpc grpc: protobufFile: ../../../pb/demo.proto - address: ${var:PRODUCT_CATALOG_SERVICE_ADDR} + address: ${var:PRODUCT_CATALOG_ADDR} method: oteldemo.ProductCatalogService.SearchProducts request: |- { diff --git a/test/tracetesting/run.bash b/test/tracetesting/run.bash index 865de274e0..1b53bda9c8 100755 --- a/test/tracetesting/run.bash +++ b/test/tracetesting/run.bash @@ -8,7 +8,7 @@ set -e # Availalble services to test -ALL_SERVICES=("ad" "cart" "currency" "checkoutservice" "frontend" "emailservice" "paymentservice" "productcatalogservice" "recommendationservice" "shipping") +ALL_SERVICES=("ad" "cart" "currency" "checkoutservice" "frontend" "emailservice" "paymentservice" "product-catalog" "recommendationservice" "shipping") ## Script variables # Will contain the list of services to test @@ -48,8 +48,8 @@ spec: value: $FRONTEND_ADDR - key: PAYMENT_SERVICE_ADDR value: $PAYMENT_SERVICE_ADDR - - key: PRODUCT_CATALOG_SERVICE_ADDR - value: $PRODUCT_CATALOG_SERVICE_ADDR + - key: PRODUCT_CATALOG_ADDR + value: $PRODUCT_CATALOG_ADDR - key: RECOMMENDATION_SERVICE_ADDR value: $RECOMMENDATION_SERVICE_ADDR - key: SHIPPING_ADDR From 3611fadfafde08f9fc9ebddc308ee4256e07141f Mon Sep 17 00:00:00 2001 From: Pierre Tessier Date: Sun, 22 Dec 2024 23:18:23 -0500 Subject: [PATCH 2/4] rename productcatalogservice to product-catalog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 886de03eea..32c75da5ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,6 +56,8 @@ the release. ([#1857](https://github.com/open-telemetry/opentelemetry-demo/pull/1857)) * [currency] rename currencyservice to currency ([#1858](https://github.com/open-telemetry/opentelemetry-demo/pull/1858)) +* [product-catalog] rename productcatalogservice to product-catalog + ([#1864](https://github.com/open-telemetry/opentelemetry-demo/pull/1864)) ## 1.12.0 From 2d5f8046496db4a662a649208fcc1b71c9e124de Mon Sep 17 00:00:00 2001 From: Pierre Tessier Date: Sun, 22 Dec 2024 23:32:24 -0500 Subject: [PATCH 3/4] rename productcatalogservice to product-catalog --- test/tracetesting/product-catalog/all.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/tracetesting/product-catalog/all.yaml b/test/tracetesting/product-catalog/all.yaml index 6cf06409f2..21f7a12b7a 100644 --- a/test/tracetesting/product-catalog/all.yaml +++ b/test/tracetesting/product-catalog/all.yaml @@ -4,8 +4,8 @@ type: TestSuite spec: id: product-catalog-all - name: 'Product Catalog Service' - description: Run all Product Catalog Service tests enabled in sequence + name: 'Product Catalog' + description: Run all Product Catalog tests enabled in sequence steps: - ./list.yaml - ./get.yaml From ec00ef826b4421bb9b2d340721377ad3a046774e Mon Sep 17 00:00:00 2001 From: Pierre Tessier Date: Mon, 23 Dec 2024 22:48:00 -0500 Subject: [PATCH 4/4] rename productcatalogservice to product-catalog --- docker-compose.minimal.yml | 2 +- docker-compose.yml | 2 +- src/product-catalog/Dockerfile | 2 +- src/product-catalog/genproto/Dockerfile | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docker-compose.minimal.yml b/docker-compose.minimal.yml index ea7f7afaff..9204b4fc07 100644 --- a/docker-compose.minimal.yml +++ b/docker-compose.minimal.yml @@ -381,7 +381,7 @@ services: # Product Catalog service product-catalog: image: ${IMAGE_NAME}:${DEMO_VERSION}-product-catalog - container_name: product-catalog-service + container_name: product-catalog build: context: ./ dockerfile: ${PRODUCT_CATALOG_DOCKERFILE} diff --git a/docker-compose.yml b/docker-compose.yml index 8a8bf7cfca..5ee6922c4c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -460,7 +460,7 @@ services: # Product Catalog service product-catalog: image: ${IMAGE_NAME}:${DEMO_VERSION}-product-catalog - container_name: product-catalog-service + container_name: product-catalog build: context: ./ dockerfile: ${PRODUCT_CATALOG_DOCKERFILE} diff --git a/src/product-catalog/Dockerfile b/src/product-catalog/Dockerfile index 9c7219d1ad..66fb63f0da 100644 --- a/src/product-catalog/Dockerfile +++ b/src/product-catalog/Dockerfile @@ -23,5 +23,5 @@ WORKDIR /usr/src/app/ COPY ./src/product-catalog/products/ ./products/ COPY --from=builder /go/bin/product-catalog/ ./ -EXPOSE ${PRODUCT_SERVICE_PORT} +EXPOSE ${PRODUCT_CATALOG_PORT} ENTRYPOINT [ "./product-catalog" ] diff --git a/src/product-catalog/genproto/Dockerfile b/src/product-catalog/genproto/Dockerfile index d313bb0cc4..3c5f118ef1 100644 --- a/src/product-catalog/genproto/Dockerfile +++ b/src/product-catalog/genproto/Dockerfile @@ -7,9 +7,9 @@ WORKDIR /build RUN apk add --no-cache protobuf-dev -COPY ./src/productcatalogservice/go.mod ./ -COPY ./src/productcatalogservice/go.sum ./ -COPY ./src/productcatalogservice/tools.go ./ +COPY ./src/product-catalog/go.mod ./ +COPY ./src/product-catalog/go.sum ./ +COPY ./src/product-catalog/tools.go ./ RUN go env -w GOMODCACHE=/root/.cache/go-build RUN --mount=type=cache,target=/root/.cache/go-build \