From d302aba7c7c3e28eab10e7ca95925e2e14d3f1d2 Mon Sep 17 00:00:00 2001 From: GeorgianaElena Date: Mon, 13 Jan 2020 16:10:28 +0200 Subject: [PATCH 1/3] increase integration tests memory --- .circleci/integration-test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/integration-test.py b/.circleci/integration-test.py index 7366c2f25..85d66ecd4 100755 --- a/.circleci/integration-test.py +++ b/.circleci/integration-test.py @@ -32,7 +32,7 @@ def run_systemd_image(image_name, container_name): # This is the minimum VM size we support. JupyterLab extensions seem # to need at least this much RAM to build. Boo? # If we change this, need to change all other references to this number. - '--memory', '768M', + '--memory', '1G', image_name ]) From c6e6d6d4aed9ceb5adb6c49e4b135298f943201d Mon Sep 17 00:00:00 2001 From: GeorgianaElena Date: Mon, 13 Jan 2020 16:42:59 +0200 Subject: [PATCH 2/3] Document new minimum RAM requirement --- docs/howto/admin/resource-estimation.rst | 2 +- docs/install/amazon.rst | 2 +- docs/install/custom-server.rst | 2 +- docs/install/google.rst | 2 +- docs/install/jetstream.rst | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/howto/admin/resource-estimation.rst b/docs/howto/admin/resource-estimation.rst index d9ee94479..40852f81e 100644 --- a/docs/howto/admin/resource-estimation.rst +++ b/docs/howto/admin/resource-estimation.rst @@ -12,7 +12,7 @@ Memory ====== Memory is usually the biggest determinant of server size in most JupyterHub -installations. At minimum, your server must have at least **768MB** of RAM +installations. At minimum, your server must have at least **1GB** of RAM for TLJH to install. .. math:: diff --git a/docs/install/amazon.rst b/docs/install/amazon.rst index c1e960784..1e189f14f 100644 --- a/docs/install/amazon.rst +++ b/docs/install/amazon.rst @@ -79,7 +79,7 @@ Let's create the server on which we can run JupyterHub. `Next: Configure Instance Details` in the lower right corner. Check out our guide on How To :ref:`howto/admin/resource-estimation` to help pick - how much Memory / CPU your server needs. You need to have at least **768MB** of + how much Memory / CPU your server needs. You need to have at least **1GB** of RAM. You may wish to consult the listing `here `_ diff --git a/docs/install/custom-server.rst b/docs/install/custom-server.rst index d30620224..2464b8097 100644 --- a/docs/install/custom-server.rst +++ b/docs/install/custom-server.rst @@ -32,7 +32,7 @@ Pre-requisites #. Some familiarity with the command line. #. A server running Ubuntu 18.04 where you have root access. -#. At least **768MB** of RAM on your server. +#. At least **1GB** of RAM on your server. #. Ability to ``ssh`` into the server & run commands from the prompt. #. A **IP address** where the server can be reached from the browsers of your target audience. diff --git a/docs/install/google.rst b/docs/install/google.rst index c63a09f4c..560711eb5 100644 --- a/docs/install/google.rst +++ b/docs/install/google.rst @@ -69,7 +69,7 @@ Let's create the server on which we can run JupyterHub. #. For **Zone**, pick any of the options. Leaving the default as is is fine. #. Under **Machine** type, select the amount of CPU / RAM / GPU you want for your - server. You need at least **768MB** of RAM. + server. You need at least **1GB** of RAM. You can select a preset combination in the default **basic view**. diff --git a/docs/install/jetstream.rst b/docs/install/jetstream.rst index 879018b55..3db3cb926 100644 --- a/docs/install/jetstream.rst +++ b/docs/install/jetstream.rst @@ -53,7 +53,7 @@ Let's create the server on which we can run JupyterHub. #. Give your server a descriptive **Instance Name**. #. Select an appropriate **Instance Size**. We suggest m1.medium or larger. - Make sure your instance has at least **768MB** of RAM. + Make sure your instance has at least **1GB** of RAM. Check out our guide on How To :ref:`howto/admin/resource-estimation` to help pick how much Memory, CPU & disk space your server needs. From 92c74d157ffe25da852ea43098d5dea2bc77449d Mon Sep 17 00:00:00 2001 From: GeorgianaElena Date: Mon, 13 Jan 2020 18:38:47 +0200 Subject: [PATCH 3/3] Fix failing plugin test --- integration-tests/plugins/simplest/tljh_simplest.py | 2 +- integration-tests/test_simplest_plugin.py | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/integration-tests/plugins/simplest/tljh_simplest.py b/integration-tests/plugins/simplest/tljh_simplest.py index f77f19b24..d9176de36 100644 --- a/integration-tests/plugins/simplest/tljh_simplest.py +++ b/integration-tests/plugins/simplest/tljh_simplest.py @@ -51,4 +51,4 @@ def tljh_post_install(): @hookimpl def tljh_new_user_create(username): with open('test_new_user_create', 'w') as f: - f.write("a new userfile") + f.write(username) diff --git a/integration-tests/test_simplest_plugin.py b/integration-tests/test_simplest_plugin.py index d2f973c5f..0b7afd3e1 100644 --- a/integration-tests/test_simplest_plugin.py +++ b/integration-tests/test_simplest_plugin.py @@ -5,7 +5,9 @@ import requests import os import subprocess + from tljh.config import CONFIG_FILE, USER_ENV_PREFIX, HUB_ENV_PREFIX +from tljh import user yaml = YAML(typ='rt') @@ -74,11 +76,15 @@ def test_post_install_hook(): assert content == "123456789" -def test_tljh_new_user_create(): +def test_new_user_create(): """ Test that plugin receives username as arg """ - with open("test_new_user_create") as f: + username="user1" + # Call ensure_user to make sure the user plugin gets called + user.ensure_user(username) + + with open(f"test_new_user_create") as f: content = f.read() - assert content == "a new userfile" + assert content == username