Idle shutdown: periodic sweep job to stop idle containers
Maintainer thường phản hồi trong vòng 4 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 38/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript, node.js
Hướng nghiên cứu
Start by reading bin/create-container.js and the existing job-runner and JobStatus paths to see how scripts are enqueued and their output is stored. Then inspect the container model, provider stop APIs, and systemd files under create-a-container/contrib/systemd/; the issue also depends on the idleTime resource request. Done means an hourly job enqueues the sweep, applies the idle and grace-period rules, records stop state and per-owner results, and supports --dry-run while continuing after failures.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Part of the Idle Container Shutdown epic. Depends on the idleTime resource request.
Summary
A job script (like bin/create-container.js) that finds containers idle longer than their effective idleTime and stops them, run periodically via a systemd timer.
Idle rule
A container is idle when now - (max(service.lastAccessedAt) ?? container.createdAt) > idleTime hours.
idleTime = 0→ skip.- Grace period after creation: never stop a container younger than its
idleTime, even if never accessed. - Activity is proxy access only (HTTP + TCP/UDP services via the nginx accounting module). SSH, direct-IP, SRV-only, and service-less containers will appear idle; this is intentional and must be documented (owners can request
idleTime = 0).
Stop behavior
- Keep it simple: call the node provider's existing stop API (
stopLxcfor Proxmox/Docker/dummy). - Timeouts or failures are logged and skipped; the sweep continues with the next container.
- Only consider containers that are currently running.
Idle state / audit trail
Persist enough state to tell an idle-stop apart from a manual stop (required by wake-on-request):
- On the container:
stoppedReason(idle|manual| null),stoppedAt,stoppedBy. Cleared when started. - Sweep output (containers evaluated, stopped, failed, skipped + reason) captured in the Job output.
Scheduling
- New
bin/idle-sweep.js(name TBD). - systemd
.timer+.serviceundercreate-a-container/contrib/systemd/that enqueues a Job row running the script, so output is visible through the existing job-runner / JobStatus. --dry-runflag that reports without stopping.
Acceptance criteria
- Script stops idle containers using the provider stop API, logs and skips failures.
- Respects
idleTime,0exemption, and creation grace period. - Stop reason/time/actor persisted; cleared on start.
- Timer enqueues a Job on an interval (e.g. hourly).
-
--dry-runsupported. - Emits per-owner results for the notification hook.
- Ngôn ngữ chính
- JavaScript
- Star
- 10
- Fork
- 6
- Merge trung bình
- 5 ngày 14 giờ
- Pull request đã merge (30 ngày)
- 5
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
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của mieweb/opensource-server
-
Render the docs site per installation from /etc/default config instead of at package build timeĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
mieweb/opensource-server#538 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
enhancement idle-shutdown
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
mieweb/opensource-server#531 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
enhancement idle-shutdown
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
mieweb/opensource-server#530 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
enhancement idle-shutdown
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
mieweb/opensource-server#529 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
enhancement idle-shutdown
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
mieweb/opensource-server#528 ·
Maintainer thường phản hồi trong vòng 4 ngày
Tất cả issue của mieweb/opensource-server
Issue tương tự
-
Name the maintainers in CODEOWNERSCó thể đã có người làm @TorecLuik đã nhận hôm nay. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
-
[Bug] AM Context Monitor (am-monitor): Session turns count is capped at 80 due to turns.slice(-80)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
lbjlaq/Antigravity-Manager#4180 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[workshop-sync] workshop/06-install-gh-aw.md: example version output is outdated (0.81.6 vs v1.2.2)Đang mởdocumentation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 84/100
githubnext/gh-aw-workshop#6467 ·
Maintainer thường phản hồi trong vòng 1 ngày