概念 (AEN 4.2.0)#

系统概览

Anaconda Enterprise Notebooks 平台由三个主要服务组组成:AEN 服务器、AEN 网关和 AEN 计算,这些被称为“节点”:

  • 服务器节点—The administrative front-end to the system where users login, user accounts are stored, and administrators manage the system.
  • 网关节点—A reverse proxy that authenticates users and directs them to the proper compute node for their project. Users will not notice this node after installation as it automatically routes them.
  • 计算节点—Where projects are stored and run.
../../../_images/ae-notebooks/4.2.0/aen-install-components.png

这些服务可以在单台机器上运行,也可以分布在多台服务器上。

../../../_images/ae-notebooks/4.2.0/aen-install-network-diagram.png

在组织上,每个AEN安装都有一个服务器实例和一个或多个网关实例。每个计算节点只能连接到一个网关。由一个网关服务的计算节点集合称为数据中心。您可以随时向AEN安装添加数据中心。

示例:一个AEN部署,包含2个数据中心,其中1个网关拥有20台物理计算机的集群,第二个网关拥有30台虚拟机,必须安装并运行以下服务:

  • 1 AEN server instance
  • 2 AEN gateway instances
  • 50 AEN compute instances (20 + 30)

节点必须单独配置和维护。

服务器节点

服务器节点控制登录、账户、管理员、项目创建和管理以及与数据库的接口。它是所有用户进入AEN的主要入口点。服务器节点处理项目设置,并确保用户被发送到正确的项目数据中心。

由于AEN是基于网络的,它在服务器上使用标准的HTTP端口80或HTTPS端口443。

AEN 使用 MongoDB 作为其内部数据持久化工具。它通常与服务器运行在同一主机上,但也可以安装在单独的主机上。

服务器节点使用NGINX来处理面向用户的AEN网页界面。NGINX作为实际服务器网络进程的请求代理,该进程运行在一个高编号的端口上,仅监听本地主机。NGINX还负责静态内容。

服务器安装在 /opt/wakari/wakari-server 目录中。

服务器进程

当你查看服务器进程状态时,你可能会看到下面解释的进程。

supervisord details
description Manage wakari-worker, multiple processes of wk-server.
user wakari
configuration /opt/wakari/wakari-server/etc/supervisord.conf
log /opt/wakari/wakari-server/var/log/supervisord.log
control service wakari-server
ports none
wk-server details
description Handles user interaction and passing jobs on to the wakari gateway. Access to it is managed by NGINX.
user wakari
command /opt/wakari/wakari-server/bin/wk-server
configuration /opt/wakari/wakari-server/etc/wakari/
control service wakari-server
logs /opt/wakari/wakari-server/var/log/wakari/server.log
ports Not used in versions after 4.1.2 *

* AEN 4.1.2 及更早版本使用端口 5000。此端口仅在本地主机上使用。 AEN 的后续版本改用 Unix 套接字。Unix 套接字路径为: unix:/opt/wakari/wakari-server/var/run/wakari-server.sock

wakari-worker details
description Asynchronously executes tasks from wk-server.
user wakari
logs /opt/wakari/wakari-server/var/log/wakari/worker.log
control service wakari-server
nginx details
description Serves static files and acts as proxy for all other requests passed to wk-server process. *
user nginx
configuration /etc/nginx/nginx.conf /opt/wakari/wakari-server/etc/conf.d/www.enterprise.conf
logs /var/log/nginx/woc.log /var/log/nginx/woc-error.log
control service nginx status
port 80

* 在AEN 4.1.2及更早版本中,wk-server进程仅在本地主机的5000端口上运行。在AEN的后续版本中,wk-server进程使用Unix套接字路径 unix:/opt/wakari/wakari-server/var/run/wakari-server.sock

NGINX 至少运行两个进程:

  • Master process running as root user.
  • Worker processes running as nginx user.

网关节点

网关节点作为一组计算节点的访问点。它充当代理服务,并管理URL和端口到在这些节点上运行的服务的授权和映射。网关节点为用户提供了一致且统一的接口。

注意:网关也可以被称为数据中心,因为它充当一组计算节点的代理。

您可以在每个数据中心以分层扩展的方式放置一个网关。

AEN网关安装在/opt/wakari/wakari-gateway目录中。

