Skip to content

Commit 358cb80

Browse files
committed
fix: CI failures with Python 3.14.0
Signed-off-by: Paulo Vital <paulo.vital@ibm.com>
1 parent 7aba51b commit 358cb80

3 files changed

Lines changed: 79 additions & 0 deletions

File tree

.github/workflows/py3140_build.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# This workflow builds a container image on top of the Python 3.14.0 RC images
2+
# with all dependencies already compiled and installed to be used in the tests
3+
# CI pipelines.
4+
5+
name: Build Instana python-sensor-test-py3.14.0
6+
on:
7+
workflow_dispatch: # Manual trigger.
8+
schedule:
9+
- cron: '1 0 * * 1,3' # Every Monday and Wednesday at midnight and one.
10+
env:
11+
IMAGE_NAME: python-sensor-test-py3.14.0
12+
IMAGE_TAG: latest
13+
CONTAINER_FILE: ./Dockerfile-py3140
14+
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }}
15+
REGISTRY_USER: ${{ github.actor }}
16+
REGISTRY_PASSWORD: ${{ github.token }}
17+
jobs:
18+
build-and-push:
19+
name: Build container image.
20+
runs-on: ubuntu-latest
21+
permissions:
22+
contents: read
23+
packages: write
24+
steps:
25+
- uses: actions/checkout@v4
26+
27+
- name: Build image
28+
id: build_image
29+
uses: redhat-actions/buildah-build@v2
30+
with:
31+
image: ${{ env.IMAGE_NAME }}
32+
tags: ${{ env.IMAGE_TAG }}
33+
containerfiles: ${{ env.CONTAINER_FILE }}
34+
35+
- name: Echo Outputs
36+
run: |
37+
echo "Image: ${{ steps.build_image.outputs.image }}"
38+
echo "Tags: ${{ steps.build_image.outputs.tags }}"
39+
echo "Tagged Image: ${{ steps.build_image.outputs.image-with-tag }}"
40+
41+
- name: Check images created
42+
run: buildah images | grep '${{ env.IMAGE_NAME }}'
43+
44+
# Push the image to GHCR (Image Registry)
45+
- name: Push To GHCR
46+
uses: redhat-actions/push-to-registry@v2
47+
id: push-to-ghcr
48+
with:
49+
image: ${{ steps.build_image.outputs.image }}
50+
tags: ${{ steps.build_image.outputs.tags }}
51+
registry: ${{ env.IMAGE_REGISTRY }}
52+
username: ${{ env.REGISTRY_USER }}
53+
password: ${{ env.REGISTRY_PASSWORD }}
54+
extra-args: |
55+
--disable-content-trust
56+
57+
- name: Print image URL
58+
run: echo "Image pushed to ${{ steps.push-to-ghcr.outputs.registry-paths }}"

Dockerfile-py3140

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM public.ecr.aws/docker/library/python:3.14.0b1
2+
3+
RUN apt-get update \
4+
&& apt-get install -y --no-install-recommends \
5+
build-essential python3-dev \
6+
&& apt-get clean \
7+
&& rm -rf /var/lib/apt/lists/*
8+
9+
ENV WORKDIR_=/root/base
10+
11+
WORKDIR $WORKDIR_
12+
COPY ./tests/requirements-pre314.txt .
13+
14+
ENV VIRTUAL_ENV="$WORKDIR_/venv"
15+
RUN python -m venv $VIRTUAL_ENV
16+
17+
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
18+
19+
RUN python -m pip install --upgrade pip \
20+
&& python -m pip install -r requirements-pre314.txt

tests/requirements-pre314.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,4 @@ tornado>=6.4.1
4040
uvicorn>=0.13.4
4141
urllib3>=1.26.5
4242
httpx>=0.27.0
43+
protobuf<=6.30.2

0 commit comments

Comments
 (0)