golem-vm-provider 0.1.9__tar.gz → 0.1.12__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {golem_vm_provider-0.1.9 → golem_vm_provider-0.1.12}/PKG-INFO +99 -87
- {golem_vm_provider-0.1.9 → golem_vm_provider-0.1.12}/README.md +98 -86
- {golem_vm_provider-0.1.9 → golem_vm_provider-0.1.12}/provider/config.py +73 -15
- {golem_vm_provider-0.1.9 → golem_vm_provider-0.1.12}/pyproject.toml +1 -1
- {golem_vm_provider-0.1.9 → golem_vm_provider-0.1.12}/provider/__init__.py +0 -0
- {golem_vm_provider-0.1.9 → golem_vm_provider-0.1.12}/provider/api/__init__.py +0 -0
- {golem_vm_provider-0.1.9 → golem_vm_provider-0.1.12}/provider/api/models.py +0 -0
- {golem_vm_provider-0.1.9 → golem_vm_provider-0.1.12}/provider/api/routes.py +0 -0
- {golem_vm_provider-0.1.9 → golem_vm_provider-0.1.12}/provider/discovery/__init__.py +0 -0
- {golem_vm_provider-0.1.9 → golem_vm_provider-0.1.12}/provider/discovery/advertiser.py +0 -0
- {golem_vm_provider-0.1.9 → golem_vm_provider-0.1.12}/provider/discovery/resource_tracker.py +0 -0
- {golem_vm_provider-0.1.9 → golem_vm_provider-0.1.12}/provider/main.py +0 -0
- {golem_vm_provider-0.1.9 → golem_vm_provider-0.1.12}/provider/network/port_verifier.py +0 -0
- {golem_vm_provider-0.1.9 → golem_vm_provider-0.1.12}/provider/security/ethereum.py +0 -0
- {golem_vm_provider-0.1.9 → golem_vm_provider-0.1.12}/provider/utils/ascii_art.py +0 -0
- {golem_vm_provider-0.1.9 → golem_vm_provider-0.1.12}/provider/utils/logging.py +0 -0
- {golem_vm_provider-0.1.9 → golem_vm_provider-0.1.12}/provider/utils/port_display.py +0 -0
- {golem_vm_provider-0.1.9 → golem_vm_provider-0.1.12}/provider/utils/retry.py +0 -0
- {golem_vm_provider-0.1.9 → golem_vm_provider-0.1.12}/provider/vm/__init__.py +0 -0
- {golem_vm_provider-0.1.9 → golem_vm_provider-0.1.12}/provider/vm/cloud_init.py +0 -0
- {golem_vm_provider-0.1.9 → golem_vm_provider-0.1.12}/provider/vm/models.py +0 -0
- {golem_vm_provider-0.1.9 → golem_vm_provider-0.1.12}/provider/vm/multipass.py +0 -0
- {golem_vm_provider-0.1.9 → golem_vm_provider-0.1.12}/provider/vm/name_mapper.py +0 -0
- {golem_vm_provider-0.1.9 → golem_vm_provider-0.1.12}/provider/vm/port_manager.py +0 -0
- {golem_vm_provider-0.1.9 → golem_vm_provider-0.1.12}/provider/vm/proxy_manager.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: golem-vm-provider
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.12
|
4
4
|
Summary: VM on Golem Provider Node - Run your own provider node to offer VMs on the Golem Network
|
5
5
|
Keywords: golem,vm,provider,cloud,decentralized
|
6
6
|
Author: Phillip Jensen
|
@@ -82,20 +82,20 @@ sequenceDiagram
|
|
82
82
|
PM-->>S: Verification Result
|
83
83
|
```
|
84
84
|
|
85
|
-
-
|
86
|
-
-
|
87
|
-
-
|
88
|
-
-
|
85
|
+
- Comprehensive port accessibility verification
|
86
|
+
- Real-time status display with progress indicators
|
87
|
+
- Local and external port validation
|
88
|
+
- Automatic port allocation management
|
89
89
|
|
90
90
|
### Future Developments
|
91
91
|
|
92
92
|
The current port verification system uses dedicated port check servers to verify external accessibility. In future releases, this functionality will be integrated into the Golem Network's verifier nodes, providing:
|
93
93
|
|
94
|
-
-
|
95
|
-
-
|
96
|
-
-
|
97
|
-
-
|
98
|
-
-
|
94
|
+
- Decentralized port verification through the network
|
95
|
+
- Increased reliability with multiple verification sources
|
96
|
+
- Consensus-based verification results
|
97
|
+
- Reduced dependency on centralized services
|
98
|
+
- Enhanced security through the network's trust system
|
99
99
|
|
100
100
|
This integration aligns with Golem's vision of a fully decentralized computing platform, moving critical infrastructure services like port verification into the network itself.
|
101
101
|
|
@@ -103,10 +103,10 @@ This integration aligns with Golem's vision of a fully decentralized computing p
|
|
103
103
|
|
104
104
|
The resource management system ensures optimal allocation and utilization of system resources:
|
105
105
|
|
106
|
-
-
|
107
|
-
-
|
108
|
-
-
|
109
|
-
-
|
106
|
+
- Real-time monitoring of CPU, memory, and storage
|
107
|
+
- Intelligent resource allocation with minimum requirement enforcement
|
108
|
+
- Threshold-based resource protection
|
109
|
+
- Automatic resource reclamation
|
110
110
|
|
111
111
|
```mermaid
|
112
112
|
sequenceDiagram
|
@@ -114,7 +114,7 @@ sequenceDiagram
|
|
114
114
|
participant RT as Resource Tracker
|
115
115
|
participant RM as Resource Monitor
|
116
116
|
participant AD as Advertiser
|
117
|
-
|
117
|
+
|
118
118
|
API->>RT: Request Resource Allocation
|
119
119
|
RT->>RM: Check Available Resources
|
120
120
|
RM-->>RT: Resource Status
|
@@ -134,7 +134,7 @@ sequenceDiagram
|
|
134
134
|
participant MP as Multipass
|
135
135
|
participant CI as Cloud Init
|
136
136
|
participant VM as Virtual Machine
|
137
|
-
|
137
|
+
|
138
138
|
API->>MP: Create VM Request
|
139
139
|
MP->>CI: Generate Config
|
140
140
|
CI-->>MP: SSH Configuration
|
@@ -143,10 +143,10 @@ sequenceDiagram
|
|
143
143
|
MP-->>API: VM Info
|
144
144
|
```
|
145
145
|
|
146
|
-
-
|
147
|
-
-
|
148
|
-
-
|
149
|
-
-
|
146
|
+
- Automated VM provisioning with cloud-init
|
147
|
+
- Secure SSH key management
|
148
|
+
- Status monitoring and health checks
|
149
|
+
- Automatic cleanup procedures
|
150
150
|
|
151
151
|
### Network Proxy System
|
152
152
|
|
@@ -158,7 +158,7 @@ sequenceDiagram
|
|
158
158
|
participant PM as Proxy Manager
|
159
159
|
participant P as Proxy
|
160
160
|
participant VM as Virtual Machine
|
161
|
-
|
161
|
+
|
162
162
|
C->>PM: SSH Connection
|
163
163
|
PM->>P: Create Proxy
|
164
164
|
P->>VM: Forward Connection
|
@@ -166,29 +166,31 @@ sequenceDiagram
|
|
166
166
|
P-->>C: Forward Response
|
167
167
|
```
|
168
168
|
|
169
|
-
-
|
170
|
-
-
|
171
|
-
-
|
172
|
-
-
|
169
|
+
- Dynamic port allocation and management
|
170
|
+
- Connection state persistence
|
171
|
+
- Clean connection handling
|
172
|
+
- Automatic proxy cleanup
|
173
173
|
|
174
174
|
## Installation
|
175
175
|
|
176
176
|
1. Prerequisites:
|
177
|
-
|
178
|
-
|
179
|
-
|
177
|
+
|
178
|
+
- Python 3.9+
|
179
|
+
- Multipass
|
180
|
+
- Poetry
|
180
181
|
|
181
182
|
2. Install dependencies:
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
183
|
+
|
184
|
+
```bash
|
185
|
+
cd provider-server
|
186
|
+
poetry install
|
187
|
+
```
|
186
188
|
|
187
189
|
3. Configure environment:
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
190
|
+
```bash
|
191
|
+
cp .env.example .env
|
192
|
+
# Edit .env with your settings
|
193
|
+
```
|
192
194
|
|
193
195
|
## Configuration
|
194
196
|
|
@@ -219,7 +221,7 @@ GOLEM_PROVIDER_PORT_RANGE_END={end_port} # Default: 50900
|
|
219
221
|
GOLEM_PROVIDER_PUBLIC_IP="auto"
|
220
222
|
|
221
223
|
# Discovery Settings
|
222
|
-
GOLEM_PROVIDER_DISCOVERY_URL="http://discovery.golem.network:
|
224
|
+
GOLEM_PROVIDER_DISCOVERY_URL="http://discovery.golem.network:9001"
|
223
225
|
GOLEM_PROVIDER_ADVERTISEMENT_INTERVAL=240
|
224
226
|
```
|
225
227
|
|
@@ -232,6 +234,7 @@ POST /api/v1/vms
|
|
232
234
|
```
|
233
235
|
|
234
236
|
Request:
|
237
|
+
|
235
238
|
```json
|
236
239
|
{
|
237
240
|
"name": "my-webserver",
|
@@ -242,6 +245,7 @@ Request:
|
|
242
245
|
```
|
243
246
|
|
244
247
|
Response:
|
248
|
+
|
245
249
|
```json
|
246
250
|
{
|
247
251
|
"id": "golem-my-webserver-20250219-130424",
|
@@ -259,10 +263,10 @@ Response:
|
|
259
263
|
|
260
264
|
### VM Operations
|
261
265
|
|
262
|
-
-
|
263
|
-
-
|
264
|
-
-
|
265
|
-
-
|
266
|
+
- List VMs: `GET /api/v1/vms`
|
267
|
+
- Get VM Status: `GET /api/v1/vms/{vm_id}`
|
268
|
+
- Delete VM: `DELETE /api/v1/vms/{vm_id}`
|
269
|
+
- Get Access Info: `GET /api/v1/vms/{vm_id}/access`
|
266
270
|
|
267
271
|
## Operations
|
268
272
|
|
@@ -273,10 +277,11 @@ poetry run python run.py
|
|
273
277
|
```
|
274
278
|
|
275
279
|
The provider will:
|
280
|
+
|
276
281
|
1. Verify port accessibility
|
277
|
-
|
278
|
-
|
279
|
-
|
282
|
+
- Check discovery port (7466)
|
283
|
+
- Verify SSH ports (50800-50900)
|
284
|
+
- Display verification progress
|
280
285
|
2. Initialize resource monitoring
|
281
286
|
3. Start the proxy manager
|
282
287
|
4. Begin resource advertisement
|
@@ -290,7 +295,7 @@ sequenceDiagram
|
|
290
295
|
participant RT as Resource Tracker
|
291
296
|
participant AD as Advertiser
|
292
297
|
participant DS as Discovery Service
|
293
|
-
|
298
|
+
|
294
299
|
P->>RT: Initialize
|
295
300
|
RT->>AD: Register Callback
|
296
301
|
loop Every 4 minutes
|
@@ -304,33 +309,34 @@ sequenceDiagram
|
|
304
309
|
### Monitoring
|
305
310
|
|
306
311
|
The provider includes comprehensive logging:
|
307
|
-
|
308
|
-
-
|
309
|
-
-
|
310
|
-
-
|
312
|
+
|
313
|
+
- Resource allocation events
|
314
|
+
- VM lifecycle changes
|
315
|
+
- Network proxy operations
|
316
|
+
- Discovery service interactions
|
311
317
|
|
312
318
|
## Technical Details
|
313
319
|
|
314
320
|
### Security
|
315
321
|
|
316
|
-
-
|
317
|
-
-
|
318
|
-
-
|
319
|
-
-
|
322
|
+
- Resource isolation through Multipass
|
323
|
+
- Secure SSH key provisioning
|
324
|
+
- Connection proxying for network isolation
|
325
|
+
- Rate limiting on API endpoints
|
320
326
|
|
321
327
|
### Performance
|
322
328
|
|
323
|
-
-
|
324
|
-
-
|
325
|
-
-
|
326
|
-
-
|
329
|
+
- Asynchronous operations with FastAPI
|
330
|
+
- Efficient resource tracking
|
331
|
+
- Connection pooling for proxy servers
|
332
|
+
- Optimized VM provisioning
|
327
333
|
|
328
334
|
### Resource Protection
|
329
335
|
|
330
|
-
-
|
331
|
-
-
|
332
|
-
-
|
333
|
-
-
|
336
|
+
- CPU threshold: 90%
|
337
|
+
- Memory threshold: 85%
|
338
|
+
- Storage threshold: 90%
|
339
|
+
- Minimum resource guarantees
|
334
340
|
|
335
341
|
## Troubleshooting
|
336
342
|
|
@@ -339,33 +345,37 @@ Common issues and solutions:
|
|
339
345
|
### Port Verification Issues
|
340
346
|
|
341
347
|
1. Provider Port ({provider_port}) Issues
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
348
|
+
|
349
|
+
- Check if port is already in use
|
350
|
+
- Verify port forwarding on router
|
351
|
+
- Check firewall rules
|
352
|
+
- Ensure provider is accessible to requestors
|
346
353
|
|
347
354
|
2. VM Access Port Range ({start_port}-{end_port}) Issues
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
355
|
+
|
356
|
+
- Verify port range availability
|
357
|
+
- Check for port conflicts
|
358
|
+
- Configure router port forwarding
|
359
|
+
- Review firewall settings for range
|
352
360
|
|
353
361
|
3. External Access Issues
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
362
|
+
- Verify internet connectivity
|
363
|
+
- Check port check servers are accessible
|
364
|
+
- Review router NAT/firewall settings
|
365
|
+
- Consider using alternative port check servers
|
358
366
|
|
359
367
|
### Port Verification Monitoring
|
360
368
|
|
361
369
|
The provider includes real-time port verification status:
|
362
|
-
|
363
|
-
-
|
364
|
-
-
|
365
|
-
-
|
366
|
-
-
|
370
|
+
|
371
|
+
- Visual progress indicators
|
372
|
+
- Port accessibility status
|
373
|
+
- Critical issues detection
|
374
|
+
- Quick fix suggestions
|
375
|
+
- Links to troubleshooting documentation
|
367
376
|
|
368
377
|
Example status output:
|
378
|
+
|
369
379
|
```bash
|
370
380
|
🌟 Port Verification Status
|
371
381
|
==========================
|
@@ -376,17 +386,19 @@ Example status output:
|
|
376
386
|
```
|
377
387
|
|
378
388
|
### Resource Allocation Issues
|
379
|
-
|
380
|
-
-
|
381
|
-
-
|
382
|
-
-
|
389
|
+
|
390
|
+
- Check system resource availability
|
391
|
+
- Verify minimum requirements
|
392
|
+
- Monitor resource thresholds
|
393
|
+
- Review resource allocation logs
|
383
394
|
|
384
395
|
### Discovery Service Issues
|
385
|
-
|
386
|
-
-
|
387
|
-
-
|
388
|
-
-
|
389
|
-
-
|
396
|
+
|
397
|
+
- Check network connectivity
|
398
|
+
- Verify discovery service URL
|
399
|
+
- Check advertisement interval
|
400
|
+
- Monitor advertisement responses
|
401
|
+
- Verify provider registration status
|
390
402
|
|
391
403
|
## Contributing
|
392
404
|
|
@@ -44,20 +44,20 @@ sequenceDiagram
|
|
44
44
|
PM-->>S: Verification Result
|
45
45
|
```
|
46
46
|
|
47
|
-
-
|
48
|
-
-
|
49
|
-
-
|
50
|
-
-
|
47
|
+
- Comprehensive port accessibility verification
|
48
|
+
- Real-time status display with progress indicators
|
49
|
+
- Local and external port validation
|
50
|
+
- Automatic port allocation management
|
51
51
|
|
52
52
|
### Future Developments
|
53
53
|
|
54
54
|
The current port verification system uses dedicated port check servers to verify external accessibility. In future releases, this functionality will be integrated into the Golem Network's verifier nodes, providing:
|
55
55
|
|
56
|
-
-
|
57
|
-
-
|
58
|
-
-
|
59
|
-
-
|
60
|
-
-
|
56
|
+
- Decentralized port verification through the network
|
57
|
+
- Increased reliability with multiple verification sources
|
58
|
+
- Consensus-based verification results
|
59
|
+
- Reduced dependency on centralized services
|
60
|
+
- Enhanced security through the network's trust system
|
61
61
|
|
62
62
|
This integration aligns with Golem's vision of a fully decentralized computing platform, moving critical infrastructure services like port verification into the network itself.
|
63
63
|
|
@@ -65,10 +65,10 @@ This integration aligns with Golem's vision of a fully decentralized computing p
|
|
65
65
|
|
66
66
|
The resource management system ensures optimal allocation and utilization of system resources:
|
67
67
|
|
68
|
-
-
|
69
|
-
-
|
70
|
-
-
|
71
|
-
-
|
68
|
+
- Real-time monitoring of CPU, memory, and storage
|
69
|
+
- Intelligent resource allocation with minimum requirement enforcement
|
70
|
+
- Threshold-based resource protection
|
71
|
+
- Automatic resource reclamation
|
72
72
|
|
73
73
|
```mermaid
|
74
74
|
sequenceDiagram
|
@@ -76,7 +76,7 @@ sequenceDiagram
|
|
76
76
|
participant RT as Resource Tracker
|
77
77
|
participant RM as Resource Monitor
|
78
78
|
participant AD as Advertiser
|
79
|
-
|
79
|
+
|
80
80
|
API->>RT: Request Resource Allocation
|
81
81
|
RT->>RM: Check Available Resources
|
82
82
|
RM-->>RT: Resource Status
|
@@ -96,7 +96,7 @@ sequenceDiagram
|
|
96
96
|
participant MP as Multipass
|
97
97
|
participant CI as Cloud Init
|
98
98
|
participant VM as Virtual Machine
|
99
|
-
|
99
|
+
|
100
100
|
API->>MP: Create VM Request
|
101
101
|
MP->>CI: Generate Config
|
102
102
|
CI-->>MP: SSH Configuration
|
@@ -105,10 +105,10 @@ sequenceDiagram
|
|
105
105
|
MP-->>API: VM Info
|
106
106
|
```
|
107
107
|
|
108
|
-
-
|
109
|
-
-
|
110
|
-
-
|
111
|
-
-
|
108
|
+
- Automated VM provisioning with cloud-init
|
109
|
+
- Secure SSH key management
|
110
|
+
- Status monitoring and health checks
|
111
|
+
- Automatic cleanup procedures
|
112
112
|
|
113
113
|
### Network Proxy System
|
114
114
|
|
@@ -120,7 +120,7 @@ sequenceDiagram
|
|
120
120
|
participant PM as Proxy Manager
|
121
121
|
participant P as Proxy
|
122
122
|
participant VM as Virtual Machine
|
123
|
-
|
123
|
+
|
124
124
|
C->>PM: SSH Connection
|
125
125
|
PM->>P: Create Proxy
|
126
126
|
P->>VM: Forward Connection
|
@@ -128,29 +128,31 @@ sequenceDiagram
|
|
128
128
|
P-->>C: Forward Response
|
129
129
|
```
|
130
130
|
|
131
|
-
-
|
132
|
-
-
|
133
|
-
-
|
134
|
-
-
|
131
|
+
- Dynamic port allocation and management
|
132
|
+
- Connection state persistence
|
133
|
+
- Clean connection handling
|
134
|
+
- Automatic proxy cleanup
|
135
135
|
|
136
136
|
## Installation
|
137
137
|
|
138
138
|
1. Prerequisites:
|
139
|
-
|
140
|
-
|
141
|
-
|
139
|
+
|
140
|
+
- Python 3.9+
|
141
|
+
- Multipass
|
142
|
+
- Poetry
|
142
143
|
|
143
144
|
2. Install dependencies:
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
145
|
+
|
146
|
+
```bash
|
147
|
+
cd provider-server
|
148
|
+
poetry install
|
149
|
+
```
|
148
150
|
|
149
151
|
3. Configure environment:
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
152
|
+
```bash
|
153
|
+
cp .env.example .env
|
154
|
+
# Edit .env with your settings
|
155
|
+
```
|
154
156
|
|
155
157
|
## Configuration
|
156
158
|
|
@@ -181,7 +183,7 @@ GOLEM_PROVIDER_PORT_RANGE_END={end_port} # Default: 50900
|
|
181
183
|
GOLEM_PROVIDER_PUBLIC_IP="auto"
|
182
184
|
|
183
185
|
# Discovery Settings
|
184
|
-
GOLEM_PROVIDER_DISCOVERY_URL="http://discovery.golem.network:
|
186
|
+
GOLEM_PROVIDER_DISCOVERY_URL="http://discovery.golem.network:9001"
|
185
187
|
GOLEM_PROVIDER_ADVERTISEMENT_INTERVAL=240
|
186
188
|
```
|
187
189
|
|
@@ -194,6 +196,7 @@ POST /api/v1/vms
|
|
194
196
|
```
|
195
197
|
|
196
198
|
Request:
|
199
|
+
|
197
200
|
```json
|
198
201
|
{
|
199
202
|
"name": "my-webserver",
|
@@ -204,6 +207,7 @@ Request:
|
|
204
207
|
```
|
205
208
|
|
206
209
|
Response:
|
210
|
+
|
207
211
|
```json
|
208
212
|
{
|
209
213
|
"id": "golem-my-webserver-20250219-130424",
|
@@ -221,10 +225,10 @@ Response:
|
|
221
225
|
|
222
226
|
### VM Operations
|
223
227
|
|
224
|
-
-
|
225
|
-
-
|
226
|
-
-
|
227
|
-
-
|
228
|
+
- List VMs: `GET /api/v1/vms`
|
229
|
+
- Get VM Status: `GET /api/v1/vms/{vm_id}`
|
230
|
+
- Delete VM: `DELETE /api/v1/vms/{vm_id}`
|
231
|
+
- Get Access Info: `GET /api/v1/vms/{vm_id}/access`
|
228
232
|
|
229
233
|
## Operations
|
230
234
|
|
@@ -235,10 +239,11 @@ poetry run python run.py
|
|
235
239
|
```
|
236
240
|
|
237
241
|
The provider will:
|
242
|
+
|
238
243
|
1. Verify port accessibility
|
239
|
-
|
240
|
-
|
241
|
-
|
244
|
+
- Check discovery port (7466)
|
245
|
+
- Verify SSH ports (50800-50900)
|
246
|
+
- Display verification progress
|
242
247
|
2. Initialize resource monitoring
|
243
248
|
3. Start the proxy manager
|
244
249
|
4. Begin resource advertisement
|
@@ -252,7 +257,7 @@ sequenceDiagram
|
|
252
257
|
participant RT as Resource Tracker
|
253
258
|
participant AD as Advertiser
|
254
259
|
participant DS as Discovery Service
|
255
|
-
|
260
|
+
|
256
261
|
P->>RT: Initialize
|
257
262
|
RT->>AD: Register Callback
|
258
263
|
loop Every 4 minutes
|
@@ -266,33 +271,34 @@ sequenceDiagram
|
|
266
271
|
### Monitoring
|
267
272
|
|
268
273
|
The provider includes comprehensive logging:
|
269
|
-
|
270
|
-
-
|
271
|
-
-
|
272
|
-
-
|
274
|
+
|
275
|
+
- Resource allocation events
|
276
|
+
- VM lifecycle changes
|
277
|
+
- Network proxy operations
|
278
|
+
- Discovery service interactions
|
273
279
|
|
274
280
|
## Technical Details
|
275
281
|
|
276
282
|
### Security
|
277
283
|
|
278
|
-
-
|
279
|
-
-
|
280
|
-
-
|
281
|
-
-
|
284
|
+
- Resource isolation through Multipass
|
285
|
+
- Secure SSH key provisioning
|
286
|
+
- Connection proxying for network isolation
|
287
|
+
- Rate limiting on API endpoints
|
282
288
|
|
283
289
|
### Performance
|
284
290
|
|
285
|
-
-
|
286
|
-
-
|
287
|
-
-
|
288
|
-
-
|
291
|
+
- Asynchronous operations with FastAPI
|
292
|
+
- Efficient resource tracking
|
293
|
+
- Connection pooling for proxy servers
|
294
|
+
- Optimized VM provisioning
|
289
295
|
|
290
296
|
### Resource Protection
|
291
297
|
|
292
|
-
-
|
293
|
-
-
|
294
|
-
-
|
295
|
-
-
|
298
|
+
- CPU threshold: 90%
|
299
|
+
- Memory threshold: 85%
|
300
|
+
- Storage threshold: 90%
|
301
|
+
- Minimum resource guarantees
|
296
302
|
|
297
303
|
## Troubleshooting
|
298
304
|
|
@@ -301,33 +307,37 @@ Common issues and solutions:
|
|
301
307
|
### Port Verification Issues
|
302
308
|
|
303
309
|
1. Provider Port ({provider_port}) Issues
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
310
|
+
|
311
|
+
- Check if port is already in use
|
312
|
+
- Verify port forwarding on router
|
313
|
+
- Check firewall rules
|
314
|
+
- Ensure provider is accessible to requestors
|
308
315
|
|
309
316
|
2. VM Access Port Range ({start_port}-{end_port}) Issues
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
317
|
+
|
318
|
+
- Verify port range availability
|
319
|
+
- Check for port conflicts
|
320
|
+
- Configure router port forwarding
|
321
|
+
- Review firewall settings for range
|
314
322
|
|
315
323
|
3. External Access Issues
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
324
|
+
- Verify internet connectivity
|
325
|
+
- Check port check servers are accessible
|
326
|
+
- Review router NAT/firewall settings
|
327
|
+
- Consider using alternative port check servers
|
320
328
|
|
321
329
|
### Port Verification Monitoring
|
322
330
|
|
323
331
|
The provider includes real-time port verification status:
|
324
|
-
|
325
|
-
-
|
326
|
-
-
|
327
|
-
-
|
328
|
-
-
|
332
|
+
|
333
|
+
- Visual progress indicators
|
334
|
+
- Port accessibility status
|
335
|
+
- Critical issues detection
|
336
|
+
- Quick fix suggestions
|
337
|
+
- Links to troubleshooting documentation
|
329
338
|
|
330
339
|
Example status output:
|
340
|
+
|
331
341
|
```bash
|
332
342
|
🌟 Port Verification Status
|
333
343
|
==========================
|
@@ -338,17 +348,19 @@ Example status output:
|
|
338
348
|
```
|
339
349
|
|
340
350
|
### Resource Allocation Issues
|
341
|
-
|
342
|
-
-
|
343
|
-
-
|
344
|
-
-
|
351
|
+
|
352
|
+
- Check system resource availability
|
353
|
+
- Verify minimum requirements
|
354
|
+
- Monitor resource thresholds
|
355
|
+
- Review resource allocation logs
|
345
356
|
|
346
357
|
### Discovery Service Issues
|
347
|
-
|
348
|
-
-
|
349
|
-
-
|
350
|
-
-
|
351
|
-
-
|
358
|
+
|
359
|
+
- Check network connectivity
|
360
|
+
- Verify discovery service URL
|
361
|
+
- Check advertisement interval
|
362
|
+
- Monitor advertisement responses
|
363
|
+
- Verify provider registration status
|
352
364
|
|
353
365
|
## Contributing
|
354
366
|
|
@@ -45,7 +45,7 @@ class Settings(BaseSettings):
|
|
45
45
|
return identity.get_or_create_identity()
|
46
46
|
|
47
47
|
# Discovery Service Settings
|
48
|
-
DISCOVERY_URL: str = "http://195.201.39.101:
|
48
|
+
DISCOVERY_URL: str = "http://195.201.39.101:9001"
|
49
49
|
ADVERTISEMENT_INTERVAL: int = 240 # seconds
|
50
50
|
|
51
51
|
# VM Settings
|
@@ -96,25 +96,83 @@ class Settings(BaseSettings):
|
|
96
96
|
if v:
|
97
97
|
path = v
|
98
98
|
else:
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
99
|
+
import platform
|
100
|
+
import subprocess
|
101
|
+
|
102
|
+
system = platform.system().lower()
|
103
|
+
binary_name = "multipass.exe" if system == "windows" else "multipass"
|
104
|
+
|
105
|
+
# Try to find multipass based on OS
|
106
|
+
if system == "linux":
|
107
|
+
# First try to find snap
|
108
|
+
try:
|
109
|
+
snap_result = subprocess.run(
|
110
|
+
["which", "snap"],
|
111
|
+
capture_output=True,
|
112
|
+
text=True
|
113
|
+
)
|
114
|
+
if snap_result.returncode == 0:
|
115
|
+
# If snap exists, check if multipass is installed
|
116
|
+
snap_path = "/snap/bin/multipass"
|
117
|
+
if os.path.isfile(snap_path) and os.access(snap_path, os.X_OK):
|
118
|
+
return snap_path
|
119
|
+
except subprocess.SubprocessError:
|
120
|
+
pass
|
121
|
+
|
122
|
+
# Common Linux paths
|
123
|
+
search_paths = [
|
124
|
+
"/usr/local/bin",
|
125
|
+
"/usr/bin",
|
126
|
+
"/snap/bin"
|
127
|
+
]
|
128
|
+
|
129
|
+
elif system == "darwin": # macOS
|
130
|
+
search_paths = [
|
131
|
+
"/opt/homebrew/bin", # M1 Mac
|
132
|
+
"/usr/local/bin", # Intel Mac
|
133
|
+
"/opt/local/bin" # MacPorts
|
134
|
+
]
|
135
|
+
|
136
|
+
elif system == "windows":
|
137
|
+
search_paths = [
|
138
|
+
os.path.expandvars(r"%ProgramFiles%\Multipass"),
|
139
|
+
os.path.expandvars(r"%ProgramFiles(x86)%\Multipass"),
|
140
|
+
os.path.expandvars(r"%LocalAppData%\Multipass")
|
141
|
+
]
|
142
|
+
|
143
|
+
else:
|
144
|
+
search_paths = ["/usr/local/bin", "/usr/bin"]
|
145
|
+
|
146
|
+
# Search for multipass binary in OS-specific paths
|
109
147
|
for directory in search_paths:
|
110
148
|
path = os.path.join(directory, binary_name)
|
111
149
|
if os.path.isfile(path) and os.access(path, os.X_OK):
|
112
150
|
return path
|
113
151
|
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
152
|
+
# OS-specific installation instructions
|
153
|
+
if system == "linux":
|
154
|
+
raise ValueError(
|
155
|
+
"Multipass binary not found. Please install using:\n"
|
156
|
+
"sudo snap install multipass\n"
|
157
|
+
"Or set GOLEM_PROVIDER_MULTIPASS_BINARY_PATH to your Multipass binary path."
|
158
|
+
)
|
159
|
+
elif system == "darwin":
|
160
|
+
raise ValueError(
|
161
|
+
"Multipass binary not found. Please install using:\n"
|
162
|
+
"brew install multipass\n"
|
163
|
+
"Or set GOLEM_PROVIDER_MULTIPASS_BINARY_PATH to your Multipass binary path."
|
164
|
+
)
|
165
|
+
elif system == "windows":
|
166
|
+
raise ValueError(
|
167
|
+
"Multipass binary not found. Please install from:\n"
|
168
|
+
"Microsoft Store or https://multipass.run/download/windows\n"
|
169
|
+
"Or set GOLEM_PROVIDER_MULTIPASS_BINARY_PATH to your Multipass binary path."
|
170
|
+
)
|
171
|
+
else:
|
172
|
+
raise ValueError(
|
173
|
+
"Multipass binary not found. Please install Multipass or set "
|
174
|
+
"GOLEM_PROVIDER_MULTIPASS_BINARY_PATH to your Multipass binary path."
|
175
|
+
)
|
118
176
|
|
119
177
|
# Validate the path
|
120
178
|
if not os.path.isfile(path):
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "golem-vm-provider"
|
3
|
-
version = "0.1.
|
3
|
+
version = "0.1.12"
|
4
4
|
description = "VM on Golem Provider Node - Run your own provider node to offer VMs on the Golem Network"
|
5
5
|
authors = ["Phillip Jensen <phillip+vm-on-golem@golemgrid.com>"]
|
6
6
|
readme = "README.md"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|