Closed maowtm closed 2 years ago
By the way, for tests we can actually (instead of actually building the image and testing its properties) just test if the generated build plan is correct. This should be a bit easier then checking image equality somehow, especially when network requests or ignore_cache
is involved. We can test the translation from build plan to buildkit separately.
Although I guess we could still have a few true integration tests - just in case.
TODO: rename done::workdir
to ::in_workdir
This is now ready to merge. The test failure seems to be related to https://github.com/modus-continens/modus/issues/65 .
cargo run -- build 'Modusfile' 'all(X)'
This is now ready to merge. The test failure seems to be related to #65.
If you want to try, it should pass if you re-run it a couple times. Some permutation should work.
Due to https://github.com/modus-continens/modus/issues/74, when testing this, Modusfile need to be changed in the following way temporarily:Resolved
@@ -23,13 +23,13 @@ build(profile) :-
frontend_img(profile) :-
(run_env,
profile_to_target_folder(profile, target_folder),
- (build(profile))::copy(f"${target_folder}/buildkit-frontend", "./buildkit-frontend")
+ (build(profile))::copy(f"./${target_folder}/buildkit-frontend", "./buildkit-frontend")
)::set_entrypoint("./buildkit-frontend").
modus(profile) :-
(run_env,
profile_to_target_folder(profile, target_folder),
- (build(profile))::copy(f"${target_folder}/modus", "./modus")
+ (build(profile))::copy(f"./${target_folder}/modus", "./modus")
)::set_entrypoint("./modus").
profile_to_target_folder("debug", "target/debug").
(query was
a(X)
)A very basic version supporting only
from
andrun
, and currently does not yet do multiple output extraction nor fetch inherited properties. Just wanted to get this out first and see what you think.Code might be a bit messy since it's 2am now. Will clean up later.
If the frontend (running inside a buildkit-created container) encounters an error it is crazy hard to debug, since buildkit does not print out the stderr of frontend (stdout is used for protocol), and also, for some reason, run containers in its own environment which
docker ps
can't access.::workdir
to::in_workdir
and add operators for setting image properties::copy
andcopy
::set_entrypoint
--progress=plain
, tagging, etc.