Compare commits
9 Commits
ca552f5a7a
...
XGBRegress
Author | SHA1 | Date | |
---|---|---|---|
1ba4c0158d | |||
fc7097fd50 | |||
4b7f57d0dd | |||
61fa099391 | |||
520416b772 | |||
3f17f7f0b7 | |||
59672292e2 | |||
505ba1a42d | |||
7fd61d13e5 |
@ -4,6 +4,8 @@ FROM amd64/python:3.9-buster as project_env
|
|||||||
# Set the working directory in the container
|
# Set the working directory in the container
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
ENV FLASK_ENV=production
|
||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
COPY requirements.txt requirements.txt
|
COPY requirements.txt requirements.txt
|
||||||
RUN pip install --upgrade pip setuptools \
|
RUN pip install --upgrade pip setuptools \
|
||||||
|
4
app.py
4
app.py
@ -61,8 +61,8 @@ def get_inference(token, period):
|
|||||||
|
|
||||||
def convert_period_to_seconds(period):
|
def convert_period_to_seconds(period):
|
||||||
"""Конвертируем период в секунды."""
|
"""Конвертируем период в секунды."""
|
||||||
if period.endswith("min"):
|
if period.endswith("m"):
|
||||||
return int(period[:-3]) * 60
|
return int(period[:-1]) * 60
|
||||||
elif period.endswith("h"):
|
elif period.endswith("h"):
|
||||||
return int(period[:-1]) * 3600
|
return int(period[:-1]) * 3600
|
||||||
elif period.endswith("d"):
|
elif period.endswith("d"):
|
||||||
|
56
config.json
56
config.json
@ -8,35 +8,53 @@
|
|||||||
"nodeRpc": "###RPC_URL###",
|
"nodeRpc": "###RPC_URL###",
|
||||||
"maxRetries": 10,
|
"maxRetries": 10,
|
||||||
"delay": 30,
|
"delay": 30,
|
||||||
"submitTx": false
|
"submitTx": true
|
||||||
},
|
},
|
||||||
"worker": [
|
"worker": [
|
||||||
{
|
{
|
||||||
"topicId": 1,
|
"topicId": 1,
|
||||||
"inferenceEntrypointName": "api-worker-reputer",
|
"inferenceEntrypointName": "api-worker-reputer", "loopSeconds": 5,
|
||||||
"loopSeconds": 5,
|
"parameters": { "InferenceEndpoint": "http://inference:8080/inference/ETH/10m", "Token": "ETH" }
|
||||||
"parameters": {
|
|
||||||
"InferenceEndpoint": "http://inference:8000/inference/{Token}",
|
|
||||||
"Token": "ETH"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"topicId": 2,
|
"topicId": 2,
|
||||||
"inferenceEntrypointName": "api-worker-reputer",
|
"inferenceEntrypointName": "api-worker-reputer", "loopSeconds": 5,
|
||||||
"loopSeconds": 5,
|
"parameters": { "InferenceEndpoint": "http://inference:8080/inference/ETH/24h", "Token": "ETH" }
|
||||||
"parameters": {
|
},
|
||||||
"InferenceEndpoint": "http://inference:8000/inference/{Token}",
|
{
|
||||||
"Token": "ETH"
|
"topicId": 3,
|
||||||
}
|
"inferenceEntrypointName": "api-worker-reputer", "loopSeconds": 5,
|
||||||
|
"parameters": { "InferenceEndpoint": "http://inference:8080/inference/BTC/10m", "Token": "BTC" }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"topicId": 4,
|
||||||
|
"inferenceEntrypointName": "api-worker-reputer", "loopSeconds": 5,
|
||||||
|
"parameters": { "InferenceEndpoint": "http://inference:8080/inference/BTC/24h", "Token": "BTC" }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"topicId": 5,
|
||||||
|
"inferenceEntrypointName": "api-worker-reputer", "loopSeconds": 5,
|
||||||
|
"parameters": { "InferenceEndpoint": "http://inference:8080/inference/SOL/10m", "Token": "SOL" }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"topicId": 6,
|
||||||
|
"inferenceEntrypointName": "api-worker-reputer", "loopSeconds": 5,
|
||||||
|
"parameters": { "InferenceEndpoint": "http://inference:8080/inference/SOL/24h", "Token": "SOL" }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"topicId": 7,
|
"topicId": 7,
|
||||||
"inferenceEntrypointName": "api-worker-reputer",
|
"inferenceEntrypointName": "api-worker-reputer", "loopSeconds": 5,
|
||||||
"loopSeconds": 5,
|
"parameters": { "InferenceEndpoint": "http://inference:8080/inference/ETH/20m", "Token": "ETH" }
|
||||||
"parameters": {
|
},
|
||||||
"InferenceEndpoint": "http://inference:8000/inference/{Token}",
|
{
|
||||||
"Token": "ETH"
|
"topicId": 8,
|
||||||
}
|
"inferenceEntrypointName": "api-worker-reputer", "loopSeconds": 5,
|
||||||
|
"parameters": { "InferenceEndpoint": "http://inference:8080/inference/BNB/20m", "Token": "BNB" }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"topicId": 9,
|
||||||
|
"inferenceEntrypointName": "api-worker-reputer", "loopSeconds": 5,
|
||||||
|
"parameters": { "InferenceEndpoint": "http://inference:8080/inference/ARB/20m", "Token": "ARB" }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
@ -4,12 +4,12 @@ services:
|
|||||||
build: .
|
build: .
|
||||||
command: python -u /app/app.py
|
command: python -u /app/app.py
|
||||||
ports:
|
ports:
|
||||||
- "8000:8000"
|
- "8080:8080"
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "curl", "-f", "http://localhost:8000/inference/ETH"]
|
test: ["CMD", "curl", "-f", "http://localhost:8080/inference/ETH/10m"]
|
||||||
interval: 10s
|
interval: 30s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 12
|
retries: 20
|
||||||
volumes:
|
volumes:
|
||||||
- ./inference-data:/app/data
|
- ./inference-data:/app/data
|
||||||
restart: always
|
restart: always
|
||||||
@ -18,7 +18,7 @@ services:
|
|||||||
container_name: updater-basic-eth-pred
|
container_name: updater-basic-eth-pred
|
||||||
build: .
|
build: .
|
||||||
environment:
|
environment:
|
||||||
- INFERENCE_API_ADDRESS=http://inference:8000
|
- INFERENCE_API_ADDRESS=http://inference:8080
|
||||||
command: >
|
command: >
|
||||||
sh -c "
|
sh -c "
|
||||||
while true; do
|
while true; do
|
||||||
|
Reference in New Issue
Block a user