diff --git a/src/api-service/__app__/onefuzzlib/tasks/config.py b/src/api-service/__app__/onefuzzlib/tasks/config.py index 052c6653f0..cfa38f0b3c 100644 --- a/src/api-service/__app__/onefuzzlib/tasks/config.py +++ b/src/api-service/__app__/onefuzzlib/tasks/config.py @@ -267,17 +267,11 @@ def build_task_config(job: Job, task: Task) -> TaskUnitConfig: if task_config.task.type not in TASK_DEFINITIONS: raise TaskConfigError("unsupported task type: %s" % task_config.task.type.name) - if job.config.logs is None: - raise TaskConfigError( - "Missing log container: job_id %s, task_id %s", job_id, task_id - ) - definition = TASK_DEFINITIONS[task_config.task.type] config = TaskUnitConfig( job_id=job_id, task_id=task_id, - logs=add_container_sas_url(job.config.logs), task_type=task_config.task.type, instance_telemetry_key=os.environ.get("APPINSIGHTS_INSTRUMENTATIONKEY"), microsoft_telemetry_key=os.environ.get("ONEFUZZ_TELEMETRY"), @@ -289,6 +283,11 @@ def build_task_config(job: Job, task: Task) -> TaskUnitConfig: instance_id=get_instance_id(), ) + if job.config.logs: + config.logs = add_container_sas_url(job.config.logs) + else: + LOGGER.warning("Missing log container: job_id %s, task_id %s", job_id, task_id) + if definition.monitor_queue: config.input_queue = get_queue_sas( task_id, diff --git a/src/pytypes/onefuzztypes/models.py b/src/pytypes/onefuzztypes/models.py index 55315291b9..a5f9e12a41 100644 --- a/src/pytypes/onefuzztypes/models.py +++ b/src/pytypes/onefuzztypes/models.py @@ -340,7 +340,7 @@ class AgentConfig(BaseModel): class TaskUnitConfig(BaseModel): instance_id: UUID - logs: str + logs: Optional[str] job_id: UUID task_id: UUID task_type: TaskType