Skip to content
Merged
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: 0 additions & 30 deletions .github/workflows/release.yml

This file was deleted.

54 changes: 50 additions & 4 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ stages:
SCCACHE_REGION: us-east-1
SCCACHE_S3_KEY_PREFIX: httpd-datadog
RUSTC_WRAPPER: /usr/bin/sccache
RUM: "ON"
# The GitLab repository identity has read/write access only to this
# repository's prefix in the shared sccache bucket.
needs:
Expand All @@ -65,7 +66,7 @@ stages:
- if [ -n "${CI_COMMIT_TAG:-}" ]; then export SCCACHE_RECACHE=1; fi
- >
cmake --preset=ci-release
-DHTTPD_DATADOG_ENABLE_RUM=ON
-DHTTPD_DATADOG_ENABLE_RUM=${RUM}
-DCMAKE_TOOLCHAIN_FILE=/sysroot/${TOOLCHAIN_ARCH}-none-linux-musl/Toolchain.cmake
-DCMAKE_C_COMPILER_LAUNCHER=sccache
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache
Expand All @@ -76,7 +77,8 @@ stages:
- mkdir -p artifacts/$ARCH upload
- cp dist/lib/mod_datadog.so artifacts/$ARCH/
- cp dist/lib/mod_datadog.so.debug artifacts/$ARCH/ || true
- cd artifacts/$ARCH && zip ../../upload/mod_datadog-${ARCH}.zip mod_datadog.so && cd -
# upload/ is the S3 payload, which only has RUM builds.
- if [ "$RUM" = "ON" ]; then cd artifacts/$ARCH && zip ../../upload/mod_datadog-${ARCH}.zip mod_datadog.so && cd -; fi
artifacts:
paths:
- artifacts/$ARCH/mod_datadog.so
Expand Down Expand Up @@ -158,6 +160,15 @@ build:arm64:
- .build-template
- .arm64

# Published on GitHub releases as mod_datadog_artifact.zip, the asset name
# users and system-tests download.
build:amd64:no-rum:
extends:
- .build-template
- .amd64
variables:
RUM: "OFF"

unit-test:amd64:
extends:
- .unit-test-template
Expand Down Expand Up @@ -198,6 +209,14 @@ check-module-load:arm64:
- .test-arm64
- .check-module-load-template

check-module-load:amd64:no-rum:
extends:
- .test-amd64
- .check-module-load-template
needs:
- job: "build:amd64:no-rum"
artifacts: true

.upload-template:
stage: aws
needs:
Expand All @@ -218,7 +237,6 @@ check-module-load:arm64:
script:
- aws s3 cp upload/ "${S3_PATH}/" --recursive --acl public-read
- echo "Uploaded to ${S3_PATH}/"
after_script:
- |
PUBLIC_URL=$(echo "${S3_PATH}" | sed 's|s3://\([^/]*\)/|https://\1.s3.amazonaws.com/|')
echo "Public URLs:"
Expand All @@ -229,14 +247,22 @@ check-module-load:arm64:
curl -sSfI "${PUBLIC_URL}/$(basename $f)" && echo " $(basename $f) verified" || echo " $(basename $f) not accessible"
done

# Release builds: s3://rum-auto-instrumentation/httpd/<YYYY_MM_DD>_<tag>_<sha7>/,
# the layout used by past releases.
.release-s3-path:
before_script:
- export S3_PATH="s3://rum-auto-instrumentation/httpd/$(echo "$CI_PIPELINE_CREATED_AT" | cut -c1-10 | tr - _)_${CI_COMMIT_TAG}_$(echo "$CI_COMMIT_SHA" | cut -c1-7)"
rules:
- if: $CI_COMMIT_TAG =~ /^v?[0-9]+\.[0-9]+\.[0-9]+$/

# Branch snapshots require a 30-day expiry rule in ddoghq/cloud-inventory:
# datacenters/us1.prod.dog/rum-auto-instrumentation/main.tf
upload-branch-snapshots:
extends: .upload-template
variables:
S3_PATH: s3://rum-auto-instrumentation/httpd/branch-snapshots/pipeline-${CI_PIPELINE_ID}
rules:
- if: $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH
- if: $CI_COMMIT_BRANCH && $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH

upload-snapshots:
extends: .upload-template
Expand All @@ -252,6 +278,26 @@ upload-snapshots-latest:
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH

upload-release:
extends:
- .upload-template
- .release-s3-path

# httpd/latest/ is what users download. `scripts/release.py --publish` runs it
# after the smoke tests.
promote-s3-latest:
extends: .release-s3-path
stage: aws
needs: ["upload-release"]
tags: ["arch:amd64"]
image: registry.ddbuild.io/images/aws-cli:2.33.12
script:
- aws s3 cp "${S3_PATH}/" s3://rum-auto-instrumentation/httpd/latest/ --recursive --acl public-read
rules:
- if: $CI_COMMIT_TAG =~ /^v?[0-9]+\.[0-9]+\.[0-9]+$/
when: manual
allow_failure: true

# ── One-pipeline overrides ────────────────────────────────────────────
#
# These re-declare only the keys we change; everything else still comes from
Expand Down
31 changes: 31 additions & 0 deletions doc/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,37 @@ Release artifact are generated through a Continuous Integration pipeline. Our CI
ensures cross-platform compatibility by compiling shared libraries for both Linux `x86_64` and
`arm64` architectures. It generates shared libaries for each HTTPD version supported.

### GitHub Release and S3

All release files come from the GitLab pipeline of the version tag.

1. Push the `vX.Y.Z` tag. The `upload-release` job uploads the RUM builds to
`s3://rum-auto-instrumentation/httpd/<YYYY_MM_DD>_vX.Y.Z_<sha>/`.
2. When the pipeline is green, create the draft GitHub release:

```sh
scripts/release.py --version-tag vX.Y.Z
```

It downloads the builds, signs each zip with your GPG key (`--local-user` to pick one) and
creates the draft with `gh`. Use `--dry-run --out-dir DIR` to only prepare the files.

| Asset | Build |
| ----- | ----- |
| `mod_datadog_artifact.zip`, `mod_datadog_artifact-debug.zip` | `x86_64`, RUM disabled at build time |
| `mod_datadog-amd64.zip`, `mod_datadog-amd64-debug.zip` | `x86_64`, RUM |
| `mod_datadog-arm64.zip`, `mod_datadog-arm64-debug.zip` | `arm64`, RUM |

3. Run the smoke tests.
4. Publish the release:

```sh
scripts/release.py --version-tag vX.Y.Z --publish
```

It runs the manual `promote-s3-latest` job, which copies the S3 files to `httpd/latest/`, then
publishes the draft.

### OCI Package

The same modules are also published as an OCI package named `datadog-apm-library-httpd`, through
Expand Down
Loading
Loading