diff --git a/.env b/.env index de4088d426..844e885c5a 100644 --- a/.env +++ b/.env @@ -46,7 +46,7 @@ OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=cumulative # Core Demo Services # ****************** # Accounting Service -ACCOUNTING_SERVICE_DOCKERFILE=./src/accountingservice/Dockerfile +ACCOUNTING_DOCKERFILE=./src/accounting/Dockerfile # Ad Service AD_SERVICE_PORT=9555 diff --git a/.github/workflows/component-build-images.yml b/.github/workflows/component-build-images.yml index f6165a7627..7514267b83 100644 --- a/.github/workflows/component-build-images.yml +++ b/.github/workflows/component-build-images.yml @@ -51,8 +51,8 @@ jobs: fail-fast: false matrix: file_tag: - - file: ./src/accountingservice/Dockerfile - tag_suffix: accountingservice + - file: ./src/accounting/Dockerfile + tag_suffix: accounting context: ./ setup-qemu: true - file: ./src/adservice/Dockerfile diff --git a/.gitignore b/.gitignore index b10c7c4af8..29327c30f6 100644 --- a/.gitignore +++ b/.gitignore @@ -54,4 +54,3 @@ test/tracetesting/tracetesting-vars.yaml /src/paymentservice/demo.proto /src/shippingservice/proto/ /src/currencyservice/proto -/src/accountingservice/genproto diff --git a/.licenserc.json b/.licenserc.json index bc2411bd88..7d2aa98c37 100644 --- a/.licenserc.json +++ b/.licenserc.json @@ -38,7 +38,6 @@ ], "ignore": [ "node_modules/", - "src/accountingservice/genproto/", "src/cartservice/src/obj/", "src/cartservice/tests/obj/", "src/checkoutservice/genproto/", diff --git a/docker-compose-tests.yml b/docker-compose-tests.yml index 8bab0cb0cd..40cbbccc28 100644 --- a/docker-compose-tests.yml +++ b/docker-compose-tests.yml @@ -57,7 +57,7 @@ services: tracetest-server: condition: service_healthy # adding demo services as dependencies - accountingservice: + accounting: condition: service_started adservice: condition: service_started diff --git a/docker-compose.yml b/docker-compose.yml index b446847474..984d4c8858 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -18,14 +18,14 @@ services: # Core Demo Services # ****************** # Accounting service - accountingservice: - image: ${IMAGE_NAME}:${DEMO_VERSION}-accountingservice - container_name: accounting-service + accounting: + image: ${IMAGE_NAME}:${DEMO_VERSION}-accounting + container_name: accounting build: context: ./ - dockerfile: ${ACCOUNTING_SERVICE_DOCKERFILE} + dockerfile: ${ACCOUNTING_DOCKERFILE} cache_from: - - ${IMAGE_NAME}:${IMAGE_VERSION}-accountingservice + - ${IMAGE_NAME}:${IMAGE_VERSION}-accounting deploy: resources: limits: @@ -36,7 +36,7 @@ services: - OTEL_EXPORTER_OTLP_ENDPOINT=http://${OTEL_COLLECTOR_HOST}:${OTEL_COLLECTOR_PORT_HTTP} - OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE - OTEL_RESOURCE_ATTRIBUTES - - OTEL_SERVICE_NAME=accountingservice + - OTEL_SERVICE_NAME=accounting depends_on: otelcol: condition: service_started diff --git a/docker-gen-proto.sh b/docker-gen-proto.sh index 2fb7d2a347..b90cab8413 100755 --- a/docker-gen-proto.sh +++ b/docker-gen-proto.sh @@ -21,7 +21,7 @@ gen_proto_python() { python -m grpc_tools.protoc -I /build/pb/ --python_out="./src/$1/" --grpc_python_out="./src/$1/" /build/pb/demo.proto } -#gen_proto_dotnet accountingservice +#gen_proto_dotnet accounting #gen_proto_java adservice #gen_proto_dotnet cartservice gen_proto_go checkoutservice diff --git a/ide-gen-proto.sh b/ide-gen-proto.sh index d219ee39a0..a6e71ebb60 100755 --- a/ide-gen-proto.sh +++ b/ide-gen-proto.sh @@ -65,7 +65,7 @@ gen_proto_ts() { cd "$base_dir" || return } -gen_proto_dotnet accountingservice +gen_proto_dotnet accounting # gen_proto_java adservice gen_proto_dotnet cartservice gen_proto_go checkoutservice diff --git a/renovate.json5 b/renovate.json5 index ed723b0e63..f871b2b08a 100644 --- a/renovate.json5 +++ b/renovate.json5 @@ -15,8 +15,8 @@ "packageRules": [ { - "matchFileNames": ["src/accountingservice/**"], - "groupName": "accountingservice", + "matchFileNames": ["src/accounting/**"], + "groupName": "accounting", }, { "matchFileNames": ["src/adservice/**"], diff --git a/src/accountingservice/AccountingService.csproj b/src/accounting/Accounting.csproj similarity index 100% rename from src/accountingservice/AccountingService.csproj rename to src/accounting/Accounting.csproj diff --git a/src/accountingservice/AccountingService.sln b/src/accounting/Accounting.sln similarity index 87% rename from src/accountingservice/AccountingService.sln rename to src/accounting/Accounting.sln index ee5a41ca9f..819a398467 100644 --- a/src/accountingservice/AccountingService.sln +++ b/src/accounting/Accounting.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.9.34701.34 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AccountingService", "AccountingService.csproj", "{C66C35E2-DF04-4DCF-8F6A-87B6D6433FF6}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Accounting", "Accounting.csproj", "{C66C35E2-DF04-4DCF-8F6A-87B6D6433FF6}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/src/accountingservice/Consumer.cs b/src/accounting/Consumer.cs similarity index 96% rename from src/accountingservice/Consumer.cs rename to src/accounting/Consumer.cs index 70f9357fea..421f04809e 100644 --- a/src/accountingservice/Consumer.cs +++ b/src/accounting/Consumer.cs @@ -5,7 +5,7 @@ using Microsoft.Extensions.Logging; using Oteldemo; -namespace AccountingService; +namespace Accounting; internal class Consumer : IDisposable { @@ -74,7 +74,7 @@ private IConsumer BuildConsumer(string servers) { var conf = new ConsumerConfig { - GroupId = $"accountingservice", + GroupId = $"accounting", BootstrapServers = servers, // https://github.com/confluentinc/confluent-kafka-dotnet/tree/07de95ed647af80a0db39ce6a8891a630423b952#basic-consumer-example AutoOffsetReset = AutoOffsetReset.Earliest, diff --git a/src/accountingservice/Dockerfile b/src/accounting/Dockerfile similarity index 56% rename from src/accountingservice/Dockerfile rename to src/accounting/Dockerfile index 974958d266..05b205fb35 100644 --- a/src/accountingservice/Dockerfile +++ b/src/accounting/Dockerfile @@ -5,19 +5,19 @@ FROM --platform=${BUILDPLATFORM} mcr.microsoft.com/dotnet/sdk:8.0 AS builder ARG TARGETARCH ARG BUILD_CONFIGURATION=Release WORKDIR /src -COPY ["/src/accountingservice/", "AccountingService/"] -COPY ["/pb/demo.proto", "AccountingService/proto/"] -RUN dotnet restore "./AccountingService/AccountingService.csproj" -r linux-$TARGETARCH -WORKDIR "/src/AccountingService" +COPY ["/src/accounting/", "Accounting/"] +COPY ["/pb/demo.proto", "Accounting/proto/"] +RUN dotnet restore "./Accounting/Accounting.csproj" -r linux-$TARGETARCH +WORKDIR "/src/Accounting" -RUN dotnet build "./AccountingService.csproj" -r linux-$TARGETARCH -c $BUILD_CONFIGURATION -o /app/build +RUN dotnet build "./Accounting.csproj" -r linux-$TARGETARCH -c $BUILD_CONFIGURATION -o /app/build # ----------------------------------------------------------------------------- FROM builder AS publish ARG TARGETARCH ARG BUILD_CONFIGURATION=Release -RUN dotnet publish "./AccountingService.csproj" -r linux-$TARGETARCH -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false +RUN dotnet publish "./Accounting.csproj" -r linux-$TARGETARCH -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false # ----------------------------------------------------------------------------- @@ -32,4 +32,4 @@ RUN chown app "/var/log/opentelemetry/dotnet" RUN chown app "/app/instrument.sh" USER app -ENTRYPOINT ["./instrument.sh", "dotnet", "AccountingService.dll"] +ENTRYPOINT ["./instrument.sh", "dotnet", "Accounting.dll"] diff --git a/src/accountingservice/Helpers.cs b/src/accounting/Helpers.cs similarity index 97% rename from src/accountingservice/Helpers.cs rename to src/accounting/Helpers.cs index c757378338..d167aae38e 100644 --- a/src/accountingservice/Helpers.cs +++ b/src/accounting/Helpers.cs @@ -3,7 +3,7 @@ using System.Collections; -namespace AccountingService +namespace Accounting { internal static class Helpers { diff --git a/src/accountingservice/Log.cs b/src/accounting/Log.cs similarity index 93% rename from src/accountingservice/Log.cs rename to src/accounting/Log.cs index 73bfb3f557..e18af0e658 100644 --- a/src/accountingservice/Log.cs +++ b/src/accounting/Log.cs @@ -4,7 +4,7 @@ using Microsoft.Extensions.Logging; using Oteldemo; -namespace AccountingService +namespace Accounting { internal static partial class Log { diff --git a/src/accountingservice/Program.cs b/src/accounting/Program.cs similarity index 95% rename from src/accountingservice/Program.cs rename to src/accounting/Program.cs index 1f122a7ebc..54a5c44657 100644 --- a/src/accountingservice/Program.cs +++ b/src/accounting/Program.cs @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -using AccountingService; +using Accounting; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; diff --git a/src/accountingservice/README.md b/src/accounting/README.md similarity index 67% rename from src/accountingservice/README.md rename to src/accounting/README.md index 9c0f57ef13..af86aee226 100644 --- a/src/accountingservice/README.md +++ b/src/accounting/README.md @@ -7,7 +7,7 @@ This service consumes new orders from a Kafka topic. To build the service binary, run: ```sh -cp pb/demo.proto src/accoutingservice/proto/demo.proto # root context +cp pb/demo.proto src/accouting/proto/demo.proto # root context dotnet build # accounting service context ``` @@ -16,7 +16,7 @@ dotnet build # accounting service context From the root directory, run: ```sh -docker compose build accountingservice +docker compose build accounting ``` ## Bump dependencies @@ -24,5 +24,5 @@ docker compose build accountingservice To bump all dependencies run in Package manager: ```sh -Update-Package -ProjectName AccountingService +Update-Package -ProjectName Accounting ```