Skip to content

Commit

Permalink
[sub]feat: modify computetask failure report (#727)
Browse files Browse the repository at this point in the history
## Companion PR

- Substra/orchestrator#277
- Substra/substra-frontend#240

## Description

The aim is to allow registering failure reports not only for compute
task but for other kind of assets (for now, functions which are not
building as part of the execution of a compute task)

- Modifies `ComputeTaskFailureReport`:
    - renamed the model to `AssetFailureReport`
- renamed field `compute_task_key` to `asset_key` (as we can now have a
function key)
    - added field `asset_type` to provide 
- Updates protobuf reflecting the previous changes
- refactor `download_file` in `PermissionMixin` to provide mroe
flexibility (and decouple from DRF)
- create new `FailableTask` (Celery task):
  - centralize the logic to submit asset failure

## How has this been tested?

As this is going to be merged on a branch that is going to be merged to
a POC branch, we use MNIST as a baseline of a working model. We will
deal with failing tests on the POC before merging on main.

## Checklist

- [x] [changelog](../CHANGELOG.md) was updated with notable changes
- [ ] documentation was updated

---------

Signed-off-by: Guilhem Barthes <[email protected]>
  • Loading branch information
guilhem-barthes committed Feb 12, 2024
1 parent 2fc8b03 commit 022d93d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
4 changes: 0 additions & 4 deletions backend/substrapp/tasks/tasks_compute_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import enum
import errno
import os
from typing import TYPE_CHECKING
from typing import Any

import celery.exceptions
Expand All @@ -25,9 +24,6 @@
from django.conf import settings
from rest_framework import status

if TYPE_CHECKING:
from billiard.einfo import ExceptionInfo

import orchestrator
from backend.celery import app
from substrapp.clients import organization as organization_client
Expand Down
6 changes: 0 additions & 6 deletions backend/substrapp/tasks/tasks_save_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,9 @@
import os
import pathlib
from tempfile import TemporaryDirectory
from typing import TYPE_CHECKING
from typing import Any

import structlog

if TYPE_CHECKING:
from billiard.einfo import ExceptionInfo

from celery import Task
from django.conf import settings
from django.core.files import File
from django.urls import reverse
Expand Down

0 comments on commit 022d93d

Please sign in to comment.