Skip to content

Commit

Permalink
Merge branch 'main' into sozhan/rename.shippingservice
Browse files Browse the repository at this point in the history
  • Loading branch information
Sozhan308 authored Dec 19, 2024
2 parents bbbaabe + 623c0e4 commit e236444
Show file tree
Hide file tree
Showing 42 changed files with 1,034 additions and 1,081 deletions.
6 changes: 3 additions & 3 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ AD_ADDR=ad:${AD_PORT}
AD_DOCKERFILE=./src/ad/Dockerfile

# Cart Service
CART_SERVICE_PORT=7070
CART_SERVICE_ADDR=cartservice:${CART_SERVICE_PORT}
CART_SERVICE_DOCKERFILE=./src/cartservice/src/Dockerfile
CART_PORT=7070
CART_ADDR=cart:${CART_PORT}
CART_DOCKERFILE=./src/cart/src/Dockerfile

# Checkout Service
CHECKOUT_SERVICE_PORT=5050
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 @@ -59,8 +59,8 @@ jobs:
tag_suffix: ad
context: ./
setup-qemu: true
- file: ./src/cartservice/src/Dockerfile
tag_suffix: cartservice
- file: ./src/cart/src/Dockerfile
tag_suffix: cart
context: ./
setup-qemu: false
- file: ./src/checkoutservice/Dockerfile
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ test/tracetesting/tracetesting-vars.yaml

