Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
372 commits
Select commit Hold shift + click to select a range
844d5fc
Merge pull request #119 from jcbollinger/devel
delarosatrevin Aug 19, 2025
8a2e853
Merge branch 'devel' into devel-tomo
delarosatrevin Aug 19, 2025
83e871f
Merge pull request #122 from 3dem/devel-tomo
delarosatrevin Aug 19, 2025
b7d6740
Removed code from extras (now in a separate repository)
delarosatrevin Aug 19, 2025
3533bf8
Changes to load tomo sessions
delarosatrevin Aug 23, 2025
bdadaa9
Allow to update/create new users
delarosatrevin Aug 23, 2025
da386c3
Updated templates for tomo live
delarosatrevin Aug 23, 2025
4345104
More on displaying tomograms
delarosatrevin Aug 26, 2025
2eaae17
More on tomo slides display
delarosatrevin Aug 28, 2025
59b693b
Plotting thickness if exist
delarosatrevin Sep 2, 2025
5be0b9a
Added repair as a booking type and added #projects to report
delarosatrevin Sep 4, 2025
538747e
Provide micrographs timestamp
delarosatrevin Sep 5, 2025
7131938
Fixed timestamp notUTC in stockChart
delarosatrevin Sep 5, 2025
071d4c4
Fixed slice_step for TS
delarosatrevin Sep 5, 2025
9cde703
Remove unused templates
delarosatrevin Sep 10, 2025
5d4f7e1
Better display of errors and user's plots
delarosatrevin Sep 10, 2025
1fda872
Improving usage reports
delarosatrevin Sep 10, 2025
4c9766e
Updated templates related to reports
delarosatrevin Sep 10, 2025
9f58d87
Added charts for cluster usage
delarosatrevin Sep 11, 2025
62d7d96
Updated graph styles
delarosatrevin Sep 12, 2025
437b8d6
Fixed overlapping validation
delarosatrevin Sep 12, 2025
2190196
Fixed when missing timestamp
delarosatrevin Sep 21, 2025
074585e
Cleaned debug prints and fixed when missing timestamp
delarosatrevin Sep 21, 2025
3429e75
Added a Grids/Pucks searchable table
delarosatrevin Sep 21, 2025
a2123c5
Allow Booking's Experiment form to be embedded
delarosatrevin Oct 7, 2025
d564422
Better management when owner is None
delarosatrevin Oct 7, 2025
3dd18f4
Updated booking type categories and colors for usage report
delarosatrevin Oct 16, 2025
afd5c24
Updated templates related to usage report
delarosatrevin Oct 16, 2025
4f4c437
Allow to selected resources, hide slots and removed unnecessary get_b…
delarosatrevin Oct 17, 2025
d41d874
Allow to modify booking.extra when displaying Booking Form
delarosatrevin Oct 20, 2025
9d17fec
Removed sameHeight on dynamic form, so entries not displaying well
delarosatrevin Oct 20, 2025
829f4a4
Allow session to store RAW and OTF paths, fixed Exception message
delarosatrevin Oct 22, 2025
ab32254
Script to populate datasets from given folders
delarosatrevin Oct 22, 2025
d27a31d
Allow to specify validation function for entries
delarosatrevin Oct 24, 2025
bd49fd7
Working on request validation
delarosatrevin Oct 28, 2025
1e965b8
Provide PI info in get_session_users()
delarosatrevin Oct 29, 2025
d12e661
Separated import of modals into another file
delarosatrevin Nov 5, 2025
169a0f2
Added functions for tomogramphy processing
delarosatrevin Nov 5, 2025
e8ac14a
Updated templates for tomo processing
delarosatrevin Nov 5, 2025
17c9772
Raise Exception if the requested file is not there
delarosatrevin Nov 5, 2025
9268abd
Fixing autoscrolling issue when double modals
delarosatrevin Nov 5, 2025
f7dfd4b
Missing initialization
delarosatrevin Nov 7, 2025
4e5bdb3
Some updated to read tomography projects
delarosatrevin Nov 7, 2025
283fa1e
More for tomo processing
delarosatrevin Nov 7, 2025
7a704b3
Reading more jobs info from config
delarosatrevin Nov 9, 2025
ecde460
Implemeted ruler
delarosatrevin Nov 9, 2025
c2e1c51
More on the jobs flowchart
delarosatrevin Nov 9, 2025
e76d7cf
Added methods for saveJob/deleteJob and more on jobs definition
delarosatrevin Nov 11, 2025
8f3a7b6
Some updates in processing form
delarosatrevin Nov 12, 2025
55e5ff8
Added duplicateJob option
delarosatrevin Nov 13, 2025
c8c3051
Added API entrypoints to deal with jobs
delarosatrevin Nov 16, 2025
18dfccd
Displaying tomograms and tilt-series star files
delarosatrevin Nov 16, 2025
ecc6370
Added launchJob function
delarosatrevin Nov 16, 2025
02e9ac2
More on tomograms/tiltseries visualization
delarosatrevin Nov 16, 2025
80b943c
More progress on launching tomo jobs
delarosatrevin Nov 17, 2025
11ec710
Displaying errors after deleteJob
delarosatrevin Nov 18, 2025
4e9f0c5
Create a tomo project by default
delarosatrevin Nov 19, 2025
41dca49
Minor changes in tomo processing page
delarosatrevin Nov 19, 2025
7d349d1
Fixed display of combobox for EnumParam
delarosatrevin Nov 19, 2025
5f69538
Fixed bug when running new job
delarosatrevin Nov 20, 2025
6040148
Kept zoom and position after network refresh
delarosatrevin Nov 20, 2025
6e90f4f
Fixed default value
delarosatrevin Nov 20, 2025
a3f87da
Added widget related js files
delarosatrevin Nov 25, 2025
75de288
Branch to test workflow widget
delarosatrevin Nov 25, 2025
64a5477
Commenting testing code
delarosatrevin Nov 25, 2025
cf20977
First approach of React graph
fonsecareyna82 Nov 29, 2025
1eacbbe
First approach of React workflow
fonsecareyna82 Nov 29, 2025
75c627f
Minor fix and removed debug print
delarosatrevin Dec 1, 2025
f7a01e8
Exported RelionRun class
delarosatrevin Dec 1, 2025
22843aa
Added new test template for ProjectWidget
delarosatrevin Dec 1, 2025
d0fd427
Testing workflow display
delarosatrevin Dec 1, 2025
43e2ae6
Minor style fix
delarosatrevin Dec 1, 2025
40352cc
Added some more sample workflows
delarosatrevin Dec 1, 2025
c953c39
Updated outputs
delarosatrevin Dec 1, 2025
15fbf0c
Modifying widgets: Fixing the spacing between nodes
fonsecareyna82 Dec 8, 2025
30cd33c
Added testData to project 43
delarosatrevin Dec 8, 2025
0e81db7
AVS dashboard and some other developments
delarosatrevin Dec 12, 2025
566d8d2
Added fibsem content and templates
delarosatrevin Dec 12, 2025
c05d2f9
Fixed how to load inputs/outputs
delarosatrevin Dec 16, 2025
eaa4caf
Clean styles: isolating styles in the components.
fonsecareyna82 Dec 22, 2025
458ee9c
Merge pull request #128 from 3dem/test_widget_isolating_styles
delarosatrevin Dec 22, 2025
86f5661
Restored card div
delarosatrevin Dec 22, 2025
e759f89
Allow project_widget test page to load the workflow with new widget a…
delarosatrevin Dec 23, 2025
31de252
Fixing widget: auto-unmount UMD ProjectPage widget on DOM detach (Fla…
fonsecareyna82 Dec 23, 2025
a5f0622
Updated to have enumParam with dict as choices
delarosatrevin Dec 23, 2025
0af7502
Merge branch 'devel' into test_widget
delarosatrevin Jan 5, 2026
46d206c
Add FIBSEM content
delarosatrevin Jan 7, 2026
7ccb39b
Improved way to get current directory for bash script
delarosatrevin Jan 13, 2026
153dc4a
Removed unnecesary API classes
delarosatrevin Jan 13, 2026
e4281ea
Removed unnecesary imports
delarosatrevin Jan 13, 2026
952fdbb
Modifying the widgets to the new structure
fonsecareyna82 Jan 13, 2026
36fb2ef
Merge pull request #127 from 3dem/test_widget
delarosatrevin Jan 13, 2026
e3b2b75
Merge remote-tracking branch 'origin/test_widget' into test_widget
fonsecareyna82 Jan 13, 2026
597b24b
Removed old tomo_sessions_list page
delarosatrevin Jan 14, 2026
c28c762
Added entry_form:tomo_processing
delarosatrevin Jan 14, 2026
57f6282
Merge pull request #129 from 3dem/test_widget
delarosatrevin Jan 14, 2026
f83d3f6
Fixed script generation
delarosatrevin Jan 14, 2026
273852b
Fixed default processing side bar
delarosatrevin Jan 14, 2026
d0fd65e
Added extra example for processing usage
delarosatrevin Jan 14, 2026
24160b4
Updated data to display workflow with the widget
delarosatrevin Jan 14, 2026
7bf20a5
Testing to load the job form and values
delarosatrevin Jan 14, 2026
b65138f
Debugging form parameters with widget
delarosatrevin Jan 14, 2026
598644e
Updating widgets to the new JSON structure
fonsecareyna82 Jan 16, 2026
7128985
Updating the JSON to the new structure
fonsecareyna82 Jan 16, 2026
4a38204
ProtocolForm: render LabelParam(Label), fix JSON viewer double bracke…
fonsecareyna82 Jan 16, 2026
043507d
Adding methods to the ProjectPage widget service contract on the Flas…
fonsecareyna82 Jan 17, 2026
48ddeb5
Updated test
delarosatrevin Jan 17, 2026
13722c2
Merge branch 'test_widget' of github.com:3dem/emhub into test_widget
delarosatrevin Jan 17, 2026
ea18aae
Updated old forms
delarosatrevin Jan 18, 2026
130f07d
Separated fake projects into another page
delarosatrevin Jan 20, 2026
e79bc41
Renamed project_widget2 to project_widget
delarosatrevin Jan 20, 2026
f46bcd1
Now displaying workflows/protocols and more API for savingProtocol an…
delarosatrevin Jan 21, 2026
bd7a069
Removed unused json file
delarosatrevin Jan 21, 2026
d7e117c
Merge pull request #130 from 3dem/test_widget
delarosatrevin Jan 21, 2026
356e59f
Adding external viewers bridge (placeholder + routing rules)
fonsecareyna82 Jan 22, 2026
458fed4
Defining an output in the ProtocolForm
fonsecareyna82 Jan 22, 2026
eefa6fc
Trying to link to React viewers
delarosatrevin Jan 22, 2026
33e9d21
Fixinig(analyze result): Minimize outputRaw context and stabilize ext…
fonsecareyna82 Jan 23, 2026
236bd5a
More work into integrating ProjectWidget with EMhub viewers
delarosatrevin Jan 23, 2026
72c437a
Calling resolveAnalyzeViewer before opening AnalyzeOutputDialog
fonsecareyna82 Jan 24, 2026
d220d95
Trying to connect job related functions from the service API
delarosatrevin Jan 25, 2026
738a9c3
Removed fake workflow from content function
delarosatrevin Jan 27, 2026
035c76a
Moved get_workflow method and compatible with widget UI
delarosatrevin Jan 27, 2026
bd4ca3a
Updated API functions related to jobs
delarosatrevin Jan 27, 2026
6240ea8
Updated templates for using the jobs API and update project widget
delarosatrevin Jan 27, 2026
d371b87
Add duplicateProtocol method to handle protocol duplication in projec…
fonsecareyna82 Jan 27, 2026
a0e9947
Re-organized workflow related API endpoints
delarosatrevin Jan 27, 2026
16febd2
Updating tomo templates, using cache for refreshing project
delarosatrevin Jan 27, 2026
00818ef
Merge branch 'test_widget' of github.com:3dem/emhub into test_widget
delarosatrevin Jan 27, 2026
9d56c28
testing errors
delarosatrevin Jan 27, 2026
780b4cb
Removed unused spinner code
delarosatrevin Jan 28, 2026
6f7d70d
Restore default to workflow until widget is functional
delarosatrevin Jan 28, 2026
5338a86
Merge pull request #134 from 3dem/test_widget
delarosatrevin Jan 28, 2026
65bbce5
Updating widgets: Fixing an error closing confirm dialogs
fonsecareyna82 Jan 29, 2026
e61feb6
Updating visualization
delarosatrevin Jan 30, 2026
5741b43
Feat(ProtocolForm): enhance pointer/path params (pointerClass support…
fonsecareyna82 Jan 31, 2026
488b99c
Moved visualize function
delarosatrevin Jan 31, 2026
4a826fb
Resolved conflicts after merging devel
delarosatrevin Jan 31, 2026
ec169a0
Merge pull request #135 from 3dem/enhance_protocolform
delarosatrevin Jan 31, 2026
8295cec
Fix(ProtocolForm): serialize params without breaking special-char names
fonsecareyna82 Jan 31, 2026
4b36c05
Merge branch 'enhance_protocolform' into devel
delarosatrevin Jan 31, 2026
81ab2df
Reorganizing workflow retrieval
delarosatrevin Feb 1, 2026
e5bbb45
- Fix(outputs): infer PointerParam when pointerClass is present
fonsecareyna82 Feb 2, 2026
80c4404
Working on file browser backend methods
delarosatrevin Feb 2, 2026
993ad0a
Merge branch 'enhance_protocolform' into devel
delarosatrevin Feb 2, 2026
209ff73
Improve json files(project 43)
fonsecareyna82 Feb 2, 2026
5a79ccc
Testing new execution mode config
delarosatrevin Feb 2, 2026
373530e
Merge branch 'enhance_protocolform' into devel
delarosatrevin Feb 2, 2026
bc04744
Refactor(RemoteFileDialog): simplify protocol file browser contract.
fonsecareyna82 Feb 2, 2026
b51bb2b
Working on the browser backend
delarosatrevin Feb 2, 2026
248488e
Merge branch 'enhance_protocolform' into devel
delarosatrevin Feb 2, 2026
0b5816d
Reading menu from a config form and fixed backend for Browser
delarosatrevin Feb 2, 2026
19089a0
some fixes
delarosatrevin Feb 2, 2026
72df99f
Supporting dynamic log channels and correct offset polling
fonsecareyna82 Feb 3, 2026
8e5d8ce
Merge branch 'devel' into dynamic_log
delarosatrevin Feb 3, 2026
52705c2
Implemented logs functions and using restart mode
delarosatrevin Feb 3, 2026
24829d5
Merge pull request #136 from 3dem/dynamic_log
delarosatrevin Feb 3, 2026
e418a3d
Removed debug logs
delarosatrevin Feb 3, 2026
7398035
Removed unncesary form
delarosatrevin Feb 3, 2026
f86c773
Make widget the default view
delarosatrevin Feb 4, 2026
f6abefc
Allow to share projects
delarosatrevin Feb 5, 2026
0721214
Fix: prevent FileBrowser launch when protocolId is missing
fonsecareyna82 Feb 5, 2026
5867e61
(Fix): Alig BooleanParam layout inside Line to prevent horizontal scroll
fonsecareyna82 Feb 5, 2026
d6299ae
Reduced left sidebar width
delarosatrevin Feb 5, 2026
13e8608
Making better use of the space, specially for processing projects
delarosatrevin Feb 5, 2026
b1a2319
Improve ProjectPage: close protocol dock when opening drawers/panels
fonsecareyna82 Feb 5, 2026
1816447
Updated how to load workflows
delarosatrevin Feb 5, 2026
8a4650b
Merge branch 'devel' into help_dialogs
delarosatrevin Feb 5, 2026
6398db1
Added missing form.help attribute
delarosatrevin Feb 6, 2026
2fd3215
Fixing some error related with the contextual menu
fonsecareyna82 Feb 6, 2026
aa5993d
Fixed elapsed for widget UI
delarosatrevin Feb 6, 2026
5d9dba6
Merge branch 'help_dialogs' into devel
delarosatrevin Feb 6, 2026
b03a195
Keepping multi-selection on right-click; clear only when clicking uns…
fonsecareyna82 Feb 6, 2026
4e40076
Showing commands.txt as a log
delarosatrevin Feb 6, 2026
390f83c
Merge branch 'devel' into keep_multi_selecction
delarosatrevin Feb 6, 2026
877d690
Improving Group parameter
fonsecareyna82 Feb 8, 2026
f40d0cf
Fixed some styling and added some functions
delarosatrevin Feb 9, 2026
e4406b8
working on TS display
delarosatrevin Feb 9, 2026
b007667
working on tomogram/ts visualization
delarosatrevin Feb 10, 2026
3aa0b00
Minor fixed in tomographs table
delarosatrevin Feb 11, 2026
b38e251
Improving the GUI: handle enum dict choices, preserve log scroll posi…
fonsecareyna82 Feb 11, 2026
12d46f3
Merge branch 'devel' into keep_multi_selecction
delarosatrevin Feb 11, 2026
ae83a41
Merge pull request #138 from 3dem/keep_multi_selecction
delarosatrevin Feb 11, 2026
7af3285
First version of supporting tag for projects/protocols
delarosatrevin Feb 11, 2026
1b4d627
Fix(ProtocolForm): keep Metadata tab in sync with live form params
fonsecareyna82 Feb 12, 2026
ba27e85
Fixed Tags loading and removed debug console.log
delarosatrevin Feb 12, 2026
8a9bb12
Merge branch 'devel' of github.com:3dem/emhub into devel
delarosatrevin Feb 12, 2026
ea2d728
Allow configuration for contextual menu
fonsecareyna82 Feb 13, 2026
7b8031d
remove unused action
fonsecareyna82 Feb 13, 2026
a5b8123
Defined the subset for the contextual menu
delarosatrevin Feb 13, 2026
e3bdd82
Added functions and templates for cluster monitoring pages
delarosatrevin Feb 13, 2026
1c308fc
Fixed id when creating/udpating tags
delarosatrevin Feb 13, 2026
52f1da7
Moved edit button to first column
delarosatrevin Feb 17, 2026
64b93d7
Working on FSC plots
delarosatrevin Feb 17, 2026
93e2084
fixed typo
taputechnic Feb 18, 2026
e790f0b
Supporting raw-json preview payloads (base64 sources)
fonsecareyna82 Feb 18, 2026
2f10c28
Merge branch 'devel' of https://github.com/3dem/emhub into devel
taputechnic Feb 19, 2026
801467c
Implementing the backend for the new file preview methods
delarosatrevin Feb 19, 2026
549acbe
Merge branch 'devel' of https://github.com/3dem/emhub into devel
taputechnic Feb 19, 2026
46333cf
Revert "Merge branch 'devel' of https://github.com/3dem/emhub into de…
taputechnic Feb 19, 2026
36de813
Reverting back some unwanted changes
delarosatrevin Feb 19, 2026
9101067
Fixing RemoteFileDialog: match image preview background to panel
fonsecareyna82 Feb 23, 2026
050aebb
Merge branch 'devel' into fix_filebrowser
delarosatrevin Feb 23, 2026
5e00e5b
Visualization for WarpPopulation
delarosatrevin Mar 4, 2026
803bfe4
Added function to retrieve LDAP username
delarosatrevin Mar 11, 2026
4fdb06a
Add option to list bookings
delarosatrevin Mar 30, 2026
edbd5fa
Fixed bug about reporting 'unused' days when no-PI
delarosatrevin Mar 30, 2026
763055f
Feat: Update widgets; Fix: refresh tag filter combobox after editing …
fonsecareyna82 Apr 3, 2026
6a4ec5d
Make same height only for cards in the same row
delarosatrevin Apr 7, 2026
019dd19
Added indepent property per instrument for each user
delarosatrevin Apr 7, 2026
63e1c34
Added 2026 to the report page
delarosatrevin Apr 7, 2026
c4541bb
Allow to overwrite the validate_booking via app_setup.py
delarosatrevin Apr 7, 2026
4921892
Allow to set queue parameters
delarosatrevin Apr 7, 2026
ae0ab7f
Fixing some booking access
delarosatrevin Apr 13, 2026
885cde3
Print json compatible and added BSL2 in session label
delarosatrevin Apr 13, 2026
ee14911
Feat(update widgets): adding exportProtocols method
fonsecareyna82 Apr 14, 2026
25ca7e1
Added user independent by microscope
delarosatrevin Apr 17, 2026
a8db268
Added experiment info to booking and request
delarosatrevin Apr 17, 2026
8f4e26a
Updated templates for user and booking changes
delarosatrevin Apr 17, 2026
beac361
Added functions for bookings and processing projects
delarosatrevin Apr 21, 2026
a28dd76
Merge branch 'devel' of github.com:3dem/emhub into devel
delarosatrevin Apr 21, 2026
0798da5
Commented out ruler (still work-in-progress)
delarosatrevin Apr 23, 2026
b592b17
Fixed path for live session display
delarosatrevin Apr 23, 2026
2953c0b
Some fixes about booking validation
delarosatrevin Apr 23, 2026
f19cfd0
fixing indentation
delarosatrevin Apr 23, 2026
4e06a68
Added script used for update
delarosatrevin Apr 23, 2026
b20cb5b
Implemented export workflow api and client method to update session
delarosatrevin Apr 23, 2026
e7c336e
Fixed some missing forms
delarosatrevin Apr 28, 2026
e969331
Some changes in reports: export dimensions and users per year
delarosatrevin May 7, 2026
f7a6a50
Make widget the default workflow mode
delarosatrevin May 7, 2026
7b1d693
Improve protocol annotation and action dialogs
fonsecareyna82 May 12, 2026
2422c2d
Working on Logbooks
delarosatrevin May 15, 2026
f58a308
Added method to stopProtocols
delarosatrevin May 15, 2026
aed8463
Merge branch 'devel' of github.com:3dem/emhub into devel
delarosatrevin May 15, 2026
541dec0
Allow to override the login method
delarosatrevin May 26, 2026
9529eae
Display config
delarosatrevin May 26, 2026
19b3a31
Re-worked the Pucks Storage operations
delarosatrevin May 28, 2026
bb3ec9f
first prototype of Inventory
delarosatrevin May 28, 2026
5477541
Allow to create multiple inventories
delarosatrevin May 29, 2026
7fef15d
Fixed bug with inventory items and updated emh-client
delarosatrevin May 29, 2026
bcc4b5f
Several bugfixed and validations
delarosatrevin May 29, 2026
0a91f9e
Refactored project_widget and project_widget_fake, and implemented wo…
delarosatrevin Jun 1, 2026
237d0d5
Fixed bug when duplicating jobs
delarosatrevin Jun 2, 2026
69a586c
Fixing remove protocol dialog. Updating the method for organizing the…
fonsecareyna82 Jun 2, 2026
6f8100b
Merge branch 'devel' into workflow_editor
delarosatrevin Jun 2, 2026
9a5d412
update gevent 23.9.1
Jun 3, 2026
c07bc3a
Updated forms for minimal instance
delarosatrevin Jun 3, 2026
4e25f1e
Changed to queue.name
delarosatrevin Jun 10, 2026
4546514
Merge branch 'devel' into workflow_editor
delarosatrevin Jun 10, 2026
40f1803
Merge pull request #139 from 3dem/workflow_editor
delarosatrevin Jun 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
119 changes: 119 additions & 0 deletions docker/emhub_otf/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
FROM nvcr.io/hpc/relion:5.0.0

LABEL maintainer="walid"

# Point to existing CUDA
ENV CUDA_HOME=/usr/local/cuda
ENV CUDAHOME=/usr/local/cuda
ENV PATH=/usr/local/cuda/bin:$PATH
ENV LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
ENV CPATH=/usr/local/cuda/include:$CPATH

ENV PATH=/usr/local/relion/bin:$PATH
ENV LD_LIBRARY_PATH=/usr/local/relion/lib:$LD_LIBRARY_PATH

# Add NVIDIA CUDA repo for Ubuntu 22.04 (CUDA 12.3)
#RUN apt-get update && apt-get install -y wget gnupg ca-certificates && \
# wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb && \
# dpkg -i cuda-keyring_1.1-1_all.deb && \
# apt-get update

# Install system + EMHub dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
cuda-toolkit-12-3 \
libcufft-dev-12-3 \
libcurand-dev-12-3 \
software-properties-common \
git \
curl \
wget \
unzip \
libxml2-dev \
libxslt1-dev \
libfftw3-dev \
libpng-dev \
libjpeg-dev \
libtiff5-dev \
redis \
redis-server \
libopenblas-dev \
liblapack-dev \
libatlas-base-dev \
gfortran \
build-essential \
#python3-pip \
#python3-redis \
#python3-hiredis \
&& rm -rf /var/lib/apt/lists/*

# crYOLO Dependencies
RUN add-apt-repository ppa:deadsnakes/ppa \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
python3.8 \
python3.8-dev \
python3.8-distutils \
libgtk-3-dev \
libglib2.0-dev \
pkg-config \
&& rm -rf /var/lib/apt/lists/*

# Switch to a clean working dir
WORKDIR /opt

# Install PIP 3.8
RUN curl -O https://bootstrap.pypa.io/pip/3.8/get-pip.py \
&& python3.8 get-pip.py \
&& rm get-pip.py

# Install crYOLO
RUN pip3 install --upgrade pip setuptools wheel \
&& pip3 install --use-pep517 "cryolo[cu11]"

# Install MotionCor3
RUN wget https://github.com/czimaginginstitute/MotionCor3/releases/download/v1.0.1/MotionCor3_1.0.1_10-26-2023.zip \
&& unzip /opt/MotionCor3_1.0.1_10-26-2023.zip \
&& cp /opt/MotionCor3_1.0.1_Cuda122_10-26-2023 /usr/bin/MotionCor3 \
&& rm /opt/MotionCor3*

# Install ctffind5
RUN curl -L -o ctffind-5.0.2.tar.gz "https://grigoriefflab.umassmed.edu/system/tdf?path=ctffind-5.0.2.tar.gz&file=1" \
&& tar -xzf ctffind-5.0.2.tar.gz \
&& cp /opt/cisTEM/bin/* /usr/local/bin \
&& rm -r /opt/cisTEM ctffind-5.0.2.tar.gz

# Install Redis & friends
RUN apt -y remove python3-blinker
RUN pip3 install "redis[hiredis]" \
&& pip3 install "setuptools<65" \
&& pip3 install blinker

# Install EMTools
RUN git clone https://github.com/3dem/emtools.git /opt/emtools \
&& pip3 install /opt/emtools/ \
&& rm -r /opt/emtools

# Clone the EMHub repository
RUN git clone https://github.com/3dem/emhub.git /opt/emhub \
&& pip3 install /opt/emhub/ \
&& rm -r /opt/emhub

# Clone the EMWrap respository
RUN git clone https://github.com/3dem/emwrap.git /opt/emwrap \
&& pip3 install /opt/emwrap/ \
&& rm -r /opt/emwrap

# Copy the Relion binaries and fake libtiff.so.6 for relion
RUN cp /lib/x86_64-linux-gnu/libtiff.so.5 /lib/x86_64-linux-gnu/libtiff.so.6 \
&& cp /usr/local/relion/sm80/bin/* /usr/local/bin \
&& cp /usr/local/relion/sm80/lib/* /usr/local/lib

RUN ln -s /usr/bin/python3.8 /usr/bin/python

WORKDIR /root

# Set entrypoint (interactive shell)
ENTRYPOINT ["/bin/bash"]
#
## CMD to provide a default action
#CMD ["--help"]
91 changes: 67 additions & 24 deletions emhub/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
from glob import glob


__version__ = '1.0.3'
__version__ = '1.0.4rc2'


def create_app(test_config=None):
Expand All @@ -47,7 +47,7 @@ def create_app(test_config=None):
send_json_data, send_error, shortname, pairname)
from .utils.mail import MailManager

from emtools.utils import Pretty
from emtools.utils import Pretty, Path

# create and configure the app
emhub_instance_path = os.environ.get('EMHUB_INSTANCE', None)
Expand Down Expand Up @@ -135,6 +135,7 @@ def load_module(module_name):
app.jinja_loader = jinja2.FileSystemLoader(template_folders)

def register_basic_params(kwargs):
kwargs['current_app'] = app
kwargs['is_devel'] = app.is_devel
kwargs['version'] = __version__
kwargs['emhub_title'] = app.config.get('EMHUB_TITLE', '')
Expand Down Expand Up @@ -215,32 +216,29 @@ def login():
next_content = flask.request.args.get('next_content', 'dashboard')
return _redirect('main', content_id=next_content)

@app.route('/do_login', methods=['POST'])
def do_login():
""" This view will be called as POST from the user login page. """
username = flask.request.form['username']
password = flask.request.form['password']
next_content = flask.request.form.get('next_content', 'index')
authenticated = None
def _default_login_user(username, password):
user = None

if not app.config.get('CASE_SENSITIVE_USERNAMES', True):
username = username.lower()

user = app.dm.get_user_by(username=username)

if user: # First check that the user in the db, then try to authenticate
if user := app.dm.get_user_by(username=username): # First check that the user in the db, then try to authenticate
# Local authentication
if not user.check_password(password):
user = None

auth_local = user.auth_local or not app.use_ldap
return user

if auth_local:
if not user.check_password(password):
user = None
else:
response = ldap_manager.authenticate(username, password)
# Specifics are configurable. That information is not presently used.
if response.status != flask_ldap3_login.AuthenticationResponseStatus.success:
user = None # Failed authentication
@app.route('/do_login', methods=['POST'])
def do_login():
""" This view will be called as POST from the user login page. """
username = flask.request.form['username']
password = flask.request.form['password']
next_content = flask.request.form.get('next_content', 'index')
authenticated = None

login_user_func = getattr(app, 'login_user', _default_login_user)
user = login_user_func(username, password)

if not user:
flask.flash('Invalid username or password')
Expand All @@ -258,7 +256,7 @@ def do_switch_login():
""" This view will be called as POST from a currently logged admin user.
It will allow admins to login as another users for troubleshooting.
"""
if not app.user.is_admin:
if not app.user.is_manager:
return send_error("Current user is not admin!")

username = flask.request.json['username']
Expand Down Expand Up @@ -294,6 +292,10 @@ def reset_password_request():
msg = "ERROR: email can not be empty."
elif user is None:
msg = "ERROR: this email does not seen registered with any user."
elif app.mm is None:
msg = ("ERROR: You need to configure a Mail server within EMhub"
"to send reset password instructions. Please contact an "
"admin to do it or set you a temporary password.")
else:
msg = ("Instructions about how to reset your password has been "
"sent to your email.")
Expand Down Expand Up @@ -375,7 +377,7 @@ def get_content():

@app.template_filter('basename')
def basename(filename):
return os.path.basename(filename) if filename else ''
return os.path.basename(Path.rmslash(filename)) if filename else ''

@app.template_filter('id_from_label')
def id_from_label(label):
Expand Down Expand Up @@ -413,6 +415,43 @@ def pretty_elapsed(ts):
def url_for_content(contentId, **kwargs):
return flask.url_for('main', _external=True, content_id=contentId, **kwargs)

def booking_cost(b):
""" Calculate the cost of a booking.
By default, it will be calculated based on the number of days
and the cost per day of the resource.
This function could be re-defined to change how to calculate
the booking costs. For example, one could compute the
booking cost per hours.
"""
return b.total_cost

def get_ldap_username(email):
ldap_username = None

if not app.config.get('CASE_SENSITIVE_USERNAMES', True):
email = email.lower()

user = app.dm.get_user_by(username=email)

if user: # First check that the user in the db, then try to authenticate

auth_local = user.auth_local or not app.use_ldap

if auth_local:
raise Exception("LDAP authentication is not configured.")
else:
with app.ldap_manager.connection as conn:
search_filter = f'(mail={email})'
# attributes=['sAMAccountName'] retrieves the short username
conn.search(
search_base=app.config['LDAP_BASE_DN'],
search_filter=search_filter,
attributes=['sAMAccountName']
)
ldap_username = conn.entries[0].sAMAccountName.value if conn.entries else None

return ldap_username

app.jinja_env.globals.update(url_for_content=url_for_content)
app.jinja_env.add_extension('jinja2.ext.do')
app.jinja_env.filters['basename'] = basename
Expand Down Expand Up @@ -450,7 +489,7 @@ def url_for_content(contentId, **kwargs):

if app.use_ldap:
import flask_ldap3_login
ldap_manager = flask_ldap3_login.LDAP3LoginManager(app)
app.ldap_manager = flask_ldap3_login.LDAP3LoginManager(app)

if app.config.get('MAIL_SERVER', None):
app.mm = MailManager(app)
Expand All @@ -475,6 +514,10 @@ def url_for_content(contentId, **kwargs):

app.jinja_env.filters['pretty_datetime'] = app.dm.local_datetime

app.booking_cost = booking_cost
app.get_ldap_username = get_ldap_username


extra_setup = load_module('app_setup')
if extra_setup and 'setup_app' in dir(extra_setup):
print(f"Extending app setup from: {extra_setup.__file__}")
Expand Down
Loading