Murfey validates ALL MachineConfigs in the MachineConfig file

Đang mở
#488 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
backend

Hướng nghiên cứu

Bắt đầu trong murfey/util/config.py, lần theo get_machine_config() đến from_file(), sau đó truy vết cách instrument cần quan tâm được chọn trong quá trình khởi động murfey.server --feedback. Kiểm tra cách các mục MachineConfig hỗn hợp được tải và xác thực. Được xem là hoàn tất khi một cấu hình không liên quan sử dụng định dạng key cũ không còn ngăn server của instrument đã chọn khởi động.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug server

This means that multiple versions which have changed MachineConfig behaviour cannot coexist in the same file.

It might be worth modifying the function so that it only validates the MachineConfig relevant to the instrument of interest.

The current error:

  • Updated the configs of one of our servers to reflect the new key format used in the latest Murfey release, but left the other ones untouched
  • Noticed that Murfey server failed to start, so tried starting it manually while SSH'ed to one of our storage servers
  • Got the following error message:
$ murfey.server --feedback

[02/12/25 06:44:53] INFO     Starting Murfey RabbitMQ thread             __init__.py:310
                    INFO     Starting Murfey server version 0.16.10 for  __init__.py:314
                             beamline m14, listening on 0.0.0.0:8000                    
Traceback (most recent call last):
  File "/dls_sw/apps/murfey/0.16.10/bin/murfey.server", line 8, in <module>
    sys.exit(run())
  File "/dls_sw/apps/murfey/0.16.10/lib/python3.10/site-packages/murfey/server/__init__.py", line 330, in run
    _running_server.run()
  File "/dls_sw/apps/murfey/0.16.10/lib/python3.10/site-packages/uvicorn/server.py", line 66, in run
    return asyncio.run(self.serve(sockets=sockets))
  File "/dls_sw/apps/murfey/0.16.10/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "uvloop/loop.pyx", line 1518, in uvloop.loop.Loop.run_until_complete
  File "/dls_sw/apps/murfey/0.16.10/lib/python3.10/site-packages/uvicorn/server.py", line 70, in serve
    await self._serve(sockets)
  File "/dls_sw/apps/murfey/0.16.10/lib/python3.10/site-packages/uvicorn/server.py", line 77, in _serve
    config.load()
  File "/dls_sw/apps/murfey/0.16.10/lib/python3.10/site-packages/uvicorn/config.py", line 435, in load
    self.loaded_app = import_from_string(self.app)
  File "/dls_sw/apps/murfey/0.16.10/lib/python3.10/site-packages/uvicorn/importer.py", line 19, in import_from_string
    module = importlib.import_module(module_str)
  File "/dls_sw/apps/murfey/0.16.10/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/dls_sw/apps/murfey/0.16.10/lib/python3.10/site-packages/murfey/server/main.py", line 14, in <module>
    import murfey.server.api.auth
  File "/dls_sw/apps/murfey/0.16.10/lib/python3.10/site-packages/murfey/server/api/__init__.py", line 49, in <module>
    from murfey.server.api.auth import MurfeySessionID, validate_token
  File "/dls_sw/apps/murfey/0.16.10/lib/python3.10/site-packages/murfey/server/api/auth.py", line 67, in <module>
    machine_config = get_machine_config()
  File "/dls_sw/apps/murfey/0.16.10/lib/python3.10/site-packages/murfey/util/config.py", line 172, in get_machine_config
    machine_config = from_file(
  File "/dls_sw/apps/murfey/0.16.10/lib/python3.10/site-packages/murfey/util/config.py", line 77, in from_file
    return {
  File "/dls_sw/apps/murfey/0.16.10/lib/python3.10/site-packages/murfey/util/config.py", line 78, in <dictcomp>
    i: MachineConfig(**config[i])
  File "pydantic/main.py", line 347, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 1 validation error for MachineConfig
create_directories
  value is not a valid list (type=type_error.list)
Ngôn ngữ chính
Python
Star
2
Fork
1
Merge trung bình
1 ngày 12 giờ
Pull request đã merge (30 ngày)
22

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của DiamondLightSource/python-murfey

Tất cả issue của DiamondLightSource/python-murfey

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.