diff --git a/infra/cifuzz/config_utils.py b/infra/cifuzz/config_utils.py index 53cb3ccae..299b5c2dc 100644 --- a/infra/cifuzz/config_utils.py +++ b/infra/cifuzz/config_utils.py @@ -98,9 +98,12 @@ class BaseConfig: self.token = self.platform_conf.token self.project_repo_owner = self.platform_conf.project_repo_owner self.project_repo_name = self.platform_conf.project_repo_name - self.docker_in_docker = self.platform_conf.docker_in_docker self.filestore = self.platform_conf.filestore + # This determines if builds are done using docker in docker + # rather than the normal method which is sibling containers. + self.docker_in_docker = self.platform_conf.docker_in_docker + self.dry_run = _is_dry_run() # Check if failures should not be reported. self.sanitizer = _get_sanitizer() self.language = _get_language() diff --git a/infra/cifuzz/platform_config/__init__.py b/infra/cifuzz/platform_config/__init__.py index 2269f8a8b..219edbe45 100644 --- a/infra/cifuzz/platform_config/__init__.py +++ b/infra/cifuzz/platform_config/__init__.py @@ -15,6 +15,8 @@ import logging import os +import environment + class BasePlatformConfig: """Base class for PlatformConfig subclasses.""" @@ -100,12 +102,12 @@ class BasePlatformConfig: @property def docker_in_docker(self): - """Returns whether or not CFL is running using DIND.""" - return os.environ.get('DOCKER_IN_DOCKER', False) + """Returns whether or not CFL is running using Docker in Docker.""" + return environment.get_bool('DOCKER_IN_DOCKER', False) @property def filestore(self): - """Returns the filestore used to store persistant data.""" + """Returns the filestore used to store persistent data.""" return os.environ.get('FILESTORE') @property diff --git a/infra/cifuzz/platform_config/gcb.py b/infra/cifuzz/platform_config/gcb.py index 176f52472..59b7e2fab 100644 --- a/infra/cifuzz/platform_config/gcb.py +++ b/infra/cifuzz/platform_config/gcb.py @@ -33,3 +33,8 @@ class PlatformConfig(platform_config.BasePlatformConfig): def workspace(self): """Returns the workspace.""" return os.getenv('WORKSPACE', '/builder/home') + + @property + def filestore(self): + """Returns the filestore used to store persistent data.""" + return os.environ.get('FILESTORE', 'gsutil') diff --git a/infra/cifuzz/platform_config/prow.py b/infra/cifuzz/platform_config/prow.py index 7ca6d4c1a..69c035ae8 100644 --- a/infra/cifuzz/platform_config/prow.py +++ b/infra/cifuzz/platform_config/prow.py @@ -55,10 +55,10 @@ class PlatformConfig(platform_config.BasePlatformConfig): @property def docker_in_docker(self): - """Returns whether or not CFL is running using DIND.""" + """Returns True if using Docker in Docker.""" return True @property def filestore(self): - """Returns whether or not CFL is running using DIND.""" + """Returns the filestore used to store persistent data.""" return os.environ.get('FILESTORE', 'gsutil')