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

feat: Docker Logging Considerations #162

Merged
merged 1 commit into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
63 changes: 63 additions & 0 deletions documentation/docs/identus/troubleshooting&considerations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Troubleshooting & Considerations

## Docker Logging Management Considerations
When setting up a long-running environment using Docker Compose, it’s important to consider several factors to avoid issues such as excessive log file sizes leading to out-of-memory errors.

### Configuring Docker Compose for Effective Log Management
To ensure your Docker containers run smoothly and avoid problems related to excessive log file growth, configure log rotation in your docker-compose.yml file. This will help manage log file sizes and prevent out-of-memory errors caused by uncontrolled log growth.

### Log Rotation Example

Here’s a example in the mediator how to set up log rotation in your Docker Compose configuration:

1. Open your docker-compose.yml file.
2. Add or update the logging configuration under your service definition. For example:

```yaml
version: '3.8'

services:
identus-mediator:
image: ghcr.io/input-output-hk/atala-prism-mediator:0.14.2
logging:
yshyn-iohk marked this conversation as resolved.
Show resolved Hide resolved
driver: json-file
options:
max-size: "10m"
max-file: "3"
```

- `driver`: Specifies the logging driver to use. The json-file driver is the default and supports log rotation options.
- `max-size`: Sets the maximum size of the log file before it gets rotated. In the example above, the log file will be rotated when it reaches 10 MB.
- `max-file`: Determines the number of rotated log files to keep. In this example, up to 3 log files will be kept before old files are deleted.

```shell
docker-compose up -d
```

3. Save the changes to your `docker-compose.yml` file and **Restart** your Docker containers to apply the new logging configuration.

### Configuring Docker Daemon for Effective Log Management

We should consider configuring the logging Options in the **Docker Daemon**. For a global logging configuration applicable to all Docker containers. We can modify the Docker daemon settings. This approach ensures consistent log management across all containers.

1. Edit the Docker daemon configuration file (usually located at /etc/docker/daemon.json). If the file doesn’t exist, you can create it.
2. Add or update the logging options in the `daemon.json` file:

```json
{
"log-driver": "json-file",
"log-opts": {
"max-size": "10m",
"max-file": "3"
}
}
```
3. Restart the Docker daemon to apply the new settings:

```shell
sudo systemctl restart docker
```

#### Docker logging drivers

For more information see https://docs.docker.com/engine/logging/configure/#supported-logging-drivers
1 change: 1 addition & 0 deletions documentation/docs/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ const sidebars = {
],
},
"identus/mediator",
"identus/troubleshooting&considerations",
"identus/getting-help",
],
},
Expand Down
2 changes: 1 addition & 1 deletion identus-cloud-agent
2 changes: 1 addition & 1 deletion identus-edge-agent-sdk-ts
Submodule identus-edge-agent-sdk-ts updated 94 files
+1 −1 .github/workflows/ci.yml
+10 −7 .github/workflows/e2e-tests.yml
+3 −7 .github/workflows/release.yml
+3 −37 CONTRIBUTING.md
+15 −18 README.md
+146 −24 demos/next/package-lock.json
+1 −5 demos/next/src/actions/types.ts
+1 −2 demos/next/src/components/OOB.tsx
+1 −5 demos/next/src/pages/debug.tsx
+2 −9 demos/next/src/reducers/app.ts
+0 −1 demos/next/src/reducers/store.ts
+0 −56 docs/examples/ConnectionlessPresentation.md
+2 −9 docs/examples/index.md
+6 −15 externals/run.sh
+1 −1 integration-tests/e2e-tests/.eslintrc.yml
+0 −1 integration-tests/e2e-tests/.gitignore
+18 −0 integration-tests/e2e-tests/cucumber.js
+0 −22 integration-tests/e2e-tests/cucumber.mjs
+1 −1 integration-tests/e2e-tests/features/create_connection.feature
+0 −14 integration-tests/e2e-tests/features/provide_anoncred_proof.feature
+6 −1 integration-tests/e2e-tests/features/verify_jwt_credential.feature
+3 −5 integration-tests/e2e-tests/package.json
+0 −1 integration-tests/e2e-tests/run-local-e2e.sh
+20 −31 integration-tests/e2e-tests/src/abilities/WalletSdk.ts
+3 −3 integration-tests/e2e-tests/src/configuration/CloudAgentConfiguration.ts
+0 −3 integration-tests/e2e-tests/src/configuration/allure-reporter.mjs
+30 −30 integration-tests/e2e-tests/src/configuration/inmemory/index.ts
+17 −17 integration-tests/e2e-tests/src/configuration/inmemory/instance.ts
+12 −16 integration-tests/e2e-tests/src/configuration/inmemory/internal.ts
+1 −1 integration-tests/e2e-tests/src/configuration/inmemory/types.ts
+6 −18 integration-tests/e2e-tests/src/steps/CloudAgentSteps.ts
+59 −35 integration-tests/e2e-tests/src/steps/EdgeAgentSteps.ts
+2 −12 integration-tests/e2e-tests/src/steps/LifecycleSteps.ts
+1 −69 integration-tests/e2e-tests/src/workflow/CloudAgentWorkflow.ts
+16 −23 integration-tests/e2e-tests/src/workflow/EdgeAgentWorkflow.ts
+673 −742 integration-tests/e2e-tests/yarn.lock
+1,560 −629 package-lock.json
+6 −6 package.json
+2 −5 publish.sh
+7 −7 release-dev.config.js
+7 −7 release-prod.config.js
+12 −12 release.base.config.js
+59 −39 src/apollo/Apollo.ts
+1 −1 src/apollo/utils/Ed25519PrivateKey.ts
+4 −5 src/apollo/utils/Secp256k1PrivateKey.ts
+1 −1 src/apollo/utils/Secp256k1PublicKey.ts
+22 −19 src/apollo/utils/derivation/DerivationPath.ts
+1 −1 src/castor/did/prismDID/PrismDIDPublicKey.ts
+0 −1 src/domain/index.ts
+12 −54 src/domain/models/Api.ts
+0 −9 src/domain/models/DIDDocument.ts
+1 −0 src/domain/models/Errors.ts
+6 −13 src/domain/models/Message.ts
+8 −21 src/domain/models/MessageAttachment.ts
+5 −0 src/domain/models/errors/Api.ts
+58 −77 src/domain/models/errors/Apollo.ts
+4 −8 src/domain/models/errors/Common.ts
+23 −0 src/domain/models/errors/Mnemonic.ts
+1 −6 src/domain/models/errors/Pollux.ts
+1 −1 src/domain/models/keyManagement/Key.ts
+0 −83 src/domain/utils/JWT.ts
+36 −19 src/domain/utils/hash.ts
+6 −6 src/domain/utils/randomBytes.ts
+11 −14 src/edge-agent/Agent.Credentials.ts
+15 −26 src/edge-agent/Agent.Invitations.ts
+7 −5 src/edge-agent/Agent.ts
+69 −0 src/edge-agent/helpers/ApiImpl.ts
+0 −76 src/edge-agent/helpers/FetchApi.ts
+9 −0 src/edge-agent/helpers/HttpError.ts
+6 −35 src/edge-agent/protocols/invitation/v2/DIDCommInvitationRunner.ts
+12 −0 src/edge-agent/protocols/invitation/v2/InvitationRunner.ts
+23 −13 src/edge-agent/protocols/invitation/v2/OutOfBandInvitation.ts
+24 −0 src/edge-agent/protocols/invitation/v2/OutOfBandParser.ts
+1 −3 src/edge-agent/protocols/pickup/PickupRunner.ts
+1 −1 src/index.ts
+0 −10 src/mercury/didcomm/Wrapper.ts
+19 −15 src/pluto/Pluto.ts
+32 −53 src/pollux/Pollux.ts
+35 −66 src/pollux/utils/Bitstring.ts
+27 −19 src/pollux/utils/JWT.ts
+26 −27 src/pollux/utils/SDJWT.ts
+23 −5 src/pollux/utils/jwt/JWTCore.ts
+54 −0 src/pollux/utils/jwt/types.ts
+6 −42 tests/agent/Agent.test.ts
+10 −8 tests/apollo/Apollo.test.ts
+2 −1 tests/castor/PrismDID.test.ts
+0 −79 tests/domain/JWT.test.ts
+4 −4 tests/mercury/Mercury.test.ts
+0 −67 tests/pollux/Bitstring.test.ts
+0 −66 tests/pollux/JWT.test.ts
+12 −25 tests/pollux/Pollux.revocation.test.ts
+211 −208 tests/pollux/Pollux.test.ts
+0 −150 tests/utils/api.test.ts
+0 −79 tests/utils/server.js