Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 16 additions & 14 deletions .github/workflows/ci-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ on:

env:
AWS_REGION: us-east-1
# Copied this CORE_REPO_SHA from
# https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/.github/workflows/test.yml#L9
CORE_REPO_SHA: v1.19.0

permissions:
contents: read
Expand All @@ -36,19 +33,24 @@ jobs:
steps:
- name: Checkout this repo
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1

- name: Setup Python for OTel Python SDK
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
with:
python-version: ${{ matrix.python }}
- name: Install tox testing package
working-directory: python/src

- name: Set up uv
uses: astral-sh/setup-uv@v7

- name: Run ruff lint
working-directory: python/src/otel
run: |
pip install tox
tox
- name: Set up Go for ADOT Collector
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
with:
go-version: '^1.20.8'
- name: Build Python Layer which includes ADOT Collector
working-directory: python/src
run: ./run.sh -b
uv sync --group dev
uv run ruff check .
uv run ruff format --check .

- name: Run tests
working-directory: python/src/otel
run: |
uv sync --extra test --extra instrumentation
uv run pytest tests
6 changes: 3 additions & 3 deletions .github/workflows/release-layer-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ jobs:
- name: Save PYTHON_OPENTELEMETRY_SDK_VERSION
id: save-python-opentelemetry-sdk-version
run: |
cd python/src
echo "PYTHON_OPENTELEMETRY_SDK_VERSION=$(cat otel/otel_sdk/requirements.txt | grep opentelemetry-sdk | sed 's/.*==\([^ ]*\).*/\1/')" >> $GITHUB_ENV
cd python/src/otel
echo "PYTHON_OPENTELEMETRY_SDK_VERSION=$(grep 'opentelemetry-sdk' pyproject.toml | sed 's/.*==\([^"]*\).*/\1/')" >> $GITHUB_ENV
echo "PYTHON_OPENTELEMETRY_SDK_VERSION=$PYTHON_OPENTELEMETRY_SDK_VERSION" >> $GITHUB_OUTPUT
shell: bash

Expand Down Expand Up @@ -78,7 +78,7 @@ jobs:
needs: build-layer
strategy:
matrix:
aws_region:
aws_region:
- ap-northeast-1
- ap-northeast-2
- ap-south-1
Expand Down
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ terraform.*
.DS_Store

.tox
__pycache__/*
.pyc
.venv
.pytest_cache/
__pycache__/
*.pyc
build.toml

*.zip
Expand Down
12 changes: 6 additions & 6 deletions python/src/otel/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ ADD . /workspace

WORKDIR /workspace

# Install uv
RUN curl -LsSf https://astral.sh/uv/install.sh | sh && \
export PATH="/root/.local/bin:$PATH"

RUN mkdir -p /build && \
python3 -m pip install -r otel_sdk/requirements.txt -t /build/python && \
python3 -m pip install -r otel_sdk/nodeps-requirements.txt -t /build/tmp --no-deps && \
# We need to use a `/build/tmp/` folder otherwise the instrumentation packages
# do not get fully downloaded to the `opentelemetry/instrumentation/` path.
cp -r /build/tmp/* /build/python/ && \
rm -rf /build/tmp && \
/root/.local/bin/uv venv /build/.venv && \
/root/.local/bin/uv pip install --python /build/.venv/bin/python '.[instrumentation]' --target /build/python && \
mv otel_sdk/otel_wrapper.py /build/python && \
mv otel_sdk/otel-instrument /build && \
mv otel_sdk/otel-handler /build && \
Expand Down
14 changes: 0 additions & 14 deletions python/src/otel/Makefile

This file was deleted.

4 changes: 0 additions & 4 deletions python/src/otel/otel_sdk/nodeps-requirements.txt

This file was deleted.

Loading