Skip to content
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

Added support for using SHA digest of Docker images. #30214

Merged
merged 27 commits into from
Apr 10, 2023

Conversation

elongl
Copy link
Contributor

@elongl elongl commented Mar 21, 2023

Closes: #30200.

@boring-cyborg boring-cyborg bot added the area:helm-chart Airflow Helm Chart label Mar 21, 2023
@boring-cyborg
Copy link

boring-cyborg bot commented Mar 21, 2023

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst)
Here are some useful points:

  • Pay attention to the quality of your code (ruff, mypy and type annotations). Our pre-commits will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example DAG that shows how users should use it.
  • Consider using Breeze environment for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: [email protected]
    Slack: https://s.apache.org/airflow-slack

@potiuk potiuk changed the title Added support for using SHA sigest of Docker images. Added support for using SHA digest of Docker images. Mar 21, 2023
@potiuk potiuk added this to the Airflow Helm Chart 1.9.0 milestone Mar 21, 2023
Copy link
Member

@jedcunningham jedcunningham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also add some tests.

chart/values.yaml Show resolved Hide resolved
chart/templates/_helpers.yaml Outdated Show resolved Hide resolved
@elongl
Copy link
Contributor Author

elongl commented Mar 21, 2023

Is there anything else to do for this PR?

@potiuk potiuk requested a review from jedcunningham March 21, 2023 18:50
@jedcunningham
Copy link
Member

Is there anything else to do for this PR?

We should add some test coverage to make sure the default vs "normal" image stuff still works with a digest.

@elongl
Copy link
Contributor Author

elongl commented Mar 22, 2023

@jedcunningham Care to provide an example for a Helm chart test?
Additionally, what do you think the test case should be?

@potiuk
Copy link
Member

potiuk commented Mar 22, 2023

@jedcunningham Care to provide an example for a Helm chart test? Additionally, what do you think the test case should be?

The chart tests are here: https://github.com/apache/airflow/tree/main/tests/charts and they are testing if the templates render properly when you provide some config values, so it should be rather straightforward.

Copy link
Member

@jedcunningham jedcunningham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also missing coverage that defaultAirflowDigest works right (hint: I don't think it does).

tests/charts/test_airflow_common.py Outdated Show resolved Hide resolved
@ele-elon
Copy link

@jedcunningham Sorry, care to clarify what do you mean by that?
I'm a bit confused as defaultAirflowDigest is a constant value.
What is the test-case that needs to be added?

@jedcunningham
Copy link
Member

I'm saying that if you set a non-default defaultAirflowDigest and images.useDefaultImageForMigration=True, it doesn't work as it should in the init containers.

It's might be worth having a new test case for it, instead of making that existing parametrized one more complex, see how it goes when you get in there.

@elongl
Copy link
Contributor Author

elongl commented Mar 31, 2023

Hi @jedcunningham, care to take another look?

@jedcunningham
Copy link
Member

@elongl, this looks good. Can you resolve the conflict when you get a chance?

@elongl
Copy link
Contributor Author

elongl commented Apr 8, 2023

Hi @jedcunningham, thanks for addressing.
Done, resolved the conflicts.

chart/templates/_helpers.yaml Outdated Show resolved Hide resolved
chart/templates/_helpers.yaml Outdated Show resolved Hide resolved
elongl and others added 2 commits April 9, 2023 01:15
@elongl
Copy link
Contributor Author

elongl commented Apr 8, 2023

@eladkal @jedcunningham Updated accordingly to the new format.

@jedcunningham jedcunningham merged commit e95f83e into apache:main Apr 10, 2023
@boring-cyborg
Copy link

boring-cyborg bot commented Apr 10, 2023

Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions.

@jedcunningham
Copy link
Member

Thanks @elongl! Congrats on your first commit 🎉

If you'd like, adding support for the digest for the rest of the images would be a good contribution.

@elongl elongl deleted the airflow-image-sha-digest branch April 10, 2023 16:41
@shalberd
Copy link

@jedcunningham is there a specific reason to include digest notation for airflow only, not for all the other potential images used? statsd, git-sync, and so on?

@potiuk
Copy link
Member

potiuk commented Aug 14, 2023

@jedcunningham is there a specific reason to include digest notation for airflow only, not for all the other potential images used? statsd, git-sync, and so on?

No - and feel free to add it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:helm-chart Airflow Helm Chart
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for providing SHA digest for the image in Helm chart
6 participants