Пример #1
0
def ensure_jupyterhub_package(prefix):
    """
    Install JupyterHub into our conda environment if needed.

    We install all python packages from PyPI as much as possible in the
    hub environment. A lot of spawners & authenticators do not have conda-forge
    packages, but do have pip packages. Keeping all python packages in the
    hub environment be installed with pip prevents accidental mixing of python
    and conda packages!
    """
    # Install pycurl. JupyterHub prefers pycurl over SimpleHTTPClient automatically
    # pycurl is generally more bugfree - see https://github.com/jupyterhub/the-littlest-jupyterhub/issues/289
    # build-essential is also generally useful to everyone involved, and required for pycurl
    apt.install_packages(
        ['libssl-dev', 'libcurl4-openssl-dev', 'build-essential'])
    conda.ensure_pip_packages(prefix, ['pycurl==7.43.*'])

    conda.ensure_pip_packages(
        prefix,
        [
            "jupyterhub==1.0.0",
            "jupyterhub-dummyauthenticator==0.3.1",
            "jupyterhub-systemdspawner==0.13",
            "jupyterhub-firstuseauthenticator==0.12",
            "jupyterhub-nativeauthenticator==0.0.4",
            "jupyterhub-ldapauthenticator==1.2.2",
            "jupyterhub-tmpauthenticator==0.6",
            "oauthenticator==0.8.2",
        ],
    )
    traefik.ensure_traefik_binary(prefix)
def ensure_jupyterhub_package(prefix):
    """
    Install JupyterHub into our conda environment if needed.

    We install all python packages from PyPI as much as possible in the
    hub environment. A lot of spawners & authenticators do not have conda-forge
    packages, but do have pip packages. Keeping all python packages in the
    hub environment be installed with pip prevents accidental mixing of python
    and conda packages!
    """
    # Install pycurl. JupyterHub prefers pycurl over SimpleHTTPClient automatically
    # pycurl is generally more bugfree - see https://github.com/jupyterhub/the-littlest-jupyterhub/issues/289
    # build-essential is also generally useful to everyone involved, and required for pycurl
    apt.install_packages(
        ["libssl-dev", "libcurl4-openssl-dev", "build-essential"])
    conda.ensure_pip_packages(prefix, ["pycurl==7.*"], upgrade=True)

    conda.ensure_pip_packages(
        prefix,
        [
            "jupyterhub==1.*",
            "jupyterhub-systemdspawner==0.15.*",
            "jupyterhub-firstuseauthenticator==1.*",
            "jupyterhub-nativeauthenticator==1.*",
            "jupyterhub-ldapauthenticator==1.*",
            "jupyterhub-tmpauthenticator==0.6.*",
            "oauthenticator==14.*",
            "jupyterhub-idle-culler==1.*",
            "git+https://github.com/yuvipanda/jupyterhub-configurator@317759e17c8e48de1b1352b836dac2a230536dba",
        ],
        upgrade=True,
    )
    traefik.ensure_traefik_binary(prefix)
Пример #3
0
def ensure_jupyterhub_package(prefix):
    """
    Install JupyterHub into our conda environment if needed.

    We install all python packages from PyPI as much as possible in the
    hub environment. A lot of spawners & authenticators do not have conda-forge
    packages, but do have pip packages. Keeping all python packages in the
    hub environment be installed with pip prevents accidental mixing of python
    and conda packages!
    """
    conda.ensure_pip_packages(prefix, [
        'jupyterhub==0.9.4', 'jupyterhub-dummyauthenticator==0.3.1',
        'jupyterhub-systemdspawner==0.11',
        'jupyterhub-firstuseauthenticator==0.12',
        'jupyterhub-nativeauthenticator==0.0.4',
        'jupyterhub-ldapauthenticator==1.2.2', 'oauthenticator==0.8.0'
    ])
    traefik.ensure_traefik_binary(prefix)
def test_download_traefik(tmpdir):
    traefik_bin = tmpdir.mkdir("bin").join("traefik")
    traefik.ensure_traefik_binary(str(tmpdir))
    assert traefik_bin.exists()
    # ignore higher-order permission bits, only verify ugo permissions
    assert (traefik_bin.stat().mode & 0o777) == 0o755