-
Notifications
You must be signed in to change notification settings - Fork 3
Conversation
While implementing the filebrowser, I decoupled filebrowser from Vfolder as a separate app. Next things to-do:
|
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.
Just some initial reviews. (Since I'm the creator of this PR, I cannot "approve" or "request changes", so I'm leaving the review as a plain comment.)
We need to think more about automatically terminating "idle" filebrowser containers.
if "g" in str(memory): | ||
memory = memory * 1e+9 | ||
elif "m": | ||
memory = memory * 1000000 |
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.
We could use BinarySize
of ai.backend.common.validators
(usually imported as tx
which means "extended trafarets") in .config.local_config_iv
to avoid repetition like this calculation.
def mangle_path(mount_path, vfid): | ||
prefix1 = vfid[0:2] | ||
prefix2 = vfid[2:4] | ||
rest = vfid[4:] | ||
return Path(mount_path, prefix1, prefix2, rest) |
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.
Could we refactor this out as a reusable function?
settings_path = ctx.local_config["filebrowser"]["settings_path"] | ||
mount_path = ctx.local_config["filebrowser"]["mount_path"] | ||
cpu_count = ctx.local_config["filebrowser"]["max-cpu"] | ||
memory = ctx.local_config["filebrowser"]["max-mem"] |
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.
Please implement max-containers
configuration.
This would require a local tracking of container states, like the agent, so that we could count the existing number of containers and get notified when the containers terminate by themselves.
Ideally, we could extend a ai.backend.common.docker
module to provide Docker lifecycle events subscription and basic parsing into typed Python objects, and reuse it across the agent and storage-proxy.
With recent git commit, proposed simple solution to prevent execution of multiple monitors and network monitoring for 1 filebrowser container. The executed monitor checks if there is a file lock exists. If file not exist then create asynchronously file lock and continue monitoring task. Other monitors who get called are checking file lock existence. Since file lock already exists because of the first monitor, all following monitors will be terminated and not proceed with their monitoring task. Hence, only one monitor will be running who create the file lock first. The file lock is automatically deleted when the storage proxy is shut down. |
Why not used |
* Remove `filebrowsers.mount_path` because they must be taken from the configured volume instances! Please fix this.
….com/lablup/backend.ai-storage-proxy into feature/filebrowser-in-storage-proxy
Previously, did the implementation on the server of preventing multiple monitors run with common.FileLock. Implemented UID and GID settings in a startup.sh script after the containers are set. The input variables are defined in the .toml settings file. Refactoring, in order to deal with multiple volumes and their path in the settings file. Added a host:volume option in client-py. This is needed for the following things: to specify the volume on which folders are located. The same name folder can occur on multiple volumes. Then based on given argument options such as volume and name the vfid of vfolder is infered. Then filebrowser based on volume path and vfid is able to mount those directories into the container. On client-py command execution example: |
….com/lablup/backend.ai-storage-proxy into feature/filebrowser-in-storage-proxy
Merge branch 'main' into feature/filebrowser-in-storage-proxy
This PR is resolved at lablup/backend.ai#710 |
Moves file browsers to the storage proxy.
This will greatly reduce the burden of manager and webserver to mediate large file transfers.
vfolder
subcommands to use the filebrowser session APIsTo think: