什么是纳囊| 胃胀打嗝是什么原因| 营养素是什么| 心脏房颤吃什么药最好| 王爷是皇上的什么人| 苏打水什么牌子的好| 甲鱼和什么不能一起吃| 吃生姜对身体有什么好处和坏处| 签注是什么| 猴戏是什么意思| 家庭出身填什么| 1964属什么生肖| 大便拉不干净是什么原因| 岁月静好什么意思| 挂失补办身份证需要什么| 舜字五行属什么| 妊娠是什么意思| 晴纶是什么材质| 黄皮肤适合什么颜色的衣服| 睡觉打呼噜是什么病| 牙根发黑是什么原因| 大便臭是什么原因| 什么口服液补血补气最好| 肚脐眼疼是什么原因| 血小板是干什么用的| 为什么新生儿有胎记| 葡萄糖氯化钠注射作用是什么| 睡前吃香蕉有什么好处| 磬是什么乐器| 忠武路演员是什么意思| 长一根白眉毛预示什么| 沈殿霞为什么地位高| 喉咙有异物感是什么原因| 蚁后长什么样| 书签是什么| 荨麻疹为什么晚上起| 24号来月经什么时候是排卵期| 什么蚌相争| 炒木耳为什么会炸锅| 家道中落是什么意思| 鼻梁高的男人说明什么| 情面是什么意思| 羊肉不能和什么食物一起吃| 花开富贵是什么生肖| 什么伤口需要打破伤风| 手心发热是什么原因| hpv病毒是什么病| 右边脑袋疼是什么原因| 孩子喝什么牛奶有助于长高| 难以启齿是什么意思| 1932年属什么| 老年人喝什么牛奶好| 吃海鲜喝什么酒| 俄罗斯和白俄罗斯有什么区别| 冷都男是什么意思| 三伏天是什么时候| 3月21日什么星座| 美国为什么那么强大| 7月去青海带什么衣服| 骨折后吃什么恢复快| 红色血痣是什么原因| 市公安局长什么级别| 广州有什么特产| 七四年属什么生肖| 双肺结节是什么病| 智商什么意思| 羟苯乙酯是什么东西| 肺结核通过什么途径传染| 梭形是什么形状| 铿锵玫瑰是什么意思| 联名款是什么意思| alds是什么病| 腰疼是什么原因引起的| 扶他是什么意思| 半夜是什么时辰| 硫酸亚铁是什么东西| 跨境电商是做什么的| 屁很多是什么原因造成的| 法令纹深是什么原因| 瞳孔放大意味着什么| 该说不说的是什么意思| 大便脂肪球是什么意思| 睡觉起来眼皮肿是什么原因| 尿频尿急是什么原因| 炎字五行属什么| 大象像什么| gv是什么意思| 南瓜子有什么功效| 哦耶是什么意思| 怀孕了什么时候做检查| 功成名就是什么意思| 尿胆原弱阳性什么意思| 小儿呕吐是什么原因引起的| 80年属什么生肖| cpi指数上涨意味着什么| 麦穗鱼吃什么| 血小板降低是什么病| 倒车雷达什么牌子好| 人流后什么叫重体力活| a02是什么牌子| 外科看什么病| 四叶草是什么牌子| 宝宝屁多是什么原因| 衣服发黄是什么原因| 三阳开泰是什么意思| 酉是什么意思| 胰腺不好吃什么食物好| 肚皮冰凉是什么原因呢| 11是什么意思| 视野是什么意思| 失眠吃什么食物效果最好| 什么奶粉比较好| 盐酸是什么| 来大姨妈喝什么汤比较好| 申请低保需要什么条件| 指甲上的月牙代表什么| 脊柱炎吃什么药效果好| 多吃青菜有什么好处| 生姜有什么功效| 三点水一个四读什么| 卯木代表什么| 夏季吃什么菜好| kitty是什么意思| 天蝎座和什么星座配| 喜人是什么意思| 甲胎蛋白是什么指标| coat是什么意思中文| 神经痛用什么药| 螺丝吃什么| 早上6点到7点是什么时辰| lt是什么意思| 上面一个山下面一个今读什么| 梦见妖魔鬼怪是什么意思| 2018年属什么生肖| 1946年中国发生了什么| 南京立冬吃什么| 兔子能吃什么水果| 拉绿色的屎是什么原因| 天伦之乐什么意思| 肥胖纹什么样子| 2月18号什么星座| 多愁善感是什么意思| 尿里面有血是什么原因| 黄油是什么意思| 区域经理的岗位职责是什么| 吃什么药可以流产| 檀郎是什么意思| 阴虚内热是什么意思| 一颗什么| 冬虫夏草有什么用| 啊哈是什么意思| 口腔溃疡挂什么科就诊| 嘴唇黑是什么原因| 什么情况下会怀孕| 甲醛有什么危害| 勃起是什么| 大便干燥一粒一粒的是什么原因| 智多星是什么意思| 瓜子脸适合剪什么发型| 红萝卜什么时候种| 流感为什么晚上会比白天严重| 任达华属什么生肖| 女性血热吃什么好得快| 懵逼是什么意思| 入宅是什么意思| 辅酶q10是什么东西| 夏天为什么会感冒| 肝素帽是什么| 吃什么可以补血| 牙齿一吸就出血是什么原因| 古代男子成年叫什么| 6.14是什么星座| 走花路是什么意思| 不均质脂肪肝是什么意思| 高危妊娠是什么意思啊| 男人为什么会晨勃| 莎莎舞是什么意思| 龙井茶什么季节喝最好| 倒挂对身体有什么好处| 疯狂动物城树懒叫什么| 3月29日是什么星座| 执勤是什么意思| 玉兰片和竹笋有什么区别| 曹休和曹操什么关系| 焦虑症吃什么药效果好| 凉虾是什么做的| cos代表什么意思| 肝有钙化灶是什么意思| 雨水是什么季节| 什么叫白内障| 副脾结节是什么意思| 11月30是什么星座| 墨菲定律什么意思| 一喝酒就脸红是什么原因| 地包天什么意思| 彩照是什么底色| 拔冗是什么意思| 慢性宫颈炎是什么原因引起的| 膝盖里面痛什么原因引起的| 下身瘙痒用什么药| 心悸吃什么药| 热闹非凡是什么意思| 蜗牛的天敌是什么| 衬衫什么面料好| 1962年属什么生肖| 什么的雪花| 孕晚期吃什么水果好| 工会副主席是什么级别| 手麻疼是什么原因引起| 脾胃虚弱吃什么药调理| 糖尿病什么原因引起的| 准生证什么时候办理| 慢性结膜炎用什么眼药水| 大校军衔是什么级别| 一般什么人戴江诗丹顿| 巨石强森是什么人种| 为什么兔子的眼睛是红色的| 中国什么时候灭亡| 什么是舒张压和收缩压| 文胸是什么意思| 国历是什么意思| 树欲静而风不止什么意思| 农历12月是什么星座| 水宝宝是什么| 真菌性外耳道炎用什么药| 电脑为什么打不开| 美帝是什么意思| 胃部检查除了胃镜还有什么方法| 酸枣仁有什么功效| 画地为牢下一句是什么| 非典是什么病| 子宫收缩是什么感觉| 血燥吃什么药| 中国地图像什么| 区号是什么| 什么人什么天| 狡兔三窟什么意思| 放我鸽子是什么意思| 陪伴是最长情的告白下一句是什么| 喝酒伤什么器官| 凉虾是什么做的| 黄芪不适合什么人吃| 浪蹄子什么意思| 脸上长粉刺是什么原因| 孔雀鱼吃什么| 早搏吃什么药好| 脖子上长扁平疣是什么原因| 早餐做什么| 鬼打墙是什么意思| 忍冬是什么意思| 感冒嗓子疼吃什么消炎药| 什么叫正盐| rush是什么东西| uva是什么意思| 明目退翳什么意思| id医学上是什么意思| 张良和刘邦是什么关系| 生气过度会气出什么病| 花胶是什么鱼的鱼肚| 御字五行属什么| 拆穿是什么意思| 黄油可以做什么美食| 检点是什么意思| 什么是龋齿| 百度
Jump to content

