Use Task.Input's for env vars that will be otherwise cached#7
Use Task.Input's for env vars that will be otherwise cached#7nderraugh wants to merge 1 commit intoGeorgOfenbeck:mainfrom
Conversation
|
Hello @nderraugh, I looked into it - you are right that stuff is cached - but i dont think he username/pw is the issue you are facing. To verify i did the following: Given the signature e.g for my example a successful run would put the following file: If one runs the Task a second time (even with changed credentials) it will indeed not excute again. However - if the credentials were incorrect the buildImage should not terminate successful and as such do not produce the .json file. Reruning the task after it was unsuccesful (and thereby not cached) it will fetch changed credentials. One can debate if buildImage is a Task that should have caching at all -> my idea at the time was that if none of the inputs change and it built successfully before you most likly do not want to rebuild. Let me know if missed it somehow (in particular i would be curious if removing "just" out/project/docker/buildImage.json is sufficent for you case. |
|
I was able to reproduce the behaviour using your Upon reproducing the same auth failure with the correct username and password delete the At this point you should have a different error. I get: I do not have a out/project/docker/buildImage.json at any point. 🤔 But can reproduce the behaviour regardless. I tried deleting bits and bobs, but haven't yet figured out the relationship to the file causing the problem. (I'll circle back when I have more time). I think it makes sense to cache the buildImage task. But not if the inputs change. I realize this is probably an edge case for most people. |
c115c51 to
502323f
Compare
Problem:
If you run
mill __.docker.buildImagewith incorrectly set DOCKER_USERNAME and DOCKER_PASSWORD values they will be stored in the Task's output cache and used on future task executions due to the use of sys.env in MDShared object. Details (here)[https://mill-build.org/mill/fundamentals/tasks.html#_environment_variable_inputs].Tentative Fix:
I put a draft together to test my own undertanding of Task.Input's. That's this PR.
Workaround:
The workaround is to delete the task cache, something like
rm -rf out/,mill cleanis insufficient.