Remove Node.js

This commit is contained in:
Jeremy Tuloup
2021-02-08 18:01:28 +01:00
parent 0b5f9c6788
commit 873e6bf661
4 changed files with 5 additions and 76 deletions

View File

@@ -40,9 +40,7 @@ Apt packages
============ ============
Base operating system packages, including Python itself, are installed Base operating system packages, including Python itself, are installed
via ``apt`` from the base Ubuntu repositories. The one exception to this via ``apt`` from the base Ubuntu repositories.
is nodejs, which is installed from the `nodesource <https://github.com/nodesource/distributions>`_
apt repository. The Ubuntu provided version of nodejs is usually too old.
We generally do not pin versions of packages provided by apt, instead We generally do not pin versions of packages provided by apt, instead
just using the latest versions provided by Ubuntu. just using the latest versions provided by Ubuntu.

View File

@@ -4,21 +4,19 @@
What does the installer do? What does the installer do?
=========================== ===========================
This document details what exactly the installer does to the machine it is This document details what exactly the installer does to the machine it is
run on. run on.
``apt`` Packages installed ``apt`` Packages installed
========================== ==========================
The packages ``python3`` and ``python3-venv`` are installed from the apt repositories. The packages ``python3`` and ``python3-venv`` are installed from the apt repositories.
Since we need an recent & supported version of ``nodejs``, we install it from
`nodesource <https://github.com/nodesource/distributions>`_.
Hub environment Hub environment
=============== ===============
JupyterHub is run from a python3 virtual environment located in ``/opt/tljh/hub``. It JupyterHub is run from a python3 virtual environment located in ``/opt/tljh/hub``. It
uses the system's installed python and is owned by root. It also contains a binary install uses the system's installed python and is owned by root. It also contains a binary install
of `traefik <http://traefik.io/>`_. This virtual environment is completely managed by TLJH. of `traefik <http://traefik.io/>`_. This virtual environment is completely managed by TLJH.
.. note:: .. note::
@@ -34,7 +32,7 @@ User environment
By default, a ``miniconda`` environment is installed in ``/opt/tljh/user``. This contains By default, a ``miniconda`` environment is installed in ``/opt/tljh/user``. This contains
the notebook interface used to launch all users, and the various packages available to all the notebook interface used to launch all users, and the various packages available to all
users. The environment is owned by the ``root`` user. JupyterHub admins may use users. The environment is owned by the ``root`` user. JupyterHub admins may use
to ``sudo -E conda install`` or ``sudo -E pip install`` packages into this environment. to ``sudo -E conda install`` or ``sudo -E pip install`` packages into this environment.
This conda environment is added to ``$PATH`` for all users started with JupyterHub. If you This conda environment is added to ``$PATH`` for all users started with JupyterHub. If you
@@ -49,7 +47,7 @@ This should let you run various ``conda`` and ``pip`` commands. If you run into
.. code-block:: bash .. code-block:: bash
sudo env PATH=${PATH} <command> sudo env PATH=${PATH} <command>
By default, ``sudo`` does not respect any custom environments you have activated. The ``env PATH=${PATH}`` By default, ``sudo`` does not respect any custom environments you have activated. The ``env PATH=${PATH}``
'fixes' that. 'fixes' that.

View File

@@ -8,11 +8,6 @@ from tljh import installer
from tljh.yaml import yaml from tljh.yaml import yaml
def test_ensure_node():
installer.ensure_node()
assert os.path.exists('/usr/bin/node')
def test_ensure_config_yaml(tljh_dir): def test_ensure_config_yaml(tljh_dir):
pm = installer.setup_plugins() pm = installer.setup_plugins()
installer.ensure_config_yaml(pm) installer.ensure_config_yaml(pm)

View File

@@ -42,67 +42,6 @@ HERE = os.path.abspath(os.path.dirname(__file__))
logger = logging.getLogger("tljh") logger = logging.getLogger("tljh")
def ensure_node():
"""
Ensure nodejs from nodesource is installed
"""
key = b"""
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1
Comment: GPGTools - https://gpgtools.org
mQINBFObJLYBEADkFW8HMjsoYRJQ4nCYC/6Eh0yLWHWfCh+/9ZSIj4w/pOe2V6V+
W6DHY3kK3a+2bxrax9EqKe7uxkSKf95gfns+I9+R+RJfRpb1qvljURr54y35IZgs
fMG22Np+TmM2RLgdFCZa18h0+RbH9i0b+ZrB9XPZmLb/h9ou7SowGqQ3wwOtT3Vy
qmif0A2GCcjFTqWW6TXaY8eZJ9BCEqW3k/0Cjw7K/mSy/utxYiUIvZNKgaG/P8U7
89QyvxeRxAf93YFAVzMXhoKxu12IuH4VnSwAfb8gQyxKRyiGOUwk0YoBPpqRnMmD
Dl7SdmY3oQHEJzBelTMjTM8AjbB9mWoPBX5G8t4u47/FZ6PgdfmRg9hsKXhkLJc7
C1btblOHNgDx19fzASWX+xOjZ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lXKLQ31VQPAHT3an5IV2C/ie12eEqZWlnCiHV/wT+zhOkSpWdrheWfBT+ac
hR4jDH80AS3F8jo3byQATJb3RoCYUCVc3u1ouhNZa5yLgYZ/iZkpk5gKjxHPudFb
DdWjbGflN9k17VCf4Z9yAb9QMqHzHwIGXrb7ryFcuROMCLLVUp07PrTrRxnO9A/4
xxECi0l/BzNxeU1gK88hEaNjIfviPR/h6Gq6KOcNKZ8rVFdwFpjbvwHMQBWhrqfu
G3KaePvbnObKHXpfIKoAM7X2qfO+IFnLGTPyhFTcrl6vZBTMZTfZiC1XDQLuGUnd
sckuXINIU3DFWzZGr0QrqkuE/jyr7FXeUJj9B7cLo+s/TXo+RaVfi3kOc9BoxIvy
/qiNGs/TKy2/Ujqp/affmIMoMXSozKmga81JSwkADO1JMgUy6dApXz9kP4EE3g==
=CLGF
-----END PGP PUBLIC KEY BLOCK-----
""".strip()
apt.trust_gpg_key(key)
apt.add_source('nodesource', 'https://deb.nodesource.com/node_10.x', 'main')
apt.install_packages(['nodejs'])
def remove_chp(): def remove_chp():
""" """
@@ -476,7 +415,6 @@ def main():
ensure_user_environment(args.user_requirements_txt_url) ensure_user_environment(args.user_requirements_txt_url)
logger.info("Setting up JupyterHub...") logger.info("Setting up JupyterHub...")
ensure_node()
ensure_jupyterhub_package(HUB_ENV_PREFIX) ensure_jupyterhub_package(HUB_ENV_PREFIX)
# Stop the http server with the progress page before traefik starts # Stop the http server with the progress page before traefik starts