7月10号是什么星座

From ArchWiki
百度 春运期间的跨城行程,乘客和车主共同返乡,有很大几率是老乡,再加上较长时间的聊天相处,很多车主都会在到达目的地之后选择为乘客免单,显示出顺风车格外有人情味的特点。

JupyterHub is a multi-user web server for Jupyter notebooks. It consists of four subsystems:

  1. The main hub process.
  2. Authenticators which authenticate users.
  3. Spawners which start and monitor a single-user server for each connected user.
  4. An HTTP proxy which receives incoming requests and routes them to either the hub or the appropriate single-user server.

See the technical overview in the JupyterHub documentation for more details.

Installation

Install the jupyterhubAUR package. In most cases you will also need to install the jupyter-notebook package (some more advanced spawners may not require it). The jupyterlab package can also be installed to make the JupyterLab interface available.

Running

Start/enable jupyterhub.service. With the default configuration you can access the hub by going to 127.0.0.1:8000 in your browser.

Configuration

The JupyterHub configuration file is located at /etc/jupyterhub/jupyterhub_config.py. This is a Python script which modifies the configuration object c. The configuration file provided by the package shows the available configuration options and their default values.

Any relative paths in the configuration are resolved from the working directory that the hub is run from. The systemd service provided by the package uses /etc/jupyterhub as the working directory. This means, for example, that the default database URL c.JupyterHub.db_url = 'sqlite:///jupyterhub.sqlite' corresponds to the file /etc/jupyterhub/jupyterhub.sqlite.

