Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

245 integration environment for didcomm mediator server deployment e6 #264

Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
2b0ad66
feat(): init mediator integration environment setup
Christiantyemele Nov 18, 2024
c0126bf
feat(): polish intergration evironment
Christiantyemele Nov 19, 2024
9e812b1
Merge branch 'main' of https://github.com/adorsys/didcomm-mediator-rs…
Christiantyemele Nov 19, 2024
8f790a3
fix(): fix on reviews
Christiantyemele Nov 20, 2024
85dd48a
update(intergration environment): added more description to doc
Christiantyemele Nov 25, 2024
ed3b710
Merge branch 'main' of https://github.com/adorsys/didcomm-mediator-rs…
Christiantyemele Nov 28, 2024
fccc753
merged main into intergration environment
Christiantyemele Nov 28, 2024
1b70cc0
feat(): init kubernetes setup
Christiantyemele Nov 29, 2024
805f954
feat(): Polish k8s integration environment
Christiantyemele Dec 2, 2024
1ef2f73
fix(): moved k8s folder
Christiantyemele Dec 3, 2024
605bfd5
feat(): publishing docker containers to ghcr with action
Christiantyemele Dec 3, 2024
0a62147
feat(): added workflow file for ghcr
Christiantyemele Dec 3, 2024
6d4dd79
update yml
Christiantyemele Dec 3, 2024
10d9a79
update(release): updated release with compose
Christiantyemele Dec 3, 2024
a0e12ff
update release.yml
Christiantyemele Dec 3, 2024
8fa870c
feat(): updated workflow
Christiantyemele Dec 3, 2024
6b85b63
update changed pcakage version version
Christiantyemele Dec 3, 2024
9642d2e
update workflow verification
Christiantyemele Dec 3, 2024
22a7e5f
feat(package): update config
Christiantyemele Dec 3, 2024
12927bd
updated pacakage
Christiantyemele Dec 3, 2024
420e1c0
fix(package): typos fix
Christiantyemele Dec 4, 2024
7a68793
fix(package): correcting yaml
Christiantyemele Dec 4, 2024
165516d
fix(): typos fix
Christiantyemele Dec 4, 2024
6fc8251
fix(): added path env for compose
Christiantyemele Dec 4, 2024
5f9bf20
fix(): removed env form .gitignore
Christiantyemele Dec 4, 2024
4d5998e
fix(): updated compose
Christiantyemele Dec 4, 2024
93db614
fix(package): fixing mediator package
Christiantyemele Dec 4, 2024
d507fa6
fix(package): added env path
Christiantyemele Dec 4, 2024
426a1a7
fix(package): changed branch for action
Christiantyemele Dec 4, 2024
7a35312
fix(): update .env
Christiantyemele Dec 4, 2024
a2425c8
fix(): debugging yml
Christiantyemele Dec 4, 2024
0085807
fix(): updated yml
Christiantyemele Dec 4, 2024
26997ea
fix(): update yml
Christiantyemele Dec 4, 2024
abbe3b0
fix(): handled error when reading env
Christiantyemele Dec 5, 2024
3870bf0
fix(global): updated configs for packaging
Christiantyemele Dec 5, 2024
1b22c59
fix(): update package.yml
Christiantyemele Dec 5, 2024
355563f
updat(): updated package.yml
Christiantyemele Dec 5, 2024
723c8ae
fix(): removed port specification form compose
Christiantyemele Dec 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM rust:latest as builder

WORKDIR /app

COPY . .

# Build the server
RUN cargo build --release

# Use a minimal image for running the server
FROM ubuntu

RUN apt update && apt install -y libpq5 && rm -rf /var/lib/apt/lists/*
WORKDIR /app


# Copy the built binary
COPY --from=builder /app/target/release/didcomm-mediator /usr/local/bin/didcomm-mediator

# Expose the necessary port
EXPOSE 8080

# Run the server
CMD ["didcomm-mediator"]
25 changes: 25 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
version: '3.8'
services:
mediator:
build:
context: .
container_name: didcomm-mediator
ports:
- "8080:3000"
env_file:
- .env
depends_on:
- mongodb

mongodb:
image: mongo:latest
container_name: mongodb
ports:
- "27017:27017"
env_file:
- .env
volumes:
- mongo-data:/data/db

volumes:
mongo-data:
42 changes: 42 additions & 0 deletions docs/environment-setup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# DIDComm Mediator Integration Environment Setup

This guide provides step-by-step instructions to set up the integration environment for deploying, testing, and interacting with the Rust-based DIDComm mediator server.

## Prerequisites
Before you begin, ensure the following are installed on your system:
- Docker: version 20+([install docker](https://docs.docker.com/engine/install/debian/))
- Rust: latest stable version ([install rust](https://www.rust-lang.org/tools/install))
- MongoDB: latest stable version ([install mongodb](https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-ubuntu/))

This documentation assumes you have clone the [mediator](https://github.com/adorsys/didcomm-mediator-rs) and are in the root of the project

## step 1: Setup the environment variables
Modify the ```.env``` file with the right values for the variables

## Step 2: Start The Environment

```sh
docker-compose up -d
Christiantyemele marked this conversation as resolved.
Show resolved Hide resolved
```
## Step 3: Test Connectivity
Use a tool like Postman or curl to verify that the server is running and responding.
```sh
curl -X GET http://0.0.0.0:8080/ \
-H "Content-Type: application/json" \
```
Christiantyemele marked this conversation as resolved.
Show resolved Hide resolved

## Step 4: Logging And Monitoring
For real time monitoring of the logs run the command
```sh
docker logs -f didcomm-mediator
```
Or save them in a file using the command
```sh
docker logs didcommm-mediator > mediator.log
```

## Step 5: Cleanup
To Stop and remove the environment
```sh
docker-compose down
```
3 changes: 2 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ async fn main() {

// Start server
let port = std::env::var("SERVER_LOCAL_PORT").unwrap_or("3000".to_owned());
let addr: SocketAddr = format!("127.0.0.1:{port}").parse().unwrap();
let ip = std::env::var("SERVER_PUBLIC_IP").unwrap_or("0.0.0.0".to_owned());
let addr: SocketAddr = format!("{ip}:{port}").parse().unwrap();

tracing::info!("listening on {addr}");
generic_server_with_graceful_shutdown(addr).await;
Expand Down
Loading