ultravioletrs / cocos

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

COCOS-165 - Add Docker support #180

Closed danko-miladinovic closed 3 months ago

danko-miladinovic commented 4 months ago

What type of PR is this?

This is a feature because it enables the Agent to run Docker images inside the VM.

What does this do?

This PR introduces a new way of executing algorithms by using Docker.

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

Resolves #165

Have you included tests for your changes?

The agent-config/main.go has been changed to create an option for the Agent to run docker.

Did you document any new/modified feature?

The official documentation will be updated in a separate PR. The manual testing documentation has been updated.

Notes

danko-miladinovic commented 3 months ago

results fails

go run ./cmd/cli/main.go result private.pem                                                                                                                                                            ✔  10s  
2024/08/02 16:57:50 Retrieving computation result file
2024/08/02 16:58:00 Error retrieving computation result: rpc error: code = Unknown desc = could not copy from the Docker container: failed to copy from container: Error response from daemon: Could not find the file /result/result.bin in container agent_container
exit status 1

Fixed, the problem was in the lin_reg.py file. My mistake was that I left the dataset path be /datasets/iris.csv but the datasets are renamed when the Agent saves them, so it did not work.

dborovcanin commented 3 months ago

@drasko, @SammyOina Please re-review.

danko-miladinovic commented 3 months ago

Now, the /cocos directory is the default working directory for the Agent. The Docker image must be built so it has the /cocos directory. In this directory the datasets and results will be mounted.