All configuration options can be overridden on the command line. For example, the configuration file setting c.Application.show_config = True could instead be set with the command line flag --Application.show_config=True. Note that the provided systemd service uses the command line to explicitly set the c.JupyterHub.pid_file and c.ConfigurableHTTPProxy.pid_file values to a suitable runtime directory so any values for them in the configuration file will be ignored.

Authenticators

Authenticators control access to the hub and the single-user servers. The authenticators section of the documentation contains details about how authenticators work and how to write a custom authenticator. The authenticators wiki page has a list of authenticators; some of these are packaged and are described below.

Note that user status is stored in cookies, encrypted by the cookie secret. If you switch to a different authenticator, or modify the settings of your chosen authenticator so that the list of allowed users might change, you should change the cookie secret. This logs out all current users and forces them to re-authenticate with your new settings. This can be performed by deleting the cookie secret file and restarting the hub which will automatically generate a new secret. With the default configuration, the cookie secret is stored at /etc/jupyterhub/jupyterhub_cookie_secret.

PAM Authenticator

The PAM authenticator uses PAM to allow local users to log in to the hub. It is included with JupyterHub and is the default authenticator. Using it requires the hub to have read permissions to /etc/shadow (which contains hashed versions of user passwords) in order to authenticate users. By default /etc/shadow is owned by root and has file permissions of -rw------, so running the hub as root will meet this requirement. Some sources advocate removing all permissions from /etc/shadow so it cannot be read by compromised daemons, and granting processes which require access the DAC_OVERRIDE capability. If your /etc/shadow is set up like this, create a drop-in file for the service to grant this capability to JupyterHub:

/etc/systemd/system/jupyterhub.service.d/override.conf
[Service]
CapabilityBoundingSet=CAP_DAC_OVERRIDE

The PAM authenticator relies on the Python package pamela. For basic troubleshooting this can be tested on the commandline. To attempt authentication as user testuser, run the following command:

# python -m pamela -a testuser

(If you run JupyterHub as a non-root user, run the command as that user instead of root). If the authentication succeeds, no output will be printed. If it failed an error message will be printed.

PAM authentication as non-root user

If you run JupyterHub as a non-root user, you will need to give that user read permissions to the shadow file. The method recommended by the JupyterHub documentation is to create a shadow group, make the shadow file readable by this group, and add the JupyterHub user to this group.

Warning This allows read-only access to the hashed passwords in /etc/shadow to anybody running code as the JupyterHub user. Note that each single-user server is run under their own account and so code executed in those servers will not have access. Also note that a security exploit in JupyterHub would allow the same access to the hashed passwords if JupyterHub was being run as root.

