Skip to content

Commit

Permalink
added resources to agent and client services in manual testing
Browse files Browse the repository at this point in the history
  • Loading branch information
share2kanna committed Sep 21, 2022
1 parent 8f9c8a5 commit 6554641
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 1 deletion.
65 changes: 64 additions & 1 deletion Notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,67 @@ So have to tag with localhost:5001 prefix path

- Add data source for clickhouse

-
# local environment with cpu&mem

## Docker

Reference: https://docs.docker.com/config/containers/resource_constraints/

```
docker run -it --cpus="0.5" --memory=256m container-bridge-agent:0.1.1
docker run -it --cpus="0.5" --memory=256m container-bridge-client:0.1.1
```

## Docker compose

Reference: https://docs.docker.com/compose/compose-file/compose-file-v3/#resources

```
For example:
version: "3.9"
services:
agent:
image: container-bridge-agent:0.1.1
deploy:
resources:
limits:
cpus: '0.50'
memory: 256M
reservations:
cpus: '0.25'
memory: 256M
```

# Example docker event payload

```
{
"events": [
{
"id": "d539f3c5-5734-47f0-a2a8-d27de5f9edb1",
"timestamp": "2022-09-21T19:00:49.658010356Z",
"action": "push",
"target": {
"mediaType": "application/octet-stream",
"size": 29136663,
"digest": "sha256:12f42424f10d587d02674c8a0dab1c08d3fd81ab6bac5b7f5e3799215c6c52e6",
"length": 29136663,
"repository": "ubuntu",
"url": "http://localhost:5001/v2/ubuntu/blobs/sha256:12f42424f10d587d02674c8a0dab1c08d3fd81ab6bac5b7f5e3799215c6c52e6"
},
"request": {
"id": "3784878a-5075-4ea5-a51b-5288ebc54c9c",
"addr": "172.22.0.1:36222",
"host": "localhost:5001",
"method": "PUT",
"useragent": "containers/5.16.0 (github.com/containers/image)"
},
"actor": {},
"source": {
"addr": "5b458294602c:5000",
"instanceID": "da4bdd5f-3f85-45c6-a37d-bc97a82fbd39"
}
}
]
}
```
16 changes: 16 additions & 0 deletions docker-compose_manual_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ services:
STREAM_NAME: "CONTAINERMETRICS"
ports:
- "8090:8090"
deploy:
resources:
limits:
cpus: '0.50'
memory: 256M
reservations:
cpus: '0.25'
memory: 64M
# depends_on:
# web:
# condition: service_healthy
Expand All @@ -76,6 +84,14 @@ services:
STREAM_NAME: "CONTAINERMETRICS"
ports:
- "8091:8091"
deploy:
resources:
limits:
cpus: '0.50'
memory: 256M
reservations:
cpus: '0.25'
memory: 64M
# depends_on:
# ch_server:
# condition: service_healthy
Expand Down

0 comments on commit 6554641

Please sign in to comment.