-
Notifications
You must be signed in to change notification settings - Fork 14.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exclude yarn.lock
from release packages
#16577
Conversation
This would also exclude the file from .tar.gz (aka sdist). Is this OK to do? |
I'm also curious why excluding the file from MANIFEST.in changes the wheel content. That file is for sdist inclusion and doesn't generally affect the wheel. There is something in the build steps I'm not understanding, probably. |
@uraunsjr is right. Closing in favour of #16580 |
Sorry for closing it. I believe #16580 is the right fix (including prod Dockerfile fix), feel free to either approve that one or incorporate here. I don't mind either (or if you find a better way of excluding the lock file only for whl package I am happy as well). |
yarn.lock
from built Python wheel fileyarn.lock
from release packages
@potiuk @uranusjr Did you guys actually try out? I had, unless I missed something (which is also possible :) ) The same link that you used Jarek explain the three options: https://setuptools.readthedocs.io/en/latest/userguide/datafiles.html If a package has @potiuk I would want to continue with this PR and you can optimize it in yours. I have updated the PR title and description to say I want to exclude yarn.lock file from both tar.gz and .whl |
3fefeea
to
8df8828
Compare
Same as apache#16494 - However that PR had to be reverted in apache#16518 as it failed building of PROD image, this PR/commit will fix it. PROBLEM: Currently the airflow wheel is built with the yarn.lock which is not actually used by the airflow itself. Having this file in the docker image causes the clair and trivy scanners to fail FIX: The fix is to exclude the yarn.lock by specifying it in the manifest.in
8df8828
to
11c927f
Compare
Yep. I tried. I think the main point (and @urunsjr I believe agrees with me on that) is that UPDATE: Stupid me. Mixed sources with sdist :( |
If we include the compiled assets, then we should not include the yarn.lock. Users don't rebuild form the sdist -- they rebuild from the source. |
Well that defeats the purpose of what this PR is solving, clair and trivy and other scanners will find it. For ASF project, if someone wants to build from source they can use |
Ah you are right. I forgot that in airflow sdist and sources are separate packages (in providers they are the same). You are right I withdraw my comment and close PR :) |
Thanks for the clarification. Excluding the file from sdist sounds reasonable to me from the justification above, so +1 to this PR on its own. The only remaining issue I have is why Edit: Oh wait we do have I will probably work on cleaning up the configs then. |
FYI the compile_assets.sh was not included. It was run during image build after the package has been installed. But it's now fixed. |
Could you clarify this a bit? It’s not clear where |
The error we had when running the compile assets was from the sources of airlflow. When we build the image from sources, we also run the In CI, the images are build from packages generated using PR sources (because we want to run K8S tests using airflow production image build from PR sources AND we want to install prod image using packages similarly when we release the image). So in CI those things happen:
The problem was that during step 3, there was an extra step run to compile the assets again (that was a mistake - fixed in this PR). This was done using compile_assets scripts from docker folder: |
I hope it's clearer now :). There are many things happening in our CI - and things are pretty complex: on one hand we want to use PR sources to verify if they work, on the other we want to build airflow from packages. But when you want to test or run the PROD/CI image locally during development (for your tests) you cannot really go through the extra hoop of preparing the packages to install them because you want to mount the sources directly to the image in order to be able to modify the sources. Having this possibility of building the images either from packages or from sources makes it much easier to iterate over your tests inside the image without having to rebuild it every time - this is basically what breeze does - builds CI/PROD image locally in the way that you can mount the local sources and continue developing locally with mounted sources. This saves A TON of time for iterations over your tests especially when you work with the integrations of Airflow (Kerberos/mongo/redis whatever) but also when you work with errors that manifest only for specific database versions - ability of having all that up-and-running and tests running with exactly the same configuration as on CI makes it super easy to reproduce any errors you see in CI as well (and you can even add |
And yeah - this is a different 'compile assets" script - that's why it is included. This one is used when you are inside the docker container or in your local environment when you iterate over the .js files and want to recompile them. I tend to forget about this one because I almost never do that. For that much better option is It should probably be indeed excluded. |
Same as #16494 - However that PR had to be reverted in #16518 as it failed building of PROD image, this PR/commit will fix it. PROBLEM: Currently the airflow wheel is built with the yarn.lock which is not actually used by the airflow itself. Having this file in the docker image causes the clair and trivy scanners to fail FIX: The fix is to exclude the yarn.lock by specifying it in the manifest.in (cherry picked from commit aa79bfe)
Same as apache#16494 - However that PR had to be reverted in apache#16518 as it failed building of PROD image, this PR/commit will fix it. PROBLEM: Currently the airflow wheel is built with the yarn.lock which is not actually used by the airflow itself. Having this file in the docker image causes the clair and trivy scanners to fail FIX: The fix is to exclude the yarn.lock by specifying it in the manifest.in (cherry picked from commit aa79bfe)
Same as apache#16494 - However that PR had to be reverted in apache#16518 as it failed building of PROD image, this PR/commit will fix it. PROBLEM: Currently the airflow wheel is built with the yarn.lock which is not actually used by the airflow itself. Having this file in the docker image causes the clair and trivy scanners to fail FIX: The fix is to exclude the yarn.lock by specifying it in the manifest.in (cherry picked from commit aa79bfe) (cherry picked from commit 8fcc68d)
Same as apache#16494 - However that PR had to be reverted in apache#16518 as it failed building of PROD image, this PR/commit will fix it. PROBLEM: Currently the airflow wheel is built with the yarn.lock which is not actually used by the airflow itself. Having this file in the docker image causes the clair and trivy scanners to fail FIX: The fix is to exclude the yarn.lock by specifying it in the manifest.in (cherry picked from commit aa79bfe) (cherry picked from commit 8fcc68d) (cherry picked from commit 99d5ebd)
Same as apache#16494 - However that PR had to be reverted in apache#16518 as it failed building of PROD image, this PR/commit will fix it. PROBLEM: Currently the airflow wheel is built with the yarn.lock which is not actually used by the airflow itself. Having this file in the docker image causes the clair and trivy scanners to fail FIX: The fix is to exclude the yarn.lock by specifying it in the manifest.in
Same as apache#16494 - However that PR had to be reverted in apache#16518 as it failed building of PROD image, this PR/commit will fix it. PROBLEM: Currently the airflow wheel is built with the yarn.lock which is not actually used by the airflow itself. Having this file in the docker image causes the clair and trivy scanners to fail FIX: The fix is to exclude the yarn.lock by specifying it in the manifest.in (cherry picked from commit aa79bfe)
The apache#16577 change removed yarn.lock from installed packages and it removed the possibility of preparing assets after the package is installed - so far that was the way it was done in the PROD image built from sources. The asset compilation was supposed to work after the change but it was not performed in this case. The change fixes it by: * detecting properly if the PROD image is built from sources (INSTALLATION_METHOD) * compiling the assets from sources, not from package * installing airflow from sources AFTER assets were compiled Fixes apache#16939
The #16577 change removed yarn.lock from installed packages and it removed the possibility of preparing assets after the package is installed - so far that was the way it was done in the PROD image built from sources. The asset compilation was supposed to work after the change but it was not performed in this case. The change fixes it by: * detecting properly if the PROD image is built from sources (INSTALLATION_METHOD) * compiling the assets from sources, not from package * installing airflow from sources AFTER assets were compiled Fixes #16939
Same as apache#16494 - However that PR had to be reverted in apache#16518 as it failed building of PROD image, this PR/commit will fix it. PROBLEM: Currently the airflow wheel is built with the yarn.lock which is not actually used by the airflow itself. Having this file in the docker image causes the clair and trivy scanners to fail FIX: The fix is to exclude the yarn.lock by specifying it in the manifest.in (cherry picked from commit aa79bfe) (cherry picked from commit 6c80e3f)
Same as apache#16494 - However that PR had to be reverted in apache#16518 as it failed building of PROD image, this PR/commit will fix it. PROBLEM: Currently the airflow wheel is built with the yarn.lock which is not actually used by the airflow itself. Having this file in the docker image causes the clair and trivy scanners to fail FIX: The fix is to exclude the yarn.lock by specifying it in the manifest.in (cherry picked from commit aa79bfe) (cherry picked from commit 6c80e3f) (cherry picked from commit 25d46e4)
Same as apache#16494 - However that PR had to be reverted in apache#16518 as it failed building of PROD image, this PR/commit will fix it. PROBLEM: Currently the airflow wheel is built with the yarn.lock which is not actually used by the airflow itself. Having this file in the docker image causes the clair and trivy scanners to fail FIX: The fix is to exclude the yarn.lock by specifying it in the manifest.in (cherry picked from commit aa79bfe) (cherry picked from commit 6c80e3f) (cherry picked from commit 25d46e4)
Same as apache#16494 - However that PR had to be reverted in apache#16518 as it failed building of PROD image, this PR/commit will fix it. PROBLEM: Currently the airflow wheel is built with the yarn.lock which is not actually used by the airflow itself. Having this file in the docker image causes the clair and trivy scanners to fail FIX: The fix is to exclude the yarn.lock by specifying it in the manifest.in (cherry picked from commit aa79bfe) (cherry picked from commit 6c80e3f) (cherry picked from commit 25d46e4)
…e#17086) The apache#16577 change removed yarn.lock from installed packages and it removed the possibility of preparing assets after the package is installed - so far that was the way it was done in the PROD image built from sources. The asset compilation was supposed to work after the change but it was not performed in this case. The change fixes it by: * detecting properly if the PROD image is built from sources (INSTALLATION_METHOD) * compiling the assets from sources, not from package * installing airflow from sources AFTER assets were compiled Fixes apache#16939 (cherry picked from commit 660027f)
…e#17086) The apache#16577 change removed yarn.lock from installed packages and it removed the possibility of preparing assets after the package is installed - so far that was the way it was done in the PROD image built from sources. The asset compilation was supposed to work after the change but it was not performed in this case. The change fixes it by: * detecting properly if the PROD image is built from sources (INSTALLATION_METHOD) * compiling the assets from sources, not from package * installing airflow from sources AFTER assets were compiled Fixes apache#16939
The #16577 change removed yarn.lock from installed packages and it removed the possibility of preparing assets after the package is installed - so far that was the way it was done in the PROD image built from sources. The asset compilation was supposed to work after the change but it was not performed in this case. The change fixes it by: * detecting properly if the PROD image is built from sources (INSTALLATION_METHOD) * compiling the assets from sources, not from package * installing airflow from sources AFTER assets were compiled Fixes #16939 (cherry picked from commit 660027f)
The #16577 change removed yarn.lock from installed packages and it removed the possibility of preparing assets after the package is installed - so far that was the way it was done in the PROD image built from sources. The asset compilation was supposed to work after the change but it was not performed in this case. The change fixes it by: * detecting properly if the PROD image is built from sources (INSTALLATION_METHOD) * compiling the assets from sources, not from package * installing airflow from sources AFTER assets were compiled Fixes #16939 (cherry picked from commit 660027f)
Same as #16494 - However that PR had to be reverted in #16518 as it failed building of PROD image, this PR/commit will fix it.
PROBLEM: Currently the airflow wheel and tar.gz is built with the yarn.lock which is not actually used by the airflow itself. Having this file in the docker image causes the clair and trivy scanners to fail.
FIX: The fix is to exclude the yarn.lock by specifying it in the manifest.in to exclude from both tar.gz and wheel -- source and binary distributions
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.