Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(bin): Down Subcommand #21

Open
Tracked by #17
refcell opened this issue Oct 3, 2023 · 5 comments
Open
Tracked by #17

feat(bin): Down Subcommand #21

refcell opened this issue Oct 3, 2023 · 5 comments
Assignees
Labels
A-bin Area: Binary related alpha C-feature Category: Features M-good-first-issue Meta: Good first issue

Comments

@refcell
Copy link
Collaborator

refcell commented Oct 3, 2023

Description

As part of #17, this task is to introduce a new down subcommand to op-up that winds down the op-stack defined by the local stack.toml configuration file.

Since this is a destructive action, it should use inquire to prompt the user to confirm running the command.

The logic of winding down a stack based on the config should be abstracted into the Stage Manager orchestrator (doesn't exist yet). This allows the opup cli binary to build the stage manager from the config, and then be able to wind down the stack via a simple down() -> eyre::Result<()> call.

For example

StageManager::from(config).down()?;

The logic behind building a stage manager orchestrator from the stack config is so that it can handle finding existing running stack components based on the configuration. This separates concerns whereby the stack configuration solely handles component and stack configuration while the stage manager can handle orchestrating the stack stages/components.

Since the stage manager .down() call is very minimal, the down subcommand logic can be placed inside cli.rs alongside subcommand dispatching.

@refcell refcell added A-bin Area: Binary related C-feature Category: Features alpha M-good-first-issue Meta: Good first issue labels Oct 3, 2023
@refcell refcell mentioned this issue Oct 3, 2023
6 tasks
@roninjin10
Copy link

I'll take this one if nobody else is on it

@merklefruit
Copy link
Collaborator

go for it ser!

@merklefruit
Copy link
Collaborator

merklefruit commented Oct 29, 2023

This really comes handy for debugging the stages module which I'm working on,
@roninjin10 did you have any luck with it yet?

The logic behind building a stage manager orchestrator from the stack config is so that it can handle finding existing running stack components based on the configuration.

All opup components are tagged with a com.docker.compose.project=op-up label, so for now a minimal version would just be to stop and remove all running docker containers with this label, regardless of the stack.toml file which we don't have just yet.

@roninjin10
Copy link

Hey @merklefruit sorry for delay been super busy with 3 projects I'm working on. I plan on starting on this this weekend and contributing semi regularly starting tomorrow. I've read the rust book 3 times but have written very little so I may be slow even once I start though

@merklefruit
Copy link
Collaborator

No worries at all sir!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-bin Area: Binary related alpha C-feature Category: Features M-good-first-issue Meta: Good first issue
Projects
None yet
Development

No branches or pull requests

3 participants