Skip to content

Commit

Permalink
rename adService to ad
Browse files Browse the repository at this point in the history
  • Loading branch information
Sozhan308 committed Dec 13, 2024
1 parent 7b2c0ad commit ad90b5a
Show file tree
Hide file tree
Showing 28 changed files with 165 additions and 165 deletions.
6 changes: 3 additions & 3 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=cumulative
ACCOUNTING_DOCKERFILE=./src/accounting/Dockerfile

# Ad Service
AD_SERVICE_PORT=9555
AD_SERVICE_ADDR=adservice:${AD_SERVICE_PORT}
AD_SERVICE_DOCKERFILE=./src/adservice/Dockerfile
AD_PORT=9555
AD_ADDR=ad:${AD_PORT}
AD_DOCKERFILE=./src/ad/Dockerfile

# Cart Service
CART_SERVICE_PORT=7070
Expand Down
2 changes: 1 addition & 1 deletion .github/component_owners.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-License-Identifier: Apache-2.0
# this file is used by .github/workflows/assign-reviewers.yml
components:
src/adservice:
src/ad:
- jack-berg
- mateuszrzeszutek
- trask
4 changes: 2 additions & 2 deletions .github/workflows/component-build-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ jobs:
tag_suffix: accounting
context: ./
setup-qemu: true
- file: ./src/adservice/Dockerfile
tag_suffix: adservice
- file: ./src/ad/Dockerfile
tag_suffix: ad
context: ./
setup-qemu: true
- file: ./src/cartservice/src/Dockerfile
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ cd opentelemetry-demo/
- Navigate to the Java Ad Service folder to install and update Gradle:

```shell
cd .\src\adservice\
cd .\src\ad\
.\gradlew installDist
.\gradlew wrapper --gradle-version 7.4.2
```
Expand Down
4 changes: 2 additions & 2 deletions docker-compose-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ services:
args:
TRACETEST_IMAGE_VERSION: ${TRACETEST_IMAGE_VERSION}
environment:
- AD_SERVICE_ADDR
- AD_ADDR
- CART_SERVICE_ADDR
- CHECKOUT_SERVICE_ADDR
- CURRENCY_SERVICE_ADDR
Expand All @@ -59,7 +59,7 @@ services:
# adding demo services as dependencies
accounting:
condition: service_started
adservice:
ad:
condition: service_started
cartservice:
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 @@ -19,14 +19,14 @@ services:
# ******************

# AdService
adservice:
image: ${IMAGE_NAME}:${DEMO_VERSION}-adservice
container_name: ad-service
ad:
image: ${IMAGE_NAME}:${DEMO_VERSION}-ad
container_name: ad
build:
context: ./
dockerfile: ${AD_SERVICE_DOCKERFILE}
dockerfile: ${AD_DOCKERFILE}
cache_from:
- ${IMAGE_NAME}:${IMAGE_VERSION}-adservice
- ${IMAGE_NAME}:${IMAGE_VERSION}-ad
args:
OTEL_JAVA_AGENT_VERSION: ${OTEL_JAVA_AGENT_VERSION}
deploy:
Expand All @@ -35,15 +35,15 @@ services:
memory: 300M
restart: unless-stopped
ports:
- "${AD_SERVICE_PORT}"
- "${AD_PORT}"
environment:
- AD_SERVICE_PORT
- AD_PORT
- FLAGD_HOST
- OTEL_EXPORTER_OTLP_ENDPOINT=http://${OTEL_COLLECTOR_HOST}:${OTEL_COLLECTOR_PORT_HTTP}
- OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE
- OTEL_RESOURCE_ATTRIBUTES
- OTEL_LOGS_EXPORTER=otlp
- OTEL_SERVICE_NAME=adservice
- OTEL_SERVICE_NAME=ad
depends_on:
otelcol:
condition: service_started
Expand Down Expand Up @@ -199,7 +199,7 @@ services:
environment:
- PORT=${FRONTEND_PORT}
- FRONTEND_ADDR
- AD_SERVICE_ADDR
- AD_ADDR
- CART_SERVICE_ADDR
- CHECKOUT_SERVICE_ADDR
- CURRENCY_SERVICE_ADDR
Expand All @@ -217,7 +217,7 @@ services:
- FLAGD_HOST
- FLAGD_PORT
depends_on:
adservice:
ad:
condition: service_started
cartservice:
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 @@ -45,14 +45,14 @@ services:
logging: *logging

