You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/12/23 19:54:40 UTC

[GitHub] [airflow] potiuk opened a new pull request #13292: Compile assets automatically when needed at Breeze entry

potiuk opened a new pull request #13292:
URL: https://github.com/apache/airflow/pull/13292


   We are storing md5 sum of all relevant files to know when we need
   to recompile the assets.
   
   Fixes #12262
   
   <!--
   Thank you for contributing! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   In case of existing issue, reference it using one of the following:
   
   closes: #ISSUE
   related: #ISSUE
   
   How to write a good git commit message:
   http://chris.beams.io/posts/git-commit/
   -->
   
   ---
   **^ Add meaningful description above**
   
   Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#pull-request-guidelines)** for more information.
   In case of fundamental code change, Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)) is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   In case of backwards incompatible changes please leave a note in [UPDATING.md](https://github.com/apache/airflow/blob/master/UPDATING.md).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] mik-laj commented on a change in pull request #13292: Compile assets automatically when needed at Breeze entry

Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #13292:
URL: https://github.com/apache/airflow/pull/13292#discussion_r548877896



##########
File path: airflow/www/compile_assets_if_needed.sh
##########
@@ -0,0 +1,36 @@
+#!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+set -e
+
+cd "$( dirname "${BASH_SOURCE[0]}" )"
+
+MD5SUM_FILE="static/dist/sum.md5"

Review comment:
       This file does not exist if we run Breeze using a previously built image, which means that when we run each type of test, we build the scripts again. 
   
   When we run the command below, I have to wait a long time too, when in fact I just want to run `pip freeze` to check the installed libraries.
   ```
   ./breeze shell --github-image-id 444074599
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] ryanahamilton commented on a change in pull request #13292: Compile assets automatically when needed at Breeze entry

Posted by GitBox <gi...@apache.org>.
ryanahamilton commented on a change in pull request #13292:
URL: https://github.com/apache/airflow/pull/13292#discussion_r548189255



##########
File path: airflow/www/compile_assets_if_needed.sh
##########
@@ -0,0 +1,36 @@
+#!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+set -e
+
+cd "$( dirname "${BASH_SOURCE[0]}" )"
+
+MD5SUM_FILE="static/dist/sum.md5"
+readonly MD5SUM_FILE
+
+md5sum=$(find package.json yarn.lock static/css static/js -type f | sort  | xargs md5sum)
+old_md5sum=$(cat "${MD5SUM_FILE}" 2>/dev/null || true)
+if [[ ${old_md5sum} != "${md5sum}" ]]; then
+    echo
+    echo "The assets need to be compiled because some of the www source files changed"
+    echo
+    ./compile_assets.sh
+    echo "${md5sum}" > "${MD5SUM_FILE}"
+else
+    echo "No need to compile www assets"

Review comment:
       This might more explicitly communicate that they've already been compiled?
   ```suggestion
       echo "No need to recompile www assets"
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] github-actions[bot] commented on pull request #13292: Compile assets automatically when needed at Breeze entry

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #13292:
URL: https://github.com/apache/airflow/pull/13292#issuecomment-750452335






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk merged pull request #13292: Compile assets automatically when needed at Breeze entry

Posted by GitBox <gi...@apache.org>.
potiuk merged pull request #13292:
URL: https://github.com/apache/airflow/pull/13292


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] mik-laj commented on a change in pull request #13292: Compile assets automatically when needed at Breeze entry

Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #13292:
URL: https://github.com/apache/airflow/pull/13292#discussion_r548877896



##########
File path: airflow/www/compile_assets_if_needed.sh
##########
@@ -0,0 +1,36 @@
+#!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+set -e
+
+cd "$( dirname "${BASH_SOURCE[0]}" )"
+
+MD5SUM_FILE="static/dist/sum.md5"

Review comment:
       This file does not exist if we run Breeze using a previously built image, which means that when we run each type of test, we build the scripts again. 
   
   When we run the command below, I have to wait a long time too, when in fact I just want to run `pip freeze` to check the installed libraries.
   ```
   ./breeze shell --github-image-id 444074599
   ```
   I would be happy if this recompilation could be turned off as I never deal with JS files, but I change branches a lot and suddenly recompiling all resources without warning is very painful for me.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on a change in pull request #13292: Compile assets automatically when needed at Breeze entry

Posted by GitBox <gi...@apache.org>.
potiuk commented on a change in pull request #13292:
URL: https://github.com/apache/airflow/pull/13292#discussion_r548195146



##########
File path: airflow/www/compile_assets_if_needed.sh
##########
@@ -0,0 +1,36 @@
+#!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+set -e
+
+cd "$( dirname "${BASH_SOURCE[0]}" )"
+
+MD5SUM_FILE="static/dist/sum.md5"
+readonly MD5SUM_FILE
+
+md5sum=$(find package.json yarn.lock static/css static/js -type f | sort  | xargs md5sum)
+old_md5sum=$(cat "${MD5SUM_FILE}" 2>/dev/null || true)
+if [[ ${old_md5sum} != "${md5sum}" ]]; then
+    echo
+    echo "The assets need to be compiled because some of the www source files changed"

Review comment:
       ```suggestion
       echo "The assets need to be recompiled because some of the www source files changed"
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org