I have a library mylib
that I want to get the current git hash for logging purposes when I run an Airflow Worker via the PythonOperator
, I know several methods to get the latest git hash, the main issue is I don't know where the directory will be and I'll likely be running it out of directory. The workers themselves can all vary (docker, ec2, gke, kubenetes) but the source python library mylib
would always be installed via a pip install git+https://${GITHUB_TOKEN}@github.com/user/mylib.git@{version}
command. Is there a generic way I can get the git hash for mylib
on any Airflow worker since the directory where mylib
is installed will change across my Airflow Workers?
source https://stackoverflow.com/questions/74954628/getting-the-current-git-hash-of-a-library-from-an-airflow-worker
Comments
Post a Comment