Skip to content

Commit f62c7a6

Browse files
fixup! ci: add permissions to trigger downstream pipeline from dd-trace-py
1 parent 6be9a71 commit f62c7a6

File tree

5 files changed

+34
-56
lines changed

5 files changed

+34
-56
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,8 @@ on:
33
push:
44
schedule:
55
- cron: "0 0 * * *"
6-
workflow_dispatch:
7-
inputs:
8-
dd_trace_py_commit_sha:
9-
description: 'dd-trace-py commit SHA to test against (installs wheels from S3)'
10-
required: false
11-
type: string
12-
test_scenarios:
13-
description: 'Regexp to select which scenarios to run (default: python.*)'
14-
required: false
15-
type: string
16-
default: 'python.*'
176
jobs:
187
schema-validation:
19-
if: ${{ !inputs.dd_trace_py_commit_sha }}
208
runs-on: ubuntu-latest
219
steps:
2210
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -27,7 +15,6 @@ jobs:
2715
- name: Run schema validation tests
2816
run: go test -v -run TestSchemaValidation
2917
ruff:
30-
if: ${{ !inputs.dd_trace_py_commit_sha }}
3118
runs-on: ubuntu-latest
3219
steps:
3320
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -43,37 +30,31 @@ jobs:
4330
if: success() || failure()
4431
run: ruff check .
4532
ddprof:
46-
if: ${{ !inputs.dd_trace_py_commit_sha }}
4733
uses: ./.github/workflows/test.yml
4834
with:
4935
test_scenarios: ddprof.*
5036
secrets: inherit
5137
dotnet:
52-
if: ${{ !inputs.dd_trace_py_commit_sha }}
5338
uses: ./.github/workflows/test.yml
5439
with:
5540
test_scenarios: dotnet.*
5641
secrets: inherit
5742
ruby:
58-
if: ${{ !inputs.dd_trace_py_commit_sha }}
5943
uses: ./.github/workflows/test.yml
6044
with:
6145
test_scenarios: ruby.*
6246
secrets: inherit
6347
node:
64-
if: ${{ !inputs.dd_trace_py_commit_sha }}
6548
uses: ./.github/workflows/test.yml
6649
with:
6750
test_scenarios: node.*
6851
secrets: inherit
6952
python:
7053
uses: ./.github/workflows/test.yml
7154
with:
72-
test_scenarios: ${{ inputs.test_scenarios || 'python.*' }}
73-
dd_trace_py_commit_sha: ${{ inputs.dd_trace_py_commit_sha || '' }}
55+
test_scenarios: python.*
7456
secrets: inherit
7557
full_host:
76-
if: ${{ !inputs.dd_trace_py_commit_sha }}
7758
uses: ./.github/workflows/test.yml
7859
with:
7960
test_scenarios: full_host.*
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: "Downstream: dd-trace-py"
2+
run-name: "dd-trace-py downstream (${{ inputs.dd_trace_py_commit_sha }})"
3+
4+
on:
5+
workflow_dispatch:
6+
inputs:
7+
dd_trace_py_commit_sha:
8+
description: 'dd-trace-py commit SHA to test against (installs wheels from S3)'
9+
required: true
10+
type: string
11+
test_scenarios:
12+
description: 'Regexp to select which scenarios to run'
13+
required: false
14+
type: string
15+
default: 'python.*'
16+
17+
jobs:
18+
python:
19+
uses: ./.github/workflows/test.yml
20+
with:
21+
test_scenarios: ${{ inputs.test_scenarios }}
22+
ddtrace_install_url: "https://dd-trace-py-builds.s3.amazonaws.com/${{ inputs.dd_trace_py_commit_sha }}/install-manylinux2014_x86_64.sh"
23+
secrets: inherit