# Ignore copied/generated protobuf files
/src/accounting/src/protos/
/src/cartservice/src/protos/
/src/cart/src/protos/
/src/featureflagservice/proto/
/src/featureflagservice/src/ffs_demo_pb.erl
/src/featureflagservice/src/ffs_service_*.erl
Expand Down
4 changes: 2 additions & 2 deletions .licenserc.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
"ignore": [
"node_modules/",
"/src/accounting/src/protos/",
"src/cartservice/src/obj/",
"src/cartservice/tests/obj/",
"src/cart/src/obj/",
"src/cart/tests/obj/",
"src/checkoutservice/genproto/",
"src/featureflagservice/assets/vendor/",
"src/featureflagservice/priv/",
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ the release.
([#1840](https://github.com/open-telemetry/opentelemetry-demo/pull/1840))
* [otel-collector] rename otelcol to otel-collector
([#1841](https://github.com/open-telemetry/opentelemetry-demo/pull/1841))
* [cart] rename cartservice to cart
([#1839](https://github.com/open-telemetry/opentelemetry-demo/pull/1839))
* [shipping] rename shippingservice to accounting
([#1827](https://github.com/open-telemetry/opentelemetry-demo/pull/1842))

Expand Down
4 changes: 2 additions & 2 deletions docker-compose-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ services:
TRACETEST_IMAGE_VERSION: ${TRACETEST_IMAGE_VERSION}
environment:
- AD_ADDR
- CART_SERVICE_ADDR
- CART_ADDR
- CHECKOUT_SERVICE_ADDR
- CURRENCY_SERVICE_ADDR
- EMAIL_SERVICE_ADDR
Expand All @@ -61,7 +61,7 @@ services:
condition: service_started
ad:
condition: service_started
cartservice:
cart:
condition: service_started
checkoutservice:
condition: service_started
Expand Down
24 changes: 12 additions & 12 deletions docker-compose.minimal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,29 +50,29 @@ services:
logging: *logging

# Cart service
cartservice:
image: ${IMAGE_NAME}:${DEMO_VERSION}-cartservice
cart:
image: ${IMAGE_NAME}:${DEMO_VERSION}-cart
container_name: cart-service
build:
context: ./
dockerfile: ${CART_SERVICE_DOCKERFILE}
dockerfile: ${CART_DOCKERFILE}
cache_from:
- ${IMAGE_NAME}:${IMAGE_VERSION}-cartservice
- ${IMAGE_NAME}:${IMAGE_VERSION}-cart
deploy:
resources:
limits:
memory: 160M
restart: unless-stopped
ports:
- "${CART_SERVICE_PORT}"
- "${CART_PORT}"
environment:
- CART_SERVICE_PORT
- CART_PORT
- FLAGD_HOST
- VALKEY_ADDR
- OTEL_EXPORTER_OTLP_ENDPOINT
- OTEL_RESOURCE_ATTRIBUTES
- OTEL_SERVICE_NAME=cartservice
- ASPNETCORE_URLS=http://*:${CART_SERVICE_PORT}
- OTEL_SERVICE_NAME=cart
- ASPNETCORE_URLS=http://*:${CART_PORT}
depends_on:
valkey-cart:
condition: service_started
Expand All @@ -98,7 +98,7 @@ services:
- "${CHECKOUT_SERVICE_PORT}"
environment:
- CHECKOUT_SERVICE_PORT
- CART_SERVICE_ADDR
- CART_ADDR
- CURRENCY_SERVICE_ADDR
- EMAIL_SERVICE_ADDR
- FLAGD_HOST
Expand All @@ -110,7 +110,7 @@ services:
- OTEL_RESOURCE_ATTRIBUTES
- OTEL_SERVICE_NAME=checkoutservice
depends_on:
cartservice:
cart:
condition: service_started
currencyservice:
condition: service_started
Expand Down Expand Up @@ -200,7 +200,7 @@ services:
- PORT=${FRONTEND_PORT}
- FRONTEND_ADDR
- AD_ADDR
- CART_SERVICE_ADDR
- CART_ADDR
- CHECKOUT_SERVICE_ADDR
- CURRENCY_SERVICE_ADDR
- PRODUCT_CATALOG_SERVICE_ADDR
Expand All @@ -219,7 +219,7 @@ services:
depends_on:
ad:
condition: service_started
cartservice:
cart:
condition: service_started
checkoutservice:
condition: service_started
Expand Down
24 changes: 12 additions & 12 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,30 +79,30 @@ services:
logging: *logging

# Cart service
cartservice:
image: ${IMAGE_NAME}:${DEMO_VERSION}-cartservice
cart:
image: ${IMAGE_NAME}:${DEMO_VERSION}-cart
container_name: cart-service
build:
context: ./
dockerfile: ${CART_SERVICE_DOCKERFILE}
dockerfile: ${CART_DOCKERFILE}
cache_from:
- ${IMAGE_NAME}:${IMAGE_VERSION}-cartservice
- ${IMAGE_NAME}:${IMAGE_VERSION}-cart
deploy:
resources:
limits:
memory: 160M
restart: unless-stopped
ports:
- "${CART_SERVICE_PORT}"
- "${CART_PORT}"
environment:
- CART_SERVICE_PORT
- CART_PORT
- FLAGD_HOST
- FLAGD_PORT
- VALKEY_ADDR
- OTEL_EXPORTER_OTLP_ENDPOINT
- OTEL_RESOURCE_ATTRIBUTES
- OTEL_SERVICE_NAME=cartservice
- ASPNETCORE_URLS=http://*:${CART_SERVICE_PORT}
- OTEL_SERVICE_NAME=cart
- ASPNETCORE_URLS=http://*:${CART_PORT}
depends_on:
valkey-cart:
condition: service_started
Expand Down Expand Up @@ -132,7 +132,7 @@ services:
- FLAGD_HOST
- FLAGD_PORT
- CHECKOUT_SERVICE_PORT
- CART_SERVICE_ADDR
- CART_ADDR
- CURRENCY_SERVICE_ADDR
- EMAIL_SERVICE_ADDR
- PAYMENT_SERVICE_ADDR
Expand All @@ -144,7 +144,7 @@ services:
- OTEL_RESOURCE_ATTRIBUTES
- OTEL_SERVICE_NAME=checkoutservice
depends_on:
cartservice:
cart:
condition: service_started
currencyservice:
condition: service_started
Expand Down Expand Up @@ -272,7 +272,7 @@ services:
- PORT=${FRONTEND_PORT}
- FRONTEND_ADDR
- AD_ADDR
- CART_SERVICE_ADDR
- CART_ADDR
- CHECKOUT_SERVICE_ADDR
- CURRENCY_SERVICE_ADDR
- PRODUCT_CATALOG_SERVICE_ADDR
Expand All @@ -291,7 +291,7 @@ services:
depends_on:
ad:
condition: service_started
cartservice:
cart:
condition: service_started
checkoutservice:
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 @@ -23,7 +23,7 @@ gen_proto_python() {

#gen_proto_dotnet accounting
#gen_proto_java ad
#gen_proto_dotnet cartservice
#gen_proto_dotnet cart
gen_proto_go checkoutservice
#gen_proto_cpp currencyservice
#gen_proto_ruby emailservice
Expand Down
2 changes: 1 addition & 1 deletion ide-gen-proto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ gen_proto_ts() {

gen_proto_dotnet accounting
# gen_proto_java ad
gen_proto_dotnet cartservice
gen_proto_dotnet cart
gen_proto_go checkoutservice
# gen_proto_cpp currencyservice
# gen_proto_ruby emailservice
Expand Down
4 changes: 2 additions & 2 deletions renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"groupName": "ad",
},
{
"matchFileNames": ["src/cartservice/**"],
"groupName": "cartservice",
"matchFileNames": ["src/cart/**"],
"groupName": "cart",
},
{
"matchFileNames": ["src/checkoutservice/**"],
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/cartservice/README.md → src/cart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ Run `dotnet restore` and `dotnet build`.
From the root directory of this repository, run:

```sh
docker compose build cartservice
docker compose build cart
```
4 changes: 2 additions & 2 deletions src/cartservice/cartservice.sln → src/cart/cart.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26124.0
MinimumVisualStudioVersion = 15.0.26124.0
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "cartservice", "src\cartservice.csproj", "{2348C29F-E8D3-4955-916D-D609CBC97FCB}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "cart", "src\cart.csproj", "{2348C29F-E8D3-4955-916D-D609CBC97FCB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "cartservice.tests", "tests\cartservice.tests.csproj", "{59825342-CE64-4AFA-8744-781692C0811B}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "cart.tests", "tests\cart.tests.csproj", "{59825342-CE64-4AFA-8744-781692C0811B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
File renamed without changes.
12 changes: 6 additions & 6 deletions src/cartservice/src/Dockerfile → src/cart/src/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@ ARG TARGETARCH

WORKDIR /usr/src/app/

COPY ./src/cartservice/ ./
COPY ./src/cart/ ./
COPY ./pb/ ./pb/

RUN dotnet restore ./src/cartservice.csproj -r linux-musl-$TARGETARCH
RUN dotnet restore ./src/cart.csproj -r linux-musl-$TARGETARCH

RUN dotnet publish ./src/cartservice.csproj -r linux-musl-$TARGETARCH --no-restore -o /cartservice
RUN dotnet publish ./src/cart.csproj -r linux-musl-$TARGETARCH --no-restore -o /cart

# -----------------------------------------------------------------------------

# https://mcr.microsoft.com/v2/dotnet/runtime-deps/tags/list
FROM mcr.microsoft.com/dotnet/runtime-deps:8.0-alpine3.20

WORKDIR /usr/src/app/
COPY --from=builder /cartservice/ ./
COPY --from=builder /cart/ ./

ENV DOTNET_HOSTBUILDER__RELOADCONFIGONCHANGE=false

EXPOSE ${CART_SERVICE_PORT}
ENTRYPOINT [ "./cartservice" ]
EXPOSE ${CART_PORT}
ENTRYPOINT [ "./cart" ]
4 changes: 2 additions & 2 deletions src/cartservice/src/Program.cs → src/cart/src/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// SPDX-License-Identifier: Apache-2.0
using System;

using cartservice.cartstore;
using cartservice.services;
using cart.cartstore;
using cart.services;

using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
using System.Threading.Tasks;

namespace cartservice.cartstore;
namespace cart.cartstore;

public interface ICartStore
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
using System.Diagnostics.Metrics;
using System.Diagnostics;

namespace cartservice.cartstore;
namespace cart.cartstore;

public class ValkeyCartStore : ICartStore
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
using System.Threading.Tasks;
using System;
using Grpc.Core;
using cartservice.cartstore;
using cart.cartstore;
using OpenFeature;
using Oteldemo;

namespace cartservice.services;
namespace cart.services;

public class CartService : Oteldemo.CartService.CartServiceBase
{
Expand Down Expand Up @@ -80,7 +80,7 @@ public override async Task<Empty> EmptyCart(EmptyCartRequest request, ServerCall

try
{
if (await _featureFlagHelper.GetBooleanValueAsync("cartServiceFailure", false))
if (await _featureFlagHelper.GetBooleanValueAsync("cartFailure", false))
{
await _badCartStore.EmptyCartAsync(request.UserId);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
using Xunit;
using static Oteldemo.CartService;

namespace cartservice.tests;
namespace cart.tests;

public class CartServiceTests
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\src\cartservice.csproj" />
<ProjectReference Include="..\src\cart.csproj" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion src/checkoutservice/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ require (
go.opentelemetry.io/otel/sdk v1.33.0
go.opentelemetry.io/otel/sdk/metric v1.33.0
go.opentelemetry.io/otel/trace v1.33.0
google.golang.org/grpc v1.69.0
google.golang.org/grpc v1.69.2
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.5.1
google.golang.org/protobuf v1.36.0
)
Expand Down
4 changes: 2 additions & 2 deletions src/checkoutservice/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,8 @@ google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576 h1:
google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576/go.mod h1:1R3kvZ1dtP3+4p4d3G8uJ8rFk/fWlScl38vanWACI08=
google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576 h1:8ZmaLZE4XWrtU3MyClkYqqtl6Oegr3235h7jxsDyqCY=
google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576/go.mod h1:5uTbfoYQed2U9p3KIj2/Zzm02PYhndfdmML0qC3q3FU=
google.golang.org/grpc v1.69.0 h1:quSiOM1GJPmPH5XtU+BCoVXcDVJJAzNcoyfC2cCjGkI=
google.golang.org/grpc v1.69.0/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4=
google.golang.org/grpc v1.69.2 h1:U3S9QEtbXC0bYNvRtcoklF3xGtLViumSYxWykJS+7AU=
google.golang.org/grpc v1.69.2/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4=
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.5.1 h1:F29+wU6Ee6qgu9TddPgooOdaqsxTMunOoj8KA5yuS5A=
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.5.1/go.mod h1:5KF+wpkbTSbGcR9zteSqZV6fqFOWBl4Yde8En8MryZA=
google.golang.org/protobuf v1.36.0 h1:mjIs9gYtt56AzC4ZaffQuh88TZurBGhIJMBZGSxNerQ=
Expand Down
2 changes: 1 addition & 1 deletion src/checkoutservice/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ func main() {
svc.productCatalogSvcClient = pb.NewProductCatalogServiceClient(c)
defer c.Close()

mustMapEnv(&svc.cartSvcAddr, "CART_SERVICE_ADDR")
mustMapEnv(&svc.cartSvcAddr, "CART_ADDR")
c = mustCreateClient(svc.cartSvcAddr)
svc.cartSvcClient = pb.NewCartServiceClient(c)
defer c.Close()
Expand Down
Loading

0 comments on commit e236444

Please sign in to comment.