Skip to content

More fixes for automatic Docker limits #6982

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

Merged
merged 2 commits into from
Apr 28, 2020
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
6 changes: 6 additions & 0 deletions readthedocs/doc_builder/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@
'memory': '7g',
'time': 1800,
})
elif total_memory > 7000:
# This is to catch AWS instances that actually only have 7.5G memory
DOCKER_LIMITS.update({
'memory': '6g',
'time': 1800,
})
elif total_memory > 4000:
DOCKER_LIMITS.update({
'memory': '3g',
Expand Down
3 changes: 2 additions & 1 deletion readthedocs/projects/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from readthedocs.builds.constants import LATEST, STABLE, INTERNAL, EXTERNAL
from readthedocs.core.resolver import resolve, resolve_domain
from readthedocs.core.utils import broadcast, slugify
from readthedocs.doc_builder.constants import DOCKER_LIMITS
from readthedocs.projects import constants
from readthedocs.projects.exceptions import ProjectConfigurationError
from readthedocs.projects.managers import HTMLFileManager
Expand Down Expand Up @@ -896,7 +897,7 @@ def repo_nonblockinglock(self, version, max_lock_age=None):
if max_lock_age is None:
max_lock_age = (
self.container_time_limit or
settings.DOCKER_LIMITS.get('time') or
DOCKER_LIMITS.get('time') or
settings.REPO_LOCK_SECONDS
)

Expand Down