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

bump python versions and use docker slim versions #1661

Merged
merged 10 commits into from
Oct 11, 2022

Conversation

v1v
Copy link
Member

@v1v v1v commented Oct 5, 2022

What does this pull request do?

Use smaller docker images (slim) and bump the version to use the supported python version for some of the scripts

Why

image

vs

image

Then the docker image with all the tooling is about 2x smaller:

REPOSITORY TAG IMAGE ID CREATED SIZE
apm-agent-python python-3.6 50ecd8523761 51 seconds ago 462MB

vs

REPOSITORY TAG IMAGE ID CREATED SIZE
apm-agent-python python-3.6 8e23ab62a462 16 seconds ago 961MB

Implementation details

There were some missing packages required to run some of the tests, such as:

  • libmariadb-dev to fix mariadb_config: not found when using the framework mysqlclient-newest
  • libpq-dev to fix pg_config executable not found when using the framework psycopg2-newest
  • build-essential to fix gcc executable not found when using the framework twisted
  • make to fix the run of all the tests.
  • gpg to fix the docker image generation.

@v1v v1v requested review from a team October 5, 2022 16:07
@v1v v1v self-assigned this Oct 5, 2022
@apmmachine
Copy link
Contributor

apmmachine commented Oct 5, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-10-06T14:56:04.102+0000

  • Duration: 38 min 42 sec

Test stats 🧪

Test Results
Failed 0
Passed 13254
Skipped 15092
Total 28346

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /test linters : Run the Python linters only.

  • /test full : Run the full matrix of tests.

  • /test benchmark : Run the APM Agent Python benchmarks tests.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@apmmachine
Copy link
Contributor

apmmachine commented Oct 5, 2022

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 100.0% (67/67) 💚
Files 100.0% (226/226) 💚
Classes 100.0% (226/226) 💚
Lines 90.657% (17902/19747) 👎 -0.643
Conditionals 74.967% (2803/3739) 👍 0.36

@v1v
Copy link
Member Author

v1v commented Oct 5, 2022

I'll run a few builds in the CI to discard any issues with the full test coverage

@v1v
Copy link
Member Author

v1v commented Oct 5, 2022

/test full

@v1v
Copy link
Member Author

v1v commented Oct 6, 2022

/test full

@v1v v1v requested a review from basepi October 6, 2022 16:01
Copy link
Contributor

@amannocci amannocci left a comment

Choose a reason for hiding this comment

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

LGTM

Small suggestion :

# Use --no-cache-dir flag.
# pre-install base requirements
RUN python -m pip install --no-cache-dir --progress-bar off -U pip && pip install --no-cache-dir --progress-bar off -r /reqs-base.txt

@@ -7,7 +7,7 @@ docker_pip_cache="/tmp/cache/pip"

cd tests

docker build --build-arg PYTHON_IMAGE=python:3.6 -t python-linters .
docker build --build-arg PYTHON_IMAGE=python:3.8 -t python-linters .
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if these scripts are still in use. We use pre-commit for black/isort/flake8. The only reference I could find is in run-tests-locally.asciidoc

From what I can tell, we might as well just delete these three scripts.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point, let me review it in a follow up, as I don't wanna change any further behaviours in this PR but only bump the version to use a slim one and default to a major python version in those scripts.

@v1v
Copy link
Member Author

v1v commented Oct 11, 2022

Small suggestion :

Thanks @amannocci , this change was not aimed to modify any of the internals but the docker image base image and default python version, for now I'll not make any further changes so this can be merged and in a follow up the implementation can be revisited 🙏

@v1v v1v merged commit 30783da into elastic:main Oct 11, 2022
@v1v v1v added automation Team:Automation Label for the Observability productivity team labels Oct 11, 2022
v1v added a commit to v1v/apm-agent-python that referenced this pull request Oct 11, 2022
…ith-k8s-skaffold

* upstream/main:
  bump python versions and use docker slim versions (elastic#1661)
  use github actions for pre-commit checks (elastic#1658)
  Use typing.TypeVar on decorators' type hints (elastic#1655)
  Use minimum of 5 seconds for interval between central config calls (elastic#1652)
  fix errors in pymongo tests introduced in elastic#1639 (elastic#1648)
  only use content-type and content-encoding headers for POSTing events (elastic#1651)
  fix starlette 0.21 tests (elastic#1653)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automation Team:Automation Label for the Observability productivity team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants