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

Detached run and runs manager #682

Closed
wants to merge 31 commits into from
Closed
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
19b41f5
wip daemonize a run
hadim Jan 17, 2024
355c5d5
add runs subcommand
hadim Jan 17, 2024
4fdb7ec
wip full ci for runs
hadim Jan 17, 2024
e3204e0
add kill clis
hadim Jan 17, 2024
f765c37
random names
hadim Jan 17, 2024
6fa85ed
disable detach on windows - attempt 1
hadim Jan 17, 2024
1bc9b65
attempt 2
hadim Jan 17, 2024
c6bd289
attempt 3
hadim Jan 17, 2024
41527b4
daemonize only for unix
hadim Jan 17, 2024
28cf9ea
windows
hadim Jan 17, 2024
52a93dd
windows again
hadim Jan 17, 2024
c6670a7
Merge branch 'main' into daemon
hadim Jan 17, 2024
f8df5fa
Merge branch 'main' into daemon
hadim Jan 18, 2024
46ea5a4
less unwrap and refactor `runs logs`
hadim Jan 18, 2024
7fcae3d
Refactor file creation and deletion in DaemonRun in clear()
hadim Jan 18, 2024
fa4cbba
more error and none management
hadim Jan 18, 2024
c39411c
windows compile fix
hadim Jan 18, 2024
3396d3e
add --follow --lines to `pixi runs logs`
hadim Jan 18, 2024
6c8b155
- allow clearing at the same time as killing
hadim Jan 18, 2024
ef93e64
kill with TERM first and then KILL
hadim Jan 18, 2024
cb174eb
wrap up documenting the runs module
hadim Jan 18, 2024
c6cfc7a
Merge branch 'main' into daemon
hadim Jan 18, 2024
a939808
refactor systeminfo and kill all the children
hadim Jan 18, 2024
03b6d40
cleaning
hadim Jan 18, 2024
21a08e4
more cleaning
hadim Jan 18, 2024
82c7270
better docstring
hadim Jan 18, 2024
dcc7d56
cli doc for run and runs
hadim Jan 18, 2024
46c42a4
wrap up cli docs
hadim Jan 18, 2024
285c68b
Merge branch 'main' into daemon
hadim Jan 18, 2024
d056f69
Merge branch 'main' into daemon
hadim Jan 19, 2024
5a3ac39
Merge branch 'main' into daemon
hadim Jan 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
__pycache__
**/**/.pixi
**/**/.build
.DS_store
.DS_Store
site/
.cache
48 changes: 47 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ itertools = "0.12.0"
lazy_static = "1.4.0"
miette = { version = "5.10.0", features = ["fancy", "supports-color", "supports-hyperlinks", "supports-unicode", "terminal_size", "textwrap"] }
minijinja = { version = "1.0.11", features = ["builtins"] }
names = { version = "0.14.0", default-features = false }
once_cell = "1.19.0"
pep440_rs = "0.3.12"
pep508_rs = { version = "0.2.3", features = ["modern"] }
Expand All @@ -53,6 +54,7 @@ rattler_solve = { version = "0.16.2", default-features = false, features = ["res
rattler_virtual_packages = { version = "0.16.2", default-features = false }
regex = "1.10.2"
reqwest = { version = "0.11.23", default-features = false }
rev_buf_reader = "0.3.0"
rip = { package = "rattler_installs_packages", version = "0.1.0", default-features = false }
self-replace = "1.3.7"
serde = "1.0.195"
Expand All @@ -63,6 +65,7 @@ serde_with = { version = "3.4.0", features = ["indexmap"] }
shlex = "1.2.0"
spdx = "0.10.3"
strsim = "0.10.0"
sysinfo = "0.30.5"
tar = "0.4.40"
tempfile = "3.9.0"
thiserror = "1.0.56"
Expand All @@ -78,6 +81,7 @@ zip = { version = "0.6.6", default-features = false, features = ["deflate", "tim
nix = { version = "0.27.1", default-features = false, features = ["fs", "signal", "term", "poll"] }
libc = { version = "0.2.152", default-features = false }
signal-hook = "0.3.17"
daemonize = "0.5.0"

[dev-dependencies]
rattler_digest = "0.16.2"
Expand Down
2 changes: 2 additions & 0 deletions examples/daemon/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# GitHub syntax highlighting
pixi.lock linguist-language=YAML
2 changes: 2 additions & 0 deletions examples/daemon/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# pixi environments
.pixi
23 changes: 23 additions & 0 deletions examples/daemon/clock_daemon.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import time
import argparse
import sys
import logging

logging.basicConfig(level=logging.INFO)

parser = argparse.ArgumentParser()
parser.add_argument("--name", type=str, required=True)
parser.add_argument("-n", type=int, required=True)
parser.add_argument("--sleep", type=int, required=True)
args = parser.parse_args()

print(f"Python Interpreter: {sys.executable}")
print(f"Name: {args.name} - N: {args.n} - Sleep: {args.sleep}")
n = args.n
sleep_seconds = args.sleep

for i in range(n):
logging.info(f"{i} - {time.ctime()}")
time.sleep(sleep_seconds)

print("Done")
Loading
Loading