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

[checkout] rename checkoutservice to checkout #1867

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
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
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ updates:
- "infra"
- package-ecosystem: "gomod"
directories:
- "/src/checkoutservice"
- "/src/checkout"
- "/src/productcatalogservice"
groups:
go-production-dependencies:
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 @@ -41,7 +41,7 @@
"/src/accounting/src/protos/",
"src/cart/src/obj/",
"src/cart/tests/obj/",
"src/checkoutservice/genproto/",
"src/checkout/genproto/",
"src/featureflagservice/assets/vendor/",
"src/featureflagservice/priv/",
"src/productcatalogservice/genproto/",
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ the release.
([#1863](https://github.com/open-telemetry/opentelemetry-demo/pull/1863))
* [recommendation] rename recommendationservice to recommendation
([#1865](https://github.com/open-telemetry/opentelemetry-demo/pull/1865))
* [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,productcatalogservice}/genproto/oteldemo/
rm -rf ./src/{checkout,productcatalogservice}/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_SERVICE_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_SERVICE_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 @@ -24,7 +24,7 @@ gen_proto_python() {
#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
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.
Loading
Loading