Skip to content

Commit

Permalink
update server.md
Browse files Browse the repository at this point in the history
  • Loading branch information
kartikeytewari-ul committed Jun 6, 2024
1 parent 848d19f commit 48c602e
Showing 1 changed file with 63 additions and 16 deletions.
79 changes: 63 additions & 16 deletions docs/server.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,53 @@

The unlogged server is a self-hosted service, that can be used with plugin and SDK. Deploy the production service with SDK and it will push the logs to unlogged server. Then the intellij IDEA can download the test candidates, and the production traffic can be replayed locally.

## Deployment without a S3 bucket
## Deployment from local filesystem
- The server can be deployed without a minio and S3 configuration. All files will be stored in the local filesystem.

### Deployment with a local minio server
### Docker Deployment
- To deploy the server from docker run the following commands:

```sh
# create a docker volume
docker volume create unlogged_volume

# run the docker container
docker run -dp 8123:8123
-v unlogged_volume:/usr/src/app/local-session
public.ecr.aws/z6h2b9v3/unlogged_server:latest
```

#### Docker-compose Deployment
- The server can be deployed using docker compose. An example docker-compose file is as follows:

```sh
version: '2'

services:
unlogged_server:
image: public.ecr.aws/z6h2b9v3/unlogged_server:latest
ports:
- "8123:8123"
volumes:
- unlogged_volume:/usr/src/app/local-session

volumes:
unlogged_volume:
external: true
```

- Create a volume using `docker volume create unlogged_volume`
- Run the container using `docker compose -f path_to_file up -d`

### Jar Deployment
- The command to run from JAR is:
```bash
java -jar unlogged_server.jar
```

## Deployment with minio server

### Docker Compose Approach

- The server can be deployed with a minio instance. This is a sample docker-compose file for the same:
```docker
Expand All @@ -16,6 +60,7 @@ services:
ports:
- "8123:8123"
environment:
- spring.profiles.active=minio
- cloud.bucketName=session-logs
- cloud.endpoint=http://minio:9000
- cloud.aws.region.static=ap-south-1
Expand Down Expand Up @@ -65,19 +110,6 @@ A S3 bucket needs to created for storing the logs.

The server can be deployed using docker or the jar file. It can be done on both a private pc for personal testing and an instance of EC2 with public IP for company wide deployment.

#### Deployment from JAR
- The jar can be downloaded from [here](https://github.com/unloggedio/server/releases).
- To deploy the service using jar use the following command:

```sh
java -jar -Dcloud.bucketName=bucket_name \
-Dcloud.endpoint=bucket_region_url \
-Dcloud.aws.region.static=bucket_region \
-Dcloud.aws.credentials.access-key=access_key \
-Dcloud.aws.credentials.secret-key=secret_key \
unlogged_server.jar
```

#### Docker Deployment
- To deploy the server from docker run the following commands:

Expand All @@ -87,7 +119,8 @@ docker volume create unlogged_volume

# run the docker container
docker run -dp 8123:8123
-v unlogged_volume:/usr/src/app/local-session
-v unlogged_volume:/usr/src/app/local-session
-e spring.profiles.active=minio
-e cloud.bucketName=bucket_name
-e cloud.endpoint=bucket_region_url
-e cloud.aws.region.static=bucket_region
Expand All @@ -110,6 +143,7 @@ services:
volumes:
- unlogged_volume:/usr/src/app/local-session
environment:
- spring.profiles.active=minio
- cloud.bucketName=bucket_name
- cloud.endpoint=bucket_region_url
- cloud.aws.region.static=bucket_region
Expand All @@ -124,6 +158,19 @@ volumes:
- Create a volume using `docker volume create unlogged_volume`
- Run the container using `docker compose -f path_to_file up -d`

#### Deployment from JAR
- The jar can be downloaded from [here](https://github.com/unloggedio/server/releases).
- To deploy the service using jar use the following command:

```sh
java -jar -Dspring.profiles.active=minio \
-Dcloud.bucketName=bucket_name \
-Dcloud.endpoint=bucket_region_url \
-Dcloud.aws.region.static=bucket_region \
-Dcloud.aws.credentials.access-key=access_key \
-Dcloud.aws.credentials.secret-key=secret_key \
unlogged_server.jar
```

## Verifying the status of deployed service

Expand Down

0 comments on commit 48c602e

Please sign in to comment.