Skip to content

BREV-8930 Add NAVER Cloud Platform VM provider support#112

Open
carterabdallahbrev wants to merge 3 commits intomainfrom
codex/local-20260421175940-naver-provider
Open

BREV-8930 Add NAVER Cloud Platform VM provider support#112
carterabdallahbrev wants to merge 3 commits intomainfrom
codex/local-20260421175940-naver-provider

Conversation

@carterabdallahbrev
Copy link
Copy Markdown

@carterabdallahbrev carterabdallahbrev commented Apr 21, 2026

Ticket: LOCAL-20260421175940

Title: Add NAVER Cloud Platform VM provider support
Labels: provider, naver, cloud, api
Priority: Medium
Created: 2026-04-21T17:59:40Z
Linear URL: https://linear.app/nvidia/issue/BREV-8930/add-naver-cloud-platform-vm-provider-support


Description

Implement a NAVER Cloud Platform provider for the Brev Cloud SDK that can create and manage cloud VM/server instances through NAVER Cloud Platform's VPC Server APIs. Use the official Naver API documentation as the source of truth, starting from https://api.ncloud-docs.com/docs/en/api-overview and the VPC Server create/list/detail/terminate endpoints.

Acceptance criteria:

  • Add a provider package under v1/providers for NAVER Cloud Platform following existing provider conventions.
  • Support credential validation/signing for NAVER's NCP Signature V2 headers using access key and secret key.
  • Implement VM/server instance create, get/list, terminate/delete, and instance type/location/image discovery behavior to the extent the SDK interfaces require.
  • Use Naver VPC Server APIs such as /vserver/v2/createServerInstances, /getServerInstanceList, /getServerInstanceDetail, /terminateServerInstances, and catalog/list endpoints.
  • Add focused unit tests for request signing, request construction, response parsing/state mapping, validation, and lifecycle behavior using fake HTTP servers where possible.
  • Do not require real NAVER credentials or network calls in unit tests.

Plan

