Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into munir/w3c-phase-3
Browse files Browse the repository at this point in the history
  • Loading branch information
mabdinur committed Jun 7, 2024
2 parents 3227a29 + 56d933f commit 8ec243d
Show file tree
Hide file tree
Showing 847 changed files with 6,464 additions and 2,330 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -531,12 +531,12 @@ workflows:
<<: *filters_all_branches_and_tags
- orb/build_and_test_integration:
name: build_and_test_integration-2.6
integration_apps: 'rack rails-five rails-six sinatra2-classic sinatra2-modular'
integration_apps: 'rack rails-five rails-six sinatra2-classic sinatra2-modular hanami'
ruby_version: '2.6'
<<: *filters_all_branches_and_tags
- orb/build_and_test_integration:
name: build_and_test_integration-2.7
integration_apps: 'rack rails-five rails-six rails-seven sinatra2-classic sinatra2-modular'
integration_apps: 'rack rails-five rails-six rails-seven sinatra2-classic sinatra2-modular hanami'
ruby_version: '2.7'
<<: *filters_all_branches_and_tags
- orb/build_and_test_integration:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
# Note:
#
# There is an incompatibility between ethon and httprb on debian 11 bullseye.
# This is why this image is based on debian 10 buster.
#
# See:
# - https://github.com/jruby/jruby/issues/7033
# - https://github.com/DataDog/dd-trace-rb/pull/2380#issuecomment-1320994823

# Note: See the "Publishing updates to images" note in ./README.md for how to publish new builds of this container image

# openjdk:11-jre image is from https://github.com/docker-library/openjdk/blob/8dfb0c5645098b8c330c4811c8228cae52f18388/11/jre/buster/Dockerfile
# note: docker-library/openjdk is deprecated, there is a later move to https://hub.docker.com/_/eclipse-temurin
FROM openjdk:11-jre-buster AS jruby-9.4.0.0-jre11
FROM eclipse-temurin:11-jammy AS jruby-9.4.7.0-jre11

RUN apt-get update && apt-get install -y libc6-dev --no-install-recommends && rm -rf /var/lib/apt/lists/*

ENV JRUBY_VERSION 9.4.0.0
ENV JRUBY_SHA256 897bb8a98ad43adcbf5fd3aa75ec85b3312838c949592ca3f623dc1f569d2870
ENV JRUBY_VERSION 9.4.7.0
ENV JRUBY_SHA256 f1c39f8257505300a528ff83fe4721fbe61a855abb25e3d27d52d43ac97a4d80
RUN mkdir /opt/jruby \
&& curl -fSL https://repo1.maven.org/maven2/org/jruby/jruby-dist/${JRUBY_VERSION}/jruby-dist-${JRUBY_VERSION}-bin.tar.gz -o /tmp/jruby.tar.gz \
&& echo "$JRUBY_SHA256 /tmp/jruby.tar.gz" | sha256sum -c - \
Expand Down Expand Up @@ -46,7 +35,7 @@ RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \

CMD [ "irb" ]

FROM jruby-9.4.0.0-jre11
FROM jruby-9.4.7.0-jre11

# Make apt non-interactive
RUN echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/90circleci \
Expand Down
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Integration tests that run in docker should not receive the gemfile lock
# files that aren't checked into git, because these lock files are dependent
# on the system set of installed software which is different between the
# host and the docker container.
#
# Gemfile lock files that *are* checked into git should be in docker
# containers also.
Gemfile.lock
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
/lib/datadog/appsec/ @DataDog/asm-ruby
/lib/datadog/appsec.rb @DataDog/asm-ruby
/lib/datadog/tracing/ @DataDog/tracing-ruby
/lib/datadog/tracing/contrib/ @DataDog/apm-idm-ruby
/lib/datadog/tracing.rb @DataDog/tracing-ruby
/lib/datadog/opentelemetry/ @DataDog/tracing-ruby
/lib/datadog/opentelemetry.rb @DataDog/tracing-ruby
Expand All @@ -20,6 +21,7 @@
/sig/datadog/appsec/ @DataDog/asm-ruby
/sig/datadog/appsec.rbs @DataDog/asm-ruby
/sig/datadog/tracing/ @DataDog/tracing-ruby
/sig/datadog/tracing/contrib/ @DataDog/apm-idm-ruby
/sig/datadog/tracing.rbs @DataDog/tracing-ruby
/sig/datadog/opentelemetry/ @DataDog/tracing-ruby
/sig/datadog/opentelemetry.rbs @DataDog/tracing-ruby
Expand All @@ -29,6 +31,7 @@
# Specs
/spec/datadog/appsec/ @DataDog/asm-ruby
/spec/datadog/tracing/ @DataDog/tracing-ruby
/spec/datadog/tracing/contrib/ @DataDog/apm-idm-ruby
/spec/datadog/tracing_spec.rb @DataDog/tracing-ruby
/spec/datadog/opentelemetry/ @DataDog/tracing-ruby
/spec/datadog/opentelemetry_spec.rb @DataDog/tracing-ruby
Expand Down
12 changes: 12 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,15 @@ dev/ci:
# Version bump pull request
release:
- all: [ '{CHANGELOG.md,lib/datadog/version.rb}' ]

# Changes to OpenTelemetry
otel:
- any: [ 'lib/datadog/opentelemetry/**' ]

# Changes to Single Step Instrumentation
single-step:
- any: [ 'lib-injection/**' ]

# Changes to Debugging
debugging:
- any: [ 'lib/datadog/debugging/**' ]
4 changes: 2 additions & 2 deletions .github/workflows/build-ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ jobs:
version: 9.3.9.0
dockerfile: Dockerfile-jruby-9.3.9.0
- engine: jruby
version: 9.4.0.0
dockerfile: Dockerfile-jruby-9.4.0.0
version: 9.4.7.0
dockerfile: Dockerfile-jruby-9.4.7.0
runs-on: ubuntu-latest
name: Build (${{ matrix.engine }} ${{ matrix.version }})
steps:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test-macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
bundler: latest # needed to fix issue with steep on Ruby 3.0/3.1
cache-version: v2 # bump this to invalidate cache
rubygems: 3.3.26
bundler: 2.3.26 # needed to fix issue with steep on Ruby 3.0/3.1
- run: bundle install
- run: bundle exec rake spec:main
1 change: 1 addition & 0 deletions .github/workflows/test-yjit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ jobs:
- ubuntu-latest
ruby:
- '3.2'
- '3.3'
# ADD NEW RUBIES HERE
name: Test (${{ matrix.os }}, ${{ matrix.ruby }})
runs-on: ${{ matrix.os }}
Expand Down
105 changes: 81 additions & 24 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ build-gem:
script:
- export RUBY_PACKAGE_VERSION=$(cat tmp/version.txt)
- export DATADOG_GEM_LOCATION=$(readlink -f pkg/datadog-*.gem)
- ruby -v
- gem -v
- bundler -v
- ruby .gitlab/install_datadog_deps.rb
artifacts:
paths:
Expand Down Expand Up @@ -149,10 +152,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
Expand All @@ -163,10 +215,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://git@github.com/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
Expand Down Expand Up @@ -194,40 +249,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"
5 changes: 4 additions & 1 deletion .gitlab/Dockerfile-2.7.8
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# This is copied from official Docker image, but compile Ruby with `--disable-shared` instead.
# This is copied from official Docker image
# but compile Ruby with `--disable-shared` and update gem version

FROM registry.ddbuild.io/images/mirror/buildpack-deps:buster

Expand Down Expand Up @@ -75,6 +76,8 @@ RUN set -eux; \
# verify we have no "ruby" packages installed
if dpkg -l | grep -i ruby; then exit 1; fi; \
[ "$(command -v ruby)" = '/usr/local/bin/ruby' ]; \
# update gem version
gem update --system 3.3.27;\
# rough smoke test
ruby --version; \
gem --version; \
Expand Down
5 changes: 4 additions & 1 deletion .gitlab/Dockerfile-3.0.6
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# This is copied from official Docker image, but compile Ruby with `--disable-shared` instead.
# This is copied from official Docker image
# but compile Ruby with `--disable-shared` and update gem version

FROM registry.ddbuild.io/images/mirror/buildpack-deps:buster

Expand Down Expand Up @@ -75,6 +76,8 @@ RUN set -eux; \
# verify we have no "ruby" packages installed
if dpkg -l | grep -i ruby; then exit 1; fi; \
[ "$(command -v ruby)" = '/usr/local/bin/ruby' ]; \
# update gem version
gem update --system;\
# rough smoke test
ruby --version; \
gem --version; \
Expand Down
5 changes: 4 additions & 1 deletion .gitlab/Dockerfile-3.1.4
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# This is copied from official Docker image, but compile Ruby with `--disable-shared` instead.
# This is copied from official Docker image
# but compile Ruby with `--disable-shared` and update gem version

FROM registry.ddbuild.io/images/mirror/buildpack-deps:buster

Expand Down Expand Up @@ -75,6 +76,8 @@ RUN set -eux; \
# verify we have no "ruby" packages installed
if dpkg -l | grep -i ruby; then exit 1; fi; \
[ "$(command -v ruby)" = '/usr/local/bin/ruby' ]; \
# update gem version
gem update --system;\
# rough smoke test
ruby --version; \
gem --version; \
Expand Down
5 changes: 4 additions & 1 deletion .gitlab/Dockerfile-3.2.2
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# This is copied from official Docker image, but compile Ruby with `--disable-shared` instead.
# This is copied from official Docker image, but
# compile Ruby with `--disable-shared` and update gem version

FROM registry.ddbuild.io/images/mirror/buildpack-deps:buster

Expand Down Expand Up @@ -99,6 +100,8 @@ RUN set -eux; \
# verify we have no "ruby" packages installed
if dpkg -l | grep -i ruby; then exit 1; fi; \
[ "$(command -v ruby)" = '/usr/local/bin/ruby' ]; \
# update gem version
gem update --system;\
# rough smoke test
ruby --version; \
gem --version; \
Expand Down
2 changes: 1 addition & 1 deletion .gitlab/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ ddprof-benchmark:
KUBERNETES_SERVICE_ACCOUNT_OVERWRITE: dd-trace-rb
benchmarks:
stage: benchmarks
when: on_success
when: always
tags: ["runner:apm-k8s-tweaked-metal"]
image: $BASE_CI_IMAGE
interruptible: true
Expand Down
19 changes: 19 additions & 0 deletions .gitlab/build-oci-package.sh
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
Loading

0 comments on commit 8ec243d

Please sign in to comment.