Skip to content

[flame] Add HTTP storage backend and flmctl close command#344

Merged
k82cn merged 6 commits into
xflops:mainfrom
k82cn:enable_http_e2e
Feb 6, 2026
Merged

[flame] Add HTTP storage backend and flmctl close command#344
k82cn merged 6 commits into
xflops:mainfrom
k82cn:enable_http_e2e

Conversation

@k82cn
Copy link
Copy Markdown
Contributor

@k82cn k82cn commented Feb 6, 2026

Summary

  • Add flame-package-storage service using dufs for HTTP-based package storage (supports PUT/DELETE operations)
  • Update ci/flame.yaml and ci/flame-local.yaml to use HTTP storage backend
  • Add flmctl close command to close sessions from CLI
  • Add Connection::close_session method to Rust SDK
  • Fix Python linter warnings (N802) with noqa comments for gRPC method names

Changes

HTTP Storage Backend

  • Added flame-package-storage container using sigoden/dufs image
  • Exposes port 5050 externally, 5000 internally
  • Supports file upload via HTTP PUT and deletion via HTTP DELETE

flmctl close command

flmctl close -s <session-id>

Testing

  • Tested flmctl close command successfully closes sessions
  • HTTP storage service starts and accepts connections

Note

The HTTP storage URL resolution between host and container networks needs additional work for seamless local development (host uses 127.0.0.1:5050, containers need flame-package-storage:5000).

k82cn added 2 commits February 6, 2026 10:41
Use from_default_env() instead of try_from_default_env() to provide
a default filter when RUST_LOG environment variable is missing,
rather than returning an error.
- Add flame-package-storage service using dufs for HTTP-based package storage
- Update ci/flame.yaml and ci/flame-local.yaml to use HTTP storage
- Add flmctl close command to close sessions
- Add Connection::close_session method to Rust SDK
- Fix Python linter warnings with noqa comments for gRPC method names
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @k82cn, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the Flame ecosystem by introducing a flexible HTTP-based package storage solution, moving away from local file storage. This change improves scalability and deployment options for package management. Concurrently, it empowers users with greater control over their sessions by adding a new CLI command and a corresponding Rust SDK method to close active sessions. Minor code quality improvements were also included to maintain consistency.

Highlights

  • HTTP Storage Backend: Introduced a new flame-package-storage service utilizing dufs to provide HTTP-based package storage, supporting PUT and DELETE operations. The ci/flame.yaml and ci/flame-local.yaml configurations have been updated to use this new HTTP storage.
  • New flmctl close Command: Added a new command flmctl close <session-id> to the CLI tool, allowing users to terminate specific sessions directly from the command line.
  • Rust SDK Session Closing: Implemented a Connection::close_session method within the Rust SDK, enabling programmatic closure of sessions.
  • Python Linter Fixes: Addressed Python linter warnings (N802) by adding noqa comments to gRPC method names in sdk/python/src/flamepy/core/service.py.
Changelog
  • ci/flame-local.yaml
    • Updated package storage configuration from a local file path to an HTTP endpoint (http://host.docker.internal:5050).
  • ci/flame.yaml
    • Updated package storage configuration from a local file path to an HTTP endpoint (http://flame-package-storage:5000).
  • compose.yaml
    • Removed the flame-packages volume mount from the flame-executor-manager service.
    • Added a new flame-package-storage service using the sigoden/dufs:latest image.
    • Configured flame-package-storage to serve /data with upload and delete permissions, mapping host port 5050 to container port 5000.
    • Added flame-package-storage as a dependency for the main flame service.
  • flmctl/src/close.rs
    • New file added, containing the implementation for the flmctl close command, which connects to the Flame cluster and calls the close_session method.
  • flmctl/src/main.rs
    • Imported the new close module.
    • Replaced the todo!() placeholder for the Commands::Close variant with a call to close::run.
  • sdk/python/src/flamepy/core/service.py
    • Added # noqa: N802 comments to OnSessionEnter, OnTaskInvoke, and OnSessionLeave methods to suppress flake8 N802 (InvalidFunctionName) warnings.
  • sdk/rust/src/apis/mod.rs
    • Changed tracing_subscriber::EnvFilter::try_from_default_env()? to EnvFilter::from_default_env() for logger initialization, simplifying error handling.
  • sdk/rust/src/client/mod.rs
    • Added a new public asynchronous function close_session to the Connection struct, allowing clients to send a CloseSessionRequest.
Activity
  • No human activity (comments, reviews, or progress updates) has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces an HTTP-based storage backend using dufs and adds a flmctl close command. The changes are mostly well-implemented. My review includes a few suggestions for improvement, primarily concerning the Docker configuration for the new storage service to enhance stability and security, and a recommendation to refactor the logging initialization in the Rust SDK to better align with library best practices.

Comment thread compose.yaml Outdated
- flame-package-storage

flame-package-storage:
image: sigoden/dufs:latest
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using the :latest tag for Docker images is not recommended as it can lead to unpredictable behavior when the image is updated. It's better to pin to a specific version (e.g., sigoden/dufs:v0.41.0) to ensure build reproducibility and stability.

Comment thread compose.yaml Outdated
logging:
options:
max-size: "100m"
command: ["/data", "-A", "--allow-upload", "--allow-delete"]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The command arguments are redundant. The -A (--allow-all) flag is a shortcut for --allow-upload, --allow-delete, and --allow-search. You can simplify this to ["/data", "-A"].

More importantly, using -A without any authentication exposes the package storage to unauthorized uploads and deletions. While this might be acceptable for a local development environment, consider adding some form of authentication for more secure setups, especially if this configuration is used as a base for other environments.

    command: ["/data", "-A"]

k82cn added 4 commits February 6, 2026 12:52
- Pin dufs image to v0.43.0 instead of :latest for reproducibility
- Simplify dufs command to just -A (already includes --allow-upload/delete)
- Use 127.0.0.1:5050 in flame-local.yaml for host-based development
- Start dufs as package storage server on port 5050 during 'start'
- Stop dufs during 'stop' command
- Add dufs to status and logs commands
- Add check_dufs function with installation instructions
- Create packages directory during install
- Install dufs via cargo install
- Start dufs as HTTP package storage server on port 5050
- Add dufs logs to failure output
- Stop dufs in cleanup step
- Add pytest-timeout dependency with 120s per-test timeout
- Add 10-minute job timeout for the test step
- Show logs on both failure and cancelled (timeout)
- Increase log lines from 100 to 200
- Add active processes and network connections to debug output
- Add cluster readiness verification step before tests
@k82cn k82cn merged commit 9cee679 into xflops:main Feb 6, 2026
5 checks passed
@k82cn k82cn deleted the enable_http_e2e branch February 6, 2026 05:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant