Skip to content

Commit

Permalink
Merge pull request #94 from soramitsu/query_with_reports
Browse files Browse the repository at this point in the history
Dockerfile was added
  • Loading branch information
adaagava authored Jun 28, 2024
2 parents 9da877d + 9ffe724 commit f141645
Show file tree
Hide file tree
Showing 4 changed files with 320 additions and 0 deletions.
38 changes: 38 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
FROM maven:3.9.5-eclipse-temurin-11-alpine as builder

RUN wget https://github.com/JetBrains/kotlin/releases/download/v1.8.0/kotlin-compiler-1.8.0.zip && \
unzip kotlin-compiler-1.8.0.zip -d /opt && \
rm kotlin-compiler-1.8.0.zip

WORKDIR /app
COPY pom.xml ./
COPY ./src ./src
RUN mvn clean package

FROM maven:3.9.5-eclipse-temurin-11-alpine

ENV USER=iroha
ENV UID=1000
ENV GID=1000
ENV MAVEN_CONFIG=/var/maven/.m2
USER root

RUN set -ex && \
addgroup -g $GID $USER && \
adduser \
--disabled-password \
--gecos "" \
--home /app \
--ingroup "$USER" \
--uid "$UID" \
"$USER" && \
mkdir -p $MAVEN_CONFIG && \
chown $USER:$USER -R $MAVEN_CONFIG

WORKDIR /app
COPY --from=builder /app/pom.xml ./
COPY --from=builder /app/target/ ./target/

USER $USER

ENTRYPOINT ["/usr/local/bin/mvn-entrypoint.sh"]
92 changes: 92 additions & 0 deletions docker-compose.load.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
version: "3"

services:
gatling:
container_name: iroha2-perf
build:
context: .
dockerfile: ./Dockerfile
restart: unless-stopped
mem_limit: 4G
cpus: 16
working_dir: /app
read_only: true
tmpfs:
- /tmp
- /app/target/gatling
- /var/log
environment:
MAVEN_CONFIG: /var/maven/.m2
command: >
mvn gatling:test
-Duser.home=/var/maven
-Dgatling.simulationClass=jp.co.soramitsu.load.simulation.transaction.StabilitySimulation
-DtargetProtocol=https
-DtargetURL=
-DremoteLogin=
-DremotePass=
-DlogLevel=INFO
-Dconfiguration=standard
-Dintensity=5
-DrampDuration=10
-DstageDuration=604800
networks:
- iroha2-perf-net
volumes:
- gatling-volume:/var/maven/.m2
logging:
driver: "json-file"
options:
max-size: "100m"
max-file: "3"
labels:
- 'filebeat.fields.app=iroha2-perf'
- 'filebeat.fields.env=tst'
- 'filebeat.fields.project=iroha2-perf'
- 'filebeat.fields.logtype=iroha2'
- 'filebeat.multiline.pattern=^\[\d{2}\.\d{2}\.\d{4}'
- 'filebeat.multiline.negate=true'
- 'filebeat.multiline.match=after'
# - 'filebeat.module=docker'
healthcheck:
test: wget --no-verbose --tries=1 --spider http://127.0.0.1:4567/health || exit 1
interval: 1m
timeout: 10s
retries: 3
start_period: 1m

pushgateway:
container_name: pushgateway
image: prom/pushgateway:v1.6.2
restart: unless-stopped
mem_limit: 512M
cpus: 1
ports:
- "9091:9091"
networks:
- iroha2-perf-net
logging:
driver: "json-file"
options:
max-size: "100m"
max-file: "3"
labels:
- 'filebeat.fields.app=iroha2-push-gw'
- 'filebeat.fields.env=tst'
- 'filebeat.fields.project=iroha2-perf'
- 'filebeat.fields.logtype=iroha2'
# - 'filebeat.module=docker'

healthcheck:
test: wget --no-verbose --tries=1 --spider http://127.0.0.1:9091/-/healthy || exit 1
interval: 1m
timeout: 10s
retries: 3
start_period: 1m

networks:
iroha2-perf-net:
driver: bridge

volumes:
gatling-volume:
94 changes: 94 additions & 0 deletions docker-compose.maxPerf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
version: "3"

