fixes & adding spring docker

This commit is contained in:
José Henrique 2023-10-30 20:34:20 -03:00
parent a6a8bd307b
commit 2965293bfb
5 changed files with 24 additions and 4 deletions

View File

@ -26,5 +26,5 @@ def return_ok():
return str(sum), 200 return str(sum), 200
@simulation_blueprint.route('/simulation/json', methods=['GET']) @simulation_blueprint.route('/simulation/json', methods=['GET'])
def return_ok(): def return_helloworld():
return simulation_controller.return_helloworld(), 200 return simulation_controller.return_helloworld(), 200

View File

@ -49,3 +49,15 @@ services:
limits: limits:
cpus: '1' cpus: '1'
memory: 1GB memory: 1GB
tcc-spring:
image: tcc:spring
container_name: tcc-spring
build: ./springtcc
restart: always
ports:
- "9085:8080"
deploy:
resources:
limits:
cpus: '1'
memory: 1GB

View File

@ -3,6 +3,7 @@ FRAMEWORKS = [
('ASP.NET', 'tcc-aspnet', 'blue'), ('ASP.NET', 'tcc-aspnet', 'blue'),
('Flask', 'tcc-flask', 'green'), ('Flask', 'tcc-flask', 'green'),
('Express', 'tcc-express', 'red'), ('Express', 'tcc-express', 'red'),
('Spring', 'tcc-spring', 'pink'),
] ]
ENDPOINTS = { ENDPOINTS = {
@ -10,6 +11,7 @@ ENDPOINTS = {
'ASP.NET': 'http://localhost:9081', 'ASP.NET': 'http://localhost:9081',
'Flask': 'http://localhost:9082', 'Flask': 'http://localhost:9082',
'Express': 'http://localhost:9084', 'Express': 'http://localhost:9084',
'Spring': 'http://localhost:9085',
} }
AVG_RUNS = 5 AVG_RUNS = 5
@ -23,6 +25,5 @@ API_REQUESTS = [
('/static/small-image.png', 'GET', range(0, 30_000, 5000), None), ('/static/small-image.png', 'GET', range(0, 30_000, 5000), None),
('/image/load-big-image', 'GET', range(0, 500, 50), None), ('/image/load-big-image', 'GET', range(0, 500, 50), None),
('/static/big-image.png', 'GET', range(0, 500, 50), None), ('/static/big-image.png', 'GET', range(0, 500, 50), None),
('/static/video.mp4', 'GET', range(0, 10_000, 1_000), None),
('/static/nginx.html', 'GET', range(0, 30_000, 5000), None), ('/static/nginx.html', 'GET', range(0, 30_000, 5000), None),
] ]

View File

@ -1,4 +1,5 @@
import requests import requests
import os
def download_file(url): def download_file(url):
local_filename = url.split('/')[-1] local_filename = url.split('/')[-1]
@ -13,5 +14,9 @@ def download_file(url):
return local_filename return local_filename
def init(): def init():
if not os.path.exists('small-image.png'):
download_file('https://files.ivanch.me/api/public/dl/iFuXSNhw/small-image.png') download_file('https://files.ivanch.me/api/public/dl/iFuXSNhw/small-image.png')
download_file('https://files.ivanch.me/api/public/dl/81Bkht5C/big-image.png') if not os.path.exists('big-image.png'):
download_file('https://files.ivanch.me/api/public/dl/iFuXSNhw/big-image.png')
init()

View File

@ -135,6 +135,8 @@ if __name__ == "__main__":
if not os.path.exists("data"): if not os.path.exists("data"):
os.mkdir("data") os.mkdir("data")
init()
for i in range(len(FRAMEWORKS)): for i in range(len(FRAMEWORKS)):
FRAMEWORK_NAME = FRAMEWORKS[i][0] FRAMEWORK_NAME = FRAMEWORKS[i][0]
CONTAINER_NAME = FRAMEWORKS[i][1] CONTAINER_NAME = FRAMEWORKS[i][1]