diff --git a/.env b/.env index a98f85dae5..93ee840b82 100644 --- a/.env +++ b/.env @@ -59,9 +59,9 @@ CART_ADDR=cart:${CART_PORT} CART_DOCKERFILE=./src/cart/src/Dockerfile # Checkout Service -CHECKOUT_SERVICE_PORT=5050 -CHECKOUT_SERVICE_ADDR=checkoutservice:${CHECKOUT_SERVICE_PORT} -CHECKOUT_SERVICE_DOCKERFILE=./src/checkoutservice/Dockerfile +CHECKOUT_PORT=5050 +CHECKOUT_ADDR=checkout:${CHECKOUT_PORT} +CHECKOUT_DOCKERFILE=./src/checkout/Dockerfile # Currency Service CURRENCY_PORT=7001 diff --git a/.github/workflows/component-build-images.yml b/.github/workflows/component-build-images.yml index 3e561c3c9f..7e4bd9ad59 100644 --- a/.github/workflows/component-build-images.yml +++ b/.github/workflows/component-build-images.yml @@ -63,8 +63,8 @@ jobs: tag_suffix: cart context: ./ setup-qemu: false - - file: ./src/checkoutservice/Dockerfile - tag_suffix: checkoutservice + - file: ./src/checkout/Dockerfile + tag_suffix: checkout context: ./ setup-qemu: true - file: ./src/currency/Dockerfile diff --git a/.licenserc.json b/.licenserc.json index c802c933e6..56a700cd0a 100644 --- a/.licenserc.json +++ b/.licenserc.json @@ -42,7 +42,7 @@ "src/cart/src/obj/", "src/cart/tests/obj/", "src/currency/build/", - "src/checkoutservice/genproto/", + "src/checkout/genproto/", "src/featureflagservice/assets/vendor/", "src/featureflagservice/priv/", "src/product-catalog/genproto/", diff --git a/CHANGELOG.md b/CHANGELOG.md index 9cedc9a7c8..57308f4620 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -66,6 +66,8 @@ the release. ([#1865](https://github.com/open-telemetry/opentelemetry-demo/pull/1865)) * [product-catalog] rename productcatalogservice to product-catalog ([#1864](https://github.com/open-telemetry/opentelemetry-demo/pull/1864)) +* [checkout] rename checkoutservice to checkout + ([#1867](https://github.com/open-telemetry/opentelemetry-demo/pull/1867)) ## 1.12.0 diff --git a/Makefile b/Makefile index c3e77ca408..a10756b585 100644 --- a/Makefile +++ b/Makefile @@ -139,7 +139,7 @@ docker-generate-protobuf: .PHONY: clean clean: - rm -rf ./src/{checkoutservice,product-catalog}/genproto/oteldemo/ + rm -rf ./src/{checkout,product-catalog}/genproto/oteldemo/ rm -rf ./src/recommendation/{demo_pb2,demo_pb2_grpc}.py .PHONY: check-clean-work-tree diff --git a/docker-compose-tests.yml b/docker-compose-tests.yml index f9e55f2863..ea12ae7d14 100644 --- a/docker-compose-tests.yml +++ b/docker-compose-tests.yml @@ -39,7 +39,7 @@ services: environment: - AD_ADDR - CART_ADDR - - CHECKOUT_SERVICE_ADDR + - CHECKOUT_ADDR - CURRENCY_ADDR - EMAIL_ADDR - FRONTEND_ADDR @@ -63,7 +63,7 @@ services: condition: service_started cart: condition: service_started - checkoutservice: + checkout: condition: service_started currency: condition: service_started diff --git a/docker-compose.minimal.yml b/docker-compose.minimal.yml index b0d3474ecb..1488d4c77a 100644 --- a/docker-compose.minimal.yml +++ b/docker-compose.minimal.yml @@ -81,23 +81,23 @@ services: logging: *logging # Checkout service - checkoutservice: - image: ${IMAGE_NAME}:${DEMO_VERSION}-checkoutservice - container_name: checkout-service + checkout: + image: ${IMAGE_NAME}:${DEMO_VERSION}-checkout + container_name: checkout build: context: ./ - dockerfile: ${CHECKOUT_SERVICE_DOCKERFILE} + dockerfile: ${CHECKOUT_DOCKERFILE} cache_from: - - ${IMAGE_NAME}:${IMAGE_VERSION}-checkoutservice + - ${IMAGE_NAME}:${IMAGE_VERSION}-checkout deploy: resources: limits: memory: 20M restart: unless-stopped ports: - - "${CHECKOUT_SERVICE_PORT}" + - "${CHECKOUT_PORT}" environment: - - CHECKOUT_SERVICE_PORT + - CHECKOUT_PORT - CART_ADDR - CURRENCY_ADDR - EMAIL_ADDR @@ -108,7 +108,7 @@ services: - OTEL_EXPORTER_OTLP_ENDPOINT - OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE - OTEL_RESOURCE_ATTRIBUTES - - OTEL_SERVICE_NAME=checkoutservice + - OTEL_SERVICE_NAME=checkout depends_on: cart: condition: service_started @@ -201,7 +201,7 @@ services: - FRONTEND_ADDR - AD_ADDR - CART_ADDR - - CHECKOUT_SERVICE_ADDR + - CHECKOUT_ADDR - CURRENCY_ADDR - PRODUCT_CATALOG_ADDR - RECOMMENDATION_ADDR @@ -221,7 +221,7 @@ services: condition: service_started cart: condition: service_started - checkoutservice: + checkout: condition: service_started currency: condition: service_started diff --git a/docker-compose.yml b/docker-compose.yml index 9bbe68949d..c49c4411d6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -113,25 +113,25 @@ services: logging: *logging # Checkout service - checkoutservice: - image: ${IMAGE_NAME}:${DEMO_VERSION}-checkoutservice - container_name: checkout-service + checkout: + image: ${IMAGE_NAME}:${DEMO_VERSION}-checkout + container_name: checkout build: context: ./ - dockerfile: ${CHECKOUT_SERVICE_DOCKERFILE} + dockerfile: ${CHECKOUT_DOCKERFILE} cache_from: - - ${IMAGE_NAME}:${IMAGE_VERSION}-checkoutservice + - ${IMAGE_NAME}:${IMAGE_VERSION}-checkout deploy: resources: limits: memory: 20M restart: unless-stopped ports: - - "${CHECKOUT_SERVICE_PORT}" + - "${CHECKOUT_PORT}" environment: - FLAGD_HOST - FLAGD_PORT - - CHECKOUT_SERVICE_PORT + - CHECKOUT_PORT - CART_ADDR - CURRENCY_ADDR - EMAIL_ADDR @@ -142,7 +142,7 @@ services: - OTEL_EXPORTER_OTLP_ENDPOINT - OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE - OTEL_RESOURCE_ATTRIBUTES - - OTEL_SERVICE_NAME=checkoutservice + - OTEL_SERVICE_NAME=checkout depends_on: cart: condition: service_started @@ -273,7 +273,7 @@ services: - FRONTEND_ADDR - AD_ADDR - CART_ADDR - - CHECKOUT_SERVICE_ADDR + - CHECKOUT_ADDR - CURRENCY_ADDR - PRODUCT_CATALOG_ADDR - RECOMMENDATION_ADDR @@ -293,7 +293,7 @@ services: condition: service_started cart: condition: service_started - checkoutservice: + checkout: condition: service_started currency: condition: service_started diff --git a/docker-gen-proto.sh b/docker-gen-proto.sh index 656755b3c1..6b08921a6d 100755 --- a/docker-gen-proto.sh +++ b/docker-gen-proto.sh @@ -34,7 +34,7 @@ if [ -z "$1" ]; then #gen_proto_dotnet accounting #gen_proto_java ad #gen_proto_dotnet cart - gen_proto_go checkoutservice + gen_proto_go checkout gen_proto_cpp currency #gen_proto_ruby email #gen_proto_ts frontend diff --git a/ide-gen-proto.sh b/ide-gen-proto.sh index 7487ce1ab3..ec144317ed 100755 --- a/ide-gen-proto.sh +++ b/ide-gen-proto.sh @@ -68,7 +68,7 @@ gen_proto_ts() { gen_proto_dotnet accounting # gen_proto_java ad gen_proto_dotnet cart -gen_proto_go checkoutservice +gen_proto_go checkout # gen_proto_cpp currency # gen_proto_ruby email gen_proto_ts frontend diff --git a/renovate.json5 b/renovate.json5 index 88d31088db..bccb4909a4 100644 --- a/renovate.json5 +++ b/renovate.json5 @@ -27,8 +27,8 @@ "groupName": "cart", }, { - "matchFileNames": ["src/checkoutservice/**"], - "groupName": "checkoutservice", + "matchFileNames": ["src/checkout/**"], + "groupName": "checkout", }, { "matchFileNames": ["src/currency/**"], diff --git a/src/checkout/Dockerfile b/src/checkout/Dockerfile new file mode 100644 index 0000000000..425c1a46ac --- /dev/null +++ b/src/checkout/Dockerfile @@ -0,0 +1,26 @@ +# 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/checkout/go.sum,target=go.sum \ + --mount=type=bind,source=./src/checkout/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/checkout,target=. \ + go build -ldflags "-s -w" -o /go/bin/checkout/ ./ + +FROM alpine + +WORKDIR /usr/src/app/ + +COPY --from=builder /go/bin/checkout/ ./ + +EXPOSE ${CHECKOUT_PORT} +ENTRYPOINT [ "./checkout" ] diff --git a/src/checkoutservice/README.md b/src/checkout/README.md similarity index 84% rename from src/checkoutservice/README.md rename to src/checkout/README.md index 30c76323d0..28064bda47 100644 --- a/src/checkoutservice/README.md +++ b/src/checkout/README.md @@ -7,7 +7,7 @@ This service provides checkout services for the application. To build the service binary, run: ```sh -go build -o /go/bin/checkoutservice/ +go build -o /go/bin/checkout/ ``` ## Docker Build @@ -15,7 +15,7 @@ go build -o /go/bin/checkoutservice/ From the root directory, run: ```sh -docker compose build checkoutservice +docker compose build checkout ``` ## Regenerate protos diff --git a/src/checkoutservice/genproto/Dockerfile b/src/checkout/genproto/Dockerfile similarity index 76% rename from src/checkoutservice/genproto/Dockerfile rename to src/checkout/genproto/Dockerfile index edc92ccee3..357329e128 100644 --- a/src/checkoutservice/genproto/Dockerfile +++ b/src/checkout/genproto/Dockerfile @@ -7,9 +7,9 @@ WORKDIR /build RUN apk add --no-cache protobuf-dev -COPY ./src/checkoutservice/go.mod ./ -COPY ./src/checkoutservice/go.sum ./ -COPY ./src/checkoutservice/tools.go ./ +COPY ./src/checkout/go.mod ./ +COPY ./src/checkout/go.sum ./ +COPY ./src/checkout/tools.go ./ RUN go env -w GOMODCACHE=/root/.cache/go-build RUN --mount=type=cache,target=/root/.cache/go-build \ diff --git a/src/checkoutservice/genproto/oteldemo/demo.pb.go b/src/checkout/genproto/oteldemo/demo.pb.go similarity index 100% rename from src/checkoutservice/genproto/oteldemo/demo.pb.go rename to src/checkout/genproto/oteldemo/demo.pb.go diff --git a/src/checkoutservice/genproto/oteldemo/demo_grpc.pb.go b/src/checkout/genproto/oteldemo/demo_grpc.pb.go similarity index 100% rename from src/checkoutservice/genproto/oteldemo/demo_grpc.pb.go rename to src/checkout/genproto/oteldemo/demo_grpc.pb.go diff --git a/src/checkoutservice/go.mod b/src/checkout/go.mod similarity index 99% rename from src/checkoutservice/go.mod rename to src/checkout/go.mod index 1b883a3ba3..1b189e7fbb 100644 --- a/src/checkoutservice/go.mod +++ b/src/checkout/go.mod @@ -1,4 +1,4 @@ -module github.com/open-telemetry/opentelemetry-demo/src/checkoutservice +module github.com/open-telemetry/opentelemetry-demo/src/checkout go 1.22.7 diff --git a/src/checkoutservice/go.sum b/src/checkout/go.sum similarity index 100% rename from src/checkoutservice/go.sum rename to src/checkout/go.sum diff --git a/src/checkoutservice/kafka/producer.go b/src/checkout/kafka/producer.go similarity index 100% rename from src/checkoutservice/kafka/producer.go rename to src/checkout/kafka/producer.go diff --git a/src/checkoutservice/main.go b/src/checkout/main.go similarity index 89% rename from src/checkoutservice/main.go rename to src/checkout/main.go index 46bf9d59f7..feea6937d5 100644 --- a/src/checkoutservice/main.go +++ b/src/checkout/main.go @@ -42,9 +42,9 @@ import ( "google.golang.org/grpc/status" "google.golang.org/protobuf/proto" - pb "github.com/open-telemetry/opentelemetry-demo/src/checkoutservice/genproto/oteldemo" - "github.com/open-telemetry/opentelemetry-demo/src/checkoutservice/kafka" - "github.com/open-telemetry/opentelemetry-demo/src/checkoutservice/money" + pb "github.com/open-telemetry/opentelemetry-demo/src/checkout/genproto/oteldemo" + "github.com/open-telemetry/opentelemetry-demo/src/checkout/kafka" + "github.com/open-telemetry/opentelemetry-demo/src/checkout/money" ) //go:generate go install google.golang.org/protobuf/cmd/protoc-gen-go @@ -119,7 +119,7 @@ func initMeterProvider() *sdkmetric.MeterProvider { return mp } -type checkoutService struct { +type checkout struct { productCatalogSvcAddr string cartSvcAddr string currencySvcAddr string @@ -139,7 +139,7 @@ type checkoutService struct { func main() { var port string - mustMapEnv(&port, "CHECKOUT_SERVICE_PORT") + mustMapEnv(&port, "CHECKOUT_PORT") tp := initTracerProvider() defer func() { @@ -163,9 +163,9 @@ func main() { openfeature.SetProvider(flagd.NewProvider()) openfeature.AddHooks(otelhooks.NewTracesHook()) - tracer = tp.Tracer("checkoutservice") + tracer = tp.Tracer("checkout") - svc := new(checkoutService) + svc := new(checkout) mustMapEnv(&svc.shippingSvcAddr, "SHIPPING_ADDR") c := mustCreateClient(svc.shippingSvcAddr) @@ -231,15 +231,15 @@ func mustMapEnv(target *string, envKey string) { *target = v } -func (cs *checkoutService) Check(ctx context.Context, req *healthpb.HealthCheckRequest) (*healthpb.HealthCheckResponse, error) { +func (cs *checkout) Check(ctx context.Context, req *healthpb.HealthCheckRequest) (*healthpb.HealthCheckResponse, error) { return &healthpb.HealthCheckResponse{Status: healthpb.HealthCheckResponse_SERVING}, nil } -func (cs *checkoutService) Watch(req *healthpb.HealthCheckRequest, ws healthpb.Health_WatchServer) error { +func (cs *checkout) Watch(req *healthpb.HealthCheckRequest, ws healthpb.Health_WatchServer) error { return status.Errorf(codes.Unimplemented, "health check via Watch not implemented") } -func (cs *checkoutService) PlaceOrder(ctx context.Context, req *pb.PlaceOrderRequest) (*pb.PlaceOrderResponse, error) { +func (cs *checkout) PlaceOrder(ctx context.Context, req *pb.PlaceOrderRequest) (*pb.PlaceOrderResponse, error) { span := trace.SpanFromContext(ctx) span.SetAttributes( attribute.String("app.user.id", req.UserId), @@ -332,7 +332,7 @@ type orderPrep struct { shippingCostLocalized *pb.Money } -func (cs *checkoutService) prepareOrderItemsAndShippingQuoteFromCart(ctx context.Context, userID, userCurrency string, address *pb.Address) (orderPrep, error) { +func (cs *checkout) prepareOrderItemsAndShippingQuoteFromCart(ctx context.Context, userID, userCurrency string, address *pb.Address) (orderPrep, error) { ctx, span := tracer.Start(ctx, "prepareOrderItemsAndShippingQuoteFromCart") defer span.End() @@ -385,7 +385,7 @@ func mustCreateClient(svcAddr string) *grpc.ClientConn { return c } -func (cs *checkoutService) quoteShipping(ctx context.Context, address *pb.Address, items []*pb.CartItem) (*pb.Money, error) { +func (cs *checkout) quoteShipping(ctx context.Context, address *pb.Address, items []*pb.CartItem) (*pb.Money, error) { shippingQuote, err := cs.shippingSvcClient. GetQuote(ctx, &pb.GetQuoteRequest{ Address: address, @@ -396,7 +396,7 @@ func (cs *checkoutService) quoteShipping(ctx context.Context, address *pb.Addres return shippingQuote.GetCostUsd(), nil } -func (cs *checkoutService) getUserCart(ctx context.Context, userID string) ([]*pb.CartItem, error) { +func (cs *checkout) getUserCart(ctx context.Context, userID string) ([]*pb.CartItem, error) { cart, err := cs.cartSvcClient.GetCart(ctx, &pb.GetCartRequest{UserId: userID}) if err != nil { return nil, fmt.Errorf("failed to get user cart during checkout: %+v", err) @@ -404,14 +404,14 @@ func (cs *checkoutService) getUserCart(ctx context.Context, userID string) ([]*p return cart.GetItems(), nil } -func (cs *checkoutService) emptyUserCart(ctx context.Context, userID string) error { +func (cs *checkout) emptyUserCart(ctx context.Context, userID string) error { if _, err := cs.cartSvcClient.EmptyCart(ctx, &pb.EmptyCartRequest{UserId: userID}); err != nil { return fmt.Errorf("failed to empty user cart during checkout: %+v", err) } return nil } -func (cs *checkoutService) prepOrderItems(ctx context.Context, items []*pb.CartItem, userCurrency string) ([]*pb.OrderItem, error) { +func (cs *checkout) prepOrderItems(ctx context.Context, items []*pb.CartItem, userCurrency string) ([]*pb.OrderItem, error) { out := make([]*pb.OrderItem, len(items)) for i, item := range items { @@ -430,7 +430,7 @@ func (cs *checkoutService) prepOrderItems(ctx context.Context, items []*pb.CartI return out, nil } -func (cs *checkoutService) convertCurrency(ctx context.Context, from *pb.Money, toCurrency string) (*pb.Money, error) { +func (cs *checkout) convertCurrency(ctx context.Context, from *pb.Money, toCurrency string) (*pb.Money, error) { result, err := cs.currencySvcClient.Convert(ctx, &pb.CurrencyConversionRequest{ From: from, ToCode: toCurrency}) @@ -440,7 +440,7 @@ func (cs *checkoutService) convertCurrency(ctx context.Context, from *pb.Money, return result, err } -func (cs *checkoutService) chargeCard(ctx context.Context, amount *pb.Money, paymentInfo *pb.CreditCardInfo) (string, error) { +func (cs *checkout) chargeCard(ctx context.Context, amount *pb.Money, paymentInfo *pb.CreditCardInfo) (string, error) { paymentService := cs.paymentSvcClient if cs.isFeatureFlagEnabled(ctx, "paymentUnreachable") { badAddress := "badAddress:50051" @@ -457,7 +457,7 @@ func (cs *checkoutService) chargeCard(ctx context.Context, amount *pb.Money, pay return paymentResp.GetTransactionId(), nil } -func (cs *checkoutService) sendOrderConfirmation(ctx context.Context, email string, order *pb.OrderResult) error { +func (cs *checkout) sendOrderConfirmation(ctx context.Context, email string, order *pb.OrderResult) error { emailPayload, err := json.Marshal(map[string]interface{}{ "email": email, "order": order, @@ -479,7 +479,7 @@ func (cs *checkoutService) sendOrderConfirmation(ctx context.Context, email stri return err } -func (cs *checkoutService) shipOrder(ctx context.Context, address *pb.Address, items []*pb.CartItem) (string, error) { +func (cs *checkout) shipOrder(ctx context.Context, address *pb.Address, items []*pb.CartItem) (string, error) { resp, err := cs.shippingSvcClient.ShipOrder(ctx, &pb.ShipOrderRequest{ Address: address, Items: items}) @@ -489,7 +489,7 @@ func (cs *checkoutService) shipOrder(ctx context.Context, address *pb.Address, i return resp.GetTrackingId(), nil } -func (cs *checkoutService) sendToPostProcessor(ctx context.Context, result *pb.OrderResult) { +func (cs *checkout) sendToPostProcessor(ctx context.Context, result *pb.OrderResult) { message, err := proto.Marshal(result) if err != nil { log.Errorf("Failed to marshal message to protobuf: %+v", err) @@ -582,7 +582,7 @@ func createProducerSpan(ctx context.Context, msg *sarama.ProducerMessage) trace. return span } -func (cs *checkoutService) isFeatureFlagEnabled(ctx context.Context, featureFlagName string) bool { +func (cs *checkout) isFeatureFlagEnabled(ctx context.Context, featureFlagName string) bool { client := openfeature.NewClient("checkout") // Default value is set to false, but you could also make this a parameter. @@ -596,7 +596,7 @@ func (cs *checkoutService) isFeatureFlagEnabled(ctx context.Context, featureFlag return featureEnabled } -func (cs *checkoutService) getIntFeatureFlag(ctx context.Context, featureFlagName string) int { +func (cs *checkout) getIntFeatureFlag(ctx context.Context, featureFlagName string) int { client := openfeature.NewClient("checkout") // Default value is set to 0, but you could also make this a parameter. diff --git a/src/checkoutservice/money/money.go b/src/checkout/money/money.go similarity index 97% rename from src/checkoutservice/money/money.go rename to src/checkout/money/money.go index 883b405a15..ba21cd8886 100644 --- a/src/checkoutservice/money/money.go +++ b/src/checkout/money/money.go @@ -5,7 +5,7 @@ package money import ( "errors" - pb "github.com/open-telemetry/opentelemetry-demo/src/checkoutservice/genproto/oteldemo" + pb "github.com/open-telemetry/opentelemetry-demo/src/checkout/genproto/oteldemo" ) const ( diff --git a/src/checkoutservice/money/money_test.go b/src/checkout/money/money_test.go similarity index 98% rename from src/checkoutservice/money/money_test.go rename to src/checkout/money/money_test.go index 55da1226cb..8c2c3d7f51 100644 --- a/src/checkoutservice/money/money_test.go +++ b/src/checkout/money/money_test.go @@ -7,7 +7,7 @@ import ( "reflect" "testing" - pb "github.com/open-telemetry/opentelemetry-demo/src/checkoutservice/genproto/oteldemo" + pb "github.com/open-telemetry/opentelemetry-demo/src/checkout/genproto/oteldemo" ) func mmc(u int64, n int32, c string) *pb.Money { return &pb.Money{Units: u, Nanos: n, CurrencyCode: c} } diff --git a/src/checkoutservice/tools.go b/src/checkout/tools.go similarity index 100% rename from src/checkoutservice/tools.go rename to src/checkout/tools.go diff --git a/src/checkoutservice/Dockerfile b/src/checkoutservice/Dockerfile deleted file mode 100644 index ca37f623b4..0000000000 --- a/src/checkoutservice/Dockerfile +++ /dev/null @@ -1,26 +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/checkoutservice/go.sum,target=go.sum \ - --mount=type=bind,source=./src/checkoutservice/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/checkoutservice,target=. \ - go build -ldflags "-s -w" -o /go/bin/checkoutservice/ ./ - -FROM alpine - -WORKDIR /usr/src/app/ - -COPY --from=builder /go/bin/checkoutservice/ ./ - -EXPOSE ${CHECKOUT_SERVICE_PORT} -ENTRYPOINT [ "./checkoutservice" ] diff --git a/src/frontend/gateways/rpc/Checkout.gateway.ts b/src/frontend/gateways/rpc/Checkout.gateway.ts index 11250a2942..3d54f9eaca 100644 --- a/src/frontend/gateways/rpc/Checkout.gateway.ts +++ b/src/frontend/gateways/rpc/Checkout.gateway.ts @@ -4,9 +4,9 @@ import { ChannelCredentials } from '@grpc/grpc-js'; import { CheckoutServiceClient, PlaceOrderRequest, PlaceOrderResponse } from '../../protos/demo'; -const { CHECKOUT_SERVICE_ADDR = '' } = process.env; +const { CHECKOUT_ADDR = '' } = process.env; -const client = new CheckoutServiceClient(CHECKOUT_SERVICE_ADDR, ChannelCredentials.createInsecure()); +const client = new CheckoutServiceClient(CHECKOUT_ADDR, ChannelCredentials.createInsecure()); const CheckoutGateway = () => ({ placeOrder(order: PlaceOrderRequest) { diff --git a/src/frontend/next.config.js b/src/frontend/next.config.js index 753e112a0e..ce28af82e0 100755 --- a/src/frontend/next.config.js +++ b/src/frontend/next.config.js @@ -15,7 +15,7 @@ dotenvExpand.expand(myEnv); const { AD_ADDR = '', CART_ADDR = '', - CHECKOUT_SERVICE_ADDR = '', + CHECKOUT_ADDR = '', CURRENCY_ADDR = '', PRODUCT_CATALOG_ADDR = '', RECOMMENDATION_ADDR = '', @@ -47,7 +47,7 @@ const nextConfig = { env: { AD_ADDR, CART_ADDR, - CHECKOUT_SERVICE_ADDR, + CHECKOUT_ADDR, CURRENCY_ADDR, PRODUCT_CATALOG_ADDR, RECOMMENDATION_ADDR, diff --git a/test/tracetesting/checkoutservice/all.yaml b/test/tracetesting/checkout/all.yaml similarity index 89% rename from test/tracetesting/checkoutservice/all.yaml rename to test/tracetesting/checkout/all.yaml index 8d083a8815..39e4391b13 100644 --- a/test/tracetesting/checkoutservice/all.yaml +++ b/test/tracetesting/checkout/all.yaml @@ -3,7 +3,7 @@ type: TestSuite spec: - id: checkout-service-all + id: checkout-all name: 'Checkout Service' description: Run all Checkout Service tests enabled in sequence steps: diff --git a/test/tracetesting/checkoutservice/place-order.yaml b/test/tracetesting/checkout/place-order.yaml similarity index 97% rename from test/tracetesting/checkoutservice/place-order.yaml rename to test/tracetesting/checkout/place-order.yaml index 29ab057b98..2b7eb2917b 100644 --- a/test/tracetesting/checkoutservice/place-order.yaml +++ b/test/tracetesting/checkout/place-order.yaml @@ -10,7 +10,7 @@ spec: type: grpc grpc: protobufFile: ../../../pb/demo.proto - address: ${var:CHECKOUT_SERVICE_ADDR} + address: ${var:CHECKOUT_ADDR} method: oteldemo.CheckoutService.PlaceOrder request: |- { diff --git a/test/tracetesting/run.bash b/test/tracetesting/run.bash index 96efd03630..13b827e754 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" "email" "payment" "product-catalog" "recommendation" "shipping") +ALL_SERVICES=("ad" "cart" "currency" "checkout" "frontend" "email" "payment" "product-catalog" "recommendation" "shipping") ## Script variables # Will contain the list of services to test @@ -38,8 +38,8 @@ spec: value: $AD_ADDR - key: CART_ADDR value: $CART_ADDR - - key: CHECKOUT_SERVICE_ADDR - value: $CHECKOUT_SERVICE_ADDR + - key: CHECKOUT_ADDR + value: $CHECKOUT_ADDR - key: CURRENCY_ADDR value: $CURRENCY_ADDR - key: EMAIL_ADDR