Skip to content
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
2 changes: 1 addition & 1 deletion docker-compose-prankweb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ services:
timeout: 30s
retries: 3
flower:
build: https://github.com/mher/flower.git
image: mher/flower
command: "celery flower --url_prefix=service/flower"
environment:
CELERY_BROKER_URL: "amqp://${RABBITMQ_DEFAULT_USER}:${RABBITMQ_DEFAULT_PASS}@rabbitmq:5672"
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ services:
timeout: 30s
retries: 3
flower:
build: https://github.com/mher/flower.git
image: mher/flower
command: "celery flower --url_prefix=service/flower"
environment:
CELERY_BROKER_URL: "amqp://${RABBITMQ_DEFAULT_USER:-user}:${RABBITMQ_DEFAULT_PASS:-1234}@rabbitmq:5672"
depends_on:
rabbitmq:
condition: service_healthy
condition: service_healthy
web-server:
build:
context: ./
Expand Down
2 changes: 1 addition & 1 deletion executor-p2rank/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ FROM debian:bookworm-20231009

ARG UID=5988
ARG GID=5988
ARG P2RANK_URL=https://github.com/rdk/p2rank/releases/download/2.5/p2rank_2.5.tar.gz
ARG P2RANK_URL=https://github.com/rdk/p2rank/releases/download/2.5.1/p2rank_2.5.1.tar.gz
ARG CELERY_BROKER_URL="amqp://user-develop:develop@localhost:5672"

RUN apt-get update \
Expand Down
23 changes: 0 additions & 23 deletions flower/Dockerfile

This file was deleted.

3 changes: 0 additions & 3 deletions flower/requirements.txt

This file was deleted.

2 changes: 1 addition & 1 deletion frontend/client/analyze/analyze.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ function renderFailedTask(database: string, id: string) {
UserInterface.progressStdout
]);
setProgressMessage("Task failed, see the log below for more details.<br/>");
if (!database.includes("user")) setProgressMessage("Task failed, see the log below for more details.<br/><strong>To re-run the prediction, please refresh the page.</strong>");
if (!database.includes("user")) setProgressMessage("Task failed, see the log below for more details.<br/><strong>To re-run the prediction, please try again in 1 hour.</strong>");
setStdout(database, id);
}

Expand Down
7 changes: 4 additions & 3 deletions gateway/nginx/gateway.conf
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ server {

# https://flower.readthedocs.io/en/latest/reverse-proxy.html
set $flower_url flower;
location /service/flower {
return 301 ./service/flower/;
}
location /service/flower/ {
include restricted.conf;
proxy_pass http://$flower_url:5555;
Expand All @@ -32,6 +29,10 @@ server {
proxy_set_header Connection "upgrade";
}

location /service/flower {
return 301 ../service/flower/;
}

# https://grafana.com/tutorials/run-grafana-behind-a-proxy/
# set $grafana_url grafana;
# location /service/grafana {
Expand Down
24 changes: 20 additions & 4 deletions web-server/src/database_v3.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def get_info(self, identifier: str):
# In such cases, we want to remove the prediction and run it again.
with open(os.path.join(directory, "info.json"), "r") as f:
info = json.load(f)
if info["status"] == "failed":
if _should_rerun_prediction(info):
# Remove the directory and create a new prediction.
shutil.rmtree(directory)
else:
Expand Down Expand Up @@ -103,7 +103,7 @@ def get_info(self, identifier: str):
# In such cases, we want to remove the prediction and run it again.
with open(os.path.join(directory, "info.json"), "r") as f:
info = json.load(f)
if info["status"] == "failed":
if _should_rerun_prediction(info):
# Remove the directory and create a new prediction.
shutil.rmtree(directory)
else:
Expand Down Expand Up @@ -185,7 +185,7 @@ def get_info(self, identifier: str):
# In such cases, we want to remove the prediction and run it again.
with open(os.path.join(directory, "info.json"), "r") as f:
info = json.load(f)
if info["status"] == "failed":
if _should_rerun_prediction(info):
# Remove the directory and create a new prediction.
shutil.rmtree(directory)
else:
Expand Down Expand Up @@ -229,7 +229,7 @@ def get_info(self, identifier: str):
# In such cases, we want to remove the prediction and run it again.
with open(os.path.join(directory, "info.json"), "r") as f:
info = json.load(f)
if info["status"] == "failed":
if _should_rerun_prediction(info):
# Remove the directory and create a new prediction.
shutil.rmtree(directory)
else:
Expand Down Expand Up @@ -356,6 +356,22 @@ def _configuration_to_prediction(
metadata={},
)

def _should_rerun_prediction(info: dict) -> bool:
last_change_str = info.get("lastChange")
last_change = None

if last_change_str:
try:
last_change = datetime.datetime.strptime(last_change_str, "%Y-%m-%dT%H:%M:%S")
except Exception:
last_change = None

now = datetime.datetime.now()
if info["status"] == "failed" and last_change and (now - last_change).total_seconds() >= 3600:
return True

return False


def _is_prediction_valid(prediction: Prediction) -> bool:
if prediction.structure_sealed:
Expand Down
24 changes: 20 additions & 4 deletions web-server/src/database_v4.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def get_info(self, identifier: str):
# In such cases, we want to remove the prediction and run it again.
with open(os.path.join(directory, "info.json"), "r") as f:
info = json.load(f)
if info["status"] == "failed":
if _should_rerun_prediction(info):
# Remove the directory and create a new prediction.
shutil.rmtree(directory)
else:
Expand Down Expand Up @@ -103,7 +103,7 @@ def get_info(self, identifier: str):
# In such cases, we want to remove the prediction and run it again.
with open(os.path.join(directory, "info.json"), "r") as f:
info = json.load(f)
if info["status"] == "failed":
if _should_rerun_prediction(info):
# Remove the directory and create a new prediction.
shutil.rmtree(directory)
else:
Expand Down Expand Up @@ -185,7 +185,7 @@ def get_info(self, identifier: str):
# In such cases, we want to remove the prediction and run it again.
with open(os.path.join(directory, "info.json"), "r") as f:
info = json.load(f)
if info["status"] == "failed":
if _should_rerun_prediction(info):
# Remove the directory and create a new prediction.
shutil.rmtree(directory)
else:
Expand Down Expand Up @@ -229,7 +229,7 @@ def get_info(self, identifier: str):
# In such cases, we want to remove the prediction and run it again.
with open(os.path.join(directory, "info.json"), "r") as f:
info = json.load(f)
if info["status"] == "failed":
if _should_rerun_prediction(info):
# Remove the directory and create a new prediction.
shutil.rmtree(directory)
else:
Expand Down Expand Up @@ -356,6 +356,22 @@ def _configuration_to_prediction(
metadata={},
)

def _should_rerun_prediction(info: dict) -> bool:
last_change_str = info.get("lastChange")
last_change = None

if last_change_str:
try:
last_change = datetime.datetime.strptime(last_change_str, "%Y-%m-%dT%H:%M:%S")
except Exception:
last_change = None

now = datetime.datetime.now()
if info["status"] == "failed" and last_change and (now - last_change).total_seconds() >= 3600:
return True

return False


def _is_prediction_valid(prediction: Prediction) -> bool:
if prediction.structure_sealed:
Expand Down