Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Change design of tasks

Đang mở
#149 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ó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
20/100
Loại issue
Tính năng
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
django, python

Hướng nghiên cứu

Bắt đầu bằng cách xem xét mô hình task hiện có và DeploymentTaskSerializer, sau đó theo dõi interface AppPlugin và cách xử lý cấu hình deployment. Issue không nêu tên file hoặc test nào; cần thống nhất một thiết kế cho các task có tham số, việc kiểm tra cấu hình và hành vi của plugin chỉ thực hiện CRUD trước khi có thể bắt đầu triển khai.

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

Mô tả

enhancement

Currently, our tasks are modelled as an enum of simple tasks (e.g. LAUNCH, RESTART, HEALTH_CHECK), and do not have any parameterization, other than initial parameterization when creating a deployment. That is, tasks can return a result (status, result, traceback), but cannot be parameterized with a config. This means that we have a hard time modelling actions like configuration changes, or even tracking what the configuration changes are.

Instead, we could possibly allow tasks to be parameterized by a config, with the deployment tracking the final, most up-to-date config.

e.g.

class DeploymentTaskSerializer(serializers.ModelSerializer):
    celery_id = serializers.CharField(read_only=True)
    action = serializers.CharField() # an arbitrary app defined string
    parameters = serializers.StoredJSONField() # arbitrary parameters for executing tasks
    status = serializers.CharField(read_only=True)
    result = serializers.DictField(read_only=True)
    traceback = serializers.CharField(read_only=True)

When modelled this way, the deployment will only contain a final, cached config reflecting the latest state. Any changes to the config must be done through tasks, and each task records what its parameters are. This gives us the ability to track/audit each configuration change, from LAUNCH to DELETE. (essentially, the command pattern)

In addition, the AppPlugin interface also becomes simpler. It will only contain CRUD methods (no special purpose methods like restart, health_check etc). Performing a restart will be a new task that perform an AppPlugin.update(), parameterised by the task name/config. Appliances can freely implement the update method as they see fit.

Not a priority for now, but something we can implement in future?

@afgane @machristie Thoughts?

Ngôn ngữ chính
Python
Star
42
Fork
36
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

  • Có Dockerfile hoặc tệp Docker Compose
  • Không có mẫu pull request
  • Không có hướng dẫn đóng góp

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 galaxyproject/cloudlaunch

Tất cả issue của galaxyproject/cloudlaunch

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.