-
Notifications
You must be signed in to change notification settings - Fork 57
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
[REQUEST] 将web host、api host相关环境变量集成进 swanlab.login
#792
Comments
关于CLI的交互用法: swanlab login --host=https://xxx |
简单来讲:
如果未执行 |
目前先不管此问题 |
输入的api host和web host会在http对象初始化以后挂载在对象上,不可修改。这意味着即使在init或者login后修改环境变量,也没有用了。 |
还有一个问题是,在netrc文件保存时host的名称不仅仅是域名 还携带了 swanlab login --api-key xxxx --host example.com 那么为了与之前保持一致,我们就需要在写入时手动添加路由前缀,但是假设在未来私有化部署时用户在上层设置了网关或者中间件改变了路由前缀,自动添加又显得不那么合适。 为了解决这个问题,还是需要新增一个参数,在代码内,api应该是: swanlab.login(api_key="xxx", host="xxx", api_path=False) 其中 对应到cli中: swanlab login --api-key xxxx --host example.com --no-api-path 至于选择https还是http协议,默认为https协议,除非用户显式添加了 |
还是有点问题,在计算机网络中host代表的是服务器资源标识,不应该包含路径等内容: 协议://host:端口/路径?查询参数#片段 |
🤩 Features description [Please make everyone to understand it]
如题,我打算将设置web host、api host的能力整合进
swanlab.login
👍 What problem does this feature solve
我们知道在sdk中
SWANLAB_WEB_HOST
和SWANLAB_API_HOST
两个环境变量分别用于表示云端前端的url和后端url。目前,用户如果需要修改此环境变量必须使用如下方式:这通常过于繁琐,也不符合人机交互直觉,因此需要拓展这部分功能——此外,这也为后面私有化部署做准备。
👾 What does the proposed API look like
设置host参数可以同时设置
web host
和api host
,我们约定api host
为web host
的/api
子路由下的内容。为了保证函数简洁性,不支持分别设置web host
和api host
(如果有这需求,还是用os.environ
进行设置)The text was updated successfully, but these errors were encountered: