Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Commit

Permalink
allow jobs with no log data to be schedule (#1893)
Browse files Browse the repository at this point in the history
  • Loading branch information
chkeita authored May 4, 2022
1 parent 0859b04 commit b2399c4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
11 changes: 5 additions & 6 deletions src/api-service/__app__/onefuzzlib/tasks/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/pytypes/onefuzztypes/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b2399c4

Please sign in to comment.