Open tailhook opened 8 years ago
I think it would be better to have it as container config option rather then command line.
Also we can make this (and probably auto-clean
) option overridable in command line.
So such a container (or a build) is more intended for deploy and not for running processes in it, am I right?
How /work
would be mounted if this container is used in command?
So such a container (or a build) is more intended for deploy and not for running processes in it, am I right?
No. To check the correctness of a build configuration. And yes, not to run commands.
How /work would be mounted if this container is used in command?
As usual. We change only build process.
I think it would be better to have it as container config option rather then command line.
So which containers deserve the option?
As I've outlined above I would use normal build process for everything including CI (for performance reasons). And run nightly or weekly CI job to check if --clean-room
build is still fine.
No. To check the correctness of a build configuration. And yes, not to run commands.
I believe the way to check the correctness of build is to run some process that depends on that data.
Otherwise users would end ls
-something on that /work
dir to check if everything has been copied.
Am I missing something?
I believe the way to check the correctness of build is to run some process that depends on that data. Otherwise users would end ls-something on that /work dir to check if everything has been copied. Am I missing something?
I'm thinking about that too. But:
Built tools usually crash on non-existing files. So if they succeed it may be good enough.
There can be lots of side-effect-files also.
The primary use case for this in our company is: a container with compiled javascripts and CSS. So we are unable to test them properly anyway.
What about cases when you're deploying, say, python container and you're !Copy
-ing py-files into container (not installing project as package)?
What about cases when you're deploying, say, python container and you're !Copy-ing py-files into container (not installing project as package)?
Can you describe any case where you have failed to add python's dependency, and how clean-room
functionality would help you?
I'm not talking about dependencies, I'm talking about project sources -- with vagga command you run project localy (sources are served/executed from /work
) but when you need to deploy you must
ship project sources inside container to be able to run it. So the way to know if all sources are copied/ok is to start process. I see that clean-room
functionality makes less sense in this case
Overview
Unlike using
Dockerfile
we build containers with mounted/work
directory. This means we can use anything from/work
to determine what to use to build a container. For examplepackage.json
andrequirements.txt
. Also we have!Depends
command which marks files that can influence container hash in case vagga can't determine it automatically.Problem Statement
There is no way to check whether
!Depends
and our commands likeCopy
orNpmDepends
(which have implicit dependency on a file) have covered everything we depend on. This is especially valuable for building deployment containers.Solution
Add
vagga _build --clean-room container-name
. This flag is going to skip mounting/work
. But will create an empty/work
folder instead put all the files that build depends on implicitly or explicitly. And run normal build.I think it's good to be a flag for performance reasons. You need this just to be sure, not for daily use.
Questions
ls some-dir/*
and build successfully and has the same hash, but not same contents as the one build in a normal way)/cc @popravich, @anti-social