Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve SSI #4366

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
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
8 changes: 4 additions & 4 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ default:
parallel:
matrix:
# ADD NEW RUBIES HERE
- RUBY_VERSION: ["3.4", "3.3", "3.2", "3.1", "3.0", "2.7"]
- RUBY_VERSION: ["3.4", "3.3", "3.2", "3.1", "3.0", "2.7", "2.6"]
script:
- >
docker build
Expand Down Expand Up @@ -67,7 +67,7 @@ promote-image:
parallel:
matrix:
# ADD NEW RUBIES HERE
- RUBY_VERSION: ["3.4", "3.3", "3.2", "3.1", "3.0", "2.7"]
- RUBY_VERSION: ["3.4", "3.3", "3.2", "3.1", "3.0", "2.7", "2.6"]
ARCHITECTURE: ["amd64", "arm64"]
script:
- docker pull $RUBY_CUSTOM_IMAGE_BASE/$RUBY_VERSION-$ARCHITECTURE:$CI_PIPELINE_ID
Expand Down Expand Up @@ -106,7 +106,7 @@ install-dependencies:
parallel:
matrix:
# Promote again when adding 3.4 support
- RUBY_VERSION: ["3.3", "3.2", "3.1", "3.0", "2.7"]
- RUBY_VERSION: ["3.4", "3.3", "3.2", "3.1", "3.0", "2.7", "2.6"]
ARCH: [ "amd64", "arm64" ]
stage: package
needs:
Expand Down Expand Up @@ -176,4 +176,4 @@ vaccine:
stage: vaccine
needs: [create-multiarch-lib-injection-image]
script: |
.gitlab/scripts/vaccine.sh master "${CI_COMMIT_SHA}" "glci:${CI_PIPELINE_ID}"
.gitlab/scripts/vaccine.sh lloeki/ssi "${CI_COMMIT_SHA}" "glci:${CI_PIPELINE_ID}"
1 change: 1 addition & 0 deletions .gitlab/Dockerfile-2.6
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FROM ghcr.io/datadog/images-rb/engines/ruby:2.6-centos-gcc
14 changes: 12 additions & 2 deletions lib-injection/host_inject_main.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ def emit(pid, version, events)

pid = utils.pid

telemetry.emit(pid, utils.version, [{ name: 'library_entrypoint.start' }])

if Process.respond_to?(:fork)
utils.debug 'Starts injection'

Expand All @@ -87,7 +89,7 @@ def runtime_supported?
major, minor, = RUBY_VERSION.split('.')
ruby_api_version = "#{major}.#{minor}.0"

supported_ruby_api_versions = ['2.7.0', '3.0.0', '3.1.0', '3.2.0', '3.3.0'].freeze
supported_ruby_api_versions = ['2.6.0', '2.7.0', '3.0.0', '3.1.0', '3.2.0', '3.3.0', '3.4.0'].freeze

RUBY_ENGINE == 'ruby' && supported_ruby_api_versions.any? { |v| ruby_api_version == v }
end
Expand Down Expand Up @@ -121,6 +123,10 @@ def frozen_bundle?
Bundler.frozen_bundle?
end

def bundle_path?
!Bundler.settings[:path].nil?
end

def bundler_supported?
Bundler::CLI.commands['add'] && Bundler::CLI.commands['add'].options.key?('require')
end
Expand All @@ -146,7 +152,11 @@ def bundler_supported?
utils.debug 'Skip injection: already installed'
elsif precheck.frozen_bundle?
utils.error "Skip injection: bundler is configured with 'deployment' or 'frozen'"
telemetry.emit(pid, utils.version, [{ name: 'library_entrypoint.abort', tags: ['reason:bundler'] }])
telemetry.emit(pid, utils.version, [{ name: 'library_entrypoint.abort', tags: ['reason:bundler_bundle_frozen'] }])
exit!(1)
elsif precheck.bundle_path?
utils.error "Skip injection: bundler is configured with 'bundle_path"
telemetry.emit(pid, utils.version, [{ name: 'library_entrypoint.abort', tags: ['reason:bundler_bundle_path'] }])
exit!(1)
elsif !precheck.bundler_supported?
utils.error "Skip injection: bundler version #{Bundler::VERSION} is not supported, please upgrade to >= 2.3."
Expand Down
Loading