Files to change

  • v1/providers/naver/client.go - add credential/client construction, options for tests, NCP Signature V2 request signing, shared request/response handling, and provider identity.
  • v1/providers/naver/capabilities.go - declare supported NAVER VM lifecycle capabilities.
  • v1/providers/naver/location.go - implement region discovery from /vserver/v2/getRegionList.
  • v1/providers/naver/image.go - implement image discovery from /vserver/v2/getServerImageProductList.
  • v1/providers/naver/instancetype.go - implement instance type discovery from /vserver/v2/getServerProductList.
  • v1/providers/naver/instance.go - implement import login key, create, get, list, terminate, reboot, stop, start, conversion, and status mapping.
  • v1/providers/naver/*_test.go - add fake-server unit coverage for signing, request construction, response parsing, filters, and status conversions.

New files

  • v1/providers/naver/client_test.go - verifies NCP Signature V2 and auth headers.
  • v1/providers/naver/instance_test.go - verifies create/get/list/terminate behavior and lifecycle mapping.
  • v1/providers/naver/instancetype_test.go - verifies catalog conversion and filtering.
  • v1/providers/naver/location_test.go - verifies region conversion.
  • v1/providers/naver/image_test.go - verifies image conversion and filtering.

Database changes

  • None.

Implementation steps

  1. Add failing unit tests using httptest.Server; ensure no real NAVER credentials or network calls are required.
  2. Add NaverCredential and NaverClient with provider ID naver, global API type, default base URL https://ncloud.apigw.ntruss.com, and deterministic tenant ID derived from the access key.
  3. Implement a small HTTP transport helper that signs the path plus encoded query string using NAVER's Signature V2 format: METHOD + "\n" + pathWithQuery + "\n" + timestamp + "\n" + accessKey, HMAC-SHA256 with secret key, Base64 encoded.
  4. Implement typed response structs for the VPC Server endpoints needed by the SDK, always requesting responseFormatType=json and treating non-zero NAVER return codes as errors.
  5. Map SDK create attributes into NAVER create parameters: regionCode, vpcNo, subnetNo, image code/no, server product/spec code, name, user data, key pair/imported login key, and network interface order 0.
  6. Convert NAVER server instances into v1.Instance, preserving cloud IDs, names, status, IPs, image/product codes, VPC/subnet, location, disk, SSH defaults, and stable instance type IDs.
  7. Implement catalog/list methods with SDK filters for locations, image IDs, architectures, and instance type names.
  8. Run the focused NAVER tests, then make test; format with gofmt.

Test command

go test ./v1/providers/naver for red/green on the new provider, then make test for repository verification.

Risks / notes

  • NAVER public IP association is a separate API; this first VM lifecycle implementation reports a public IP when NAVER returns one but does not allocate/associate a new public IP.
  • NAVER VPC creation requires existing VPC/subnet identifiers through CreateInstanceAttrs.VPCID and CreateInstanceAttrs.SubnetID.
  • Some NAVER GPU product metadata is encoded in product codes/descriptions; conversion uses explicit API fields when available and conservative parsing for GPU hints.

Tests to Write

  • v1/providers/naver/client_test.go - auth header/signature generation and credential client construction.
  • v1/providers/naver/location_test.go - region endpoint conversion into SDK locations.
  • v1/providers/naver/image_test.go - image product conversion and architecture/id filtering.
  • v1/providers/naver/instancetype_test.go - server product conversion, GPU parsing, location/type filtering, and stable IDs.
  • v1/providers/naver/instance_test.go - login key import, server create request mapping, instance conversion, get/list/terminate flows.

Test Results (Red)

Command: go test ./v1/providers/naver

Result: blocked before compilation because go is not installed/on PATH in this shell (/usr/bin/bash: line 1: go: command not found). The tests are present and currently precede implementation.

Implementation Notes

Tests written

  • v1/providers/naver/client_test.go - verifies NCP Signature V2 headers/signature and credential client construction.
  • v1/providers/naver/location_test.go - verifies region list conversion into SDK locations.
  • v1/providers/naver/image_test.go - verifies image product conversion and filtering.
  • v1/providers/naver/instancetype_test.go - verifies server product conversion, GPU parsing, filtering, and stable IDs.
  • v1/providers/naver/instance_test.go - verifies login key import, create request mapping, detail/list/terminate flows, and lifecycle status mapping.

Red phase

Tests written, confirmed failing: YES
Failure reason: the first red command could not compile because the repository shell had no go binary on PATH. A temporary Go 1.25.1 toolchain was then downloaded under /tmp/go1.25.1 for verification.

Changes made

  • v1/providers/naver/client.go - added NAVER credential/client, test options, NCP Signature V2 signing, and shared JSON request handling.
  • v1/providers/naver/capabilities.go - declared VM lifecycle, stop/start, reboot, and image capabilities.
  • v1/providers/naver/location.go - added getRegionList location discovery.
  • v1/providers/naver/image.go - added getServerImageProductList image discovery.
  • v1/providers/naver/instancetype.go - added getServerProductList instance type discovery and conservative GPU parsing.
  • v1/providers/naver/instance.go - added login key import, create, detail get, list, terminate, reboot, stop/start, and SDK instance conversion.

Green phase

Focused tests passing: YES
Command: PATH=/tmp/go1.25.1/bin:$PATH go test ./v1/providers/naver

Full suite: BLOCKED by existing environment-sensitive SSH test
Command: PATH=/tmp/go1.25.1/bin:$PATH make test
Failure: internal/ssh Test_GetPublicIP cannot reach https://api.ipify.org from this environment (connection reset by peer). The NAVER provider package passes.

Build

Not separately run; go test ./v1/providers/naver compiles the new package.

Commit

313966b feat(naver): add Naver cloud provider [LOCAL-20260421175940]

Notes

  • Existing .gitignore modifications were present before this work and are intentionally left unstaged.

Review

Diff summary

  • Files changed: 11 new NAVER provider files
  • Lines added: about 1.2k in the new provider package and tests
  • Matches plan: YES
  • Tests present: YES

Issues found

  • None in the NAVER provider diff. Full-suite verification is blocked by the unrelated internal/ssh Test_GetPublicIP network dependency.

Verdict

APPROVED

@carterabdallahbrev carterabdallahbrev requested a review from a team as a code owner April 21, 2026 18:11
@carterabdallahbrev carterabdallahbrev changed the title Add NAVER Cloud Platform VM provider support BREV-8930 Add NAVER Cloud Platform VM provider support Apr 21, 2026
@carterabdallahbrev carterabdallahbrev force-pushed the codex/local-20260421175940-naver-provider branch from 4146f43 to 0f79d0e Compare April 21, 2026 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants