ethoscopy 2.0.4__tar.gz → 2.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. ethoscopy-2.1.0/.claude/settings.local.json +48 -0
  2. ethoscopy-2.1.0/.coverage +0 -0
  3. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/.github/workflows/ci.yml +13 -12
  4. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/.github/workflows/release.yml +7 -6
  5. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/.pre-commit-config.yaml +2 -2
  6. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/CLAUDE.md +2 -2
  7. ethoscopy-2.1.0/Docker/.env.dummy.example +25 -0
  8. ethoscopy-2.1.0/Docker/.env.github.example +39 -0
  9. ethoscopy-2.1.0/Docker/.env.google.example +41 -0
  10. ethoscopy-2.1.0/Docker/.env.keycloak.example +53 -0
  11. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/Docker/Dockerfile +19 -2
  12. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/Docker/README.md +21 -28
  13. ethoscopy-2.1.0/Docker/README_AUTH.md +548 -0
  14. ethoscopy-2.1.0/Docker/config/jupyterhub_config.py +154 -0
  15. ethoscopy-2.1.0/Docker/config/users.py +47 -0
  16. ethoscopy-2.1.0/Docker/docker-compose.yml +57 -0
  17. ethoscopy-2.1.0/Docker/install_r_packages.r +96 -0
  18. {ethoscopy-2.0.4/Docker/config → ethoscopy-2.1.0/Docker/jupyterhub_data}/jupyterhub.sqlite +0 -0
  19. ethoscopy-2.1.0/Docker/jupyterhub_data/jupyterhub_cookie_secret +1 -0
  20. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/PKG-INFO +26 -9
  21. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/README.md +23 -4
  22. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/pyproject.toml +10 -5
  23. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/scripts/README.md +30 -2
  24. ethoscopy-2.1.0/scripts/publish_tutorials.py +407 -0
  25. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/src/ethoscopy/__init__.py +3 -0
  26. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/src/ethoscopy/behavpy_core.py +6 -0
  27. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/src/ethoscopy/load.py +36 -11
  28. ethoscopy-2.1.0/src/ethoscopy/misc/__init__.py +0 -0
  29. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/src/ethoscopy/misc/get_HMM.py +8 -18
  30. ethoscopy-2.1.0/src/ethoscopy/misc/get_tutorials.py +220 -0
  31. ethoscopy-2.1.0/tasks/todo.md +130 -0
  32. ethoscopy-2.1.0/tests/test_get_tutorials.py +338 -0
  33. ethoscopy-2.1.0/tests/test_load_metadata_fixes.py +214 -0
  34. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/tutorial_notebook/1_Overview_tutorial.ipynb +26 -0
  35. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/tutorial_notebook/2_HMM_tutorial.ipynb +26 -0
  36. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/tutorial_notebook/3_Circadian_tutorial.ipynb +28 -2
  37. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/tutorial_notebook/5_Ethoscopy_catch22_tutorial.ipynb +26 -0
  38. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/tutorial_notebook/6_Ethoscopy_to_hctsa_tutorial.ipynb +26 -0
  39. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/tutorial_notebook/notebook_paper.ipynb +26 -0
  40. ethoscopy-2.0.4/.claude/settings.local.json +0 -25
  41. ethoscopy-2.0.4/Docker/.claude/settings.local.json +0 -41
  42. ethoscopy-2.0.4/Docker/.env +0 -39
  43. ethoscopy-2.0.4/Docker/config/jupyterhub_cookie_secret +0 -1
  44. ethoscopy-2.0.4/Docker/docker-compose.yml +0 -25
  45. ethoscopy-2.0.4/Docker/install_r_packages.r +0 -75
  46. ethoscopy-2.0.4/Docker/jupyterhub_data/jupyterhub-proxy.pid +0 -1
  47. ethoscopy-2.0.4/Docker/jupyterhub_data/jupyterhub.sqlite +0 -0
  48. ethoscopy-2.0.4/Docker/jupyterhub_data/jupyterhub_cookie_secret +0 -1
  49. ethoscopy-2.0.4/QWEN.md +0 -88
  50. ethoscopy-2.0.4/src/ethoscopy/misc/get_tutorials.py +0 -48
  51. ethoscopy-2.0.4/tests/test_get_tutorials.py +0 -136
  52. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/.codecov.yml +0 -0
  53. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/.gitignore +0 -0
  54. /ethoscopy-2.0.4/src/ethoscopy/misc/__init__.py → /ethoscopy-2.1.0/Docker/.env.gitlab.example +0 -0
  55. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/Docker/.env.keycloak +0 -0
  56. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/Docker/jupyterhub_data/jupyterhub_config.py +0 -0
  57. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/LICENSE +0 -0
  58. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/TESTING.md +0 -0
  59. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/_config.yml +0 -0
  60. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/pytest.ini +0 -0
  61. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/run_tests.py +0 -0
  62. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/scripts/convert_databases.sh +0 -0
  63. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/scripts/convert_wal_to_delete.py +0 -0
  64. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/setup.py +0 -0
  65. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/src/ethoscopy/analyse.py +0 -0
  66. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/src/ethoscopy/behavpy.py +0 -0
  67. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/src/ethoscopy/behavpy_HMM_class.py +0 -0
  68. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/src/ethoscopy/behavpy_class.py +0 -0
  69. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/src/ethoscopy/behavpy_draw.py +0 -0
  70. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/src/ethoscopy/behavpy_periodogram_class.py +0 -0
  71. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/src/ethoscopy/behavpy_plotly.py +0 -0
  72. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/src/ethoscopy/behavpy_seaborn.py +0 -0
  73. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/src/ethoscopy/metadata_db.py +0 -0
  74. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/src/ethoscopy/misc/circadian_bars.py +0 -0
  75. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/src/ethoscopy/misc/general_functions.py +0 -0
  76. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/src/ethoscopy/misc/hmm_functions.py +0 -0
  77. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/src/ethoscopy/misc/periodogram_functions.py +0 -0
  78. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/src/ethoscopy/misc/validate_datetime.py +0 -0
  79. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/tests/__init__.py +0 -0
  80. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/tests/conftest.py +0 -0
  81. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/tests/data/README.md +0 -0
  82. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/tests/data/test_ethoscope.db +0 -0
  83. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/tests/test_analyse.py +0 -0
  84. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/tests/test_baseline_enhancements.py +0 -0
  85. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/tests/test_behavpy.py +0 -0
  86. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/tests/test_behavpy_core_simple.py +0 -0
  87. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/tests/test_compatibility_classes.py +0 -0
  88. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/tests/test_general_functions.py +0 -0
  89. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/tests/test_load.py +0 -0
  90. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/tests/test_load_comprehensive.py +0 -0
  91. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/tests/test_load_optimizations.py +0 -0
  92. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/tutorial_notebook/4_Navigating_db_tutorial.ipynb +0 -0
  93. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/tutorial_notebook/ethoscope_db.csv +0 -0
  94. {ethoscopy-2.0.4 → ethoscopy-2.1.0}/tutorial_notebook/jones_et_al_metadata.csv +0 -0
@@ -0,0 +1,48 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(wc:*)",
5
+ "Bash(paplay:*)",
6
+ "Bash(ETHOSCOPE_DATA_PATH=/mnt/ethoscope_data docker compose:*)",
7
+ "Bash(docker ps:*)",
8
+ "Bash(docker logs:*)",
9
+ "Bash(docker compose:*)",
10
+ "Bash(curl:*)",
11
+ "Bash(docker exec:*)",
12
+ "Bash(mkdir -p /tmp/ethoscopy_wheel_inspect)",
13
+ "Read(//tmp/**)",
14
+ "Bash(pip download *)",
15
+ "Bash(unzip -l ethoscopy-2.0.4-py3-none-any.whl)",
16
+ "Bash(git check-ignore *)",
17
+ "Bash(/home/gg/Code/ethoscope_project/ethoscopy/.venv/bin/pip install *)",
18
+ "Bash(.venv/bin/python -m pytest tests/test_get_tutorials.py -v)",
19
+ "Bash(.venv/bin/python *)",
20
+ "Bash(.venv/bin/pip install *)",
21
+ "Bash(gh auth *)",
22
+ "Bash(gh repo *)",
23
+ "Bash(docker info *)",
24
+ "mcp__bookstack__bookstack_search",
25
+ "Bash(.venv/bin/ruff check *)",
26
+ "Bash(.venv/bin/black --check src/ tests/)",
27
+ "Bash(.venv/bin/black src/ethoscopy/misc/get_tutorials.py tests/test_get_tutorials.py)",
28
+ "mcp__bookstack__bookstack_pages_read",
29
+ "mcp__bookstack__bookstack_pages_update",
30
+ "Bash(gh issue create --repo gilestrolab/ethoscopy --title 'Tutorial data pickles missing from PyPI wheel \\(2.0.0 – 2.0.4\\)' --body ' *)",
31
+ "Bash(git add *)",
32
+ "Bash(git commit *)",
33
+ "Bash(git push *)",
34
+ "Bash(git tag *)",
35
+ "Bash(gh release create v2.0.5 --repo gilestrolab/ethoscopy --title 'v2.0.5 — package tutorial data separately' --notes ' *)",
36
+ "Bash(gh run *)",
37
+ "Bash(gh issue *)",
38
+ "Bash(.venv/bin/twine check *)",
39
+ "Bash(.venv/bin/twine upload *)",
40
+ "Bash(.venv/bin/pip index *)",
41
+ "Bash(ETHOSCOPE_LAB_TAG=1.2 docker compose build)",
42
+ "Bash(gh release *)",
43
+ "Bash(ETHOSCOPE_LAB_TAG=1.2 docker compose build --no-cache --progress=plain)",
44
+ "Bash(grep -E --line-buffered '^#[0-9]+ \\(ERROR|CANCELED\\)|^#[0-9]+ DONE [0-9.]+s$|^ERROR|^failed to solve|Execution halted|^Error: Required R packages|non-zero code|^naming to|^ *=> .* done *$')",
45
+ "Bash(grep -E --line-buffered '^#[0-9]+ \\(ERROR|CANCELED\\)$|^#[0-9]+ DONE [0-9.]+s$|^failed to solve|Execution halted|^Error: Required R packages|Successfully built|naming to docker\\\\.io')"
46
+ ]
47
+ }
48
+ }
Binary file
@@ -13,19 +13,20 @@ jobs:
13
13
  test:
14
14
  runs-on: ubuntu-latest
15
15
  strategy:
16
+ fail-fast: false
16
17
  matrix:
17
- python-version: ['3.10', '3.11', '3.12']
18
+ python-version: ['3.12']
18
19
 
19
20
  steps:
20
21
  - uses: actions/checkout@v4
21
22
 
22
23
  - name: Set up Python ${{ matrix.python-version }}
23
- uses: actions/setup-python@v4
24
+ uses: actions/setup-python@v5
24
25
  with:
25
26
  python-version: ${{ matrix.python-version }}
26
27
 
27
28
  - name: Cache pip dependencies
28
- uses: actions/cache@v3
29
+ uses: actions/cache@v4
29
30
  with:
30
31
  path: ~/.cache/pip
31
32
  key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
@@ -69,10 +70,10 @@ jobs:
69
70
  steps:
70
71
  - uses: actions/checkout@v4
71
72
 
72
- - name: Set up Python 3.11
73
- uses: actions/setup-python@v4
73
+ - name: Set up Python 3.12
74
+ uses: actions/setup-python@v5
74
75
  with:
75
- python-version: '3.11'
76
+ python-version: '3.12'
76
77
 
77
78
  - name: Install dependencies
78
79
  run: |
@@ -92,10 +93,10 @@ jobs:
92
93
  steps:
93
94
  - uses: actions/checkout@v4
94
95
 
95
- - name: Set up Python 3.11
96
- uses: actions/setup-python@v4
96
+ - name: Set up Python 3.12
97
+ uses: actions/setup-python@v5
97
98
  with:
98
- python-version: '3.11'
99
+ python-version: '3.12'
99
100
 
100
101
  - name: Install build dependencies
101
102
  run: |
@@ -122,10 +123,10 @@ jobs:
122
123
  steps:
123
124
  - uses: actions/checkout@v4
124
125
 
125
- - name: Set up Python 3.11
126
- uses: actions/setup-python@v4
126
+ - name: Set up Python 3.12
127
+ uses: actions/setup-python@v5
127
128
  with:
128
- python-version: '3.11'
129
+ python-version: '3.12'
129
130
 
130
131
  - name: Install dependencies
131
132
  run: |
@@ -11,14 +11,15 @@ jobs:
11
11
  test:
12
12
  runs-on: ubuntu-latest
13
13
  strategy:
14
+ fail-fast: false
14
15
  matrix:
15
- python-version: ['3.10', '3.11', '3.12']
16
+ python-version: ['3.12']
16
17
 
17
18
  steps:
18
19
  - uses: actions/checkout@v4
19
20
 
20
21
  - name: Set up Python ${{ matrix.python-version }}
21
- uses: actions/setup-python@v4
22
+ uses: actions/setup-python@v5
22
23
  with:
23
24
  python-version: ${{ matrix.python-version }}
24
25
 
@@ -30,7 +31,7 @@ jobs:
30
31
 
31
32
  - name: Run tests
32
33
  run: |
33
- python -m pytest tests/ -v --cov=ethoscopy -m "not slow"
34
+ python -m pytest tests/ -v --cov=ethoscopy -m "unit or integration"
34
35
 
35
36
  build-and-publish:
36
37
  needs: test
@@ -39,10 +40,10 @@ jobs:
39
40
  steps:
40
41
  - uses: actions/checkout@v4
41
42
 
42
- - name: Set up Python 3.11
43
- uses: actions/setup-python@v4
43
+ - name: Set up Python 3.12
44
+ uses: actions/setup-python@v5
44
45
  with:
45
- python-version: '3.11'
46
+ python-version: '3.12'
46
47
 
47
48
  - name: Install build dependencies
48
49
  run: |
@@ -51,7 +51,7 @@ repos:
51
51
  language: system
52
52
  pass_filenames: false
53
53
  always_run: true
54
- stages: [commit]
54
+ stages: [pre-commit]
55
55
 
56
56
  - id: pytest-fast
57
57
  name: pytest-fast
@@ -59,4 +59,4 @@ repos:
59
59
  language: system
60
60
  pass_filenames: false
61
61
  always_run: true
62
- stages: [push]
62
+ stages: [pre-push]
@@ -9,7 +9,7 @@ Ethoscopy is a Python data analysis toolbox for behavioral time series data from
9
9
  ## Development Environment
10
10
 
11
11
  ### Python Environment
12
- - **Use Python 3.10+** (project requires >=3.10,<4.0)
12
+ - **Use Python 3.12+** (project requires >=3.12,<4.0)
13
13
  - **Always use virtual environment** (`.venv` as mentioned in user's global instructions)
14
14
  - **Install in development mode**: `pip install -e .`
15
15
 
@@ -21,7 +21,7 @@ Ethoscopy is a Python data analysis toolbox for behavioral time series data from
21
21
  ### Key Dependencies
22
22
  - Core: pandas >=2.2.2, numpy >=2.0.0
23
23
  - Visualization: plotly >=5.22.0, seaborn >=0.13.2
24
- - Analysis: hmmlearn >=0.3.2, astropy >=6.1, pywavelets >=1.6.0
24
+ - Analysis: hmmlearn >=0.3.2, astropy >=7.0, pywavelets >=1.6.0
25
25
  - Dev: ipykernel for Jupyter notebook support
26
26
 
27
27
  ## Build and Development Commands
@@ -0,0 +1,25 @@
1
+ # ============================================================================
2
+ # DUMMY AUTHENTICATOR (Simple Shared Password)
3
+ # ============================================================================
4
+ # Default authentication method - all users share the same password
5
+ # Best for: Lab environments, small teams, trusted networks
6
+
7
+ # Authenticator type (must be 'dummy' for this configuration)
8
+ AUTHENTICATOR_CLASS=dummy
9
+
10
+ # Shared password for all users
11
+ DUMMY_PASSWORD=ethoscope
12
+
13
+ # Comma-separated list of allowed users
14
+ ALLOWED_USERS=amadabhushi,ggilestro,mjoyce,lguo,labguest1,labguest2,labguest3,labguest4,labguest5,labguest6,labguest7,labguest8,ethoscopelab
15
+
16
+ # Comma-separated list of admin users
17
+ ADMIN_USERS=ggilestro
18
+
19
+ # Docker user/group (optional, defaults to 1000:1000)
20
+ UID=1000
21
+ GID=1000
22
+
23
+ # JupyterHub and Ethoscope Lab versions
24
+ JUPYTER_HUB_TAG=5.3.0
25
+ ETHOSCOPE_LAB_TAG=1.1
@@ -0,0 +1,39 @@
1
+ # ============================================================================
2
+ # GITHUB OAUTH AUTHENTICATOR
3
+ # ============================================================================
4
+ # Authenticate users via their GitHub accounts
5
+ # Best for: Open source projects, teams already using GitHub
6
+ #
7
+ # Setup Instructions:
8
+ # 1. Go to GitHub Settings > Developer Settings > OAuth Apps
9
+ # 2. Create a new OAuth App
10
+ # 3. Set Homepage URL: http://your-server:8082
11
+ # 4. Set Authorization callback URL: http://your-server:8082/hub/oauth_callback
12
+ # 5. Copy the Client ID and generate a Client Secret
13
+
14
+ # Authenticator type
15
+ AUTHENTICATOR_CLASS=github
16
+
17
+ # OAuth credentials from GitHub OAuth App
18
+ OAUTH_CLIENT_ID=your_github_client_id_here
19
+ OAUTH_CLIENT_SECRET=your_github_client_secret_here
20
+
21
+ # Callback URL (must match what you set in GitHub OAuth App)
22
+ OAUTH_CALLBACK_URL=http://your-server:8082/hub/oauth_callback
23
+
24
+ # (Optional) Restrict to GitHub organization members
25
+ # GITHUB_ORG=your-organization-name
26
+
27
+ # Comma-separated list of allowed users (GitHub usernames)
28
+ ALLOWED_USERS=username1,username2,username3
29
+
30
+ # Comma-separated list of admin users (GitHub usernames)
31
+ ADMIN_USERS=your-github-username
32
+
33
+ # Docker user/group (optional, defaults to 1000:1000)
34
+ UID=1000
35
+ GID=1000
36
+
37
+ # JupyterHub and Ethoscope Lab versions
38
+ JUPYTER_HUB_TAG=5.3.0
39
+ ETHOSCOPE_LAB_TAG=1.1
@@ -0,0 +1,41 @@
1
+ # ============================================================================
2
+ # GOOGLE OAUTH AUTHENTICATOR
3
+ # ============================================================================
4
+ # Authenticate users via their Google accounts
5
+ # Best for: Organizations using Google Workspace, universities with Google
6
+ #
7
+ # Setup Instructions:
8
+ # 1. Go to Google Cloud Console (console.cloud.google.com)
9
+ # 2. Create a new project or select existing
10
+ # 3. Enable Google+ API
11
+ # 4. Go to Credentials > Create Credentials > OAuth 2.0 Client ID
12
+ # 5. Set Application type: Web application
13
+ # 6. Add Authorized redirect URI: http://your-server:8082/hub/oauth_callback
14
+ # 7. Copy the Client ID and Client Secret
15
+
16
+ # Authenticator type
17
+ AUTHENTICATOR_CLASS=google
18
+
19
+ # OAuth credentials from Google Cloud Console
20
+ OAUTH_CLIENT_ID=your_google_client_id.apps.googleusercontent.com
21
+ OAUTH_CLIENT_SECRET=your_google_client_secret_here
22
+
23
+ # Callback URL (must match what you set in Google Cloud Console)
24
+ OAUTH_CALLBACK_URL=http://your-server:8082/hub/oauth_callback
25
+
26
+ # (Optional) Restrict to Google Workspace domain
27
+ # GOOGLE_HOSTED_DOMAIN=yourdomain.com
28
+
29
+ # Comma-separated list of allowed users (Gmail addresses without @gmail.com or @yourdomain.com)
30
+ ALLOWED_USERS=user1,user2,user3
31
+
32
+ # Comma-separated list of admin users
33
+ ADMIN_USERS=your-email-username
34
+
35
+ # Docker user/group (optional, defaults to 1000:1000)
36
+ UID=1000
37
+ GID=1000
38
+
39
+ # JupyterHub and Ethoscope Lab versions
40
+ JUPYTER_HUB_TAG=5.3.0
41
+ ETHOSCOPE_LAB_TAG=1.1
@@ -0,0 +1,53 @@
1
+ # ============================================================================
2
+ # KEYCLOAK / GENERIC OIDC AUTHENTICATOR
3
+ # ============================================================================
4
+ # Authenticate users via Keycloak or any OIDC-compliant provider
5
+ # Best for: Organizations with existing SSO, enterprise environments
6
+ #
7
+ # Setup Instructions for Keycloak:
8
+ # 1. Log into your Keycloak Admin Console
9
+ # 2. Select your realm (e.g., 'gilestro-lab')
10
+ # 3. Go to Clients > Create Client
11
+ # 4. Set Client ID: jupyterhub
12
+ # 5. Set Client Protocol: openid-connect
13
+ # 6. Set Access Type: confidential
14
+ # 7. Set Valid Redirect URIs: http://your-server:8082/hub/oauth_callback
15
+ # 8. Save and go to Credentials tab to get the Client Secret
16
+ # 9. Create users in Keycloak matching your existing home directory names
17
+
18
+ # Authenticator type
19
+ AUTHENTICATOR_CLASS=generic
20
+
21
+ # OAuth credentials from Keycloak client
22
+ OAUTH_CLIENT_ID=jupyterhub
23
+ OAUTH_CLIENT_SECRET=your_keycloak_client_secret_here
24
+
25
+ # Callback URL
26
+ OAUTH_CALLBACK_URL=http://your-server:8082/hub/oauth_callback
27
+
28
+ # Keycloak OIDC endpoints (replace YOUR_KEYCLOAK_SERVER and YOUR_REALM)
29
+ # Example: http://keycloak.example.com/realms/gilestro-lab
30
+ OAUTH_AUTHORIZE_URL=http://YOUR_KEYCLOAK_SERVER/realms/YOUR_REALM/protocol/openid-connect/auth
31
+ OAUTH_TOKEN_URL=http://YOUR_KEYCLOAK_SERVER/realms/YOUR_REALM/protocol/openid-connect/token
32
+ OAUTH_USERDATA_URL=http://YOUR_KEYCLOAK_SERVER/realms/YOUR_REALM/protocol/openid-connect/userinfo
33
+
34
+ # Username claim (Keycloak uses 'preferred_username' by default)
35
+ OAUTH_USERNAME_CLAIM=preferred_username
36
+
37
+ # OAuth scopes (comma-separated, optional)
38
+ OAUTH_SCOPE=openid,profile,email
39
+
40
+ # CRITICAL: Keycloak usernames MUST match existing home directory names exactly
41
+ # Comma-separated list of allowed users
42
+ ALLOWED_USERS=amadabhushi,ggilestro,mjoyce,lguo,labguest1,labguest2,labguest3,labguest4,labguest5,labguest6,labguest7,labguest8,ethoscopelab
43
+
44
+ # Comma-separated list of admin users
45
+ ADMIN_USERS=ggilestro
46
+
47
+ # Docker user/group (optional, defaults to 1000:1000)
48
+ UID=1000
49
+ GID=1000
50
+
51
+ # JupyterHub and Ethoscope Lab versions
52
+ JUPYTER_HUB_TAG=5.3.0
53
+ ETHOSCOPE_LAB_TAG=1.1
@@ -1,5 +1,5 @@
1
1
  # Dockerfile for jupyter-rethomics
2
- ARG JUPYTER_HUB_TAG=5.3.0
2
+ ARG JUPYTER_HUB_TAG=5.4.0
3
3
  FROM jupyterhub/jupyterhub:${JUPYTER_HUB_TAG}
4
4
 
5
5
  # ============================================================================
@@ -25,6 +25,16 @@ RUN apt-get update && \
25
25
  libtiff-dev \
26
26
  libxml2-dev \
27
27
  libpam0g-dev \
28
+ libssl-dev \
29
+ libgit2-dev \
30
+ libssh2-1-dev \
31
+ libfreetype6-dev \
32
+ libpng-dev \
33
+ libjpeg-dev \
34
+ libwebp-dev \
35
+ libcap-dev \
36
+ python3-dev \
37
+ pkg-config \
28
38
  wget \
29
39
  lsb-release \
30
40
  software-properties-common \
@@ -70,16 +80,23 @@ RUN pip3 install jupyterlab-spreadsheet-editor
70
80
  # ============================================================================
71
81
 
72
82
  # Install Python data science packages
83
+ # Including oauthenticator for flexible authentication support
73
84
  RUN pip3 install \
85
+ oauthenticator \
74
86
  pandas \
75
87
  seaborn \
76
88
  bokeh \
77
89
  lifelines \
78
90
  opencv-python \
79
91
  mysql-connector \
80
- ethoscopy
92
+ ethoscopy
81
93
  # pycatch22
82
94
 
95
+ # Pre-populate tutorial datasets inside the installed package so non-root
96
+ # JupyterHub users don't have to download them on first notebook run. The
97
+ # pickles (~36 MB total) live in the ethoscopy repo, not the PyPI wheel.
98
+ RUN python3 -c "from ethoscopy.misc.get_tutorials import download_tutorial_data, package_tutorial_data_dir; download_tutorial_data(dest_dir=package_tutorial_data_dir(), verbose=True)"
99
+
83
100
  # Install Ethoscope from source
84
101
  RUN git clone https://github.com/gilestrolab/ethoscope.git /opt/ethoscope && \
85
102
  cd /opt/ethoscope/ && git checkout dev && \
@@ -12,43 +12,36 @@ The command to use to recreate that image is `JUPYTER_HUB_TAG=5.3.0 ETHOSCOPE_LA
12
12
 
13
13
  After creation, the image can be run using the enclosed `docker-compose.yml` file, replacing values as fit.
14
14
 
15
- ## Add new users to the JupyterHub
15
+ ## Authentication and User Management
16
16
 
17
- To add new users to the JupyterHub instance:
17
+ This JupyterHub instance supports multiple authentication methods including:
18
+ - **Keycloak OAuth** (current production setup at auth.gilest.ro)
19
+ - GitHub OAuth
20
+ - Google OAuth
21
+ - GitLab OAuth
22
+ - Dummy authenticator (shared password)
18
23
 
19
- ### 1. Modify the jupyterhub_config.py file
24
+ ### Adding New Users
20
25
 
21
- Edit the `allowed_users` set on lines 14-19 to include your new usernames:
26
+ **⚠️ Important**: Adding a new user requires steps on BOTH the authentication provider AND the JupyterHub host.
22
27
 
23
- ```python
24
- c.Authenticator.allowed_users = {
25
- 'amadabhushi', 'ggilestro', 'mjoyce', 'lguo',
26
- 'labguest1', 'labguest2', 'labguest3', 'labguest4',
27
- 'labguest5', 'labguest6', 'labguest7', 'labguest8',
28
- 'ethoscopelab', 'newuser1', 'newuser2' # Add your new users here
29
- }
30
- ```
31
-
32
- To make a user an admin, add them to the `admin_users` set on line 22:
28
+ For detailed instructions on adding users, making users admins, and switching authentication methods, see:
33
29
 
34
- ```python
35
- c.Authenticator.admin_users = {'ggilestro', 'newadmin'}
36
- ```
30
+ **📖 [README_AUTH.md](./README_AUTH.md) - Complete Authentication and User Management Guide**
37
31
 
38
- ### 2. Restart the Docker container
32
+ ### Quick Reference
39
33
 
40
- After modifying the config file:
34
+ **For Keycloak (current setup)**:
35
+ 1. Add user to Keycloak at `auth.gilest.ro` in the `gilestro-lab` realm
36
+ 2. Create home directory on host: `sudo mkdir -p /mnt/homes/username && sudo chown 1000:1000 /mnt/homes/username`
37
+ 3. (Optional) Add to `config/users.py` if using whitelist enforcement
41
38
 
42
- ```bash
43
- docker compose down
44
- docker compose up -d
45
- ```
39
+ **For Dummy Auth**:
40
+ 1. Add username to `config/users.py` or `.env` file
41
+ 2. Create home directory on host
42
+ 3. Restart container
46
43
 
47
- **Notes:**
48
- - All users share the same password: `ethoscope` (line 11)
49
- - The system uses DummyAuthenticator for simple shared-password authentication
50
- - Each user gets their own home directory at `/home/{username}`
51
- - Home directories are created automatically when users first log in
44
+ See [README_AUTH.md](./README_AUTH.md) for complete step-by-step instructions.
52
45
 
53
46
  ## Mounting Home Directories as Volumes
54
47