Skip to content

Commit

Permalink
[checkout] rename checkoutservice to checkout (#1867)
Browse files Browse the repository at this point in the history
* rename checkoutservice to checkout

* rename checkoutservice to checkout
  • Loading branch information
puckpuck authored Jan 10, 2025
1 parent 8cb101d commit 0a39d44
Show file tree
Hide file tree
Showing 29 changed files with 100 additions and 98 deletions.
6 changes: 3 additions & 3 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -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
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 @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .licenserc.json
Original file line number Diff line number Diff line change
Expand Up @@ -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/",
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions docker-compose-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ services:
environment:
- AD_ADDR
- CART_ADDR
- CHECKOUT_SERVICE_ADDR
- CHECKOUT_ADDR
- CURRENCY_ADDR
- EMAIL_ADDR
- FRONTEND_ADDR
Expand All @@ -63,7 +63,7 @@ services:
condition: service_started
cart:
condition: service_started
checkoutservice:
checkout:
condition: service_started
currency:
condition: service_started
Expand Down
20 changes: 10 additions & 10 deletions docker-compose.minimal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -201,7 +201,7 @@ services:
- FRONTEND_ADDR
- AD_ADDR
- CART_ADDR
- CHECKOUT_SERVICE_ADDR
- CHECKOUT_ADDR
- CURRENCY_ADDR
- PRODUCT_CATALOG_ADDR
- RECOMMENDATION_ADDR
Expand All @@ -221,7 +221,7 @@ services:
condition: service_started
cart:
condition: service_started
checkoutservice:
checkout:
condition: service_started
currency:
condition: service_started
Expand Down
20 changes: 10 additions & 10 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -273,7 +273,7 @@ services:
- FRONTEND_ADDR
- AD_ADDR
- CART_ADDR
- CHECKOUT_SERVICE_ADDR
- CHECKOUT_ADDR
- CURRENCY_ADDR
- PRODUCT_CATALOG_ADDR
- RECOMMENDATION_ADDR
Expand All @@ -293,7 +293,7 @@ services:
condition: service_started
cart:
condition: service_started
checkoutservice:
checkout:
condition: service_started
currency:
condition: service_started
Expand Down
2 changes: 1 addition & 1 deletion docker-gen-proto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ide-gen-proto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"groupName": "cart",
},
{
"matchFileNames": ["src/checkoutservice/**"],
"groupName": "checkoutservice",
"matchFileNames": ["src/checkout/**"],
"groupName": "checkout",
},
{
"matchFileNames": ["src/currency/**"],
Expand Down
26 changes: 26 additions & 0 deletions src/checkout/Dockerfile
Original file line number Diff line number Diff line change
@@ -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" ]
4 changes: 2 additions & 2 deletions src/checkoutservice/README.md → src/checkout/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ 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

From the root directory, run:

```sh
docker compose build checkoutservice
docker compose build checkout
```

## Regenerate protos
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/checkoutservice/go.mod → src/checkout/go.mod
Original file line number Diff line number Diff line change
@@ -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

Expand Down
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 0a39d44

Please sign in to comment.