网关进程

当你查看服务器进程状态时,你可能会看到下面解释的进程。

supervisord details
description Manages the wk-gateway process.
user wakari
configuration /opt/wakari/wakari-gateway/etc/supervisord.conf
log /opt/wakari/wakari-gateway/var/log/supervisord.log
control service wakari-gateway
ports none
wakari-gateway details
description Passes requests from the AEN Server to the Compute nodes.
user wakari
configuration /opt/wakari/wakari-gateway/etc/wakari/wk-gateway-config.json
logs /opt/wakari/wakari-gateway/var/log/wakari/gateway.application.log /opt/wakari/wakari-gateway/var/log/wakari/gateway.log
working dir / (root)
port 8089 (webcache)

计算节点

计算节点是诸如Jupyter Notebook和Workbench等应用程序实际运行的地方。它们也是用户在使用终端应用程序或使用SSH访问节点时看到的主机。计算节点包含所有用户可见的程序。

计算节点只需要与网关通信,因此它们可以通过防火墙完全隔离。

每个项目都与一个或多个计算节点相关联,这些节点是单个数据中心的一部分。

AEN计算节点安装在 /opt/wakari/wakari-compute 目录中。

AEN系统中的每个计算节点都需要一个计算启动器服务来调解对服务器和网关的访问。

计算过程

当你查看服务器进程状态时,你可能会看到下面解释的进程。

supervisord details
description Manages the wk-compute process.
user wakari
configuration /opt/wakari/wakari-compute/etc/supervisord.conf
log /opt/wakari/wakari-compute/var/log/supervisord.log
control service wakari-compute
working dir /opt/wakari/wakari-compute/etc
ports none
wk-compute details
description Launches compute processes.
user wakari
configuration /opt/wakari/wakari-compute/etc/wakari/wk-compute-launcher-config.json /opt/wakari/wakari-compute/etc/wakari/scripts/config.json
logs /opt/wakari/wakari-compute/var/log/wakari/compute-launcher.application.log /opt/wakari/wakari-compute/var/log/wakari/compute-launcher.log
working dir / (root)
control service wakari-compute
port 5002 (rfe)

Wk-compute 按以下顺序加载每个配置文件:

  • /etc/wakari/config.json.
  • /etc/wakari/compute-launcher-config.json.
  • ./compute-launcher-config.json.
  • Any configuration file specified by the -c option.

如果一个选项在多个文件中被指定,最后遇到的那个将优先。

Supervisor 和 supervisord

AEN使用一个名为“Supervisor”的进程控制系统来运行其服务。Supervisor由AEN服务账户用户运行,通常是wakari或aen_admin。

Supervisor守护进程被称为“supervisord”。它在后台运行,通常很少需要重启。

Anaconda 环境

每个项目都有一个相关的conda环境,包含该项目所需的包。当项目首次启动时,AEN会将名为“default”的默认环境克隆到项目目录中。

有关环境的更多信息,请参阅 Working with environments

项目和权限

AEN用户主要通过projects与系统交互。

项目与AEN环境中的单个数据中心相关联。用户团队包括一个所有者,即创建项目的用户。

项目位于计算节点上的projectRoot文件夹中——默认情况下是/projects

项目目录在项目首次启动时创建。start-project 脚本从 /opt/wakari/wakari-compute/lib/node_modules/wakari-compute-launcher/skeleton 克隆它。

项目目录权限为:

owner: rwx, user who created the project
group: rwx, group of the owner
other: --x, to allow access to the Public folder
ACL: rwx for any other team members

项目目录中的文件和子目录具有与项目目录相同的权限,除了:

  • The public folder and everything in it are open to anyone.
  • Any files hardlinked into the root anaconda environment—/opt/wakari/anaconda—are owned by the root or wakari users.

项目文件和目录权限由start-project脚本维护。项目中的所有文件和目录在项目启动时都会设置其权限,除了由root或AEN_SRVC_ACCT用户拥有的文件——默认情况下,wakari或aen_admin。

为了避免更改/opt/wakari/anaconda目录中任何链接文件的权限设置,root或AEN_SRVC_ACCT用户拥有的文件的权限设置不会被更改。

注意:不要以AEN_SRVC_ACCT用户身份启动项目。 权限系统无法正确管理由该用户拥有的项目文件。