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

Add VERSION_CHECK configuration setting. #1347

Merged
merged 1 commit into from
Sep 27, 2023
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
1 change: 1 addition & 0 deletions docker/local/local-config.sed
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ s/OUTPUT_DIR = .*/OUTPUT_DIR = '\/evidence'/g
s/MOUNT_DIR_PREFIX = .*/MOUNT_DIR_PREFIX = '\/tmp\/turbinia-mounts'/g
s/SHARED_FILESYSTEM = .*/SHARED_FILESYSTEM = True/g
s/DEBUG_TASKS = .*/DEBUG_TASKS = True/g
s/VERSION_CHECK = .*/VERSION_CHECK = False/g
s/DISABLED_JOBS = .*/DISABLED_JOBS = ['DfdeweyJob', 'VolatilityJob', 'HindsightJob']/g
1 change: 1 addition & 0 deletions turbinia/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
'MOUNT_DIR_PREFIX',
'SHARED_FILESYSTEM',
'DEBUG_TASKS',
'VERSION_CHECK',
'DEPENDENCIES',
'DOCKER_ENABLED',
'DISABLED_JOBS',
Expand Down
4 changes: 4 additions & 0 deletions turbinia/config/turbinia_config_tmpl.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@
# problems.
DEBUG_TASKS = False

# This indicates whether the server and worker version need to be the same.
# Makes sense to set to False while developing.
VERSION_CHECK = True

# Directory keeping all eligible recipes
RECIPE_FILE_DIR = None

Expand Down
17 changes: 9 additions & 8 deletions turbinia/workers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1061,14 +1061,15 @@ def run_wrapper(self, evidence):

self.evidence_setup(evidence)

if self.turbinia_version != __version__:
message = (
'Worker and Server versions do not match: {0:s} != {1:s}'.format(
self.turbinia_version, __version__))
self.result.log(message, level=logging.ERROR)
self.result.status = message
self.result.successful = False
return self.result.serialize()
if config.VERSION_CHECK:
if self.turbinia_version != __version__:
message = (
'Worker and Server versions do not match: {0:s} != {1:s}'
.format(self.turbinia_version, __version__))
self.result.log(message, level=logging.ERROR)
self.result.status = message
self.result.successful = False
return self.result.serialize()

self.result.update_task_status(self, 'running')
self._evidence_config = evidence.config
Expand Down
Loading