|
1 | | -# Triggers a build within the Datadog infrastructure in the ddprof-build repository |
2 | | -trigger_internal_build: |
| 1 | +image: alpine |
| 2 | + |
| 3 | +variables: |
| 4 | + REGISTRY: registry.ddbuild.io |
| 5 | + PREPARE_IMAGE: registry.ddbuild.io/images/benchmarking-platform-tools-ubuntu:latest |
| 6 | + # Image with dd-octo-sts for GitHub token exchange (check-image-updates, rebuild-images-pr) |
| 7 | + DD_OCTO_STS_IMAGE: registry.ddbuild.io/images/dd-octo-sts-ci-base:2025.06-1 |
| 8 | + FORCE_BUILD: |
| 9 | + value: "" |
| 10 | + description: "Force build even if no new commits (any non-empty value)" |
| 11 | + |
| 12 | +default: |
| 13 | + tags: ["arch:amd64"] |
| 14 | + interruptible: true |
| 15 | + before_script: |
| 16 | + - '[ "${CANCELLED:-}" != "true" ] || { echo "No PR for this branch — skipping job"; exit 0; }' |
| 17 | + |
| 18 | +stages: |
| 19 | + - images |
| 20 | + - generate-signing-key |
| 21 | + - prepare |
| 22 | + - build |
| 23 | + - stresstest |
| 24 | + - deploy |
| 25 | + - integration-test |
| 26 | + - reliability |
| 27 | + - benchmarks |
| 28 | + - notify |
| 29 | + |
| 30 | +# Detects newer images in registry and creates GitHub PR with updates |
| 31 | +check-image-updates: |
| 32 | + stage: images |
3 | 33 | rules: |
4 | | - - if: $CI_COMMIT_BRANCH =~ /release\/.*/ |
| 34 | + - if: '$CI_PIPELINE_SOURCE == "schedule" && $CHECK_IMAGE_UPDATES == "true"' |
| 35 | + when: always |
| 36 | + - if: '$CI_PIPELINE_SOURCE == "web"' |
| 37 | + when: manual |
| 38 | + allow_failure: true |
| 39 | + extends: .bootstrap-gh-tools |
| 40 | + tags: ["arch:amd64"] |
| 41 | + image: ${DD_OCTO_STS_IMAGE} |
| 42 | + id_tokens: |
| 43 | + DDOCTOSTS_ID_TOKEN: |
| 44 | + aud: dd-octo-sts |
| 45 | + script: |
| 46 | + - set -euo pipefail |
| 47 | + - echo "Checking for image updates..." |
| 48 | + - .gitlab/scripts/check-image-updates.sh > updates.json |
| 49 | + - | |
| 50 | + update_count=$(jq 'length' updates.json) |
| 51 | + echo "Found ${update_count} update(s)" |
| 52 | + if [ "$update_count" -gt 0 ]; then |
| 53 | + echo "Updates available:" |
| 54 | + jq . updates.json |
| 55 | + .gitlab/scripts/create-image-update-pr.sh updates.json |
| 56 | + else |
| 57 | + echo "All images are up to date" |
| 58 | + fi |
| 59 | + artifacts: |
| 60 | + when: always |
| 61 | + paths: |
| 62 | + - updates.json |
| 63 | + expire_in: 7 days |
| 64 | + |
| 65 | +rebuild-images: |
| 66 | + stage: images |
| 67 | + rules: |
| 68 | + - if: '$CI_COMMIT_TAG' |
5 | 69 | when: never |
6 | | - - when: always |
7 | | - allow_failure: false |
| 70 | + - if: '$CI_PIPELINE_SOURCE == "schedule"' |
| 71 | + when: never |
| 72 | + - when: manual |
| 73 | + allow_failure: true |
| 74 | + tags: ["arch:amd64"] |
| 75 | + variables: |
| 76 | + REBUILD_IMAGES: "" # comma/space-separated short names, or empty = all |
| 77 | + image: ${DOCKER_IMAGE} |
| 78 | + id_tokens: |
| 79 | + DDSIGN_ID_TOKEN: |
| 80 | + aud: image-integrity |
| 81 | + script: |
| 82 | + - set -euo pipefail |
| 83 | + - .gitlab/scripts/rebuild-images.sh |
| 84 | + artifacts: |
| 85 | + when: always |
| 86 | + paths: |
| 87 | + - updates.json |
| 88 | + expire_in: 1 day |
| 89 | + |
| 90 | +rebuild-images-pr: |
| 91 | + stage: images |
| 92 | + rules: |
| 93 | + - if: '$CI_COMMIT_TAG' |
| 94 | + when: never |
| 95 | + - if: '$CI_PIPELINE_SOURCE == "schedule"' |
| 96 | + when: never |
| 97 | + - when: on_success |
| 98 | + needs: |
| 99 | + - job: rebuild-images |
| 100 | + artifacts: true |
| 101 | + extends: .bootstrap-gh-tools |
| 102 | + tags: ["arch:amd64"] |
| 103 | + image: ${DD_OCTO_STS_IMAGE} |
| 104 | + id_tokens: |
| 105 | + DDOCTOSTS_ID_TOKEN: |
| 106 | + aud: dd-octo-sts |
| 107 | + script: |
| 108 | + - set -euo pipefail |
| 109 | + - .gitlab/scripts/create-image-update-pr.sh updates.json |
| 110 | + |
| 111 | +create_key: |
| 112 | + stage: generate-signing-key |
| 113 | + when: manual |
| 114 | + needs: [] |
| 115 | + tags: ["arch:amd64"] |
8 | 116 | variables: |
9 | | - DOWNSTREAM_BRANCH: "main" |
10 | | - UPSTREAM_PROJECT: ${CI_PROJECT_PATH} |
11 | | - UPSTREAM_PROJECT_NAME: ${CI_PROJECT_NAME} |
12 | | - UPSTREAM_BRANCH: ${CI_COMMIT_BRANCH} |
13 | | - UPSTREAM_COMMIT_SHA: ${CI_COMMIT_SHA} |
14 | | - DDPROF_DEFAULT_BRANCH: "main" |
15 | | - DDPROF_COMMIT_BRANCH: ${CI_COMMIT_BRANCH} |
16 | | - DDROF_COMMIT_SHA: ${CI_COMMIT_SHA} |
17 | | - DPROF_SHORT_COMMIT_SHA: ${CI_COMMIT_SHORT_SHA} |
18 | | - DDPROF_COMMIT_TAG: ${CI_COMMIT_TAG} |
| 117 | + PROJECT_NAME: "java-profiler" |
| 118 | + EXPORT_TO_KEYSERVER: "true" |
| 119 | + KUBERNETES_SERVICE_ACCOUNT_OVERWRITE: java-profiler |
| 120 | + image: $REGISTRY/ci/agent-key-management-tools/gpg:1 |
| 121 | + script: |
| 122 | + - /create.sh |
| 123 | + artifacts: |
| 124 | + expire_in: 13 mos |
| 125 | + paths: |
| 126 | + - pubkeys |
| 127 | + |
| 128 | +# Shared version detection used by benchmarks and reliability pipelines |
| 129 | +get-versions: |
| 130 | + extends: .get-versions |
| 131 | + needs: |
| 132 | + - job: prepare:start |
| 133 | + artifacts: false |
| 134 | + |
| 135 | +# Triggered externally from async-profiler-build with JDK build parameters; |
| 136 | +# kept as a child pipeline because it is mutually exclusive with the main build |
| 137 | +jdk-integration-test: |
| 138 | + stage: build |
| 139 | + rules: |
| 140 | + - if: '$JDK_VERSION == null || $DEBUG_LEVEL == null || $HASH == null || $DOWNSTREAM == null' |
| 141 | + when: never |
| 142 | + - if: '$CI_PIPELINE_SOURCE == "trigger" || $CI_PIPELINE_SOURCE == "pipeline" || $CI_PIPELINE_SOURCE == "web"' |
| 143 | + when: always |
| 144 | + allow_failure: false |
| 145 | + - when: always |
19 | 146 | trigger: |
20 | | - project: DataDog/apm-reliability/async-profiler-build |
| 147 | + include: .gitlab/jdk-integration/.gitlab-ci.yml |
21 | 148 | strategy: depend |
22 | | - branch: $DOWNSTREAM_BRANCH |
23 | 149 | forward: |
24 | 150 | pipeline_variables: true |
| 151 | + |
| 152 | +include: |
| 153 | + - local: .gitlab/common.yml |
| 154 | + - local: .adms/python/gitlab.yaml |
| 155 | + - local: .gitlab/benchmarks/images.yml |
| 156 | + - local: .gitlab/build-deploy/images.yml |
| 157 | + - local: .gitlab/build-deploy/.gitlab-ci.yml |
| 158 | + - local: .gitlab/benchmarks/.gitlab-ci.yml |
| 159 | + - local: .gitlab/reliability/.gitlab-ci.yml |
0 commit comments