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

PYT-3173: download wheels for the Python agent #420

Merged
merged 1 commit into from
Feb 5, 2025

Conversation

contrast-jproberts
Copy link
Contributor

The Python agent has started distributing prebuilt wheels in v10.0.0 . This change updates the build to use those wheels. Some advantages of wheels include

  • no longer needing a separate build stage for each supported Python version
  • easier reproducibility, since we're downloading prebuilt packages instead of building them in a slim-bookworm image.
  • now supporting Alpine and other musllibc environments! (with libgcc available at runtime for linking)

This script may appear overly complex. It's generalized so that it can be used by other Contrast installation tools with minimal changes.

The Python agent has started distributing prebuilt wheels in
v10.0.0 . This change updates the build to use those wheels. Some
advantages of wheels include
  * no longer needing a separate build stage for each supported
    Python version
  * easier reproducibility, since we're downloading prebuilt
    packages instead of building them in a slim-bookworm image.
  * now supporting Alpine and other musllibc environments!
@contrast-jproberts contrast-jproberts requested a review from a team as a code owner February 3, 2025 21:02
Copy link

github-actions bot commented Feb 3, 2025

Images built:

dotnet-core: ghcr.io/contrast-security-oss/agent-operator-images/agent-dotnet-core@sha256:fcd9e74ba1bdbb6c44c5111c35a8f9a7229defdfcfdcfb188c8aeba9e44caa9a
dotnet-framework: ghcr.io/contrast-security-oss/agent-operator-images/agent-dotnet-framework@sha256:3e404f034729760f04a8f909105c0139725606cc64c469e65c0b5ce14d2182a9
java: ghcr.io/contrast-security-oss/agent-operator-images/agent-java@sha256:fbb73bf8d2b96a6c5a23207695a1c1f0624c4911c2d790053144c5696e1c47c7
nodejs: ghcr.io/contrast-security-oss/agent-operator-images/agent-nodejs@sha256:e62df14ff6217ced0e843e64100c790dabd1d52d4d75a289cf296e110662f771
php: ghcr.io/contrast-security-oss/agent-operator-images/agent-php@sha256:8240dbfe8a5cf4337892a67c36a4605a95651199967f140c219f69fe4d1cadb7
python: ghcr.io/contrast-security-oss/agent-operator-images/agent-python@sha256:52503c8aa9e626672498a2930c7fff47156d0578698dbfd654d72d293953184d

Copy link
Contributor

@lazorchakp lazorchakp left a comment

Choose a reason for hiding this comment

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

Looks good to me. I looked briefly into the python test step in this pipeline and couldn't totally understand how it was working, but I imagine if this script was failing to download the right wheels the tests would catch it.

if [ "$VERSION" == "latest" ]; then
VERSION=$(
python3 -m pip index versions "contrast-agent" --only-binary :all: \
| sed -n 's/.*contrast-agent (\(.*\)).*/\1/p'
Copy link
Contributor

Choose a reason for hiding this comment

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

I learned a few new things about sed reading this line 😅

@contrast-jproberts contrast-jproberts merged commit 23fa823 into master Feb 5, 2025
15 checks passed
@contrast-jproberts contrast-jproberts deleted the PYT-3173-wheels branch February 5, 2025 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants