CLI
geo-mlops-edge 명령: run, config, status, sync, queue, models, register
geo-mlops-edge 는 edge 엑스트라와 함께 설치. run 은 서비스가 실행하는 명령. 나머지는 데이터가 중앙에 업로드되지 않을 때 장비에서 원인을 찾는 진단 명령.
geo-mlops-edge [--version] [-c CONFIG] {run,config,status,sync,queue,models,register} ...
-c,--config는 하위 명령 앞뒤 어디에나 지정 가능(geo-mlops-edge run --config …도 가능). 생략하면 설정 파일 탐색 순서를 따름.status·sync·queue·models는 DB 를 직접 열지 않고 실행 중인 에이전트의 로컬 API 에 요청. 에이전트가 사용하는 SQLite 파일에 다른 프로세스가 동시에 접근하는 사고 방지 목적. 따라서 설정 파일의api.host·api.port·api.token도 함께 읽음.
| 명령 | 기능 |
|---|---|
run | 에이전트 실행(서비스 진입점) |
config | 적용된 설정을 JSON 으로 출력 |
status | 실행 중인 에이전트의 상태 |
sync | 즉시 큐 비우기 요청 |
queue [--state S] [--limit N] | 대기 중인 항목 조회 |
models [--pull NAME --version-tag V] | 캐시된 모델 조회 또는 내려받기 |
register [--location L] | 에이전트 없이 중앙에 등록만 |
run
geo-mlops-edge --config /etc/geo-mlops/edge.yaml run
SIGINT/SIGTERM 을 수신하면 정리 작업 후 종료. 종료 코드는 0(정지 요청), 3(재시작 요청), 4(로컬 API 포트를 열지 못함).
config
환경 변수까지 반영한 실제 적용값 출력.
geo-mlops-edge -c /etc/geo-mlops/edge.yaml config
{
"central": {
"base_url": "https://mlops.example.com",
"token": "",
"timeout_s": 10.0,
"verify_tls": true
},
"device": { "id": "edge-bench-01", "location": "bench" },
"data_dir": "/var/lib/geo-mlops-edge",
"retention": { "max_bytes": 53687091200, "max_age_days": 30, "free_disk_min_bytes": 5368709120 },
"...": "..."
}
status
사용자 조치가 필요하면 JSON 앞에 !! 로 시작하는 문장을 먼저 출력. 아래는 토큰이 거부된 장비의 출력.
!! Central rejected this device's token. Write a new token into the agent's configuration on this machine and restart the service -- command polling has stopped too, so this cannot be fixed remotely.
{
"device": { "id": "edge-bench-01", "registered": false, "...": "..." },
"link": {
"state": "auth_failed",
"error": "401 invalid or expired edge token (POST https://mlops.example.com/api/v1/edge/telemetry)"
},
"sync": { "state": "auth_failed", "...": "..." },
"...": "..."
}
에이전트가 실행 중이 아니면 종료 코드 3 과 함께 다음 메시지 출력.
no agent is listening on http://127.0.0.1:8600 (is the service running?)
sync
geo-mlops-edge sync
{ "requested": true }
업로더에 전송 시도를 요청할 뿐. 링크가 online 이 아니거나 전송 시간대·CPU 한도 조건에 해당하면 전송하지 않음.
queue
geo-mlops-edge queue --state failed --limit 20
--state 에는 pending·uploading·failed 지정 가능, --limit 기본값은 20. 결과의 각 항목에 attempts 와 last_error 가 있어 전송이 중단된 원인 확인 가능.
models
geo-mlops-edge models # 캐시 목록과 활성 모델
geo-mlops-edge models --pull helmet-detector --version-tag 2 # 내려받아 활성화
--pull 에는 --version-tag 필수. 내려받기는 실행 중인 에이전트가 수행하므로 에이전트가 실행 중이어야 함.
register
에이전트를 실행하지 않고 등록 요청만 전송. 새 현장에서 토큰과 주소를 확인할 때 사용.
GEO_EDGE_CENTRAL__TOKEN=<device-token> geo-mlops-edge -c /etc/geo-mlops/edge.yaml register --location line-1
{ "id": "edge-bench-01", "status": "ACTIVE" }
central.base_url 이나 토큰이 없으면 종료 코드 2, 중앙이 거부하면 registration failed: … 와 종료 코드 4.
| 종료 코드(진단 명령) | 뜻 |
|---|---|
0 | 성공 |
2 | 인자·설정 부족 |
3 | 로컬 에이전트가 응답하지 않음 |
4 | 에이전트나 중앙이 오류를 반환함 |