Skip to content

Commit

Permalink
[accounting]: rename accountingservice to accounting (open-telemetry#…
Browse files Browse the repository at this point in the history
…1827)

* rename accountingservice to accounting

* Add ignore protos back

---------

Co-authored-by: Juliano Costa <juliano.costa@datadoghq.com>
  • Loading branch information
puckpuck and julianocosta89 authored Dec 12, 2024
1 parent 5f28491 commit e54439d
Show file tree
Hide file tree
Showing 18 changed files with 34 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -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
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 @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ src/shippingservice/target/
test/tracetesting/tracetesting-vars.yaml

# Ignore copied/generated protobuf files
/src/accounting/src/protos/
/src/cartservice/src/protos/
/src/featureflagservice/proto/
/src/featureflagservice/src/ffs_demo_pb.erl
Expand All @@ -54,4 +55,3 @@ test/tracetesting/tracetesting-vars.yaml
/src/paymentservice/demo.proto
/src/shippingservice/proto/
/src/currencyservice/proto
/src/accountingservice/genproto
2 changes: 1 addition & 1 deletion .licenserc.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
],
"ignore": [
"node_modules/",
"src/accountingservice/genproto/",
"/src/accounting/src/protos/",
"src/cartservice/src/obj/",
"src/cartservice/tests/obj/",
"src/checkoutservice/genproto/",
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ the release.
([#1794](https://github.com/open-telemetry/opentelemetry-demo/pull/1784))
* [paymentservice] Add nodejs instrumentation for runtime metrics
([#1797](https://github.com/open-telemetry/opentelemetry-demo/pull/1797))
* [accounting] rename accountingservice to accounting
([#1827](https://github.com/open-telemetry/opentelemetry-demo/pull/1827))

## 1.12.0

Expand Down
2 changes: 1 addition & 1 deletion docker-compose-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ services:
tracetest-server:
condition: service_healthy
# adding demo services as dependencies
accountingservice:
accounting:
condition: service_started
adservice:
condition: service_started
Expand Down
12 changes: 6 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docker-gen-proto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ide-gen-proto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

"packageRules": [
{
"matchFileNames": ["src/accountingservice/**"],
"groupName": "accountingservice",
"matchFileNames": ["src/accounting/**"],
"groupName": "accounting",
},
{
"matchFileNames": ["src/adservice/**"],
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using Microsoft.Extensions.Logging;
using Oteldemo;

namespace AccountingService;
namespace Accounting;

internal class Consumer : IDisposable
{
Expand Down Expand Up @@ -74,7 +74,7 @@ private IConsumer<string, byte[]> 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,
Expand Down
14 changes: 7 additions & 7 deletions src/accountingservice/Dockerfile → src/accounting/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

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

Expand All @@ -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"]
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using System.Collections;

namespace AccountingService
namespace Accounting
{
internal static class Helpers
{
Expand Down
2 changes: 1 addition & 1 deletion src/accountingservice/Log.cs → src/accounting/Log.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using Microsoft.Extensions.Logging;
using Oteldemo;

namespace AccountingService
namespace Accounting
{
internal static partial class Log
{
Expand Down
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
6 changes: 3 additions & 3 deletions src/accountingservice/README.md → src/accounting/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand All @@ -16,13 +16,13 @@ dotnet build # accounting service context
From the root directory, run:

```sh
docker compose build accountingservice
docker compose build accounting
```

## Bump dependencies

To bump all dependencies run in Package manager:

```sh
Update-Package -ProjectName AccountingService
Update-Package -ProjectName Accounting
```

0 comments on commit e54439d

Please sign in to comment.