Comments (2)
Good find! This situation brings to light several things that need consideration:
Dud treats all inputs to a stage as not cached (skip-cache: true
) unless it's owned by another stage. Essentially a stage owns its outputs, and it references its inputs. So in Dud, currently, the recommended way to handle this situation would be to use another stage:
$ dud stage gen -o foo | tee foo.yaml
working-dir: .
outputs:
foo:
is-dir: true
$ dud stage gen -i foo -o bar -- cat | tee bar.yaml
command: cat
working-dir: .
inputs:
foo:
is-dir: true
outputs:
bar: {}
$ dud stage add *.yaml
Added bar.yaml to the index.
Added foo.yaml to the index.
$ dud status
foo.yaml stage definition not checksummed
foo 1x directory, 1x not committed
bar.yaml stage definition not checksummed
bar missing and not committed
I can see how this could be unintuitive. Frankly, the implicit skip-cache: true
has always bugged me. I will reevaluate if it's even needed.
What's more, if you commit a stage with a parent-less directory input, you get skip-cache: false
behavior 🤦♂️:
# removed '-o bar', which doesn't exist
$ dud stage gen -i foo -- cat > test.yaml
$ dud stage add test.yaml
$ dud commit
committing stage test.yaml
foo 4 B / 4 B 100% ?/s 0s total
# This shouldn't have been committed in Dud's current model.
$ tree -a foo
foo
`-- bar -> ../.dud/cache/49/dc870df1de7fd60794cebce449f5ccdae575affaa67a24b62acb03e039db92
So I have some thinking to do about Dud's stage ownership model. There might be an opportunity here to simplify things by removing implicit behavior. In the meantime, I'd recommend following the pattern in my first example code block.
from dud.
Thank you for the quick response! Your first example worked for me. Besides the things you pointed out, please consider changing the error message (incorrect file type: directory
) and adding documentation to explain this.
from dud.
Related Issues (20)
- add diff command to summarize the differences between two cached artifacts HOT 1
- empty sub-directories not included in directory status output
- status: add flag to skip byte-level equality checks
- Support cloud usage patterns HOT 1
- Improve data integrity for misbehaving users HOT 4
- data is missing from workspace HOT 1
- How do you add a directory? HOT 2
- checkout: add flag to delete artifacts prior to checkout
- commit does not work properly in certain situation: 'expected regular file' HOT 1
- Wrong symlinks when fetch / checkout is done from symlinked folder HOT 7
- Multiple stages per file HOT 5
- Print out the command before running it
- Don't mess with yaml formatting while checksumming HOT 1
- can't copy - source file is being updated HOT 1
- add a `--leaves-only` option to only operate on stages without downstream dependencies
- Support operation on a sub-tree of stages
- Add command to list all committed artifacts (i.e. checksums) for a given stage
- Add ability to configure rclone parameters
- status: show progress when doing byte-level checks HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dud.