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 | 에이전트나 중앙이 오류로 답함 |