# AdService
adservice:
image: ${IMAGE_NAME}:${DEMO_VERSION}-adservice
container_name: ad-service
ad:
image: ${IMAGE_NAME}:${DEMO_VERSION}-ad
container_name: ad
build:
context: ./
dockerfile: ${AD_SERVICE_DOCKERFILE}
dockerfile: ${AD_DOCKERFILE}
cache_from:
- ${IMAGE_NAME}:${IMAGE_VERSION}-adservice
- ${IMAGE_NAME}:${IMAGE_VERSION}-ad
args:
OTEL_JAVA_AGENT_VERSION: ${OTEL_JAVA_AGENT_VERSION}
deploy:
Expand All @@ -61,16 +61,16 @@ services:
memory: 300M
restart: unless-stopped
ports:
- "${AD_SERVICE_PORT}"
- "${AD_PORT}"
environment:
- AD_SERVICE_PORT
- AD_PORT
- FLAGD_HOST
- FLAGD_PORT
- OTEL_EXPORTER_OTLP_ENDPOINT=http://${OTEL_COLLECTOR_HOST}:${OTEL_COLLECTOR_PORT_HTTP}
- OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE
- OTEL_RESOURCE_ATTRIBUTES
- OTEL_LOGS_EXPORTER=otlp
- OTEL_SERVICE_NAME=adservice
- OTEL_SERVICE_NAME=ad
depends_on:
otelcol:
condition: service_started
Expand Down Expand Up @@ -271,7 +271,7 @@ services:
environment:
- PORT=${FRONTEND_PORT}
- FRONTEND_ADDR
- AD_SERVICE_ADDR
- AD_ADDR
- CART_SERVICE_ADDR
- CHECKOUT_SERVICE_ADDR
- CURRENCY_SERVICE_ADDR
Expand All @@ -289,7 +289,7 @@ services:
- FLAGD_HOST
- FLAGD_PORT
depends_on:
adservice:
ad:
condition: service_started
cartservice:
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 @@ -22,7 +22,7 @@ gen_proto_python() {
}

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

gen_proto_dotnet accounting
# gen_proto_java adservice
# gen_proto_java ad
gen_proto_dotnet cartservice
gen_proto_go checkoutservice
# gen_proto_cpp currencyservice
Expand Down
36 changes: 18 additions & 18 deletions kubernetes/opentelemetry-demo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8674,13 +8674,13 @@ spec:
apiVersion: v1
kind: Service
metadata:
name: opentelemetry-demo-adservice
name: opentelemetry-demo-ad
labels:

opentelemetry.io/name: opentelemetry-demo-adservice
opentelemetry.io/name: opentelemetry-demo-ad
app.kubernetes.io/instance: opentelemetry-demo
app.kubernetes.io/component: adservice
app.kubernetes.io/name: opentelemetry-demo-adservice
app.kubernetes.io/component: ad
app.kubernetes.io/name: opentelemetry-demo-ad
app.kubernetes.io/version: "1.12.0"
app.kubernetes.io/part-of: opentelemetry-demo
spec:
Expand All @@ -8691,7 +8691,7 @@ spec:
targetPort: 8080
selector:

opentelemetry.io/name: opentelemetry-demo-adservice
opentelemetry.io/name: opentelemetry-demo-ad
---
# Source: opentelemetry-demo/templates/component.yaml
apiVersion: v1
Expand Down Expand Up @@ -9568,13 +9568,13 @@ spec:
apiVersion: apps/v1
kind: Deployment
metadata:
name: opentelemetry-demo-adservice
name: opentelemetry-demo-ad
labels:

opentelemetry.io/name: opentelemetry-demo-adservice
opentelemetry.io/name: opentelemetry-demo-ad
app.kubernetes.io/instance: opentelemetry-demo
app.kubernetes.io/component: adservice
app.kubernetes.io/name: opentelemetry-demo-adservice
app.kubernetes.io/component: ad
app.kubernetes.io/name: opentelemetry-demo-ad
app.kubernetes.io/version: "1.12.0"
app.kubernetes.io/part-of: opentelemetry-demo
spec:
Expand All @@ -9583,20 +9583,20 @@ spec:
selector:
matchLabels:

opentelemetry.io/name: opentelemetry-demo-adservice
opentelemetry.io/name: opentelemetry-demo-ad
template:
metadata:
labels:

opentelemetry.io/name: opentelemetry-demo-adservice
opentelemetry.io/name: opentelemetry-demo-ad
app.kubernetes.io/instance: opentelemetry-demo
app.kubernetes.io/component: adservice
app.kubernetes.io/name: opentelemetry-demo-adservice
app.kubernetes.io/component: ad
app.kubernetes.io/name: opentelemetry-demo-ad
spec:
serviceAccountName: opentelemetry-demo
containers:
- name: adservice
image: 'ghcr.io/open-telemetry/demo:1.12.0-adservice'
- name: ad
image: 'ghcr.io/open-telemetry/demo:1.12.0-ad'
imagePullPolicy: IfNotPresent
ports:

Expand All @@ -9612,7 +9612,7 @@ spec:
value: 'opentelemetry-demo-otelcol'
- name: OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE
value: cumulative
- name: AD_SERVICE_PORT
- name: AD_PORT
value: "8080"
- name: FLAGD_HOST
value: 'opentelemetry-demo-flagd'
Expand Down Expand Up @@ -10149,8 +10149,8 @@ spec:
value: "8080"
- name: FRONTEND_ADDR
value: :8080
- name: AD_SERVICE_ADDR
value: 'opentelemetry-demo-adservice:8080'
- name: AD_ADDR
value: 'opentelemetry-demo-ad:8080'
- name: CART_SERVICE_ADDR
value: 'opentelemetry-demo-cartservice:8080'
- name: CHECKOUT_SERVICE_ADDR
Expand Down
4 changes: 2 additions & 2 deletions renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"groupName": "accounting",
},
{
"matchFileNames": ["src/adservice/**"],
"groupName": "adservice",
"matchFileNames": ["src/ad/**"],
"groupName": "ad",
},
{
"matchFileNames": ["src/cartservice/**"],
Expand Down
File renamed without changes.
10 changes: 5 additions & 5 deletions src/adservice/Dockerfile → src/ad/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ FROM --platform=${BUILDPLATFORM} eclipse-temurin:21-jdk AS builder

WORKDIR /usr/src/app/

COPY ./src/adservice/gradlew* ./src/adservice/settings.gradle* ./src/adservice/build.gradle ./
COPY ./src/adservice/gradle ./gradle
COPY ./src/ad/gradlew* ./src/ad/settings.gradle* ./src/ad/build.gradle ./
COPY ./src/ad/gradle ./gradle

RUN ./gradlew
RUN ./gradlew downloadRepos

COPY ./src/adservice/ ./
COPY ./src/ad/ ./
COPY ./pb/ ./proto
RUN ./gradlew installDist -PprotoSourceDir=./proto

Expand All @@ -27,5 +27,5 @@ COPY --from=builder /usr/src/app/ ./
ADD --chmod=644 https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v$OTEL_JAVA_AGENT_VERSION/opentelemetry-javaagent.jar /usr/src/app/opentelemetry-javaagent.jar
ENV JAVA_TOOL_OPTIONS=-javaagent:/usr/src/app/opentelemetry-javaagent.jar

EXPOSE ${AD_SERVICE_PORT}
ENTRYPOINT [ "./build/install/opentelemetry-demo-ad-service/bin/AdService" ]
EXPOSE ${AD_PORT}
ENTRYPOINT [ "./build/install/opentelemetry-demo-ad-service/bin/Ad" ]
8 changes: 4 additions & 4 deletions src/adservice/README.md → src/ad/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ To build Ad Service, run:
```

It will create an executable script
`src/adservice/build/install/oteldemo/bin/AdService`.
`src/ad/build/install/oteldemo/bin/Ad`.

To run the Ad Service:

```sh
export AD_SERVICE_PORT=8080
export AD_PORT=8080
export FEATURE_FLAG_GRPC_SERVICE_ADDR=featureflagservice:50053
./build/install/opentelemetry-demo-ad-service/bin/AdService
./build/install/opentelemetry-demo-ad-service/bin/Ad
```

### Upgrading Gradle
Expand All @@ -37,5 +37,5 @@ If you need to upgrade the version of gradle then run
From the root of `opentelemetry-demo`, run:

```sh
docker build --file ./src/adservice/Dockerfile ./
docker build --file ./src/ad/Dockerfile ./
```
10 changes: 5 additions & 5 deletions src/adservice/build.gradle → src/ad/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repositories {
}

description = 'Ad Service'
group = "adservice"
group = "ad"
version = "0.1.0-SNAPSHOT"

def opentelemetryVersion = "1.40.0"
Expand Down Expand Up @@ -129,14 +129,14 @@ task downloadRepos(type: Copy) {
into offlineCompile
}

task adService(type: CreateStartScripts) {
mainClass.set('oteldemo.AdService')
applicationName = 'AdService'
task ad(type: CreateStartScripts) {
mainClass.set('oteldemo.Ad')
applicationName = 'Ad'
outputDir = new File(project.buildDir, 'tmp')
classpath = startScripts.classpath
}

applicationDistribution.into('bin') {
from(adService)
from(ad)
fileMode = 0755
}
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit ad90b5a

Please sign in to comment.