Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions agents/nemo-studio-copilot/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ LABEL org.opencontainers.image.title="nemo-studio-copilot" \

ENV NAT_CONFIG_FILE=/workspace/src/nemo_studio_copilot/nemo-studio-copilot.yml

# Authenticated Kubernetes deployments inject a loopback auth-proxy sidecar on
# this port. NMP_BASE_URL is supplied by the deployment runtime, so use the
# agent-specific legacy override for SDK calls and allow local runtimes to
# replace it when needed.
ENV NEMO_BASE_URL=https://127.0.0.1:8090

Comment thread
coderabbitai[bot] marked this conversation as resolved.
ENV PATH="/workspace/.venv/bin:$PATH"

# Some modern base images (notably Ubuntu 24.04 "noble" and the NVIDIA base
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def _delete_fileset(name: str) -> str:
def _get_client() -> NeMoPlatform:
global _client
if _client is None:
base_url = os.environ.get("NMP_BASE_URL") or os.environ.get("NEMO_BASE_URL")
base_url = os.environ.get("NEMO_BASE_URL") or os.environ.get("NMP_BASE_URL")
kwargs: dict[str, Any] = {}
if base_url:
kwargs["base_url"] = base_url
Expand Down
16 changes: 16 additions & 0 deletions agents/nemo-studio-copilot/tests/test_nemo_studio_copilot.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,22 @@ def test_sdk_uses_deployment_platform_base_url(self, monkeypatch):
workspace="developer-workspace",
)

def test_sdk_prefers_agent_base_url_override(self, monkeypatch):
monkeypatch.setenv("NMP_BASE_URL", "http://platform-gateway:8080")
monkeypatch.setenv("NEMO_BASE_URL", "http://127.0.0.1:8090")
monkeypatch.delenv("NMP_WORKSPACE", raising=False)

with (
patch("nemo_studio_copilot.register._client", None),
patch("nemo_studio_copilot.register.NeMoPlatform") as platform_client,
):
_get_client()

platform_client.assert_called_once_with(
base_url="http://127.0.0.1:8090",
workspace="default",
)

Comment thread
coderabbitai[bot] marked this conversation as resolved.
def test_sdk_defaults_to_default_workspace(self, monkeypatch):
monkeypatch.delenv("NMP_WORKSPACE", raising=False)

Expand Down
Loading
Loading