fleetflow-container

Crates.iofleetflow-container
lib.rsfleetflow-container
version0.1.1
created_at2025-11-09 10:56:42.395163+00
updated_at2025-11-09 11:05:21.754614+00
descriptionContainer runtime integration for FleetFlow
homepagehttps://github.com/chronista-club/fleetflow
repositoryhttps://github.com/chronista-club/fleetflow
max_upload_size
id1923994
size67,130
Mako (mako-357)

documentation

README

fleetflow-container

Crates.io Documentation License

FleetFlowのDockerコンテナランタイム統合を提供するライブラリクレート。

概要

fleetflow-containerは、FleetFlowの設定をDocker APIパラメータに変換し、コンテナライフサイクルを管理する機能を提供します:

  • 設定変換 - FleetFlowの設定をDocker APIパラメータに変換
  • ランタイムトレイト - コンテナランタイムの抽象化
  • コンテナ管理 - 起動、停止、ステータス確認

使用例

FlowConfigからDockerコンテナ設定に変換

use fleetflow_container::converter::service_to_container_config;
use fleetflow_atom::Service;

let service = Service {
    image: Some("postgres:16".to_string()),
    version: Some("16".to_string()),
    ..Default::default()
};

let (config, options) = service_to_container_config("postgres", &service);

// configとoptionsをBollardに渡してコンテナを作成

ステージからサービスリストを取得

use fleetflow_container::converter::get_stage_services;
use fleetflow_atom::Flow;

let flow = /* ... */;
let services = get_stage_services(&flow, "local")?;

for service_name in services {
    println!("Service: {}", service_name);
}

コンテナランタイムトレイト

use fleetflow_container::runtime::ContainerRuntime;
use fleetflow_atom::Flow;

#[async_trait]
pub trait ContainerRuntime {
    async fn start(&self, flow: &Flow) -> Result<()>;
    async fn stop(&self, flow: &Flow) -> Result<()>;
    async fn status(&self) -> Result<Vec<ContainerStatus>>;
}

機能

サービス設定の変換

FleetFlowのServiceをDocker APIのパラメータに変換:

  • イメージとバージョン - Dockerイメージとタグ
  • ポートマッピング - ホストとコンテナのポートバインディング
  • 環境変数 - コンテナ内の環境変数
  • ボリューム - ホストとコンテナのボリュームマウント
  • コマンド - コンテナ起動時のコマンド
  • 依存関係 - サービス間の依存関係

対応プロトコル

  • TCP (デフォルト)
  • UDP

ボリュームマウント

  • 読み取り専用 (read_only)
  • 読み書き可能 (デフォルト)
  • 相対パスの自動解決

依存関係

ドキュメント

ライセンス

MIT OR Apache-2.0

Commit count: 0

cargo fmt