services:
gatling:
container_name: iroha2-perf
build:
context: .
dockerfile: ./Dockerfile
restart: unless-stopped
mem_limit: 4G
cpus: 16
working_dir: /app
read_only: true
tmpfs:
- /tmp
- /app/target/gatling
- /var/log
environment:
MAVEN_CONFIG: /var/maven/.m2
command: >
mvn gatling:test
-Duser.home=/var/maven
-Dgatling.simulationClass=jp.co.soramitsu.load.simulation.transaction.PerformanceSimulation
-DtargetProtocol=https
-DtargetURL=
-DremoteLogin=
-DremotePass=
-DlogLevel=INFO
-Dconfiguration=standard
-DconcurrentUsers=1
-Dtimes=10000
-DeachLevelLasting=15
-DseparatedByRampsLasting=1
-DstartingFrom=0
networks:
- iroha2-perf-net
volumes:
- gatling-volume:/var/maven/.m2
logging:
driver: "json-file"
options:
max-size: "100m"
max-file: "3"
labels:
- 'filebeat.fields.app=iroha2-perf'
- 'filebeat.fields.env=tst'
- 'filebeat.fields.project=iroha2-perf'
- 'filebeat.fields.logtype=iroha2'
- 'filebeat.multiline.pattern=^\[\d{2}\.\d{2}\.\d{4}'
- 'filebeat.multiline.negate=true'
- 'filebeat.multiline.match=after'
# - 'filebeat.module=docker'
healthcheck:
test: wget --no-verbose --tries=1 --spider http://127.0.0.1:4567/health || exit 1
interval: 1m
timeout: 10s
retries: 3
start_period: 1m

pushgateway:
container_name: pushgateway
image: prom/pushgateway:v1.6.2
restart: unless-stopped
mem_limit: 512M
cpus: 1
ports:
- "9091:9091"
networks:
- iroha2-perf-net
logging:
driver: "json-file"
options:
max-size: "100m"
max-file: "3"
labels:
- 'filebeat.fields.app=iroha2-push-gw'
- 'filebeat.fields.env=tst'
- 'filebeat.fields.project=iroha2-perf'
- 'filebeat.fields.logtype=iroha2'
# - 'filebeat.module=docker'

healthcheck:
test: wget --no-verbose --tries=1 --spider http://127.0.0.1:9091/-/healthy || exit 1
interval: 1m
timeout: 10s
retries: 3
start_period: 1m

networks:
iroha2-perf-net:
driver: bridge

volumes:
gatling-volume:
96 changes: 96 additions & 0 deletions docker-compose.stress.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
version: "3"

services:
gatling:
container_name: iroha2-perf
build:
context: .
dockerfile: ./Dockerfile
restart: unless-stopped
mem_limit: 4G
cpus: 16
working_dir: /app
read_only: true
tmpfs:
- /tmp
- /app/target/gatling
- /var/log
environment:
MAVEN_CONFIG: /var/maven/.m2
command: >
mvn gatling:test
-Duser.home=/var/maven
-Dgatling.simulationClass=jp.co.soramitsu.load.simulation.transaction.StressSimulation
-DtargetProtocol=https
-DtargetURL=
-DtargetPath=
-DremoteLogin=
-DremotePass=
-DlogLevel=INFO
-Dconfiguration=standard
-Dintensity=5
-DrampDuration=10
-DstageDuration=300
-DstressIntensity=20
-DstressRampDuration=1
-DstressDuration=300
networks:
- iroha2-perf-net
volumes:
- gatling-volume:/var/maven/.m2
logging:
driver: "json-file"
options:
max-size: "100m"
max-file: "3"
labels:
- 'filebeat.fields.app=iroha2-perf'
- 'filebeat.fields.env=tst'
- 'filebeat.fields.project=iroha2-perf'
- 'filebeat.fields.logtype=iroha2'
- 'filebeat.multiline.pattern=^\[\d{2}\.\d{2}\.\d{4}'
- 'filebeat.multiline.negate=true'
- 'filebeat.multiline.match=after'
# - 'filebeat.module=docker'
healthcheck:
test: wget --no-verbose --tries=1 --spider http://127.0.0.1:4567/health || exit 1
interval: 1m
timeout: 10s
retries: 3
start_period: 1m

pushgateway:
container_name: pushgateway
image: prom/pushgateway:v1.6.2
restart: unless-stopped
mem_limit: 512M
cpus: 1
ports:
- "9091:9091"
networks:
- iroha2-perf-net
logging:
driver: "json-file"
options:
max-size: "100m"
max-file: "3"
labels:
- 'filebeat.fields.app=iroha2-push-gw'
- 'filebeat.fields.env=tst'
- 'filebeat.fields.project=iroha2-perf'
- 'filebeat.fields.logtype=iroha2'
# - 'filebeat.module=docker'

healthcheck:
test: wget --no-verbose --tries=1 --spider http://127.0.0.1:9091/-/healthy || exit 1
interval: 1m
timeout: 10s
retries: 3
start_period: 1m

networks:
iroha2-perf-net:
driver: bridge

volumes:
gatling-volume:

0 comments on commit f141645

Please sign in to comment.