.github/workflows/test.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ on:
99
required: false
1010
type: string
1111
default: '.*'
12-
dd_trace_py_commit_sha:
13-
description: 'dd-trace-py commit SHA to test against (installs wheels from S3)'
12+
ddtrace_install_url:
13+
description: 'URL to a ddtrace install script (e.g. from S3 builds)'
1414
required: false
1515
type: string
1616
default: ''
@@ -28,17 +28,10 @@ jobs:
2828
- name: Update perf_event_paranoid settings
2929
run: sudo sysctl kernel.perf_event_paranoid=1
3030
- name: Run Docker scenarios
31-
run: |
32-
SHA="${{ inputs.dd_trace_py_commit_sha }}"
33-
if [ -n "$SHA" ]; then
34-
export DDTRACE_INSTALL_URL="https://dd-trace-py-builds.s3.amazonaws.com/${SHA}/install-manylinux2014_x86_64.sh"
35-
echo "Will install ddtrace from: ${DDTRACE_INSTALL_URL}"
36-
else
37-
echo "No custom ddtrace wheels requested, using PyPI"
38-
fi
39-
go test -timeout 20m -v -run TestScenarios
31+
run: go test -timeout 20m -v -run TestScenarios
4032
env:
4133
TEST_SCENARIOS: ${{ inputs.test_scenarios }}
34+
DDTRACE_INSTALL_URL: ${{ inputs.ddtrace_install_url }}
4235
- name: Create unique artifact name
4336
id: artifact_name
4437
if: failure()

scenarios/python_cpu/Dockerfile

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
1-
# Use an official Python runtime as a parent image
2-
FROM python:3.11
3-
4-
# When set, download and run this install script to pre-install ddtrace.
5-
# Used by upstream dd-trace-py CI to test with just-built wheels from S3.
6-
ARG DDTRACE_INSTALL_URL=""
7-
RUN if [ -n "$DDTRACE_INSTALL_URL" ]; then \
8-
curl -fsSL "$DDTRACE_INSTALL_URL" | bash; \
9-
fi
1+
ARG BASE_IMAGE="prof-python-3.11"
2+
FROM $BASE_IMAGE
103

114
# Set the working directory in the container
125
WORKDIR /usr/src/app
@@ -20,10 +13,7 @@ RUN pip install --no-cache-dir -r requirements.txt
2013

2114
ENV EXECUTION_TIME_SEC 30
2215
# Run your python script when the container launches
23-
ENV DD_PROFILING_ENABLED true
24-
ENV DD_TRACE_ENABLED false
25-
ENV DD_TRACE_DEBUG false
16+
ENV DD_TRACE_DEBUG=false
2617
ENV DD_PROFILING_MEMORY_ENABLED=false
27-
ENV DD_PROFILING_OUTPUT_PPROF="/app/data/profiles"
2818

2919
CMD ddtrace-run python main.py
Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
1-
FROM python:3.11
2-
3-
# When set, download and run this install script to pre-install ddtrace.
4-
# Used by upstream dd-trace-py CI to test with just-built wheels from S3.
5-
ARG DDTRACE_INSTALL_URL=""
6-
RUN if [ -n "$DDTRACE_INSTALL_URL" ]; then \
7-
curl -fsSL "$DDTRACE_INSTALL_URL" | bash; \
8-
fi
1+
ARG BASE_IMAGE="prof-python-3.11"
2+
FROM $BASE_IMAGE
93

104
WORKDIR /usr/src/app
115

@@ -15,10 +9,7 @@ RUN pip install --no-cache-dir torch --index-url https://download.pytorch.org/wh
159
RUN pip install --no-cache-dir -r requirements.txt
1610

1711
ENV EXECUTION_TIME_SEC 30
18-
ENV DD_PROFILING_ENABLED true
19-
ENV DD_TRACE_ENABLED false
20-
ENV DD_TRACE_DEBUG false
12+
ENV DD_TRACE_DEBUG=false
2113
ENV DD_PROFILING_MEMORY_ENABLED=false
22-
ENV DD_PROFILING_OUTPUT_PPROF="/app/data/profiles"
2314

2415
CMD ddtrace-run python main.py

0 commit comments

Comments
 (0)