Skip to content

Commit

Permalink
Merge pull request #309 from delimitrou/revert-308-reviewservice
Browse files Browse the repository at this point in the history
Revert "add Review Service"
  • Loading branch information
cdelimitrou authored Dec 8, 2023
2 parents c2fcb17 + 5db4bfa commit aeb4860
Show file tree
Hide file tree
Showing 1,513 changed files with 397,871 additions and 143,052 deletions.
Binary file removed hotelReservation/Docker/._.DS_Store
Binary file not shown.
8 changes: 0 additions & 8 deletions hotelReservation/Docker/.gitignore

This file was deleted.

41 changes: 30 additions & 11 deletions hotelReservation/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,30 @@
FROM golang:1.17.3

RUN git config --global http.sslverify false
COPY . /go/src/github.com/harlow/go-micro-services
WORKDIR /go/src/github.com/harlow/go-micro-services
RUN go get gopkg.in/mgo.v2
RUN go get github.com/bradfitz/gomemcache/memcache
RUN go get github.com/google/uuid
RUN go mod init
RUN go mod vendor
RUN go install -ldflags="-s -w" ./cmd/...
FROM golang:1.21 as builder

WORKDIR /workspace

COPY go.sum go.sum
COPY go.mod go.mod
COPY vendor/ vendor/

COPY cmd/ cmd/
COPY dialer/ dialer/
COPY registry/ registry/
COPY services/ services/
COPY tls/ tls/
COPY tracing/ tracing/
COPY tune/ tune/

RUN CGO_ENABLED=0 GOOS=linux GO111MODULE=on go install -ldflags="-s -w" -mod=vendor ./cmd/...

FROM gcr.io/distroless/static:nonroot

WORKDIR /

COPY --from=builder /go/bin/frontend .
COPY --from=builder /go/bin/geo .
COPY --from=builder /go/bin/profile .
COPY --from=builder /go/bin/rate .
COPY --from=builder /go/bin/recommendation .
COPY --from=builder /go/bin/reservation .
COPY --from=builder /go/bin/search .
COPY --from=builder /go/bin/user .
194 changes: 0 additions & 194 deletions hotelReservation/Gopkg.lock

This file was deleted.

58 changes: 0 additions & 58 deletions hotelReservation/Gopkg.toml

This file was deleted.

25 changes: 19 additions & 6 deletions hotelReservation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Supported actions:
- luarocks (apt-get install luarocks)
- luasocket (luarocks install luasocket)

## Running the social network application
## Running the hotel reservation application
### Before you start
- Install Docker and Docker Compose.
- Make sure exposed ports in docker-compose files are available
Expand All @@ -29,11 +29,24 @@ Supported actions:

### Running the containers
##### Docker-compose
- NOTLS: Start docker containers by running `docker-compose up -d`. All images will be pulled from Docker Hub.
- TLS: Start docker containers by running `TLS=1 docker-compose up -d`. All the gRPC communications will be protected by TLS.
- TLS with spcified ciphersuite: Start docker containers by running `TLS=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 docker-compose up -d`. The available cipher suite can be find at the file [options.go](tls/options.go#L21).
Start docker containers by running `docker-compose up -d`. All images will be pulled from Docker Hub.

Check if TLS is enabled or not: `docker-compose logs <service> | grep TLS`.
The workload itself can be configured using optional enviroment variables. The avaialbe 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=<ciphersuite>: 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).

- 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.

- JAEGER_SAMPLE_RATIO: Environment variable JAEGER_SAMPLE_RATIO controls the ratio of requests to be traced Jaeger. Default is 0.01(1%).

- MEMC_TIMEOUT: Environment variable MEMC_TIMEOUT controls the timeout value in seconds when communicating with memcached. Default is 2 seconds. We may need to increase this value in case of very high work loads.

- 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 <service>` to check the corresponding configurations.

##### Openshift
Read the Readme file in Openshift directory.
Expand All @@ -43,7 +56,7 @@ Read the Readme file in Kubernetes directory.

#### workload generation
```bash
./wrk2/wrk -D exp -t <num-threads> -c <num-conns> -d <duration> -L -s ./wrk2/scripts/hotel-reservation/mixed-workload_type_1.lua http://x.x.x.x:5000 -R <reqs-per-sec>
../wrk2/wrk -D exp -t <num-threads> -c <num-conns> -d <duration> -L -s ./wrk2/scripts/hotel-reservation/mixed-workload_type_1.lua http://x.x.x.x:5000 -R <reqs-per-sec>
```

### Questions and contact
Expand Down
Loading

0 comments on commit aeb4860

Please sign in to comment.