Skip to content

Commit 921456a

Browse files
Initial public release of containerd-manager
Rust library for managing containerd containers, tasks, and images. Docker-free alternative to bollard, targeting MongoDB Atlas Local CLI's test-data and integration-test workflows. Highlights: - Full container lifecycle: pull, create, start, stop, kill, delete - Snapshot / restore / reset-to-snapshot / clone with copy-on-write rootfs - Bridge networking via OCI hooks (colima-VM compatible) + host/isolated modes - Per-container background log tailer writing timestamped + rotated events.log - LogFollower for live tailing (mpsc + futures::Stream) - HEALTHCHECK-aware readiness with start_period grace (Healthy / Starting / Unhealthy) - Exec inside running tasks with capability + env inheritance - Image-config caching, multi-arch resolution, content store integration - Per-namespace tracking of task start times, managed port forwards, log tailers - typed-builder Opts for ergonomic construction - tracing instrumentation on all public Client methods
0 parents  commit 921456a

39 files changed

Lines changed: 13076 additions & 0 deletions

.github/dependabot.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "cargo"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
day: "monday"
8+
time: "09:00"
9+
open-pull-requests-limit: 10
10+
commit-message:
11+
prefix: "chore(deps)"
12+
labels:
13+
- "dependencies"
14+
groups:
15+
rust-all:
16+
patterns: ["*"]
17+
18+
- package-ecosystem: "github-actions"
19+
directory: "/"
20+
schedule:
21+
interval: "weekly"
22+
day: "monday"
23+
time: "09:00"
24+
open-pull-requests-limit: 5
25+
commit-message:
26+
prefix: "chore(deps)"
27+
labels:
28+
- "dependencies"

.github/workflows/ci.yml

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
8+
env:
9+
CARGO_TERM_COLOR: always
10+
11+
jobs:
12+
check:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v6
16+
17+
- name: Install Rust toolchain
18+
run: |
19+
rustup update stable
20+
rustup default stable
21+
rustup component add clippy rustfmt
22+
23+
- name: Install protoc
24+
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
25+
26+
- name: Cache cargo
27+
uses: actions/cache@v5
28+
with:
29+
path: |
30+
~/.cargo/registry
31+
~/.cargo/git
32+
target
33+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
34+
restore-keys: |
35+
${{ runner.os }}-cargo-
36+
37+
- name: Check formatting
38+
run: cargo fmt --all -- --check
39+
40+
- name: Run clippy
41+
run: cargo clippy --all-targets --no-deps -- -D warnings
42+
43+
- name: Build
44+
run: cargo build --verbose
45+
46+
- name: Run unit tests
47+
run: cargo test --lib --verbose
48+
49+
- name: Build examples
50+
run: cargo build --examples --verbose
51+
52+
test-matrix:
53+
# Ubuntu stable is covered by `check`; this job adds platform breadth.
54+
runs-on: ${{ matrix.os }}
55+
strategy:
56+
fail-fast: false
57+
matrix:
58+
os: [macos-latest, windows-latest]
59+
60+
steps:
61+
- uses: actions/checkout@v6
62+
63+
- name: Install Rust toolchain
64+
run: |
65+
rustup update stable
66+
rustup default stable
67+
68+
- name: Install protoc (macOS)
69+
if: runner.os == 'macOS'
70+
run: brew install protobuf
71+
72+
- name: Install protoc (Windows)
73+
if: runner.os == 'Windows'
74+
run: choco install protoc -y
75+
76+
- name: Cache cargo
77+
uses: actions/cache@v5
78+
with:
79+
path: |
80+
~/.cargo/registry
81+
~/.cargo/git
82+
target
83+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
84+
restore-keys: |
85+
${{ runner.os }}-cargo-
86+
87+
- name: Build
88+
run: cargo build --verbose
89+
90+
- name: Run unit tests
91+
run: cargo test --lib --verbose
92+
93+
msrv:
94+
# Matches `rust-version` in Cargo.toml. `cargo check` is enough; tests
95+
# may pull in features unavailable on the MSRV toolchain.
96+
runs-on: ubuntu-latest
97+
steps:
98+
- uses: actions/checkout@v6
99+
100+
- name: Install Rust 1.88
101+
run: |
102+
rustup update 1.88
103+
rustup default 1.88
104+
105+
- name: Install protoc
106+
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
107+
108+
- name: Cache cargo
109+
uses: actions/cache@v5
110+
with:
111+
path: |
112+
~/.cargo/registry
113+
~/.cargo/git
114+
target
115+
key: ${{ runner.os }}-cargo-msrv-${{ hashFiles('**/Cargo.lock') }}
116+
restore-keys: |
117+
${{ runner.os }}-cargo-msrv-
118+
119+
- name: Check MSRV build
120+
run: cargo check --verbose
121+
122+
e2e-linux:
123+
# Runs the e2e suite against native Linux containerd. Bridge networking
124+
# uses only the OCI poststart-hook socat on Linux (no host-side managed
125+
# proxy — see start_container in src/client.rs).
126+
runs-on: ubuntu-latest
127+
env:
128+
CONTAINERD_SOCKET: /run/containerd/containerd.sock
129+
steps:
130+
- uses: actions/checkout@v6
131+
132+
- name: Install Rust toolchain
133+
run: |
134+
rustup update stable
135+
rustup default stable
136+
137+
- name: Install containerd + OCI hook deps
138+
run: |
139+
sudo apt-get update
140+
sudo apt-get install -y containerd socat python3 iptables iproute2 util-linux protobuf-compiler
141+
142+
- name: Start containerd
143+
run: |
144+
sudo systemctl start containerd
145+
sudo systemctl status containerd --no-pager
146+
sudo chmod 666 /run/containerd/containerd.sock
147+
148+
- name: Cache cargo
149+
uses: actions/cache@v5
150+
with:
151+
path: |
152+
~/.cargo/registry
153+
~/.cargo/git
154+
target
155+
key: ${{ runner.os }}-cargo-e2e-${{ hashFiles('**/Cargo.lock') }}
156+
restore-keys: |
157+
${{ runner.os }}-cargo-e2e-
158+
159+
- name: Run e2e tests
160+
env:
161+
RUST_BACKTRACE: 1
162+
# Serialize: bridge-mode containers race for free host ports (TOCTOU
163+
# in pick_free_port). One-at-a-time avoids spurious bind conflicts.
164+
run: cargo test --features e2e-tests --no-fail-fast -- --test-threads=1

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/target
2+
/tasks
3+
/.claude
4+
*.code-workspace
5+
6+
# Personal planning docs / demo materials excluded from public release.
7+
/REFACTOR_PLAN.md
8+
/TODO.md
9+
/demo/

0 commit comments

Comments
 (0)