Skip to content

Commit fca8fd1

Browse files
authored
[shipping] rename shippingservice to shipping (#1842)
1 parent 623c0e4 commit fca8fd1

33 files changed

+64
-62
lines changed

.dockerignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ src/*/*/Dockerfile
2828

2929
###################################
3030
# shippingservice
31-
./src/shippingservice/target
31+
./src/shipping/target
3232
###################################
3333

3434
# Mix artifacts

.env

+3-3
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,9 @@ RECOMMENDATION_SERVICE_ADDR=recommendationservice:${RECOMMENDATION_SERVICE_PORT}
122122
RECOMMENDATION_SERVICE_DOCKERFILE=./src/recommendationservice/Dockerfile
123123

124124
# Shipping Service
125-
SHIPPING_SERVICE_PORT=50050
126-
SHIPPING_SERVICE_ADDR=shippingservice:${SHIPPING_SERVICE_PORT}
127-
SHIPPING_SERVICE_DOCKERFILE=./src/shippingservice/Dockerfile
125+
SHIPPING_PORT=50050
126+
SHIPPING_ADDR=shipping:${SHIPPING_PORT}
127+
SHIPPING_DOCKERFILE=./src/shipping/Dockerfile
128128

129129
# ******************
130130
# Dependent Services

.github/workflows/component-build-images.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ jobs:
119119
tag_suffix: recommendationservice
120120
context: ./
121121
setup-qemu: true
122-
- file: ./src/shippingservice/Dockerfile
123-
tag_suffix: shippingservice
122+
- file: ./src/shipping/Dockerfile
123+
tag_suffix: shipping
124124
context: ./
125125
setup-qemu: true
126126
- file: ./src/flagd-ui/Dockerfile

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ composer.lock
3939

4040
src/frontend/cypress/videos
4141
src/frontend/cypress/screenshots
42-
src/shippingservice/target/
42+
src/shipping/target/
4343
test/tracetesting/tracetesting-vars.yaml
4444

4545
# Ignore copied/generated protobuf files
@@ -53,5 +53,5 @@ test/tracetesting/tracetesting-vars.yaml
5353
/src/frontend/pb/
5454
/src/frontend/protos/
5555
/src/paymentservice/demo.proto
56-
/src/shippingservice/proto/
56+
/src/shipping/proto/
5757
/src/currencyservice/proto

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ the release.
4444
([#1841](https://github.com/open-telemetry/opentelemetry-demo/pull/1841))
4545
* [cart] rename cartservice to cart
4646
([#1839](https://github.com/open-telemetry/opentelemetry-demo/pull/1839))
47+
* [shipping] rename shippingservice to shipping
48+
([#1842](https://github.com/open-telemetry/opentelemetry-demo/pull/1842))
4749

4850
## 1.12.0
4951

docker-compose-tests.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ services:
4646
- PAYMENT_SERVICE_ADDR
4747
- PRODUCT_CATALOG_SERVICE_ADDR
4848
- RECOMMENDATION_SERVICE_ADDR
49-
- SHIPPING_SERVICE_ADDR
49+
- SHIPPING_ADDR
5050
- KAFKA_SERVICE_ADDR
5151
extra_hosts:
5252
- "host.docker.internal:host-gateway"
@@ -81,7 +81,7 @@ services:
8181
condition: service_started
8282
recommendationservice:
8383
condition: service_started
84-
shippingservice:
84+
shipping:
8585
condition: service_started
8686
flagd:
8787
condition: service_started

docker-compose.minimal.yml

+12-12
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ services:
104104
- FLAGD_HOST
105105
- PAYMENT_SERVICE_ADDR
106106
- PRODUCT_CATALOG_SERVICE_ADDR
107-
- SHIPPING_SERVICE_ADDR
107+
- SHIPPING_ADDR
108108
- OTEL_EXPORTER_OTLP_ENDPOINT
109109
- OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE
110110
- OTEL_RESOURCE_ATTRIBUTES
@@ -120,7 +120,7 @@ services:
120120
condition: service_started
121121
productcatalogservice:
122122
condition: service_started
123-
shippingservice:
123+
shipping:
124124
condition: service_started
125125
otel-collector:
126126
condition: service_started
@@ -205,7 +205,7 @@ services:
205205
- CURRENCY_SERVICE_ADDR
206206
- PRODUCT_CATALOG_SERVICE_ADDR
207207
- RECOMMENDATION_SERVICE_ADDR
208-
- SHIPPING_SERVICE_ADDR
208+
- SHIPPING_ADDR
209209
- OTEL_EXPORTER_OTLP_ENDPOINT
210210
- OTEL_RESOURCE_ATTRIBUTES=${OTEL_RESOURCE_ATTRIBUTES}
211211
- ENV_PLATFORM
@@ -231,7 +231,7 @@ services:
231231
condition: service_started
232232
recommendationservice:
233233
condition: service_started
234-
shippingservice:
234+
shipping:
235235
condition: service_started
236236
otel-collector:
237237
condition: service_started
@@ -468,27 +468,27 @@ services:
468468
logging: *logging
469469

470470
# Shipping service
471-
shippingservice:
472-
image: ${IMAGE_NAME}:${DEMO_VERSION}-shippingservice
473-
container_name: shipping-service
471+
shipping:
472+
image: ${IMAGE_NAME}:${DEMO_VERSION}-shipping
473+
container_name: shipping
474474
build:
475475
context: ./
476-
dockerfile: ${SHIPPING_SERVICE_DOCKERFILE}
476+
dockerfile: ${SHIPPING_DOCKERFILE}
477477
cache_from:
478-
- ${IMAGE_NAME}:${IMAGE_VERSION}-shippingservice
478+
- ${IMAGE_NAME}:${IMAGE_VERSION}-shipping
479479
deploy:
480480
resources:
481481
limits:
482482
memory: 20M
483483
restart: unless-stopped
484484
ports:
485-
- "${SHIPPING_SERVICE_PORT}"
485+
- "${SHIPPING_PORT}"
486486
environment:
487-
- SHIPPING_SERVICE_PORT
487+
- SHIPPING_PORT
488488
- QUOTE_ADDR
489489
- OTEL_EXPORTER_OTLP_ENDPOINT=http://${OTEL_COLLECTOR_HOST}:${OTEL_COLLECTOR_PORT_GRPC}
490490
- OTEL_RESOURCE_ATTRIBUTES
491-
- OTEL_SERVICE_NAME=shippingservice
491+
- OTEL_SERVICE_NAME=shipping
492492
depends_on:
493493
otel-collector:
494494
condition: service_started

docker-compose.yml

+12-12
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ services:
137137
- EMAIL_SERVICE_ADDR
138138
- PAYMENT_SERVICE_ADDR
139139
- PRODUCT_CATALOG_SERVICE_ADDR
140-
- SHIPPING_SERVICE_ADDR
140+
- SHIPPING_ADDR
141141
- KAFKA_SERVICE_ADDR
142142
- OTEL_EXPORTER_OTLP_ENDPOINT
143143
- OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE
@@ -154,7 +154,7 @@ services:
154154
condition: service_started
155155
productcatalogservice:
156156
condition: service_started
157-
shippingservice:
157+
shipping:
158158
condition: service_started
159159
otel-collector:
160160
condition: service_started
@@ -277,7 +277,7 @@ services:
277277
- CURRENCY_SERVICE_ADDR
278278
- PRODUCT_CATALOG_SERVICE_ADDR
279279
- RECOMMENDATION_SERVICE_ADDR
280-
- SHIPPING_SERVICE_ADDR
280+
- SHIPPING_ADDR
281281
- OTEL_EXPORTER_OTLP_ENDPOINT
282282
- OTEL_RESOURCE_ATTRIBUTES=${OTEL_RESOURCE_ATTRIBUTES}
283283
- ENV_PLATFORM
@@ -303,7 +303,7 @@ services:
303303
condition: service_started
304304
recommendationservice:
305305
condition: service_started
306-
shippingservice:
306+
shipping:
307307
condition: service_started
308308
otel-collector:
309309
condition: service_started
@@ -553,27 +553,27 @@ services:
553553
logging: *logging
554554

555555
# Shipping service
556-
shippingservice:
557-
image: ${IMAGE_NAME}:${DEMO_VERSION}-shippingservice
558-
container_name: shipping-service
556+
shipping:
557+
image: ${IMAGE_NAME}:${DEMO_VERSION}-shipping
558+
container_name: shipping
559559
build:
560560
context: ./
561-
dockerfile: ${SHIPPING_SERVICE_DOCKERFILE}
561+
dockerfile: ${SHIPPING_DOCKERFILE}
562562
cache_from:
563-
- ${IMAGE_NAME}:${IMAGE_VERSION}-shippingservice
563+
- ${IMAGE_NAME}:${IMAGE_VERSION}-shipping
564564
deploy:
565565
resources:
566566
limits:
567567
memory: 20M
568568
restart: unless-stopped
569569
ports:
570-
- "${SHIPPING_SERVICE_PORT}"
570+
- "${SHIPPING_PORT}"
571571
environment:
572-
- SHIPPING_SERVICE_PORT
572+
- SHIPPING_PORT
573573
- QUOTE_ADDR
574574
- OTEL_EXPORTER_OTLP_ENDPOINT=http://${OTEL_COLLECTOR_HOST}:${OTEL_COLLECTOR_PORT_GRPC}
575575
- OTEL_RESOURCE_ATTRIBUTES
576-
- OTEL_SERVICE_NAME=shippingservice
576+
- OTEL_SERVICE_NAME=shipping
577577
depends_on:
578578
otel-collector:
579579
condition: service_started

docker-gen-proto.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ gen_proto_go checkoutservice
3232
gen_proto_go productcatalogservice
3333
#gen_proto_php quote
3434
gen_proto_python recommendationservice
35-
#gen_proto_rust shippingservice
35+
#gen_proto_rust shipping

ide-gen-proto.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,4 @@ gen_proto_js paymentservice
7676
gen_proto_go productcatalogservice
7777
# gen_proto_php quote
7878
gen_proto_python recommendationservice
79-
gen_proto_rust shippingservice
79+
gen_proto_rust shipping

renovate.json5

+2-2
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@
9191
"groupName": "recommendationservice",
9292
},
9393
{
94-
"matchFileNames": ["src/shippingservice/**"],
95-
"groupName": "shippingservice",
94+
"matchFileNames": ["src/shipping/**"],
95+
"groupName": "shipping",
9696
},
9797
{
9898
// intentionally using Java 11 in some examples

src/checkoutservice/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ func main() {
167167

168168
svc := new(checkoutService)
169169

170-
mustMapEnv(&svc.shippingSvcAddr, "SHIPPING_SERVICE_ADDR")
170+
mustMapEnv(&svc.shippingSvcAddr, "SHIPPING_ADDR")
171171
c := mustCreateClient(svc.shippingSvcAddr)
172172
svc.shippingSvcClient = pb.NewShippingServiceClient(c)
173173
defer c.Close()

src/frontend/gateways/rpc/Shipping.gateway.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
import { ChannelCredentials } from '@grpc/grpc-js';
55
import { Address, CartItem, GetQuoteResponse, ShippingServiceClient } from '../../protos/demo';
66

7-
const { SHIPPING_SERVICE_ADDR = '' } = process.env;
7+
const { SHIPPING_ADDR = '' } = process.env;
88

9-
const client = new ShippingServiceClient(SHIPPING_SERVICE_ADDR, ChannelCredentials.createInsecure());
9+
const client = new ShippingServiceClient(SHIPPING_ADDR, ChannelCredentials.createInsecure());
1010

1111
const ShippingGateway = () => ({
1212
getShippingCost(itemList: CartItem[], address: Address) {

src/frontend/next.config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const {
1919
CURRENCY_SERVICE_ADDR = '',
2020
PRODUCT_CATALOG_SERVICE_ADDR = '',
2121
RECOMMENDATION_SERVICE_ADDR = '',
22-
SHIPPING_SERVICE_ADDR = '',
22+
SHIPPING_ADDR = '',
2323
ENV_PLATFORM = '',
2424
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT = '',
2525
OTEL_SERVICE_NAME = 'frontend',
@@ -51,7 +51,7 @@ const nextConfig = {
5151
CURRENCY_SERVICE_ADDR,
5252
PRODUCT_CATALOG_SERVICE_ADDR,
5353
RECOMMENDATION_SERVICE_ADDR,
54-
SHIPPING_SERVICE_ADDR,
54+
SHIPPING_ADDR,
5555
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT,
5656
NEXT_PUBLIC_PLATFORM: ENV_PLATFORM,
5757
NEXT_PUBLIC_OTEL_SERVICE_NAME: OTEL_SERVICE_NAME,
File renamed without changes.

src/shippingservice/Cargo.lock src/shipping/Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/shippingservice/Cargo.toml src/shipping/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11

22

33
[package]
4-
name = "shippingservice"
4+
name = "shipping"
55
version = "1.8.0"
66
edition = "2021"
77

88
[[bin]]
9-
name = "shippingservice"
9+
name = "shipping"
1010
path = "src/main.rs"
1111

1212
[features]

src/shippingservice/Dockerfile src/shipping/Dockerfile

+6-6
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ RUN if [ "${TARGETPLATFORM}" = "${BUILDPLATFORM}" ] ; then \
2727

2828
WORKDIR /app/
2929

30-
COPY /src/shippingservice/ /app/
30+
COPY /src/shipping/ /app/
3131
COPY /pb/ /app/proto/
3232

3333
# Compile or crosscompile
@@ -38,13 +38,13 @@ RUN if [ "${TARGETPLATFORM}" = "${BUILDPLATFORM}" ] ; then \
3838
CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc \
3939
CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++ \
4040
cargo build -r --features="dockerproto" --target aarch64-unknown-linux-gnu && \
41-
cp /app/target/aarch64-unknown-linux-gnu/release/shippingservice /app/target/release/shippingservice; \
41+
cp /app/target/aarch64-unknown-linux-gnu/release/shipping /app/target/release/shipping; \
4242
elif [ "${TARGETPLATFORM}" = "linux/amd64" ] ; then \
4343
env CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=x86_64-linux-gnu-gcc \
4444
CC_x86_64_unknown_linux_gnu=x86_64-linux-gnu-gcc \
4545
CXX_x86_64_unknown_linux_gnu=x86_64-linux-gnu-g++ \
4646
cargo build -r --features="dockerproto" --target x86_64-unknown-linux-gnu && \
47-
cp /app/target/x86_64-unknown-linux-gnu/release/shippingservice /app/target/release/shippingservice; \
47+
cp /app/target/x86_64-unknown-linux-gnu/release/shipping /app/target/release/shipping; \
4848
else \
4949
echo "${TARGETPLATFORM} is not supported"; \
5050
exit 1; \
@@ -58,8 +58,8 @@ RUN wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health
5858
FROM debian:bookworm-slim AS release
5959

6060
WORKDIR /app
61-
COPY --from=builder /app/target/release/shippingservice /app/shippingservice
61+
COPY --from=builder /app/target/release/shipping /app/shipping
6262
COPY --from=builder /bin/grpc_health_probe /bin/grpc_health_probe
6363

64-
EXPOSE ${SHIPPING_SERVICE_PORT}
65-
ENTRYPOINT ["/app/shippingservice"]
64+
EXPOSE ${SHIPPING_PORT}
65+
ENTRYPOINT ["/app/shipping"]

src/shippingservice/README.md src/shipping/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ rust [here](https://www.rust-lang.org/tools/install).
1313
From `../../`, run:
1414

1515
```sh
16-
docker compose build shippingservice
16+
docker compose build shipping
1717
```
1818

1919
## Test
File renamed without changes.

src/shippingservice/src/main.rs src/shipping/src/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
2828
init_reqwest_tracing(init_tracer()?)?;
2929

3030
info!("OTel pipeline created");
31-
let port = env::var("SHIPPING_SERVICE_PORT").expect("$SHIPPING_SERVICE_PORT is not set");
31+
let port = env::var("SHIPPING_PORT").expect("$SHIPPING_PORT is not set");
3232
let addr = format!("0.0.0.0:{}", port).parse()?;
3333
info!("listening on {}", addr);
3434
let shipper = ShippingServer::default();

src/shippingservice/src/shipping_service.rs src/shipping/src/shipping_service.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ impl ShippingService for ShippingServer {
7070
// We may want to ask another service for product pricing / info
7171
// (although now everything is assumed to be the same price)
7272
// check out the create_quote_from_count method to see how we use the span created here
73-
let tracer = global::tracer("shippingservice");
73+
let tracer = global::tracer("shipping");
7474
let mut span = tracer
7575
.span_builder("oteldemo.ShippingService/GetQuote")
7676
.with_kind(SpanKind::Server)
@@ -125,7 +125,7 @@ impl ShippingService for ShippingServer {
125125
global::get_text_map_propagator(|prop| prop.extract(&MetadataMap(request.metadata())));
126126
// in this case, generating a tracking ID is trivial
127127
// we'll create a span and associated events all in this function.
128-
let tracer = global::tracer("shippingservice");
128+
let tracer = global::tracer("shipping");
129129
let mut span = tracer
130130
.span_builder("oteldemo.ShippingService/ShipOrder")
131131
.with_kind(SpanKind::Server)
File renamed without changes.

test/tracetesting/run.bash

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
set -e
99

1010
# Availalble services to test
11-
ALL_SERVICES=("ad" "cart" "currencyservice" "checkoutservice" "frontend" "emailservice" "paymentservice" "productcatalogservice" "recommendationservice" "shippingservice")
11+
ALL_SERVICES=("ad" "cart" "currencyservice" "checkoutservice" "frontend" "emailservice" "paymentservice" "productcatalogservice" "recommendationservice" "shipping")
1212

1313
## Script variables
1414
# Will contain the list of services to test
@@ -52,8 +52,8 @@ spec:
5252
value: $PRODUCT_CATALOG_SERVICE_ADDR
5353
- key: RECOMMENDATION_SERVICE_ADDR
5454
value: $RECOMMENDATION_SERVICE_ADDR
55-
- key: SHIPPING_SERVICE_ADDR
56-
value: $SHIPPING_SERVICE_ADDR
55+
- key: SHIPPING_ADDR
56+
value: $SHIPPING_ADDR
5757
- key: KAFKA_SERVICE_ADDR
5858
value: $KAFKA_SERVICE_ADDR
5959
EOF
File renamed without changes.

0 commit comments

Comments
 (0)