Skip to content

make gpud port number configurable#1199

Open
aimichal wants to merge 2 commits into
leptonai:mainfrom
aimichal:main
Open

make gpud port number configurable#1199
aimichal wants to merge 2 commits into
leptonai:mainfrom
aimichal:main

Conversation

@aimichal

Copy link
Copy Markdown

I'd like to be able to choose the port number that gpud exposes.

This change renames DefaultGPUdPort to defaultGPUdPort to scope its visibility to the config package, and exposes a function GPUdPortNumber() that reads env var GPUD_PORT but falls back to defaultGPUdPort if it's missing or not an int.

It would be nice to factor this such that the port number is considered only when building the config (in DefaultConfig()) with a nice error message if it's malformed. But today DefaultGPUdPort (now GPUdPortNumber() is used throughout the codebase, so I decided to propose this surgical change to start.

@gyuho gyuho self-assigned this Jan 24, 2026
@codecov

codecov Bot commented Jan 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 47.05882% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.01%. Comparing base (fcc10e6) to head (cb24aca).
⚠️ Report is 52 commits behind head on main.

Files with missing lines Patch % Lines
pkg/config/default.go 55.55% 4 Missing ⚠️
cmd/gpud/status/command.go 0.00% 2 Missing ⚠️
cmd/gpud/list-plugins/command.go 0.00% 1 Missing ⚠️
cmd/gpud/run-plugin-group/command.go 0.00% 1 Missing ⚠️
cmd/gpud/set-healthy/command.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1199      +/-   ##
==========================================
- Coverage   70.01%   70.01%   -0.01%     
==========================================
  Files         339      339              
  Lines       24229    24237       +8     
==========================================
+ Hits        16965    16970       +5     
- Misses       6164     6166       +2     
- Partials     1100     1101       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread pkg/config/default.go Outdated
Comment thread pkg/config/default.go Outdated
@gyuho

gyuho commented Jan 25, 2026

Copy link
Copy Markdown
Member

@aimichal The different port for listener is already supported by --listen-address flag, but some places you are changing are NOT using the flag value (as you correctly attempted to fix in this PR). Can we fix that instead, to use --listen-address flag value everywhere, rather than introducing the env variable?

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