【问题标题】:Has anybody found a way to make Tensorboard password-protected?有没有人找到让 Tensorboard 受密码保护的方法?
【发布时间】:2018-08-05 11:38:32
【问题描述】:

我一直在尝试使Tensoboard 受密码保护,但这并不容易,因为它不是 Flask 应用程序。 issue 去年已开通,但此后没有消息。

【问题讨论】:

  • 作为一种解决方法,您可以将 --host 参数设置为 127.0.0.1,然后使用 nginx 或其他东西通过基本身份验证来保护本地端口..

标签: tensorflow authentication passwords password-protection tensorboard


【解决方案1】:

我写了一篇博文,解释了如何在 GCP 上以经济高效的方式创建自己的可共享 Tensorboards带有身份验证。这篇文章包含 Terraform 设置,以便轻松复制该解决方案。

https://blog.ml6.eu/a-vertex-ai-tensorboard-alternative-for-smaller-budgets-part-2-923953c1e422

【讨论】:

  • 虽然此链接可能会回答问题,但最好在此处包含答案的基本部分并提供链接以供参考。如果链接页面发生更改,仅链接答案可能会失效。 - From Review
【解决方案2】:

不幸的是,由于 Tensorboard 没有内置密码保护,我在 docker 容器中使用了一个 nginx 服务器作为反向代理。

然后使用 HTTP 基本身份验证保护 Tensorboard。

nginx.conf

events { worker_connections 1024; }

http {
  server {
    listen 5000;

    server_name localhost;

    location / {
      proxy_pass http://host.docker.internal:5000;
      auth_basic "Restricted Remote";
      auth_basic_user_file /etc/nginx/.htpasswd;
    }
  }
}

要生成 .htpasswd 文件,请使用以下命令:

htpasswd -c .htpasswd admin

docker-compose.yml

version: '3'
services:
  nginx:
    image: nginx:latest
    container_name: nginx_reverse_proxy
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf
      - ./.htpasswd:/etc/nginx/.htpasswd
    ports:
      - 5000:5000

要运行使用docker-compose up -d

【讨论】:

    猜你喜欢
    • 2019-11-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-12-23
    • 2011-07-22
    • 1970-01-01
    • 2011-07-09
    • 1970-01-01
    相关资源
    最近更新 更多