ultravioletrs / cocos

Cocos AI - Confidential Computing System for AI
https://ultraviolet.rs/cocos.html
Apache License 2.0
25 stars 9 forks source link

NOISSUE - Fix bug on same dataset provider for multiple datasets #198

Closed SammyOina closed 3 months ago

SammyOina commented 3 months ago

What type of PR is this?

This is a bug fix of dataset provider upload order

What does this do?

sequenceDiagram
    participant User
    participant AuthService
    participant DatasetService

    User->>AuthService: AuthenticateUser(ctx, role)
    AuthService-->>User: Return original ctx

    User->>DatasetService: Data(ctx)
    DatasetService->>DatasetService: Iterate through datasets
    DatasetService->>DatasetService: Check hash and filename
    alt Match found
        DatasetService-->>User: Dataset retrieved
    else No match
        DatasetService-->>User: ErrUndeclaredDataset
    end

Which issue(s) does this PR fix/relate to?

Have you included tests for your changes?

manually tested

Did you document any new/modified feature?

no

Notes

SammyOina commented 3 months ago
➜  cocos git:(single-data-provider) ✗ export AGENT_GRPC_URL=localhost:6019
➜  cocos git:(single-data-provider) ✗ ./build/cocos-cli algo ../ai/covid19/train.py private.pem -a Python -r ../ai/covid19/requirements.txt
2024/08/16 14:07:12 Uploading algorithm binary: ../ai/covid19/train.py
Uploading algorithm...  100% [===============================================>] 
2024/08/16 14:07:12 Successfully uploaded algorithm
➜  cocos git:(single-data-provider) ✗ ./build/cocos-cli data ../ai/covid19/datasets/h3.zip private.pem                                     

2024/08/16 14:07:21 Uploading dataset CSV: ../ai/covid19/datasets/h3.zip
Uploading data...  100% [====================================================>] 
{"time":"2024-08-16T14:07:22.877016164+03:00","level":"ERROR","msg":"Failed to send Data"}
2024/08/16 14:07:22 Error uploading dataset: rpc error: code = Unknown desc = agent not expecting this operation in the current state

➜ cocos git:(single-data-provider) ✗

➜  cocos git:(single-data-provider) ✗ export AGENT_GRPC_URL=localhost:6005
➜  cocos git:(single-data-provider) ✗ ./build/cocos-cli algo ../ai/covid19/train.py private.pem                                            
2024/08/16 14:10:23 Uploading algorithm binary: ../ai/covid19/train.py
Uploading algorithm...  100% [===============================================>] 
2024/08/16 14:10:23 Successfully uploaded algorithm
➜  cocos git:(single-data-provider) ✗ ./build/cocos-cli data ../ai/covid19/datasets/h3.zip private.pem

2024/08/16 14:10:27 Uploading dataset CSV: ../ai/covid19/datasets/h3.zip
Uploading data...  100% [====================================================>] 
2024/08/16 14:10:29 Successfully uploaded dataset
➜  cocos git:(single-data-provider) ✗

Does not work when algo type is specified

share your steps here and manifest as well, as I am not able to replicate this behavior, as well as relevant logs