I took your lead and used the same idea for adding the* api-type-generation
hook* by using the pre-commit node env.

Running this on the host also makes the hook so much simpler, 3 vs ~35
lines, this is a nice quality of life improvement :)

Le mer. 20 juil. 2022 à 21:41, Jarek Potiuk <[email protected]> a écrit :

> Glad you liked it. Happy to help in adding more of those if we have an
> idea on how to improve the experience of webserver devs :).
>
> J.
>
>
> On Wed, Jul 20, 2022 at 9:12 PM Jeambrun Pierre <[email protected]>
> wrote:
>
>> Hello,
>>
>> Thank you Jarek for this nice change. I didn't have time today to check
>> the PR before it was merged, sorry for that.
>>
>> I've run it locally and everything is working fine. I'm glad to see that
>> it simplifies the Dockerfiles a lot.
>>
>> Best,
>>
>> Le mer. 20 juil. 2022 à 20:54, Jarek Potiuk <[email protected]> a écrit :
>>
>>> The change is merged.
>>>
>>> If you use Breeze I recommend everyone to rebase to main and rebuild
>>> their images at earliest convenience. I just merged the change.
>>>
>>> On Linux, there might be some problems with permissions/ownership of
>>> files created during the build. They should fix themselves
>>> automatically - first time you run Breeze, but you can also force it
>>> with `breeze fix-ownership` command.
>>>
>>> J.
>>>
>>> On Wed, Jul 20, 2022 at 8:19 PM Ferruzzi, Dennis
>>> <[email protected]> wrote:
>>> >
>>> > I do like the sound of this. :thumbs-up:
>>> >
>>> >
>>> >
>>> > ________________________________
>>> > From: Jarek Potiuk <[email protected]>
>>> > Sent: Tuesday, July 19, 2022 3:00 PM
>>> > To: [email protected]
>>> > Subject: [EXTERNAL] [PROPOSAL] Simplification of www asset compilation
>>> for Breeze/dev env
>>> >
>>> >
>>> > CAUTION: This email originated from outside of the organization. Do
>>> not click links or open attachments unless you can confirm the sender and
>>> know the content is safe.
>>> >
>>> >
>>> > Hello everyone.
>>> >
>>> > I wanted to propose a slight change (but also simplification and
>>> speedup) of our dev env for the www asset compilation.
>>> >
>>> > I am on a spree of optimizing our CI/Dev environment (with quite a
>>> success so far - the new Python-based breeze is a wonderful tool that
>>> allows all kinds of optimizations - for one I just merged two change that
>>> will cut the build time for our k8s pretty much by half).
>>> >
>>> > Those changes are largely transparent (just waiting time decreases for
>>> everyone :)) But I have one more change that might (very slightly) impact
>>> the dev environment, while it will also decrease the waiting/build times
>>> for breeze locally so I wanted to announce it here.
>>> >
>>> > The PR is here: https://github.com/apache/airflow/pull/25169
>>> >
>>> > The gist of the change is that it moves all "node" asset compilation
>>> out from the image to the host - but I am also harnessing `pre-commit`s
>>> automated environment setup - so you will not have to worry about node/yarn
>>> setup - pre-commit will do it for you.
>>> >
>>> >
>>> > Very little changes if you used breeze:
>>> >
>>> > * when you run `start-airflow` assets will be automatically compiled
>>> by breeze/pre-commit (so UI will work out of the box). This previously
>>> happened inside the image
>>> > * when you run `prepare-airflow-package` - same thing happen - the
>>> package will have compiled packages ready
>>> > * the asset compilation locally caches node_modules/assets locally, so
>>> only first build will take more time
>>> > * you can run `breeze compile-www-assets` to force-compiling the
>>> assets any time
>>> >
>>> > The benefits of the change:
>>> >
>>> > * CI images will be smaller and rebuild faster (no nodejs in the
>>> images any more)
>>> > *  Dockerfiles are WAY simpler as they do not have to account for
>>> compiling the assets and optimizing it
>>> > * we used to have multiple scripts to compile assets - now we only
>>> have `breeze compile-www-assets` that runs 'pre-commit manual run` under
>>> the hood
>>> > * the lint pre-commits are also using the same environment, so they do
>>> not need the image any more - way simpler setup and execution
>>> >
>>> > Overall - 400 lines of code :)
>>> >
>>> > I hope you will like it.
>>> >
>>> > Brent, Pierre -please take a look as it will mostly impact you (but I
>>> think the impact will be vastly positive).
>>> >
>>> > J.
>>> >
>>> >
>>> >
>>> >
>>> >
>>>
>>

Reply via email to