Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/ben/expose visibility timeout #224

Merged
merged 7 commits into from
Jun 2, 2020
Merged
Show file tree
Hide file tree
Changes from 3 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
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed
- The default rabbitmq vhost is now <user> instead of /<user>.
- Changed default task timeout from 2 hours to 24 hours.
- Changed default visibility timeout from 2 hours to 24 hours. Exposed this in the config
file.
- The monitor function will now check the queues to determine when
to exit.

Expand Down
7 changes: 4 additions & 3 deletions merlin/celery.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
broker,
results_backend,
)
from merlin.config.configfile import CONFIG
from merlin.log_formatter import FORMATS
from merlin.router import route_for_task

Expand Down Expand Up @@ -100,10 +101,10 @@
redis_max_connections=100000,
)

# Set a 24-hour timeout to acknowledge a task before it's available to grab
# again.
# Set a timeout to acknowledge a task before it's available to grab
# again (default 24 hours).
app.conf.broker_transport_options = {
"visibility_timeout": 86400,
"visibility_timeout": CONFIG.celery.visibility_timeout,
"max_connections": 100,
}

Expand Down
3 changes: 3 additions & 0 deletions merlin/data/celery/app.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
celery:
visibility_timeout: 86400

broker:
# can be redis, redis+sock, or rabbitmq
name: rabbitmq
Expand Down
3 changes: 3 additions & 0 deletions merlin/data/celery/app_redis.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
celery:
visibility_timeout: 86400

broker:
# can be redis, redis+sock, or rabbitmq
name: redis
Expand Down
1 change: 0 additions & 1 deletion merlin/examples/workflows/feature_demo/scripts/learn.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import sys

import numpy as np

from sklearn.ensemble import RandomForestRegressor


Expand Down
3 changes: 1 addition & 2 deletions merlin/examples/workflows/hello/make_samples.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import argparse

import numpy as np

import names
import numpy as np


# argument parsing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import glob

import numpy as np

import Ofpp


Expand Down
1 change: 0 additions & 1 deletion merlin/examples/workflows/openfoam_wf/scripts/learn.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import matplotlib.pyplot as plt
import numpy as np

from joblib import dump
from sklearn.ensemble import RandomForestRegressor
from sklearn.metrics import mean_squared_error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import glob

import numpy as np

import Ofpp


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import matplotlib.pyplot as plt
import numpy as np

from joblib import dump
from sklearn.ensemble import RandomForestRegressor
from sklearn.metrics import mean_squared_error
Expand Down
2 changes: 1 addition & 1 deletion merlin/study/study.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ def expanded_spec(self):
# rewrite provenance spec to correct samples.generate.cmd and samples.file
if self.restart_dir is None:
self.write_expanded_spec(self.expanded_filepath)

LOG.info(f"Study workspace is '{self.workspace}'.")
return result

Expand Down