필드 테스트를 위해 edge OpenAI-compatible 경로와 node adapter 설정을 확장하고, Jenkins 바이너리 빌드 및 control-plane/web compose 배포 구성을 함께 정리한다.
171 lines
5.1 KiB
Markdown
171 lines
5.1 KiB
Markdown
# Dev Field Deployment
|
|
|
|
이 문서는 dev 필드 테스트 기준의 배포 단위를 정리한다. Control Plane과 Web은 compose 서비스로 묶고, Edge와 Node는 호스트에서 직접 실행하는 단일 바이너리로 배포한다.
|
|
|
|
## 배포 단위
|
|
|
|
```text
|
|
control host
|
|
docker compose
|
|
- postgres
|
|
- redis
|
|
- control-plane
|
|
- web
|
|
|
|
edge host
|
|
iop-edge binary
|
|
edge.yaml
|
|
|
|
node host
|
|
iop-node binary
|
|
node.yaml
|
|
```
|
|
|
|
Edge와 Node는 Docker 이미지로 만들지 않는다. Jenkins는 repo의 shell entrypoint를 호출해 Edge/Node 바이너리 산출물을 만든다.
|
|
|
|
## Edge/Node 바이너리 빌드
|
|
|
|
기본 빌드는 현재 호스트의 `GOOS/GOARCH` 대상으로 `edge`, `node`를 모두 만든다.
|
|
|
|
```bash
|
|
bin/build/field-binaries.sh
|
|
```
|
|
|
|
Jenkins에서 Linux amd64/arm64를 함께 만들 때는 다음처럼 호출한다.
|
|
|
|
```bash
|
|
TARGETS="linux/amd64 linux/arm64" \
|
|
VERSION="${BUILD_TAG}" \
|
|
COMMIT="${GIT_COMMIT}" \
|
|
bin/build/field-binaries.sh
|
|
```
|
|
|
|
산출물은 `dist/field/<version>/<goos>-<goarch>/` 아래에 생성된다.
|
|
|
|
```text
|
|
iop-edge
|
|
iop-edge.sha256
|
|
iop-node
|
|
iop-node.sha256
|
|
SHA256SUMS
|
|
manifest.env
|
|
```
|
|
|
|
## Control Plane/Web Compose
|
|
|
|
루트의 `.env.example`을 참고해 필요한 값만 `.env`로 복사해 조정한다.
|
|
|
|
```bash
|
|
cp .env.example .env
|
|
docker compose up --build -d
|
|
```
|
|
|
|
서비스 포트 기본값은 다음과 같다.
|
|
|
|
| Service | Port | Purpose |
|
|
|---|---:|---|
|
|
| web | 3000 | Web Portal |
|
|
| control-plane | 9080 | HTTP health/bootstrap |
|
|
| control-plane wire | 19080 | IOP wire endpoint |
|
|
| postgres | 5432 | Control Plane DB |
|
|
| redis | 6379 | Control Plane cache/queue 후보 |
|
|
|
|
현재 Control Plane 구현은 DB/Redis를 아직 사용하지 않지만, dev compose에는 먼저 포함해 이후 schema, queue, audit, event 처리 작업을 같은 배포 단위 안에서 진행할 수 있게 둔다.
|
|
|
|
헬스체크는 다음 명령으로 확인한다.
|
|
|
|
```bash
|
|
docker compose ps
|
|
curl -fsS http://localhost:${IOP_CONTROL_PLANE_HTTP_PORT:-9080}/healthz
|
|
curl -fsS http://localhost:${IOP_CONTROL_PLANE_HTTP_PORT:-9080}/readyz
|
|
```
|
|
|
|
## Edge 실행
|
|
|
|
Jenkins 산출물의 `iop-edge`를 edge host에 배포한 뒤, 초기에는 dev 환경의 `edge.yaml`을 지정해 직접 실행한다.
|
|
|
|
```bash
|
|
./iop-edge serve --config /etc/iop/edge.yaml
|
|
```
|
|
|
|
콘솔 기반 현장 smoke가 필요하면 다음처럼 실행한다.
|
|
|
|
```bash
|
|
./iop-edge console --config /etc/iop/edge.yaml
|
|
```
|
|
|
|
dev 초기 단계에서는 repo의 `configs/edge.yaml`을 기준으로 포트와 node token을 맞춘다. 이후 Control Plane enrollment/config sync가 붙으면 edge 설정 파일은 bootstrap 정보만 남기는 방향으로 줄인다.
|
|
|
|
## Node 실행
|
|
|
|
Jenkins 산출물의 `iop-node`를 node host에 배포한 뒤, 초기에는 edge 주소와 token이 들어 있는 `node.yaml`로 직접 실행한다.
|
|
|
|
```bash
|
|
./iop-node serve --config /etc/iop/node.yaml
|
|
```
|
|
|
|
repo root에서 수동으로 검증할 때는 기존 helper를 사용할 수 있다.
|
|
|
|
```bash
|
|
IOP_EDGE_ADDR=<edge-host>:9090 ./bin/node.sh
|
|
```
|
|
|
|
## Field Smoke
|
|
|
|
최소 확인 순서는 다음을 기준으로 한다.
|
|
|
|
1. `docker compose ps`에서 `postgres`, `redis`, `control-plane`, `web`이 healthy/running인지 확인한다.
|
|
2. edge host에서 `iop-edge console --config /etc/iop/edge.yaml`을 실행한다.
|
|
3. node host에서 `iop-node serve --config /etc/iop/node.yaml`을 실행한다.
|
|
4. edge console에서 `/nodes`로 node 등록을 확인한다.
|
|
5. 메시지 2회를 보내고 각 요청의 start, message, complete event가 edge console에 표시되는지 확인한다.
|
|
6. `/capabilities`, `/transport`, `/sessions`를 실행해 command 응답을 확인한다.
|
|
|
|
보조 자동 smoke는 repo root에서 다음 명령으로 실행한다.
|
|
|
|
```bash
|
|
make test-e2e
|
|
```
|
|
|
|
이 명령은 보조 확인이며, 필드 배포 완료 기준은 실제 edge/node 바이너리 실행 흐름 확인이다.
|
|
|
|
## 다음 결정 지점
|
|
|
|
### Edge/Node setup CLI
|
|
|
|
다음 구현 단계에서는 Edge/Node 바이너리에 `setup` 명령을 추가한다. 공식 운영 경로는 하나로 고정한다.
|
|
|
|
```bash
|
|
sudo iop-edge setup --config /etc/iop/edge.yaml --enable --start
|
|
sudo iop-node setup --config /etc/iop/node.yaml --enable --start
|
|
```
|
|
|
|
`setup`은 다음을 담당한다.
|
|
|
|
- 실행 user/group 준비
|
|
- `/etc/iop`와 `/var/lib/iop/{edge,node}` 디렉터리 준비
|
|
- 설정 파일이 없을 때만 기본 템플릿 생성
|
|
- systemd unit 생성 또는 갱신
|
|
- `systemctl daemon-reload`
|
|
- 옵션에 따른 `enable`, `start`, `restart`
|
|
|
|
별도 `render`, `service install`, `service status` 명령은 초기 범위에 넣지 않는다. 검토와 CI 확인은 `setup --dry-run`으로 흡수하고, 상태/로그/재시작은 `systemctl`과 `journalctl`을 기준 운영 도구로 둔다.
|
|
|
|
초기 CLI 표면은 다음 정도로 제한한다.
|
|
|
|
```text
|
|
iop-edge serve
|
|
iop-edge console
|
|
iop-edge setup
|
|
iop-edge config print
|
|
iop-edge config check
|
|
iop-edge version
|
|
|
|
iop-node serve
|
|
iop-node setup
|
|
iop-node config print
|
|
iop-node config check
|
|
iop-node version
|
|
```
|
|
|
|
구현 시 `setup`은 여러 번 실행해도 같은 결과로 수렴해야 한다. 기존 설정 파일은 기본적으로 덮어쓰지 않고, 강제 갱신이 필요하면 명시 옵션을 별도로 둔다.
|