Repository navigation
fix(fastapi-sqlalchemy-pg-catalog): retry the image's pip fetch and pin pydantic - #110
Draft
slayerjain wants to merge 1 commit into
Draft
slayerjain wants to merge 1 commit into
slayerjain wants to merge 1 commit into
Conversation
…ay keploy's CI lanes do
keploy/integrations' sqlalchemy-pg-catalog-postgres lane builds this
image. On a CI runner whose uplink a full pipeline saturates, pip gives
up on an index page that sends nothing for 15 s (its socket timeout),
logs why only at debug level, and reports the package as having no
versions:
ERROR: Could not find a version that satisfies the requirement
pydantic-core==... (from versions: none)
That failed the integrations lanes that build pip images in pipelines
1910, 1911 and 1912, before keploy ran.
The pip install now follows the fetch rule those lanes' own images use
(keploy/integrations .ci/scripts/pip-fetch-rule_test.sh, from
keploy/enterprise's .ci/scripts/fetch.sh), written inline because a
build context cannot reach a script: at most 5 attempts, waiting attempt
x 10 s between them and not after the last, then exit 1 naming pip's
last exit status. ARG PIP_RESUME_RETRIES=5 makes pip 25.1 and later
resume a cut download. A fetch is idempotent and fails because of the
network, so retrying it cannot hide a regression: a version that does
not exist fails all 5 attempts.
This is the only Dockerfile in this repo that an integrations lane
builds with pip: the doccano lane builds doccano-django/Dockerfile,
which has no pip step (its Dockerfile.coverage does, but no lane builds
it).
requirements.txt now pins pydantic (2.14.1, what the unpinned file
resolves to today). fastapi takes pydantic 1 or 2, so when pydantic-core's
index page was cut, pip did not fail: it resolved around the gap and
installed pydantic 1.10.26, and the lane went on to test a different app.
With the pin, that cut fails the install and the rule retries it.
On a box, in the lane's own `docker compose build app` (keploy/integrations
sqlalchemy-pg-catalog-postgres, keploy v3.6.161), with a PyPI index that
sends half of one project's page and then nothing for 25 s, on that
page's first fetch only:
- fastapi's page cut: the previous image fails with the CI error
("fastapi==0.115.0 (from versions: none)") and the lane fails; this one
logs "pip install failed (attempt 1 of 5, exit 1), retrying in 10s",
builds, and the lane passes.
- pydantic-core's page cut: the previous image builds with
pydantic-1.10.26; this one fails attempt 1 on "pydantic-core==2.50.1
(from pydantic) (from versions: none)", retries, and builds with
pydantic-2.14.1. The lane passes both times.
- no cut: this one builds once and the lane passes.
Signed-off-by: slayerjain <shubhamkjain@outlook.com>
Member
Author
4 of 5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #102 (the fastapi-sqlalchemy-pg-catalog sample); it only touches that sample's app image.
keploy/integrations' sqlalchemy-pg-catalog-postgres lane builds this image. On a CI runner whose uplink is saturated, pip gives up on an index page that stops moving for 15 s and reports the package as having no versions ("from versions: none"), which failed the integrations lanes that build pip images in pipelines 1910-1912 before keploy ran.
What changes:
pip installfollows the fetch rule the integrations lanes' own images use (keploy/integrations.ci/scripts/pip-fetch-rule_test.sh): at most 5 attempts, waiting attempt x 10 s between them, then exit 1 naming pip's last exit status.ARG PIP_RESUME_RETRIES=5lets pip 25.1+ resume a cut download.requirements.txtpinspydantic==2.14.1(what the file resolves to today). fastapi takes pydantic 1 or 2, so a cut pydantic-core page made pip quietly install pydantic 1.10.26 instead of failing, and the lane tested a different app.This is the only Dockerfile here that an integrations lane builds with pip: the doccano lane builds
doccano-django/Dockerfile, which has no pip step.Tested on an amd64 box, in the lane's own
docker compose build appwith keploy v3.6.161, through a PyPI index that sends half of one project's page on its first fetch and then stalls for 25 s:Once this merges, the integrations lane pins the resulting commit as its SAMPLES_SHA.