Skip to content

Commit

Permalink
Properly manage timestamps of profile files (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
MrHedmad authored Apr 15, 2024
2 parents f5abb1f + fe58151 commit 7e47e8d
Show file tree
Hide file tree
Showing 15 changed files with 491 additions and 56 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on: [pull_request]

env:
RUST_LOG: debug
RUST_BACKTRACE: 1

jobs:
test:
Expand All @@ -13,4 +14,4 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo test --all-features
- run: cargo test --all-features -- --nocapture
208 changes: 205 additions & 3 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@ ctrlc = "^3.4"
env_logger = "^0.10"
filetime = "^0.2"
flate2 = "1.0.28"
homedir = "0.2.1"
indicatif = "^0.17"
log = "^0.4"
reqwest = { version = "^0.11", default-features = false, features = ["json", "blocking", "rustls-tls"] }
serde = { version = "^1.0", features = ["derive"] }
serde_json = "1.0.115"
tar = "0.4.40"
tempfile = "^3.8"
termimad = "0.29.0"
Expand Down
20 changes: 19 additions & 1 deletion docs/src/tutorial/run.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,25 @@ In this way, you can detect from inside the pipeline if you are in a profile or
This is useful if you want to keep the outputs of different profiles separate,
for instance.

### File modification times when using profiles
`make` tracks file creation times to determine if it has to re-run pipelines again.
This means that if you move files around, like Kerblam! does when it applies
profiles, `make` will always re-run your pipelines, even if you run the same
pipeline with the same profile back-to-back.

To avoid this, Kerblam! will keep track of the last-run profile in your
projects and update the timestamps of the moved files
**only when strictly necessary**.

This means that the profile files will get updated timestamps only when they
actually need to be updated, which is:
- When you use a profile for the first time;
- When you switch from one profile to a different one;
- When you don't use a profile, but you just used one the previous run;

To track what was the last profile used, Kerblam! creates a file in
`$HOME/.cache/kerblam/` for each of your projects.

## Sending additional arguments to make or bash
You can send additional arguments to either `make` or `bash` after what
Kerblam! sets by default by specifying them after kerblam's own `run` arguments:
Expand Down Expand Up @@ -147,4 +166,3 @@ kerblam run my_pipe -- -- arg_1 arg_2 ...
The first `--` is "eaten up" by Kerblam!, and the second one is passed to the
containerization engine, telling it to pass `arg_1`, `arg_2` etc... as-is to
the entrypoint.

Loading

0 comments on commit 7e47e8d

Please sign in to comment.