Skip to content
Closed
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
14 changes: 13 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ include:
- local: ".gitlab/package.yml"
- local: ".gitlab/release.yml"
- local: ".gitlab/testrunner.yml"
- local: ".gitlab/benchmarks/serverless.yml"
- local: ".gitlab/native.yml"

tests-gen:
Expand Down Expand Up @@ -105,6 +104,19 @@ microbenchmarks:
# Disable VPA for benchmarks
DD_DISABLE_VPA: true

serverless-benchmarks:
stage: benchmarks
needs: [ "download_ddtrace_artifacts" ]
rules:
- if: $RELEASE_ALLOW_BENCHMARK_FAILURES == "true"
allow_failure: true
- allow_failure: false
trigger:
include: .gitlab/benchmarks/serverless.yml
strategy: depend
variables:
PARENT_PIPELINE_ID: $CI_PIPELINE_ID

macrobenchmarks:
stage: benchmarks
needs: [ "download_ddtrace_artifacts" ]
Expand Down
122 changes: 102 additions & 20 deletions .gitlab/benchmarks/serverless.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,105 @@
variables:
SLS_CI_IMAGE: registry.ddbuild.io/ci/serverless-tools:1
PACKAGE_IMAGE: registry.ddbuild.io/images/mirror/pypa/manylinux2014_x86_64:2024-08-12-7fde9b1
UPSTREAM_PIPELINE_ID: $CI_PIPELINE_ID
UPSTREAM_PROJECT_URL: $CI_PROJECT_URL
UPSTREAM_COMMIT_BRANCH: $CI_COMMIT_BRANCH
UPSTREAM_COMMIT_AUTHOR: $CI_COMMIT_AUTHOR
UPSTREAM_COMMIT_TITLE: $CI_COMMIT_TITLE
UPSTREAM_COMMIT_TAG: $CI_COMMIT_TAG
UPSTREAM_PROJECT_NAME: $CI_PROJECT_NAME
UPSTREAM_GITLAB_USER_LOGIN: $GITLAB_USER_LOGIN
UPSTREAM_GITLAB_USER_EMAIL: $GITLAB_USER_EMAIL

benchmark-serverless:
stage: benchmarks
trigger:
project: DataDog/serverless-tools
strategy: depend
needs: []
rules:
- if: $RELEASE_ALLOW_BENCHMARK_FAILURES == "true"
allow_failure: true
- allow_failure: false
variables:
UPSTREAM_PIPELINE_ID: $CI_PIPELINE_ID
UPSTREAM_PROJECT_URL: $CI_PROJECT_URL
UPSTREAM_COMMIT_BRANCH: $CI_COMMIT_BRANCH
UPSTREAM_COMMIT_AUTHOR: $CI_COMMIT_AUTHOR
UPSTREAM_COMMIT_TITLE: $CI_COMMIT_TITLE
UPSTREAM_COMMIT_TAG: $CI_COMMIT_TAG
UPSTREAM_PROJECT_NAME: $CI_PROJECT_NAME
UPSTREAM_GITLAB_USER_LOGIN: $GITLAB_USER_LOGIN
UPSTREAM_GITLAB_USER_EMAIL: $GITLAB_USER_EMAIL

stages:
- build
- benchmark
- notify

include:
- project: 'DataDog/serverless-tools'
file: '.gitlab-ci.yml'
ref: brettlangdon/candidate.wheels

candidate:
image: $PACKAGE_IMAGE
stage: build
tags: [ "arch:amd64" ]
needs:
- pipeline: $PARENT_PIPELINE_ID
job: download_ddtrace_artifacts
script: |
cp pywheels/*-cp311-cp311-manylinux*_x86_64*.whl ./
cp pywheels/*-cp311-cp311-manylinux*_aarch64*.whl ./
echo "CANDIDATE_AMD64_WHL=$(ls *x86_64*.whl | head -n 1)" | tee candidate.env
echo "CANDIDATE_ARM64_WHL=$(ls *aarch64*.whl | head -n 1)" | tee -a candidate.env
artifacts:
reports:
dotenv: candidate.env
paths:
- "*.whl"

.common:
# We are in a child pipeline of dd-trace-py so we need to clone and enter the serverless-tools repo for jobs to work
before_script: |
if [[ -n "$CI_JOB_TOKEN" ]];
then
git config --global url."https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.ddbuild.io/DataDog/".insteadOf "https://github.com/DataDog/"
fi
git clone --branch "brettlangdon/candidate.wheels" --single-branch https://github.com/DataDog/serverless-tools ./serverless-tools
cd ./serverless-tools


.common_setup:
before_script:
- !reference [.common, before_script]
- "cp ../*.whl ./"
after_script:
- cp ${CI_PROJECT_DIR}/serverless-tools/.env ${CI_PROJECT_DIR}/serverless-tools/layer.zip ${CI_PROJECT_DIR}/

# We are in ./serverless-tools, and child jobs will be in serverless-tools as well
artifacts:
expire_in: 1 hr # Unsigned zips expire in 1 hour
paths:
- layer.zip
reports:
dotenv: .env # To pass environment variables

setup (amd64):
needs:
- job: candidate
artifacts: true
dependencies:
- candidate
before_script:
- !reference [.common_setup, before_script]
after_script:
- !reference [.common_setup, after_script]
artifacts: !reference [.common_setup, artifacts]

setup (arm64):
needs:
- job: candidate
artifacts: true
dependencies:
- candidate
before_script:
- !reference [.common_setup, before_script]
after_script:
- !reference [.common_setup, after_script]
artifacts: !reference [.common_setup, artifacts]


.common_tests:
before_script:
- !reference [.common, before_script]
- "cp ${CI_PROJECT_DIR}/*.zip ./"

.layer-size:
before_script:
- !reference [.common_tests, before_script]

.cold-start:
before_script:
- !reference [.common_tests, before_script]
Loading