charts icon indicating copy to clipboard operation
charts copied to clipboard

support using git-sync with PVC (allowing there to only be one git-sync container)

Open thesuperzapper opened this issue 3 years ago • 4 comments

Currently, we don't let users enable dags.gitSync and dags.persistence at the same time.

If we do this (obviously requiring dags.persistence.accessMode = ReadWriteMany), we can massively reduce the number of git-sync containers required.

This is because we won't have to put a git-sync container in every Pod, but rather have all pods mount the PVC, while having a central single git-sync deployment that keeps the PVC up to date.

thesuperzapper avatar Jul 08 '21 06:07 thesuperzapper

in airflow1 version, gitSync with dags pvc works. we hope it keeps the same in airflow2. which would not leading the task container waiting for git clone done (this masters a lot if the git repo is too big or poor network connection)

justbeay avatar Jul 22 '21 07:07 justbeay

@justbeay two comments:

  1. version 8.X.X of the chart can be used with both airflow 1 and airflow 2 (see the Airflow Version Support table)
  2. while the 7.X.X version of the chart may have let you enable a PVC with git-sync enabled, it would have resulted in all the git-sync containers fighting over the sync

thesuperzapper avatar Jul 26 '21 00:07 thesuperzapper

I think this feature is really important for KubernetesExecutor, as right now if cloning the git repo takes a long time, then EVERY task will take at least that long, this is because the git-clone init-container must run before the task can, as it needs the DAG definitions.

thesuperzapper avatar Mar 22 '22 05:03 thesuperzapper

I have created a PR trying to address these, I'd appreciate feedback on it.

karakanb avatar May 13 '22 18:05 karakanb