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

Pin CI to Python 3.9.18 specifically #19783

Closed
wants to merge 1 commit into from
Closed

Conversation

huonw
Copy link
Contributor

@huonw huonw commented Sep 7, 2023

This fixes #19781 by pinning CI to use exactly 3.9.18, not just 3.9 in general, so that all jobs use the same patch version. Before this, the patch version could differ, and that would change the engine hash (as computed by calculate_engine_hash.sh), leading to jobs attempting to rebuild the engine.

GitHub seems to upgrade the Python versions across runners in phases, meaning actions/setup-python with a version specifier of 3.9 will sometimes be 3.9.17, and sometimes 3.9.18. When the the engine is built with one version, and then a test job has a different version, the test job would notice the mismatch in engine hash and start rebuilding the Rust engine. See #19780 for verification of this.

This explains why CI has been failing inconsistently: sometimes we get lucky and all jobs run with the same Python version, but often we don't.

This is one approach to fixing #19781. #19784 is probably a better approach, if it is valid.

(Only one of this and #19784 needs to merge.)

@huonw huonw added the category:internal CI, fixes for not-yet-released features, etc. label Sep 7, 2023
@benjyw
Copy link
Contributor

benjyw commented Sep 7, 2023

It can't hurt to merge this one as well though?

huonw added a commit that referenced this pull request Sep 7, 2023
This fixes #19781 by ensuring the engine hash (as computed by
calculate_engine_hash.sh) only uses the implementation, major version
and minor version, not the patch version (e.g. `cpython 3 9` instead of
`Python 3.9.17`. Before this, the patch version could differ between
runners on CI, and that would change the engine hash, leading to jobs
attempting to rebuild the engine.

This is motivated by the assumption that the engine only depends on the
CPython ABI version, which is the same for all patch versions, and thus
having the hash change based on the patch version is unnecessary.

GitHub seems to upgrade the Python versions across runners in phases,
meaning `actions/setup-python` with a version specifier of `3.9` will
sometimes be 3.9.17, and sometimes 3.9.18. When the the engine is built
with one version, and then a test job has a different version, the test
job would notice the mismatch in engine hash and start rebuilding the
Rust engine. See #19780 for verification of this.

This explains why CI has been failing inconsistently: sometimes we get
lucky and all jobs run with the same Python version, but often we don't.

This is one approach to fixing #19781, that's probably better than
#19783.

(Only one of this and #19783 needs to merge.)
WorkerPants pushed a commit that referenced this pull request Sep 7, 2023
This fixes #19781 by ensuring the engine hash (as computed by
calculate_engine_hash.sh) only uses the implementation, major version
and minor version, not the patch version (e.g. `cpython 3 9` instead of
`Python 3.9.17`. Before this, the patch version could differ between
runners on CI, and that would change the engine hash, leading to jobs
attempting to rebuild the engine.

This is motivated by the assumption that the engine only depends on the
CPython ABI version, which is the same for all patch versions, and thus
having the hash change based on the patch version is unnecessary.

GitHub seems to upgrade the Python versions across runners in phases,
meaning `actions/setup-python` with a version specifier of `3.9` will
sometimes be 3.9.17, and sometimes 3.9.18. When the the engine is built
with one version, and then a test job has a different version, the test
job would notice the mismatch in engine hash and start rebuilding the
Rust engine. See #19780 for verification of this.

This explains why CI has been failing inconsistently: sometimes we get
lucky and all jobs run with the same Python version, but often we don't.

This is one approach to fixing #19781, that's probably better than
#19783.

(Only one of this and #19783 needs to merge.)
WorkerPants pushed a commit that referenced this pull request Sep 7, 2023
This fixes #19781 by ensuring the engine hash (as computed by
calculate_engine_hash.sh) only uses the implementation, major version
and minor version, not the patch version (e.g. `cpython 3 9` instead of
`Python 3.9.17`. Before this, the patch version could differ between
runners on CI, and that would change the engine hash, leading to jobs
attempting to rebuild the engine.

This is motivated by the assumption that the engine only depends on the
CPython ABI version, which is the same for all patch versions, and thus
having the hash change based on the patch version is unnecessary.

GitHub seems to upgrade the Python versions across runners in phases,
meaning `actions/setup-python` with a version specifier of `3.9` will
sometimes be 3.9.17, and sometimes 3.9.18. When the the engine is built
with one version, and then a test job has a different version, the test
job would notice the mismatch in engine hash and start rebuilding the
Rust engine. See #19780 for verification of this.

This explains why CI has been failing inconsistently: sometimes we get
lucky and all jobs run with the same Python version, but often we don't.

This is one approach to fixing #19781, that's probably better than
#19783.

(Only one of this and #19783 needs to merge.)
WorkerPants pushed a commit that referenced this pull request Sep 7, 2023
This fixes #19781 by ensuring the engine hash (as computed by
calculate_engine_hash.sh) only uses the implementation, major version
and minor version, not the patch version (e.g. `cpython 3 9` instead of
`Python 3.9.17`. Before this, the patch version could differ between
runners on CI, and that would change the engine hash, leading to jobs
attempting to rebuild the engine.

This is motivated by the assumption that the engine only depends on the
CPython ABI version, which is the same for all patch versions, and thus
having the hash change based on the patch version is unnecessary.

GitHub seems to upgrade the Python versions across runners in phases,
meaning `actions/setup-python` with a version specifier of `3.9` will
sometimes be 3.9.17, and sometimes 3.9.18. When the the engine is built
with one version, and then a test job has a different version, the test
job would notice the mismatch in engine hash and start rebuilding the
Rust engine. See #19780 for verification of this.

This explains why CI has been failing inconsistently: sometimes we get
lucky and all jobs run with the same Python version, but often we don't.

This is one approach to fixing #19781, that's probably better than
#19783.

(Only one of this and #19783 needs to merge.)
@huonw
Copy link
Contributor Author

huonw commented Sep 7, 2023

The only reason not to would be the specific comment (originally from #11866) about not specifying patch versions, in order to get the latest.

huonw added a commit that referenced this pull request Sep 7, 2023
…9799)

This fixes #19781 by ensuring the engine hash (as computed by
calculate_engine_hash.sh) only uses the implementation, major version
and minor version, not the patch version (e.g. `cpython 3 9` instead of
`Python 3.9.17`. Before this, the patch version could differ between
runners on CI, and that would change the engine hash, leading to jobs
attempting to rebuild the engine.

This is motivated by the assumption that the engine only depends on the
CPython ABI version, which is the same for all patch versions, and thus
having the hash change based on the patch version is unnecessary.

GitHub seems to upgrade the Python versions across runners in phases,
meaning `actions/setup-python` with a version specifier of `3.9` will
sometimes be 3.9.17, and sometimes 3.9.18. When the the engine is built
with one version, and then a test job has a different version, the test
job would notice the mismatch in engine hash and start rebuilding the
Rust engine. See #19780 for verification of this.

This explains why CI has been failing inconsistently: sometimes we get
lucky and all jobs run with the same Python version, but often we don't.

This is one approach to fixing #19781, that's probably better than
#19783.

(Only one of this and #19783 needs to merge.)

Co-authored-by: Huon Wilson <huon@exoflare.io>
huonw added a commit that referenced this pull request Sep 8, 2023
…9801)

This fixes #19781 by ensuring the engine hash (as computed by
calculate_engine_hash.sh) only uses the implementation, major version
and minor version, not the patch version (e.g. `cpython 3 9` instead of
`Python 3.9.17`. Before this, the patch version could differ between
runners on CI, and that would change the engine hash, leading to jobs
attempting to rebuild the engine.

This is motivated by the assumption that the engine only depends on the
CPython ABI version, which is the same for all patch versions, and thus
having the hash change based on the patch version is unnecessary.

GitHub seems to upgrade the Python versions across runners in phases,
meaning `actions/setup-python` with a version specifier of `3.9` will
sometimes be 3.9.17, and sometimes 3.9.18. When the the engine is built
with one version, and then a test job has a different version, the test
job would notice the mismatch in engine hash and start rebuilding the
Rust engine. See #19780 for verification of this.

This explains why CI has been failing inconsistently: sometimes we get
lucky and all jobs run with the same Python version, but often we don't.

This is one approach to fixing #19781, that's probably better than
#19783.

(Only one of this and #19783 needs to merge.)

Co-authored-by: Huon Wilson <huon@exoflare.io>
huonw added a commit that referenced this pull request Sep 8, 2023
…9800)

This fixes #19781 by ensuring the engine hash (as computed by
calculate_engine_hash.sh) only uses the implementation, major version
and minor version, not the patch version (e.g. `cpython 3 9` instead of
`Python 3.9.17`. Before this, the patch version could differ between
runners on CI, and that would change the engine hash, leading to jobs
attempting to rebuild the engine.

This is motivated by the assumption that the engine only depends on the
CPython ABI version, which is the same for all patch versions, and thus
having the hash change based on the patch version is unnecessary.

GitHub seems to upgrade the Python versions across runners in phases,
meaning `actions/setup-python` with a version specifier of `3.9` will
sometimes be 3.9.17, and sometimes 3.9.18. When the the engine is built
with one version, and then a test job has a different version, the test
job would notice the mismatch in engine hash and start rebuilding the
Rust engine. See #19780 for verification of this.

This explains why CI has been failing inconsistently: sometimes we get
lucky and all jobs run with the same Python version, but often we don't.

This is one approach to fixing #19781, that's probably better than
#19783.

(Only one of this and #19783 needs to merge.)

Co-authored-by: Huon Wilson <huon@exoflare.io>
@thejcannon
Copy link
Member

Do we want latest though? Do we care? Wouldn't patch versions of 3.9 be ABI compatible?

@huonw
Copy link
Contributor Author

huonw commented Sep 11, 2023

Yeah, ABI compatibility is why we thought #19784 (now merged) was the better fix.

Are you suggesting we should or shouldn't merge this one?

@thejcannon
Copy link
Member

Ah I get it now. Yeah I think either is fine.

When we starting using PBS to provide Python we'll end up with a solution like this one (pinned patch). But either works.

I agree the other fix is likely the better one.

@huonw
Copy link
Contributor Author

huonw commented Sep 22, 2023

Given the other fix has been working fine, I feel no particular inclination to get this in (just becomes yet another thing to remember to update occasionally). So I'm going to close, but someone else can reopen/champion it in if they want.

@huonw huonw closed this Sep 22, 2023
@huonw huonw deleted the huonw/pin-python-3.9 branch September 22, 2023 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:internal CI, fixes for not-yet-released features, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CI inconsistently rebuilds Rust engine in jobs that don't expect it
3 participants