Draft-Spec.md 1.65 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
### API

I was thinking of also following docker daemon api conventions, but it looks stupid.
( https://docs.docker.com/engine/api/v1.24/#32-images )

```
GET /images[?scope=<local|cluster|origin>][?search=keyword]
GET /images/{imagename}[/info]
GET /images/{imagename}/versions[?scope=<local|cluster|origin>]
GET /images/{imagename}/versions/{tag|hash}/package.tar[.gz|.xz]
GET /images/{imagename}/versions/{tag|hash}/layers

GET /layers/{layer}[/info]
GET /layers/{layer}.tar[.gz|.xz]

GET /nodes
GET /nodes/{uuid}
GET /nodes/{uuid}/images

json: {"type":"pull","url":"docker://nginx:latest","name":"nginx","tag":"latest"} => POST /images
 -- receive task info payload --

json: {"type":"upload","name":"nginx","tag":"latest"} => POST /images
 -- receive task info payload --

stat --printf=%s image.tar | PUT /tasks/{task-uuid}/upload/size
cat image.tar | PUT /tasks/{task-uuid}/upload/stream
..or
docker inspect -f '{{.Size}}' ${IMAGE} | PUT /tasks/{task-uuid}/upload/size
docker save ${IMAGE} | PUT /tasks/{task-uuid}/upload/stream


GET /tasks
GET /tasks/{task-uuid}
GET /tasks/{task-uuid}/status
 -- receive long-polling json-stream for task status --

WS /tasks
 -- receive continous stream of all changes, events of tasks --
```


### Desired Client Behavior;

```
$ beiran images
--- lists local images ----

$ beiran images --available
or
$ beiran images --all
--- lists all images between connected peers ---


$ beiran pull image docker://nginx:latest
( we can follow the convention rkt people made here )
```







### Client Process Interruption

```
$ beiran pull nginx:latest
Downloading ... 35%
..
^C

$ beiran pull nginx:latest
Downloading ... 35%
^C

...
...
...
^C
```