kaizen-ai / kaizenflow

KaizenFlow is a framework for Bayesian reasoning and AI/ML stream computing
GNU General Public License v3.0
108 stars 76 forks source link

Turn dind check into a warning #680

Open gpsaggese opened 5 months ago

gpsaggese commented 5 months ago
          2) The error is because you don't have docker-in-docker enabled. This is an old way of doing things that we don't really use anymore.

In repo_config.py, you can set check_repo = False

198     # dind is supported on both Mac and GH Actions.
199     check_repo = os.environ.get("AM_REPO_CONFIG_CHECK", "True") != "False"
200     if check_repo:
201         if hserver.is_cmamp_prod():
202             assert not has_dind, "Not expected privileged mode"

I'll file another bug to make this check optional.

Originally posted by @gpsaggese in https://github.com/sorrentum/sorrentum/issues/665#issuecomment-1962398137

gpsaggese commented 5 months ago

I don't think we rely on dind anywhere at this point (maybe only in the GH actions, since they require dind to avoid containers spawned on the machine itself?).

I would start by:

198     # Check docker-in-docker.
199     check_repo = os.environ.get("AM_REPO_CONFIG_CHECK", "True") != "False"
200     if check_repo:
206             if hserver.is_inside_ci():
207                 # dind should be supported on Mac, dev_ck, and GH Actions.
208                 assert has_dind, (
209                     f"Expected privileged mode: has_dind={has_dind}\n"
210                     + hserver.setup_to_str()
211                 )
214             else:
215                 only_warning = True
216                 _raise_invalid_host(only_warning)
217                 return False
218     else:

Also let's start moving this code in hserver so we reduce the copy-paste in repo_config.

Note that this check should be mirrored in all the repo

So this change is a bit tricky