You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2022/12/24 21:27:25 UTC
[airflow] branch main updated: Output of the "dev" asset compilation for breeze available in file (#28579)
This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 790b9d173a Output of the "dev" asset compilation for breeze available in file (#28579)
790b9d173a is described below
commit 790b9d173afe0a0ae98d322f2b8986a30a76dd81
Author: Jarek Potiuk <ja...@potiuk.com>
AuthorDate: Sat Dec 24 22:26:57 2022 +0100
Output of the "dev" asset compilation for breeze available in file (#28579)
When you start airflow in `dev-mode`, the output of asset compilation
(which run continuously) is now available in a file that you can
run `tail -f` on to see the output.
---
.../ci/pre_commit/pre_commit_compile_www_assets.py | 4 ++--
.../pre_commit_compile_www_assets_dev.py | 24 ++++++++++++++++++----
2 files changed, 22 insertions(+), 6 deletions(-)
diff --git a/scripts/ci/pre_commit/pre_commit_compile_www_assets.py b/scripts/ci/pre_commit/pre_commit_compile_www_assets.py
index a2b4723b93..27975f6b8c 100755
--- a/scripts/ci/pre_commit/pre_commit_compile_www_assets.py
+++ b/scripts/ci/pre_commit/pre_commit_compile_www_assets.py
@@ -44,6 +44,6 @@ if __name__ == "__main__":
sys.exit(0)
env = os.environ.copy()
env["FORCE_COLOR"] = "true"
- subprocess.check_call(["yarn", "install", "--frozen-lockfile"], cwd=str(www_directory))
- subprocess.check_call(["yarn", "run", "build"], cwd=str(www_directory), env=env)
+ subprocess.check_call(["yarn", "install", "--frozen-lockfile"], cwd=os.fspath(www_directory))
+ subprocess.check_call(["yarn", "run", "build"], cwd=os.fspath(www_directory), env=env)
WWW_HASH_FILE.write_text(new_hash)
diff --git a/scripts/ci/pre_commit/pre_commit_compile_www_assets_dev.py b/scripts/ci/pre_commit/pre_commit_compile_www_assets_dev.py
index 778e8d67d1..6d8bfe05cd 100755
--- a/scripts/ci/pre_commit/pre_commit_compile_www_assets_dev.py
+++ b/scripts/ci/pre_commit/pre_commit_compile_www_assets_dev.py
@@ -28,14 +28,30 @@ if __name__ not in ("__main__", "__mp_main__"):
)
AIRFLOW_SOURCES_PATH = Path(__file__).parents[3].resolve()
-WWW_HASH_FILE = AIRFLOW_SOURCES_PATH / ".build" / "www" / "hash.txt"
+WWW_CACHE_DIR = AIRFLOW_SOURCES_PATH / ".build" / "www"
+WWW_HASH_FILE = WWW_CACHE_DIR / "hash.txt"
+WWW_ASSET_OUT_FILE = WWW_CACHE_DIR / "asset_compile.out"
if __name__ == "__main__":
- www_directory = Path("airflow") / "www"
+ www_directory = AIRFLOW_SOURCES_PATH / "airflow" / "www"
if WWW_HASH_FILE.exists():
# cleanup hash of www so that next compile-assets recompiles them
WWW_HASH_FILE.unlink()
env = os.environ.copy()
env["FORCE_COLOR"] = "true"
- subprocess.check_call(["yarn", "install", "--frozen-lockfile"], cwd=str(www_directory))
- subprocess.check_call(["yarn", "dev"], cwd=str(www_directory), env=env)
+ with open(WWW_ASSET_OUT_FILE, "w") as f:
+ subprocess.run(
+ ["yarn", "install", "--frozen-lockfile"],
+ cwd=os.fspath(www_directory),
+ check=True,
+ stdout=f,
+ stderr=subprocess.STDOUT,
+ )
+ subprocess.run(
+ ["yarn", "dev"],
+ check=True,
+ cwd=os.fspath(www_directory),
+ env=env,
+ stdout=f,
+ stderr=subprocess.STDOUT,
+ )