Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup CLI #401

Draft
wants to merge 96 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
02c9b17
The machine config for the instrument is already accessed via key
d-j-hatton Oct 15, 2024
3d747ad
No longer strictly an int
d-j-hatton Oct 15, 2024
66a424d
Allow spaces in directory names when looking for gain references
d-j-hatton Oct 17, 2024
c18c782
Fix for instrument card display now that the whole machine configurat…
d-j-hatton Oct 17, 2024
29f50ac
Ignore parts with spaces, don't remove them
d-j-hatton Oct 17, 2024
8e4b0e2
Remove unused function
d-j-hatton Oct 17, 2024
60ec9a1
THe function wasn't unused but should be renamed
d-j-hatton Oct 17, 2024
7c6548f
If there is no ISPyB connection then autogenerate data collection and…
d-j-hatton Oct 17, 2024
a1996a9
Setup for multigrid controller to be able to skip the rsync step
d-j-hatton Oct 17, 2024
df0719c
Make data transfer option configurable
d-j-hatton Oct 18, 2024
42984f1
Extend data transfer option configuration to TUI
d-j-hatton Oct 18, 2024
600d71f
Add visit creation option in TUI
d-j-hatton Oct 21, 2024
d171395
Explanatory comment
d-j-hatton Oct 24, 2024
aed6c98
Remove some path construction that is specific to DLS directory struc…
d-j-hatton Oct 24, 2024
74871e1
Starting to add some description to configuration
d-j-hatton Oct 24, 2024
7fc5e28
Further improvements to machine configuration including some validati…
d-j-hatton Oct 24, 2024
b6b6b50
Early development of command line tool for generating a configuration…
d-j-hatton Oct 24, 2024
616ecaf
Merged recent changes from 'main' branch
tieneupin Nov 11, 2024
db60fa4
Rearranged MachineConfig keys by purpose and added descriptions
tieneupin Nov 12, 2024
816738a
Renamed Security as ServerConfig, given the change in its contents
tieneupin Nov 13, 2024
70e1c68
Fixed '_resize_initial_model' since 'executables' dict stores Path ob…
tieneupin Nov 13, 2024
c53b099
Replaced 'from_file' with 'machine_config_from_file' for greater clarity
tieneupin Nov 13, 2024
3e13879
Updated code to reflect type changes of parameters from str to Path a…
tieneupin Nov 13, 2024
203eaac
Renamed 'security_from_file' to 'server_config_from_file' for greater…
tieneupin Nov 13, 2024
2888524
Renamed 'ServerConfig' to 'GlobalConfig' and 'get_security_config' to…
tieneupin Nov 13, 2024
bde9c95
Missed renaming 'get_security_config' in 'tests' folder
tieneupin Nov 13, 2024
edfb058
Added default options to the description of 'flip_gain'
tieneupin Nov 13, 2024
c1a7ccf
Rearranged keys and updated descriptions
tieneupin Nov 14, 2024
e6178db
Updated 'generate_config' CLI (WIP)
tieneupin Nov 14, 2024
4e77371
Fixed errors in code logic
tieneupin Nov 15, 2024
3ac7467
Set data transfer and data processing to False by default; set rsync …
tieneupin Nov 15, 2024
b7ac67f
Fixed logic in setup to save config as a YAML file with complex objec…
tieneupin Nov 15, 2024
e7b37bf
Adjusted type hint for 'rsync_module'
tieneupin Nov 18, 2024
617d84b
Fixed logic when saving config; adjusted colour of messages
tieneupin Nov 18, 2024
92a57df
Added debug flag for machine config setup; further updated colours of…
tieneupin Nov 18, 2024
bf2ce95
Replaced 'exit() in 'set_up_machine_config' with 'return'.
tieneupin Nov 18, 2024
4cf7e2a
Added function to set up data directories
tieneupin Nov 18, 2024
a7a6b05
Updated notes and type hints for 'camera'
tieneupin Nov 18, 2024
71de649
Added function to set up directories for Murfey to create
tieneupin Nov 18, 2024
422d1f5
Added function to set up folders to analyse; added validation to setu…
tieneupin Nov 18, 2024
0cf5b15
Added function to standardise field validation.
tieneupin Nov 19, 2024
97e7117
Updated field description
tieneupin Nov 19, 2024
03d60f5
Added more helper functions to construct generics lists and dicts, an…
tieneupin Nov 19, 2024
9954b76
Replaced requesting for calibration JSONs with manual input instead (…
tieneupin Nov 20, 2024
8c5b3a8
Added logic to sort fully numeric dictionary keys numerically and sep…
tieneupin Nov 20, 2024
431e477
Updated dictionary and list sorting conditions
tieneupin Nov 20, 2024
b551dfd
Updated dictionary and list sorting conditions
tieneupin Nov 20, 2024
e21928a
Fixed sorting logic for lists and dicts; added option to restrict all…
tieneupin Nov 20, 2024
e64eadd
Replaced more parts of the config setup with the generic dict and lis…
tieneupin Nov 20, 2024
24f3a49
Added option to pass functions as inputs to the list and dict constru…
tieneupin Nov 20, 2024
a8e66eb
Replaced parts of 'add_software_package' with the generic list and di…
tieneupin Nov 20, 2024
e784085
Replaced parts of 'add_create_directories' with the generic dict cons…
tieneupin Nov 20, 2024
9b7f6de
Added generic constructors for folder names, folder paths, and file p…
tieneupin Nov 20, 2024
9d6679a
Replaced directory creation functions with the generic ones
tieneupin Nov 20, 2024
423460d
Updated description to make it more accurate
tieneupin Nov 21, 2024
d90b585
Updated description of 'upstream_data_directories'
tieneupin Nov 21, 2024
975f04a
Added function to handle data transfer related fields in config
tieneupin Nov 21, 2024
2925f66
Added placeholders to lambda functions to make sure sorting criteria …
tieneupin Nov 21, 2024
0cffe36
Allowed more functions to offer to be run again if a field fails vali…
tieneupin Nov 21, 2024
c3be80e
Added function to populate data processing fields in config
tieneupin Nov 21, 2024
ae8a9fe
Adjusted order of some keys in MachineConfig
tieneupin Nov 21, 2024
8878244
Updated descriptionof 'external_environment' field in MachineConfig
tieneupin Nov 21, 2024
1f6a774
Added functions to handle external executables and environments, as w…
tieneupin Nov 21, 2024
6ffd694
Forgot to remove a #TODO comment
tieneupin Nov 21, 2024
0dae68a
Added logic to write machine configs to YAML file in alphabetical ord…
tieneupin Nov 21, 2024
d977662
Add alias to 'global_configuration_path' to facilitate shift away fro…
tieneupin Nov 21, 2024
c543f6a
Added a welcome panel to the setup tool; adjusted font colours
tieneupin Nov 21, 2024
3c6a31b
Merged recent changes from main branch
tieneupin Dec 18, 2024
8db6865
Put y/n prompt in a different colour
tieneupin Dec 18, 2024
094470e
Allow setup wizard to skip sections if they are disabled; updated fon…
tieneupin Dec 19, 2024
043046e
Renamed 'generate_config' to 'create_config'
tieneupin Dec 19, 2024
cfffcf2
Empty console inputs for simple fields are now converted to the defau…
tieneupin Dec 19, 2024
aab451f
Updated data directories type from dict[str, str] to list[Path]; chan…
tieneupin Dec 19, 2024
436fab7
Added logic to use default values for fields if empty console input i…
tieneupin Dec 19, 2024
ae2d291
Recipe keys are nowtype hinted as string literals
tieneupin Dec 19, 2024
53a30ad
Grouped 'rsync_url' together with other data transfer-related keys
tieneupin Dec 19, 2024
194341b
Updated printed messages
tieneupin Dec 19, 2024
2b25266
Removed unused variable
tieneupin Dec 19, 2024
93ebb07
Modernised type hints
tieneupin Dec 19, 2024
d19683d
Fixed improperly cased 'GLOBAL_CONFIGURATION_PATH'
tieneupin Dec 19, 2024
05b1057
Union type hint still needed for Python 3.9 pytest tests
tieneupin Dec 19, 2024
d43ab64
Fixed improperly cased 'MURFEY_GLOBAL_CONFIGURATION'
tieneupin Dec 19, 2024
85d905d
'murfey_db_credentials' in GlobalConfig is now a Path
tieneupin Dec 20, 2024
c8e6caa
'murfey_db_credentials' no longer part of MachineConfig
tieneupin Dec 20, 2024
0b12cb7
Added description for 'sqlalchemy_pooling' field in GlobalConfig
tieneupin Dec 20, 2024
01f9532
Added description for the 'crypto_key' field in the GlobalConfig
tieneupin Dec 20, 2024
22b72f3
Added description for the 'feedback_queue' field in the GlobalConfig
tieneupin Dec 20, 2024
3742c71
Added description for the 'auth_type' field in the GlobalConfig
tieneupin Dec 20, 2024
67e9322
Merged recent changes from 'main' branch
tieneupin Jan 7, 2025
aba0618
'MachineConfig.rsync_basepath' is now no longer None
tieneupin Jan 7, 2025
af80bf3
Grouped all skippable keys under a single 'if' block
tieneupin Jan 7, 2025
9167512
Adjust logic for using default values when an empty console input is …
tieneupin Jan 8, 2025
a69aa2a
Merged recent changes from 'main' branch and resolved merge conflicts
tieneupin Jan 10, 2025
838720f
'murfey_db_credentials', and 'rabbit_mq_credentials' should be mandat…
tieneupin Jan 10, 2025
a5c4029
Fixed broken logic with interactive prompt when a field doesn't have …
tieneupin Jan 10, 2025
1b117d3
Merged recent changes from 'main' branch
tieneupin Jan 13, 2025
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
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ GitHub = "https://github.com/DiamondLightSource/python-murfey"
[project.scripts]
murfey = "murfey.client:run"
"murfey.add_user" = "murfey.cli.add_user:run"
"murfey.create_config" = "murfey.cli.create_config:run"
"murfey.create_db" = "murfey.cli.create_db:run"
"murfey.db_sql" = "murfey.cli.murfey_db_sql:run"
"murfey.decrypt_password" = "murfey.cli.decrypt_db_password:run"
Expand Down
4 changes: 2 additions & 2 deletions src/murfey/cli/add_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from murfey.server.api.auth import hash_password
from murfey.server.murfey_db import url
from murfey.util.config import get_security_config
from murfey.util.config import get_global_config

Check warning on line 7 in src/murfey/cli/add_user.py

View check run for this annotation

Codecov / codecov/patch

src/murfey/cli/add_user.py#L7

Added line #L7 was not covered by tests
from murfey.util.db import MurfeyUser as User


Expand All @@ -21,7 +21,7 @@
new_user = User(
username=args.username, hashed_password=hash_password(args.password)
)
_url = url(get_security_config())
_url = url(get_global_config())

Check warning on line 24 in src/murfey/cli/add_user.py

View check run for this annotation

Codecov / codecov/patch

src/murfey/cli/add_user.py#L24

Added line #L24 was not covered by tests
engine = create_engine(_url)
with Session(engine) as murfey_db:
murfey_db.add(new_user)
Expand Down
Loading
Loading