Creating the group, modifying the shadow file permissions and adding the user jupyterhub to the group can be accomplished with the following four commands:

# groupadd shadow
# chgrp shadow /etc/shadow
# chmod g+r /etc/shadow
# usermod -aG shadow jupyterhub

Spawners

Spawners are responsible for starting and monitoring each user's notebook server. The spawners section of the documentation contains more details about how they work and how to write a custom spawner. The spawners wiki page has a list of spawners; some of these are packaged and are described below.

LocalProcessSpawner

This is the default spawner included with JupyterHub. It runs each single-user server in a separate local process under their user account (this means each JupyterHub user must correspond to a local user account). It also requires JupyterHub to be run as root so it can spawn the processes under the different user accounts. The jupyter-notebook package must be installed for this spawner to work.

SudoSpawner

The SudoSpawner uses an intermediate process created with sudo to spawn the single-user servers. This allows the JupyterHub process to be run as a non-root user. To use it install the jupyterhub-sudospawnerAUR package.

To use it, create a system user account (the following assumes the account is named jupyterhub) and a group whose membership will define which users can access the hub (here assumed to be called jupyterhub-users). First, we have to configure sudo to allow the jupyterhub user to spawn a server without a password. Create a drop-in sudo configuration file with visudo:

# visudo -f /etc/sudoers.d/jupyterhub-sudospawner
# The command the hub is allowed to run.
Cmnd_Alias SUDOSPAWNER_CMD = /usr/bin/sudospawner

# Allow the jupyterhub user to run this command on behalf of anybody
# in the jupyterhub-users group.
jupyterhub ALL=(%jupyterhub-users) NOPASSWD:SUDOSPAWNER_CMD

The default service file runs the hub as root. It also applies a number of hardening options to the service to restrict its capabilities. This hardening prevents sudo from working; to allow it, the NoNewPrivileges service option (plus any other options which implicitly set it, see systemd.exec(5) for a list of service options) needs to be off. Create a drop-in file to run the hub using the jupyterhub user instead:

/etc/systemd/system/jupyterhub.service.d/override.conf
[Service]
User=jupyterhub
Group=jupyterhub

# Required for sudo.
NoNewPrivileges=false

# Setting the following would implicitly set NoNewPrivileges.
PrivateDevices=false
ProtectKernelTunables=false
ProtectKernelModules=false
LockPersonality=false
RestrictRealtime=false
RestrictSUIDGID=false
SystemCallFilter=
SystemCallArchitectures=

If you have previously run the hub as the root user, you will need to change the ownership of the user database and cookie secret files:

# chown jupyterhub:jupyterhub /etc/jupyterhub/{jupyterhub_cookie_secret,jupyterhub.sqlite}

If you are using the PAMAuthenticator, you will need to configure your system to allow it to work as a non-root user.

Finally, edit the JupyterHub configuration and change the spawner class to SudoSpawner:

/etc/jupyterhub/jupyterhub_config.py
c.JupyterHub.spawner_class='sudospawner.SudoSpawner'

To give a user access to the hub, add them to the jupyterhub-users group:

# usermod -aG jupyterhub-users <username>

systemdspawner

The systemdspawner uses systemd to manage each user's notebook which allows configuring resource limitations, better process isolation and sandboxing, and dynamically allocated users. To use it install the jupyterhub-systemdspawnerAUR package and set the spawner class in the configuration file:

/etc/jupyterhub/jupyterhub_config.py
c.JupyterHub.spawner_class = 'systemdspawner.SystemdSpawner'

Note that as per systemdspawner's readme using it currently requires JupyterHub to be run as root.

Services

A JupyterHub service is defined as a process which interacts with the Hub through its API. Services can either be run by the hub or as standalone processes.

Idle culler

The idle culler service can be used to automatically shut down idle single-user servers. To use it, install the jupyterhub-idle-cullerAUR package. To run the service through the hub, add a service description to the c.JupyterHub.services configuration variable:

/etc/jupyterhub/jupyterhub_config.py
import sys
c.JupyterHub.services = [
    {
        'name': 'idle-culler',
        'admin': True,
        'command': [
            sys.executable,
            '-m', 'jupyterhub_idle_culler',
            '--timeout=3600'
        ],
    }
]

See the service documentation or the output of python -m jupyterhub_idle_culler --help for a description of command-line options and details of how to run the service as a standalone process.

Tips and Tricks

Running as non-root user

By default, the main hub process is run as the root user (the individual user servers are run under the corresponding local user as set by the spawner). To run as a non-root user, you need to use the SudoSpawner (the other spawners listed above require running as root). If you are using the PAM authenticator, you will also need to configure it for a non-root user.

Using a reverse proxy

A reverse proxy can be used to redirect external requests to the JupyterHub instance. This can be useful if you want to serve multiple sites from one machine, or use an existing server to handle SSL. The using a reverse proxy section of the JupyterHub documentation has example configuration for using either nginx or Apache as a reverse proxy.

Note This does not replace the proxy component of JupyterHub which is responsible for routing requests to either the main hub or the single-user servers. Rather, the reverse proxy passes external requests to the JupyterHub proxy.

Proxy other web services

The Jupyter Server Proxy extension allows you to run other web services such as Code Server or RStudio alongside JupyterHub and provide authenticated web access to them. To use it, install python-jupyter-server-proxyAUR and configure it with the /etc/jupyter/jupyter_notebook_config.py file. For instance, to proxy code-serverAUR:

/etc/jupyter/jupyter_notebook_config.py
c.ServerProxy.servers = {
  'code-server': {
    'command': [
      'code-server',
        '--auth=none',
        '--disable-telemetry',
        '--disable-update-check',
        '--bind-addr=localhost:{port}',
        '--user-data-dir=.config/Code - OSS/',
        '--extensions-dir=.vscode-oss/extensions/'
    ],
    'timeout': 20,
    'launcher_entry': {
      'title': 'VS Code'
    }
  }
}

See the documentation for more details about configuring the Jupyter Server Proxy.

Access to GPUs

If you receive errors when accessing GPUs (for instance, if nvidia-smi reports it cannot communicate with the NVIDIA driver), you must consider the hardening that is shipped with the JupyterHub systemd unit file. To allow access to GPUs (and other hardware) broadly, you can add this to a drop-in file:

/etc/systemd/system/jupyterhub.service.d/override.conf
[Service]
PrivateDevices=false
汤力水是什么 姓许的女孩取什么名字好听 为什么不 kay是什么意思 为什么会基因突变
白质脱髓鞘是什么病 尿培养是检查什么病 隶属什么意思 痰多吃什么好化痰 wmf是什么牌子
什么是婚检 合胞病毒用什么药最好 尾椎骨疼挂什么科 海豹吃什么 流鼻血是什么原因引起的
农历六月六是什么节日 薄幸是什么意思 帅是什么意思 腿抽筋缺什么 宝宝多吃什么蔬菜好
右下腹疼痛挂什么科xinmaowt.com 什么的表演hcv8jop5ns0r.cn 身体出现白斑有可能患什么病xjhesheng.com 吃什么东西可以补血hcv9jop3ns1r.cn 血府逐瘀丸治什么病hcv9jop1ns0r.cn
望穿秋水是什么意思inbungee.com 247什么意思hcv9jop1ns8r.cn 结节有什么症状hcv8jop1ns1r.cn 贪污是什么意思hcv8jop1ns5r.cn 值太岁是什么意思hcv8jop1ns1r.cn
两鬓斑白是什么意思mmeoe.com 中风吃什么药好creativexi.com 乳糖不耐受是什么意思hcv9jop1ns7r.cn 相依相偎是什么意思hcv9jop1ns0r.cn 缺席是什么意思xinmaowt.com
国士无双是什么意思hcv7jop4ns6r.cn 孕妇吃什么水果好sanhestory.com 什么网站可以看三节片hcv7jop9ns8r.cn 射手男和什么座最配对hcv9jop5ns2r.cn 星期天左眼皮跳是什么预兆hcv8jop3ns4r.cn
百度