summaryrefslogtreecommitdiff
path: root/README.md
blob: 342cb6b85b233278ca090897141f36c6f20625cf (plain)
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# skopos
A gRPC server that facilitates provisioning and updating containers.

## Usage
### List Services
Replace IP address accordingly.
```bash
grpcurl -plaintext 10.0.0.42:50052 list
```

Example output:
```bash
grpc.reflection.v1.ServerReflection
unit.containers.v0.Ormos
```

### List Ormos Service Methods
Replace IP address accordingly.
```bash
grpcurl -plaintext 10.0.0.42:50052 list unit.containers.v0.Ormos
```

Example output:
```bash
unit.containers.v0.Ormos.InspectImageArchive
unit.containers.v0.Ormos.ListImageArchives
unit.containers.v0.Ormos.ListUsbDevices
unit.containers.v0.Ormos.LoadImageArchive
unit.containers.v0.Ormos.MountUsbDevice
unit.containers.v0.Ormos.UnmountUsbDevice
```

### List USB Devices
Replace IP address accordingly.
```bash
grpcurl -plaintext -import-path ./proto -proto ormos.proto -d '{}' '10.0.0.42:50052' unit.containers.v0.Ormos.ListUsbDevices
```

Example output (device not mounted):
```json
{
  "devices": [
    {
      "devicePath": "/dev/sda"
    },
    {
      "devicePath": "/dev/sda1"
    }
  ]
}
```

Example output (device mounted):
```json
{
  "devices": [
    {
      "devicePath": "/dev/sda"
    },
    {
      "devicePath": "/dev/sda1",
      "isMounted": true,
      "mountPoint": "/mnt/usb"
    }
  ]
}
```

### Mount USB Device
Replace IP address accordingly.
```bash
grpcurl -plaintext -import-path ./proto -proto ormos.proto -d '{"device_path": "/dev/sda1", "mount_point": "/mnt/usb"}' '10.0.0.42:50052' unit.containers.v0.Ormos.MountUsbDevice
```

### List Container Image Archives
Replace IP address accordingly.
```bash
grpcurl -plaintext -import-path ./proto -proto ormos.proto -d '{"path": "/mnt/usb"}' '10.0.0.42:50052' unit.containers.v0.Ormos.ListImageArchives
```

Example output:
```json
{
  "imageArchives": [
    {
      "filePath": "/mnt/usb/alpine-arm64.tar",
      "fileSizeBytes": "8468992",
      "sha256Checksum": "0b070f92dd64e2bfead9f0c494511c9ce486f18900ec8297f374e5000a5f2994"
    }
  ]
}

```

### Inspect Container Image Archive
Replace IP address and archive path accordingly, pretty printing underlying skopeo commands stdout if request successful.
```bash
grpcurl -plaintext -import-path ./proto -proto ormos.proto -d '{"file_path": "/mnt/usb/alpine-arm64.tar"}' '10.0.0.42:50052' unit.containers.v0.Ormos.InspectImageArchive | jq 'if .isSuccess then .stdout | fromjson else . end'
```

Example output (success):
```json
{
  "Digest": "sha256:058c92d86112aa6f641b01ed238a07a3885b8c0815de3e423e5c5f789c398b45",
  "RepoTags": [],
  "Created": "2025-02-14T03:28:36Z",
  "DockerVersion": "",
  "Labels": null,
  "Architecture": "arm64",
  "Os": "linux",
  "Layers": [
    "sha256:a16e98724c05975ee8c40d8fe389c3481373d34ab20a1cf52ea2accc43f71f4c"
  ],
  "LayersData": [
    {
      "MIMEType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
      "Digest": "sha256:a16e98724c05975ee8c40d8fe389c3481373d34ab20a1cf52ea2accc43f71f4c",
      "Size": 8461312,
      "Annotations": null
    }
  ],
  "Env": [
    "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
  ]
}
```

Example output (failed):
```json
{
  "stderr": "time=\"2025-06-08T16:15:16Z\" level=fatal msg=\"Error parsing image name \\\"docker-archive:/mnt/usb/dne.tar\\\": opening file \\\"/mnt/usb/dne.tar\\\": open /mnt/usb/dne.tar: no such file or directory\"\n"
}
```

### Unmount USB Device
Replace IP address accordingly.
```bash
grpcurl -plaintext -import-path ./proto -proto ormos.proto -d '{"mount_point": "/mnt/usb"}' '10.0.0.42:50052' unit.containers.v0.Ormos.UnmountUsbDevice
```

### Copy Container Image Archive to Local Registry
Replace IP address accordingly.
```bash
grpcurl -plaintext -import-path ./proto -proto ormos.proto -d '{"file_path": "/mnt/usb/alpine-arm64.tar", "image_name": "alpine", "image_tag": "latest"}' '10.0.0.42:50052' unit.containers.v0.Ormos.LoadImageArchive
```