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

Run processes in the background #80

Closed
JanLikar opened this issue Nov 18, 2022 · 4 comments · Fixed by #1005
Closed

Run processes in the background #80

JanLikar opened this issue Nov 18, 2022 · 4 comments · Fixed by #1005
Labels
enhancement New feature or request

Comments

@JanLikar
Copy link
Contributor

It would be nice to have a way of running processes in the background, similar to docker-compose up -d.

Maybe devenv up -d would be an intuitive choice?

@domenkozar domenkozar added the enhancement New feature or request label Nov 18, 2022
JanLikar added a commit to JanLikar/devenv that referenced this issue Nov 18, 2022
Use `devenv up -d` to run honcho processes in the background with nohup.

`devenv down` and `devenv logs` are also included.

See cachix#80.
JanLikar added a commit to JanLikar/devenv that referenced this issue Nov 18, 2022
Use `devenv up -d` to run honcho processes in the background with nohup.

`devenv down` and `devenv logs` are also included.

See cachix#80.
JanLikar added a commit to JanLikar/devenv that referenced this issue Nov 18, 2022
Use `devenv up -d` to run honcho processes in the background with nohup.

`devenv down` and `devenv logs` are also included.

See cachix#80.
JanLikar added a commit to JanLikar/devenv that referenced this issue Nov 21, 2022
Use `devenv up -d` to run honcho processes in the background with nohup.

`devenv down` and `devenv logs` are also included.

See cachix#80.
@domenkozar domenkozar mentioned this issue Jul 29, 2023
7 tasks
@domenkozar
Copy link
Member

That's implemented in #745

@domenkozar domenkozar mentioned this issue Mar 11, 2024
2 tasks
@ElrohirGT
Copy link
Contributor

Hi @domenkozar ! I tried reading the link you mentioned, it took me to a python rewrite and then to a rust rewrite. I'm using devenv as a flake but when I tried running the command devenv up -d as the original author suggested it still runs as normal with a TUI and everything. How could I run services in a detached state?

@domenkozar
Copy link
Member

It does not work with flakes yet.

@ElrohirGT
Copy link
Contributor

Hi! I found a solution for my use case and I'm sharing it here in case someone else ends here. I wanted to run "devenv up" in CI from a github action to automatically setup postgress and other background services of my project. Turns out the default TUI of process-compose was the problem so searching on the documentation I managed to add the following configuration:

default = devenv.lib.mkShell {
          inherit inputs pkgs;
          modules = [
            {
              process = {
                process-compose = pkgs.lib.mkOptionDefault {
                  tui = "false";
                };
              };

              services.postgres = {
                enable = true;
                listen_addresses = postgresHost;
                port = postgresPort;
                initialScript = dbInitFile;
              };
            }
          ];
        };

pkgs.lib.mkOptionDefault overrides only the field tui inside the configuration that process-compose uses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants