From e9a46eb393078a35b2577a5997da697c30d85acb Mon Sep 17 00:00:00 2001 From: Gerard Vanloo Date: Tue, 16 Jan 2024 09:31:44 -0500 Subject: [PATCH] fix: correct entrypoint, config file, and image versions in docker-compose --- hotelReservation/README.md | 10 +- hotelReservation/docker-compose-swarm.yml | 246 ---------------------- hotelReservation/docker-compose.yml | 243 ++++++++++++++------- 3 files changed, 170 insertions(+), 329 deletions(-) delete mode 100644 hotelReservation/docker-compose-swarm.yml diff --git a/hotelReservation/README.md b/hotelReservation/README.md index 545de1743..29fd97994 100644 --- a/hotelReservation/README.md +++ b/hotelReservation/README.md @@ -29,14 +29,14 @@ Supported actions: ### Running the containers ##### Docker-compose -Start docker containers by running `docker-compose up -d`. All images will be pulled from Docker Hub. +Start docker containers by running `docker compose up -d`. All images will be pulled from Docker Hub. In order to run `docker compose` with images built from the `Dockerfile`, run `docker compose up -d --build`. -The workload itself can be configured using optional enviroment variables. The avaialbe configuration items are: +The workload itself can be configured using optional enviroment variables. The available configuration items are: - TLS: Environment variable TLS controls the TLS enablement of gRPC and HTTP communications of the microservices in hotelReservation. - TLS=0 or not set(default): No TLS enabled for gRPC and HTTP communication. - - TLS=1: All the gRPC and HTTP communications will be protected by TLS, e.g. `TLS=1 docker-compose up -d`. - - TLS=: Use specified ciphersuite for TLS, e.g. `TLS=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 docker-compose up -d`. The avaialbe cipher suite can be found at the file [options.go](tls/options.go#L21). + - TLS=1: All the gRPC and HTTP communications will be protected by TLS, e.g. `TLS=1 docker compose up -d`. + - TLS=: Use specified ciphersuite for TLS, e.g. `TLS=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 docker- ompose up -d`. The avaialbe cipher suite can be found at the file [options.go](tls/options.go#L21). - GC: Environment variable GC controls the garbage collection target percentage of Golang runtime. The default value is 100. See [golang doc](https://pkg.go.dev/runtime/debug#SetGCPercent) for details. @@ -46,7 +46,7 @@ The workload itself can be configured using optional enviroment variables. The a - LOG_LEVEL: Environment variable LOG_LEVEL controls the log verbosity. Valid values are: ERROR, WARNING, INFO, TRACE, DEBUG. Default value is INFO. -Users may run `docker-compose logs ` to check the corresponding configurations. +Users may run `docker compose logs ` to check the corresponding configurations. ##### Openshift Read the Readme file in Openshift directory. diff --git a/hotelReservation/docker-compose-swarm.yml b/hotelReservation/docker-compose-swarm.yml deleted file mode 100644 index 27eb2a0dc..000000000 --- a/hotelReservation/docker-compose-swarm.yml +++ /dev/null @@ -1,246 +0,0 @@ -version: "3" -services: - consul: - image: hashicorp/consul:latest - ports: - - "8300:8300" - - "8400:8400" - - "8500:8500" - - "8600:53/udp" - deploy: - replicas: 1 - restart_policy: - condition: any - - frontend: - environment: - - TLS - image: igorrudyk1/hotel_reserv_frontend_single_node:latest - entrypoint: frontend - ports: - - "5000:5000" - depends_on: - - consul - deploy: - replicas: 3 - restart_policy: - condition: any - - profile: - environment: - - TLS - image: igorrudyk1/hotel_reserv_profile_single_node:latest - entrypoint: profile - depends_on: - - mongodb-profile - - memcached-profile - - consul - deploy: - replicas: 1 - restart_policy: - condition: any - - search: - image: igorrudyk1/hotel_reserv_search_single_node:latest - entrypoint: search - depends_on: - - consul - environment: - - TLS - deploy: - replicas: 1 - restart_policy: - condition: any - - geo: - environment: - - TLS - image: igorrudyk1/hotel_reserv_geo_single_node:latest - entrypoint: geo - depends_on: - - mongodb-geo - - consul - deploy: - replicas: 1 - restart_policy: - condition: any - - rate: - environment: - - TLS - image: igorrudyk1/hotel_reserv_rate_single_node:latest - entrypoint: rate - depends_on: - - mongodb-rate - - memcached-rate - - consul - deploy: - replicas: 1 - restart_policy: - condition: any - - recommendation: - environment: - - TLS - image: igorrudyk1/hotel_reserv_recommendation_single_node:latest - entrypoint: recommendation - depends_on: - - mongodb-recommendation - - consul - deploy: - replicas: 1 - restart_policy: - condition: any - - user: - environment: - - TLS - image: igorrudyk1/hotel_reserv_user_single_node:latest - entrypoint: user - depends_on: - - mongodb-user - - consul - deploy: - replicas: 1 - restart_policy: - condition: any - - reservation: - environment: - - TLS - image: igorrudyk1/hotel_reserv_reserve_single_node:latest - entrypoint: reservation - depends_on: - - mongodb-reservation - - memcached-reserve - - consul - deploy: - replicas: 1 - restart_policy: - condition: any - - jaeger: - image: jaegertracing/all-in-one:latest - ports: - - "14269" - - "5778:5778" - - "14268:14268" - - "14267" - - "16686:16686" - - "5775:5775/udp" - - "6831:6831/udp" - - "6832:6832/udp" - deploy: - replicas: 1 - restart_policy: - condition: any - - memcached-rate: - image: memcached - hostname: user-memcached - environment: - - MEMCACHED_CACHE_SIZE=128 - - MEMCACHED_THREADS=2 - logging: - options: - max-size: 50m - deploy: - replicas: 1 - restart_policy: - condition: any - - memcached-profile: - image: memcached - hostname: user-memcached - environment: - - MEMCACHED_CACHE_SIZE=128 - - MEMCACHED_THREADS=2 - logging: - options: - max-size: 50m - deploy: - replicas: 1 - restart_policy: - condition: any - - memcached-reserve: - image: memcached - hostname: user-memcached - environment: - - MEMCACHED_CACHE_SIZE=128 - - MEMCACHED_THREADS=2 - logging: - options: - max-size: 50m - deploy: - replicas: 1 - restart_policy: - condition: any - - mongodb-geo: - image: mongo:4.4.6 - hostname: geo-db - volumes: - - geo:/data/db - deploy: - replicas: 1 - restart_policy: - condition: any - - mongodb-profile: - image: mongo:4.4.6 - hostname: profile-db - volumes: - - profile:/data/db - deploy: - replicas: 1 - restart_policy: - condition: any - - mongodb-rate: - image: mongo:4.4.6 - hostname: rate-db - volumes: - - rate:/data/db - deploy: - replicas: 1 - restart_policy: - condition: any - - mongodb-recommendation: - image: mongo:4.4.6 - hostname: recommendation-db - volumes: - - recommendation:/data/db - deploy: - replicas: 1 - restart_policy: - condition: any - - mongodb-reservation: - image: mongo:4.4.6 - hostname: reservation-db - volumes: - - reservation:/data/db - deploy: - replicas: 1 - restart_policy: - condition: any - - mongodb-user: - image: mongo:4.4.6 - hostname: user-db - volumes: - - user:/data/db - deploy: - replicas: 1 - restart_policy: - condition: any - -volumes: - geo: - profile: - rate: - recommendation: - reservation: - user: diff --git a/hotelReservation/docker-compose.yml b/hotelReservation/docker-compose.yml index 6da517404..a875a3da5 100644 --- a/hotelReservation/docker-compose.yml +++ b/hotelReservation/docker-compose.yml @@ -1,4 +1,5 @@ -version: "2" +version: "3.8" + services: consul: image: hashicorp/consul:latest @@ -8,87 +9,117 @@ services: - "8500:8500" - "8600:53/udp" restart: always + deploy: + replicas: 1 + restart_policy: + condition: any frontend: + configs: + - source: server_config + target: /config.json environment: - TLS - GC - JAEGER_SAMPLE_RATIO - LOG_LEVEL build: . - image: hotel_reserv_frontend_single_node - entrypoint: frontend - container_name: 'hotel_reserv_frontend' + image: deathstarbench/hotel-reservation:latest + entrypoint: ./frontend ports: - "5000:5000" depends_on: - consul restart: always + deploy: + replicas: 3 + restart_policy: + condition: any profile: + configs: + - source: server_config + target: /config.json environment: - TLS - GC - JAEGER_SAMPLE_RATIO - - MEMC_TIMEOUT - LOG_LEVEL build: . - image: hotel_reserv_profile_single_node - entrypoint: profile - container_name: 'hotel_reserv_profile' + image: deathstarbench/hotel-reservation:latest + entrypoint: ./profile depends_on: - mongodb-profile - memcached-profile - consul restart: always + deploy: + replicas: 1 + restart_policy: + condition: any search: - build: . - image: hotel_reserv_search_single_node - entrypoint: search - container_name: 'hotel_reserv_search' - depends_on: - - consul - restart: always + configs: + - source: server_config + target: /config.json environment: - TLS - GC - JAEGER_SAMPLE_RATIO - LOG_LEVEL - # - GRPC_GO_LOG_VERBOSITY_LEVEL=2 - # - GRPC_GO_LOG_SEVERITY_LEVEL=info + build: . + image: deathstarbench/hotel-reservation:latest + entrypoint: ./search + depends_on: + - consul + restart: always + deploy: + replicas: 1 + restart_policy: + condition: any geo: + configs: + - source: server_config + target: /config.json environment: - TLS - GC - JAEGER_SAMPLE_RATIO - LOG_LEVEL build: . - image: hotel_reserv_geo_single_node - entrypoint: geo - container_name: 'hotel_reserv_geo' + image: deathstarbench/hotel-reservation:latest + entrypoint: ./geo depends_on: - mongodb-geo - consul restart: always + deploy: + replicas: 1 + restart_policy: + condition: any rate: + configs: + - source: server_config + target: /config.json environment: - TLS - GC - JAEGER_SAMPLE_RATIO - - MEMC_TIMEOUT - LOG_LEVEL build: . - image: hotel_reserv_rate_single_node - entrypoint: rate - container_name: 'hotel_reserv_rate' + image: deathstarbench/hotel-reservation:latest + entrypoint: ./rate depends_on: - mongodb-rate - memcached-rate - consul restart: always + deploy: + replicas: 1 + restart_policy: + condition: any review: environment: @@ -124,55 +155,71 @@ services: restart: always recommendation: + configs: + - source: server_config + target: /config.json environment: - TLS - GC - JAEGER_SAMPLE_RATIO - LOG_LEVEL build: . - image: hotel_reserv_recommend_single_node - entrypoint: recommendation - container_name: 'hotel_reserv_recommendation' + image: deathstarbench/hotel-reservation:latest + entrypoint: ./recommendation depends_on: - mongodb-recommendation - consul restart: always + deploy: + replicas: 1 + restart_policy: + condition: any user: + configs: + - source: server_config + target: /config.json environment: - TLS - GC - JAEGER_SAMPLE_RATIO - LOG_LEVEL build: . - image: hotel_reserv_user_single_node - entrypoint: user - container_name: 'hotel_reserv_user' + image: deathstarbench/hotel-reservation:latest + entrypoint: ./user depends_on: - mongodb-user - consul restart: always + deploy: + replicas: 1 + restart_policy: + condition: any reservation: + configs: + - source: server_config + target: /config.json environment: - TLS - GC - JAEGER_SAMPLE_RATIO - - MEMC_TIMEOUT - LOG_LEVEL build: . - image: hotel_reserv_rsv_single_node - entrypoint: reservation - container_name: 'hotel_reserv_reservation' + image: deathstarbench/hotel-reservation:latest + entrypoint: ./reservation depends_on: - mongodb-reservation - memcached-reserve - consul restart: always + deploy: + replicas: 1 + restart_policy: + condition: any jaeger: image: jaegertracing/all-in-one:latest - container_name: 'hotel_reserv_jaeger' ports: - "14269" - "5778:5778" @@ -183,18 +230,25 @@ services: - "6831:6831/udp" - "6832:6832/udp" restart: always + deploy: + replicas: 1 + restart_policy: + condition: any memcached-rate: - image: memcached - # hostname: user-memcached - container_name: 'hotel_reserv_rate_mmc' - restart: always + image: memcached:latest + hostname: user-memcached environment: - MEMCACHED_CACHE_SIZE=128 - MEMCACHED_THREADS=2 logging: options: max-size: 50m + restart: always + deploy: + replicas: 1 + restart_policy: + condition: any memcached-review: image: memcached @@ -209,93 +263,123 @@ services: max-size: 50m memcached-profile: - image: memcached - # hostname: user-memcached - container_name: 'hotel_reserv_profile_mmc' - restart: always + image: memcached:latest + hostname: user-memcached environment: - MEMCACHED_CACHE_SIZE=128 - MEMCACHED_THREADS=2 logging: options: max-size: 50m + restart: always + deploy: + replicas: 1 + restart_policy: + condition: any memcached-reserve: - image: memcached - # hostname: user-memcached - container_name: 'hotel_reserv_reservation_mmc' - restart: always + image: memcached:latest + hostname: user-memcached environment: - MEMCACHED_CACHE_SIZE=128 - MEMCACHED_THREADS=2 logging: options: max-size: 50m + restart: always + deploy: + replicas: 1 + restart_policy: + condition: any mongodb-geo: - image: mongo:4.4.6 - container_name: 'hotel_reserv_geo_mongo' - # hostname: geo-db - restart: always + image: mongo:5.0 + hostname: geo-db volumes: - - geo:/data/db + - geo:/data/db + restart: always + deploy: + replicas: 1 + restart_policy: + condition: any mongodb-profile: - image: mongo:4.4.6 - container_name: 'hotel_reserv_profile_mongo' + image: mongo:5.0 hostname: profile-db - restart: always volumes: - - profile:/data/db + - profile:/data/db + restart: always + deploy: + replicas: 1 + restart_policy: + condition: any mongodb-rate: - image: mongo:4.4.6 - container_name: 'hotel_reserv_rate_mongo' + image: mongo:5.0 hostname: rate-db - restart: always volumes: - rate:/data/db + restart: always + deploy: + replicas: 1 + restart_policy: + condition: any mongodb-review: - image: mongo:4.4.6 - container_name: 'hotel_reserv_review_mongo' + image: mongo:5.0 hostname: review-db - restart: always volumes: - review:/data/db + restart: always + deploy: + replicas: 1 + restart_policy: + condition: any mongodb-attractions: - image: mongo:4.4.6 - container_name: 'hotel_reserv_attractions_mongo' + image: mongo:5.0 hostname: attractions-db - restart: always volumes: - - attractions:/data/db + - attractions:/data/db + restart: always + deploy: + replicas: 1 + restart_policy: + condition: any mongodb-recommendation: - image: mongo:4.4.6 + image: mongo:5.0 hostname: recommendation-db - container_name: 'hotel_reserv_recommendation_mongo' - restart: always volumes: - recommendation:/data/db - + restart: always + deploy: + replicas: 1 + restart_policy: + condition: any + mongodb-reservation: - image: mongo:4.4.6 - container_name: 'hotel_reserv_reservation_mongo' + image: mongo:5.0 hostname: reservation-db - restart: always volumes: - - reservation:/data/db + - reservation:/data/db + restart: always + deploy: + replicas: 1 + restart_policy: + condition: any mongodb-user: - image: mongo:4.4.6 - container_name: 'hotel_reserv_user_mongo' + image: mongo:5.0 hostname: user-db - restart: always volumes: - user:/data/db - + restart: always + deploy: + replicas: 1 + restart_policy: + condition: any + volumes: geo: profile: @@ -306,3 +390,6 @@ volumes: review: attractions: +configs: + server_config: + file: ./config.json