forked from DataDog/dd-trace-rb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into hanami-ci
* master: (22 commits) Remove experimental warning from OpenTelemetry.md Remove latest tag on docker images add installer system tests Extract trace id format helper method (DataDog#3670) Remaps http status code tag for otel span for trace metrics (DataDog#3664) Update .github/labeler.yml Use 3.20 rb -> ruby Add a note about `use` vs `instrument` GitHub: Update labeller bot with new products Update lockfiles for release 2.0.0.rc1 Bump version 2.0.0.beta2 to 2.0.0.rc1 Add 2.0.0.rc1 to CHANGELOG.md chore(lib-injection): update base image to alpine 3.18.6 Apply suggestions from code review Revert "DEBUG-2334 Add Debugger component (DataDog#3640)" Implement `latest_major` and `lastest_minor` tag for docker init container (DataDog#3643) Build oci package Update `rexml` (DataDog#3656) Remove bundler cache in for `setup-ruby` step and pin bundler and rubygem version ...
- Loading branch information
Showing
779 changed files
with
3,399 additions
and
1,085 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -149,10 +149,59 @@ package-arm64: | |
- ../.gitlab/build-deb-rpm.sh | ||
- find . -iregex '.*\.\(deb\|rpm\)' -printf '%f\0' | xargs -0 dd-pkg lint | ||
|
||
package-oci-amd64: | ||
extends: .package-oci | ||
stage: package | ||
needs: | ||
- build-gem | ||
- install-dependencies-amd64 | ||
variables: | ||
ARCH: amd64 | ||
script: | ||
- cp ../lib-injection/host_inject.rb ../tmp | ||
- export RUBY_PACKAGE_VERSION=$(cat ../tmp/version.txt) | ||
- ../.gitlab/build-oci-package.sh | ||
|
||
package-oci-arm64: | ||
extends: .package-oci | ||
stage: package | ||
needs: | ||
- build-gem | ||
- install-dependencies-arm64 | ||
variables: | ||
ARCH: arm64 | ||
script: | ||
- cp ../lib-injection/host_inject.rb ../tmp | ||
- export RUBY_PACKAGE_VERSION=$(cat ../tmp/version.txt) | ||
- ../.gitlab/build-oci-package.sh | ||
|
||
oci-internal-publish: | ||
extends: .oci-internal-publish | ||
stage: package | ||
needs: [ package-oci-arm64, package-oci-amd64 ] | ||
rules: | ||
- when: on_success | ||
variables: | ||
FLAVOR: datadog-apm-library-ruby | ||
|
||
oci-internal-test-ecr-publish: | ||
stage: package | ||
needs: [ oci-internal-publish ] | ||
rules: | ||
- when: on_success | ||
trigger: | ||
project: DataDog/public-images | ||
branch: main | ||
strategy: depend | ||
variables: | ||
IMG_SOURCES: registry.ddbuild.io/ci/remote-updates/datadog-apm-library-ruby:pipeline-${CI_PIPELINE_ID}-1 | ||
IMG_DESTINATIONS: apm-library-ruby-package:pipeline-${CI_PIPELINE_ID} | ||
IMG_REGISTRIES: agent-qa | ||
|
||
onboarding_tests: | ||
extends: .base_job_onboarding_tests | ||
stage: integration-tests | ||
needs: [ package-amd64, package-arm64] | ||
needs: [ package-amd64, package-arm64, oci-internal-test-ecr-publish] | ||
allow_failure: false | ||
variables: | ||
TEST_LIBRARY: ruby | ||
|
@@ -163,10 +212,13 @@ onboarding_tests: | |
SCENARIO: [SIMPLE_HOST_AUTO_INJECTION] | ||
- ONBOARDING_FILTER_WEBLOG: [test-app-ruby-container] | ||
SCENARIO: [SIMPLE_CONTAINER_AUTO_INJECTION] | ||
- ONBOARDING_FILTER_WEBLOG: [test-app-ruby,test-app-ruby-container] | ||
SCENARIO: [INSTALLER_AUTO_INJECTION] | ||
script: | ||
- git clone https://[email protected]/DataDog/system-tests.git system-tests | ||
- cp packaging/*.rpm system-tests/binaries | ||
- cp packaging/*.deb system-tests/binaries | ||
- export DD_INSTALLER_LIBRARY_VERSION="pipeline-${CI_PIPELINE_ID}" | ||
- ls system-tests/binaries | ||
- cd system-tests | ||
- ./build.sh -i runner | ||
|
@@ -194,40 +246,42 @@ deploy_to_reliability_env: | |
UPSTREAM_PROJECT_NAME: $CI_PROJECT_NAME | ||
UPSTREAM_COMMIT_SHA: $CI_COMMIT_SHA | ||
|
||
deploy_to_docker_registries: | ||
prepare_image_destinations: | ||
stage: deploy | ||
tags: ["arch:amd64"] | ||
image: $DOCKER_REGISTRY/images/mirror/ruby:3.2.2 | ||
rules: | ||
- if: "$POPULATE_CACHE" | ||
- if: '$POPULATE_CACHE' | ||
when: never | ||
- if: $CI_COMMIT_TAG =~ /^v(\d+)\.(\d+)\.(\d+)$/ # Exclude prerelease | ||
when: delayed | ||
start_in: 1 day | ||
- if: $CI_COMMIT_TAG =~ /^v(\d+)\.(\d+)\.(\d+)$/ # Exclude prerelease | ||
when: always | ||
- when: manual | ||
allow_failure: true | ||
trigger: | ||
project: DataDog/public-images | ||
branch: main | ||
strategy: depend | ||
variables: | ||
IMG_SOURCES: ghcr.io/datadog/dd-trace-rb/dd-lib-ruby-init:$CI_COMMIT_TAG | ||
IMG_DESTINATIONS: dd-lib-ruby-init:$CI_COMMIT_TAG | ||
IMG_SIGNING: "false" | ||
script: | ||
- ruby -v | ||
- gem -v | ||
- bundle -v | ||
- ./.gitlab/check_gem_presence.rb $CI_COMMIT_TAG | ||
- | | ||
IMG_DESTINATIONS=$(./.gitlab/prepare_image_destinations.rb dd-lib-ruby-init $CI_COMMIT_TAG) || { | ||
echo "Failed to prepare image destinations: $CI_COMMIT_TAG" | ||
exit 1 | ||
} | ||
echo "IMG_DESTINATIONS=$IMG_DESTINATIONS" > build.env | ||
artifacts: | ||
reports: | ||
dotenv: build.env | ||
|
||
deploy_latest_tag_to_docker_registries: | ||
deploy_to_docker_registries: | ||
stage: deploy | ||
rules: | ||
- if: "$POPULATE_CACHE" | ||
when: never | ||
- if: $CI_COMMIT_TAG =~ /^v(\d+)\.(\d+)\.(\d+)$/ && $CI_COMMIT_BRANCH == 'master' # Exclude prerelease and only for master branch | ||
when: delayed | ||
start_in: 1 day | ||
- when: manual | ||
allow_failure: true | ||
needs: | ||
- job: prepare_image_destinations | ||
artifacts: true | ||
trigger: | ||
project: DataDog/public-images | ||
branch: main | ||
strategy: depend | ||
variables: | ||
IMG_SOURCES: ghcr.io/datadog/dd-trace-rb/dd-lib-ruby-init:$CI_COMMIT_TAG | ||
IMG_DESTINATIONS: dd-lib-ruby-init:latest | ||
IMG_DESTINATIONS: $IMG_DESTINATIONS | ||
IMG_SIGNING: "false" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
mkdir sources | ||
|
||
cp -r ../tmp/* sources | ||
sed -i "s#/opt/datadog/apm/library/ruby/#/opt/datadog-packages/datadog-apm-library-ruby/$RUBY_PACKAGE_VERSION/#g" sources/host_inject.rb | ||
|
||
echo -n "$RUBY_PACKAGE_VERSION" > sources/version | ||
|
||
datadog-package create \ | ||
--version="$RUBY_PACKAGE_VERSION" \ | ||
--package="datadog-apm-library-ruby" \ | ||
--archive=true \ | ||
--archive-path="datadog-apm-library-ruby-$RUBY_PACKAGE_VERSION-$ARCH.tar" \ | ||
--arch "$ARCH" \ | ||
--os "linux" \ | ||
./sources |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/usr/bin/env ruby | ||
|
||
require 'bundler/inline' | ||
|
||
gemfile { gem 'gems', source: 'https://rubygems.org' } | ||
|
||
require 'rubygems' | ||
require 'gems' | ||
|
||
version = ARGV[0].chomp | ||
version = version.delete_prefix('v') if version.start_with?('v') | ||
|
||
candidate = Gem::Version.new(version) | ||
|
||
retry_count = 0 | ||
max_retries = 60 | ||
interval = 60 | ||
|
||
loop do | ||
versions = Gems.versions('datadog').map { |h| Gem::Version.new(h['number']) } | ||
|
||
if versions.include?(candidate) | ||
puts "Gem version #{candidate} found!" | ||
exit 0 | ||
else | ||
retry_count += 1 | ||
puts "Attempt(#{retry_count}): Gem 'datadog' version '#{candidate}' not found." | ||
|
||
if retry_count >= max_retries | ||
puts "Max retries(#{max_retries}) reached, stopping..." | ||
exit 1 | ||
else | ||
puts "Retrying in #{interval} seconds..." | ||
sleep interval | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/usr/bin/env ruby | ||
|
||
require 'bundler/inline' | ||
|
||
gemfile { gem 'gems', source: 'https://rubygems.org' } | ||
|
||
require 'rubygems' | ||
require 'gems' | ||
|
||
image_name = ARGV[0].chomp | ||
version = ARGV[1].chomp | ||
version = version.delete_prefix('v') if version.start_with?('v') | ||
|
||
candidate = Gem::Version.new(version) | ||
versions = Gems.versions('datadog').map { |h| Gem::Version.new(h['number']) } | ||
|
||
# Make sure candidate has already been published to 'https://rubygems.org' | ||
unless versions.include?(candidate) | ||
warn "Version #{candidate} not found in RubyGems" | ||
exit 1 | ||
end | ||
|
||
# Skip pre-releases | ||
if candidate.prerelease? | ||
warn 'No tags for pre-releases' | ||
exit 1 | ||
end | ||
|
||
major, minor, = candidate.to_s.split('.') | ||
current_major_versions = versions.select { |v| v.to_s.start_with?("#{major}.") } | ||
|
||
tags = [] | ||
|
||
# Disable tagging 'latest' for now avoid crossing major versions | ||
# tags << 'latest' if versions.all? { |v| candidate >= v } | ||
tags << "v#{major}" if current_major_versions.all? { |v| candidate >= v } | ||
tags << "v#{major}.#{minor}" | ||
tags << "v#{candidate}" | ||
|
||
# $stdout.puts "tags: #{tags}" # Uncomment for debugging | ||
|
||
destinations = tags.map { |tag| "#{image_name}:#{tag}" } | ||
$stdout.puts destinations.join(',') |
Oops, something went wrong.