-
Notifications
You must be signed in to change notification settings - Fork 172
feat(BA-5670): Add optional dedicated SFTP agent in TUI dev installer #10971
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Yaminyam
wants to merge
5
commits into
main
Choose a base branch
from
feat/BA-5670-sftp-agent-installer
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
102ab30
feat(BA-5670): Add optional dedicated SFTP agent in TUI dev installer
Yaminyam 2a67090
Rename changelog to PR number #10971
Yaminyam c1c21cc
feat(BA-5670): Use configs/agent/halfstack-sftp.toml sample + pid-fil…
Yaminyam 2670190
fix(BA-5670): Address code review feedback for SFTP agent installer
Yaminyam 4e7b5eb
fix(BA-5670): Fix port collisions when cloning agent.toml for SFTP agent
Yaminyam File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Add optional --with-sftp-agent option to the dev-mode TUI installer that provisions a dedicated SFTP agent alongside the regular compute agent using the multi-agent-per-node feature, and register the 'upload' scaling group for routing SFTP upload sessions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,137 @@ | ||
| [etcd] | ||
| namespace = "local" | ||
| addr = { host = "127.0.0.1", port = 8120 } | ||
| user = "" | ||
| password = "" | ||
|
|
||
|
|
||
| [agent] | ||
| mode = "docker" | ||
| # SFTP agent uses a distinct RPC port (primary is 6001 in the template, | ||
| # rewritten to 6011 by the dev installer). | ||
| rpc-listen-addr = { host = "127.0.0.1", port = 6013 } | ||
| # metric API service address — must not collide with the primary agent's 6003. | ||
| service-addr = { host = "0.0.0.0", port = 6023 } | ||
| ssl-enabled = false | ||
| #ssl-cert = "" | ||
| #ssl-key = "" | ||
| # Distinct from the primary agent's default 6007. | ||
| agent-sock-port = 6017 | ||
| # Distinguishable agent id so that the manager treats this as a separate node | ||
| # from the primary agent. | ||
| id = "i-local-sftp" | ||
| # Dedicated scaling group for SFTP upload sessions. | ||
| scaling-group = "upload" | ||
| pid-file = "./agent-sftp.pid" | ||
| event-loop = "uvloop" | ||
| ipc-base-path = "ipc/agent-sftp" | ||
| var-base-path = "var/agent-sftp" | ||
| # The SFTP agent does NOT load any accelerator plugin — otherwise it would | ||
| # try to import libraries that may not be installed in a dev environment | ||
| # (e.g. Tenstorrent's `tt_tools_common`). Leaving this explicitly empty | ||
| # instead of relying on the default (None → load all discovered plugins). | ||
| allow-compute-plugins = [] | ||
| # block-compute-plugins = [] | ||
| image-commit-path = "./tmp/backend.ai/commit/" | ||
| # Share the same vfolder root as the primary agent so that files uploaded | ||
| # via SFTP are visible to compute sessions running on the primary agent. | ||
| # This path is rewritten by the installer to an absolute path under | ||
| # `<base>/vfolder/local/volume1`. | ||
| mount-path = "./vfroot/local" | ||
| cohabiting-storage-proxy = true | ||
| # aiomonitor / metadata-server ports — must not collide with the primary | ||
| # agent's defaults (38200 / 39200 / 40128). | ||
| aiomonitor-termui-port = 38201 | ||
| aiomonitor-webui-port = 39201 | ||
| metadata-server-port = 40129 | ||
|
|
||
|
|
||
| [container] | ||
| # Non-overlapping with the primary agent's default 30000-31000. SFTP | ||
| # upload sessions don't typically allocate compute kernels but we still | ||
| # need a non-overlapping range to be safe. | ||
| port-range = [31100, 31200] | ||
| kernel-uid = -1 | ||
| kernel-gid = -1 | ||
| bind-host = "127.0.0.1" | ||
| sandbox-type = "docker" | ||
| scratch-type = "hostdir" | ||
| scratch-root = "./scratches" | ||
| scratch-size = "1G" | ||
|
|
||
|
|
||
| [watcher] | ||
| # Distinct watcher service-addr (primary is 6009). | ||
| service-addr = { host = "127.0.0.1", port = 6015 } | ||
| ssl-enabled = false | ||
| #ssl-cert = "" | ||
| #ssl-key = "" | ||
| target-service = "backendai-agent.service" | ||
| soft-reset-available = false | ||
|
|
||
|
|
||
| [pyroscope] | ||
| enabled = true | ||
| # Differentiated pyroscope app-name so the two agents show up separately | ||
| # in dashboards. | ||
| app-name = "backendai-half-sftp-agent" | ||
| server-addr = "http://localhost:4040" | ||
| sample-rate = 100 | ||
|
|
||
|
|
||
| [logging] | ||
| level = "INFO" | ||
| drivers = ["console"] | ||
|
|
||
| [logging.pkg-ns] | ||
| "" = "WARNING" | ||
| "aiodocker" = "INFO" | ||
| "aiotools" = "INFO" | ||
| "aiohttp" = "INFO" | ||
| "ai.backend" = "INFO" | ||
|
|
||
| [logging.console] | ||
| colored = true | ||
| format = "verbose" | ||
|
|
||
| [logging.file] | ||
| path = "./logs" | ||
| filename = "agent-sftp.log" | ||
| rotation-size = "10M" | ||
|
|
||
| [logging.logstash] | ||
| endpoint = { host = "localhost", port = 9300 } | ||
| protocol = "tcp" | ||
| ssl-enabled = true | ||
| ssl-verify = false | ||
|
|
||
| [logging.graylog] | ||
| host = "127.0.0.1" | ||
| port = 12201 | ||
| ssl-verify = false | ||
| ca-certs = "" | ||
| keyfile = "" | ||
| certfile = "" | ||
|
|
||
| [resource] | ||
| reserved-cpu = 1 | ||
| reserved-mem = "1G" | ||
| reserved-disk = "8G" | ||
| allocation-order = ["cuda", "rocm", "tpu", "cpu", "mem"] | ||
| affinity-policy = "INTERLEAVED" | ||
|
|
||
|
|
||
| [debug] | ||
| enabled = true | ||
| skip-container-deletion = false | ||
|
|
||
| [debug.coredump] | ||
| enabled = false | ||
| path = "./coredumps" | ||
| backup-count = 10 | ||
| size-limit = "64M" | ||
|
|
||
| [otel] | ||
| enabled = true | ||
| log-level = "INFO" | ||
| endpoint = "http://127.0.0.1:4317" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sftp-agentis accepted as a valid service, but there’s no explicit check that./agent-sftp.tomlexists before attempting./dev start/restart sftp-agent. Sincecmd_statusalready hides the optional service unless the config exists, consider failing fast in_validate_service(or start path) with a clear message when the config is missing.