Skip to content

Commit

Permalink
[NO-TICKET] Bootstrap Ruby 3.4.0-preview1 image for early testing
Browse files Browse the repository at this point in the history
**What does this PR do?**

This PR does the minimal amount of work to enable us to start tackling
Ruby 3.4 testing.

There's a number of tests failing just in the core test suite:

```
4328 examples, 15 failures, 48 pending

Failed examples:

rspec ./spec/datadog/core/utils/safe_dup_spec.rb:49 # Datadog::Core::Utils::SafeDup String .frozen_dup when given a string returns a frozen duplicate
rspec ./spec/datadog/core/utils/safe_dup_spec.rb:20 # Datadog::Core::Utils::SafeDup String .frozen_or_dup when given a string returns a non-frozen dupliacte
rspec ./spec/datadog/core/error_spec.rb:87 # Datadog::Core::Error.build_from with an exception with a cause reports nested errors
rspec ./spec/datadog/core/telemetry/event_spec.rb:31 # Datadog::Core::Telemetry::Event AppStarted is expected to match {:products=>{:appsec=>{:enabled=>false}, :profiler=>{:enabled=>false, :error=>#<RSpec::Mocks::ArgumentMatchers::AnyArgMatcher:0x0000705250507db0>}}, :configuration=>[{:name=>"DD_AGENT_HOST", :origin=>"code", :seq_id=>#<Double "seq_id">, :value=>"1.2.3.4"}, {:name=>"DD_AGENT_TRANSPORT", :origin=>"code", :seq_id=>#<Double "seq_id">, :value=>"TCP"}, {:name=>"DD_TRACE_SAMPLE_RATE", :origin=>"code", :seq_id=>#<Double "seq_id">, :value=>"0.5"}, {:name=>"DD_TRACE_REMOVE_INTEGRATION_SERVICE_NAMES_ENABLED", :origin=>"code", :seq_id=>#<Double "seq_id">, :value=>true}, {:name=>"DD_TRACE_PEER_SERVICE_MAPPING", :origin=>"code", :seq_id=>#<Double "seq_id">, :value=>"foo:bar"}, {:name=>"logger.level", :origin=>"code", :seq_id=>#<Double "seq_id">, :value=>0}, {:name=>"profiling.advanced.code_provenance_enabled", :origin=>"code", :seq_id=>#<Double "seq_id">, :value=>true}, {:name=>"profiling.advanced.endpoint.collection.enabled", :origin=>"code", :seq_id=>#<Double "seq_id">, :value=>true}, {:name=>"profiling.enabled", :origin=>"code", :seq_id=>#<Double "seq_id">, :value=>false}, {:name=>"runtime_metrics.enabled", :origin=>"code", :seq_id=>#<Double "seq_id">, :value=>false}, {:name=>"tracing.analytics.enabled", :origin=>"code", :seq_id=>#<Double "seq_id">, :value=>true}, {:name=>"tracing.propagation_style_extract", :origin=>"code", :seq_id=>#<Double "seq_id">, :value=>"[\"datadog\", \"tracecontext\"]"}, {:name=>"tracing.propagation_style_inject", :origin=>"code", :seq_id=>#<Double "seq_id">, :value=>"[\"datadog\", \"tracecontext\"]"}, {:name=>"tracing.enabled", :origin=>"code", :seq_id=>#<Double "seq_id">, :value=>true}, {:name=>"tracing.log_injection", :origin=>"code", :seq_id=>#<Double "seq_id">, :value=>true}, {:name=>"tracing.partial_flush.enabled", :origin=>"code", :seq_id=>#<Double "seq_id">, :value=>false}, {:name=>"tracing.partial_flush.min_spans_threshold", :origin=>"code", :seq_id=>#<Double "seq_id">, :value=>500}, {:name=>"tracing.report_hostname", :origin=>"code", :seq_id=>#<Double "seq_id">, :value=>false}, {:name=>"tracing.sampling.rate_limit", :origin=>"code", :seq_id=>#<Double "seq_id">, :value=>100}, {:name=>"tracing.auto_instrument.enabled", :origin=>"code", :seq_id=>#<Double "seq_id">, :value=>false}, {:name=>"tracing.writer_options.buffer_size", :origin=>"code", :seq_id=>#<Double "seq_id">, :value=>123}, {:name=>"tracing.writer_options.flush_interval", :origin=>"code", :seq_id=>#<Double "seq_id">, :value=>456}, {:name=>"tracing.opentelemetry.enabled", :origin=>"code", :seq_id=>#<Double "seq_id">, :value=>false}, {:name=>"logger.instance", :origin=>"code", :seq_id=>#<Double "seq_id">, :value=>"MyLogger"}, {:name=>"appsec.enabled", :origin=>"code", :seq_id=>#<Double "seq_id">, :value=>false}, {:name=>"appsec.sca_enabled", :origin=>"code", :seq_id=>#<Double "seq_id">, :value=>false}], :install_signature=>{:install_id=>"id", :install_time=>"time", :install_type=>"type"}}
rspec ./spec/datadog/tracing/remote_spec.rb:33 # Datadog::Tracing::Remote#process_config with an empty content sets errored apply state
rspec ./spec/datadog/release_gem_spec.rb:8 # gem release process datadog.gemspec files includes all important files
rspec ./spec/datadog/core/environment/execution_spec.rb:69 # Datadog::Core::Environment::Execution.development? when not in an RSpec test when in a Pry session returns true
rspec ./spec/datadog/tracing/trace_segment_spec.rb:207 # Datadog::Tracing::TraceSegment::new given tags :origin is expected to have attributes {:origin => (be a copy of "synthetics")}
rspec ./spec/datadog/tracing/trace_segment_spec.rb:230 # Datadog::Tracing::TraceSegment::new given tags :resource is expected to have attributes {:resource => (be a copy of "generate_report")}
rspec ./spec/datadog/tracing/trace_segment_spec.rb:200 # Datadog::Tracing::TraceSegment::new given tags :name is expected to have attributes {:name => (be a copy of "job.work")}
rspec ./spec/datadog/tracing/trace_segment_spec.rb:276 # Datadog::Tracing::TraceSegment::new given tags :service is expected to have attributes {:service => (be a copy of "job-worker")}
rspec ./spec/datadog/tracing/trace_segment_spec.rb:150 # Datadog::Tracing::TraceSegment::new given arguments :service is expected to have attributes {:service => (be a copy of "job-worker")}
rspec ./spec/datadog/tracing/trace_segment_spec.rb:87 # Datadog::Tracing::TraceSegment::new given arguments :name is expected to have attributes {:name => (be a copy of "job.work")}
rspec ./spec/datadog/tracing/trace_segment_spec.rb:94 # Datadog::Tracing::TraceSegment::new given arguments :origin is expected to have attributes {:origin => (be a copy of "synthetics")}
rspec ./spec/datadog/tracing/trace_segment_spec.rb:115 # Datadog::Tracing::TraceSegment::new given arguments :resource is expected to have attributes {:resource => (be a copy of "generate_report")}
```

**Motivation:**

Start working on supporting Ruby 3.4.

**Additional Notes:**

We'll need to later do the full onboarding: add appraisals,
integration apps, write up CI, etc (e.g. see #2863 as inspiration).

**How to test the change?**

This change only affects testing. You can use
`docker-compose run --rm tracer-3.4 /bin/bash --init-file .config` to
start experimenting with Ruby 3.4.
  • Loading branch information
ivoanjo committed Jun 12, 2024
1 parent 66a74aa commit f7b2946
Show file tree
Hide file tree
Showing 5 changed files with 212 additions and 116 deletions.
65 changes: 65 additions & 0 deletions .circleci/images/primary/Dockerfile-3.4.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Note: See the "Publishing updates to images" note in ./README.md for how to publish new builds of this container image

FROM ruby:3.4.0-preview1-bookworm

# Make apt non-interactive
RUN echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/90circleci \
&& echo 'DPkg::Options "--force-confnew";' >> /etc/apt/apt.conf.d/90circleci

ENV DEBIAN_FRONTEND=noninteractive

# Install required packages
RUN set -ex; \
apt-get update; \
mkdir -p /usr/share/man/man1; \
apt-get install -y --no-install-recommends \
git mercurial xvfb \
locales sudo openssh-client ca-certificates tar gzip parallel \
net-tools netcat-openbsd unzip zip bzip2 gnupg curl wget \
tzdata rsync vim less jq; \
rm -rf /var/lib/apt/lists/*;

# Set timezone to UTC by default
RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime

# Set language
RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en

# Install Docker
RUN set -ex \
&& export DOCKER_VERSION=$(curl --silent --fail --retry 3 https://download.docker.com/linux/static/stable/$(arch)/ | grep -o -e 'docker-[.0-9]*-ce\.tgz' | sort -r | head -n 1) \
&& DOCKER_URL="https://download.docker.com/linux/static/stable/$(arch)/${DOCKER_VERSION}" \
&& echo DOCKER_URL: $DOCKER_URL \
&& curl --silent --show-error --location --fail --retry 3 --output /tmp/docker.tgz "${DOCKER_URL}" \
&& ls -lha /tmp/docker.tgz \
&& tar -xz -C /tmp -f /tmp/docker.tgz \
&& mv /tmp/docker/* /usr/bin \
&& rm -rf /tmp/docker /tmp/docker.tgz \
&& which docker \
&& (docker version || true)

# Install Docker Compose
RUN COMPOSE_URL="https://github.com/linuxserver/docker-docker-compose/releases/download/1.29.2-ls51/docker-compose-$(dpkg --print-architecture)" \
&& echo COMPOSE_URL: $COMPOSE_URL \
&& curl --silent --show-error --location --fail --retry 3 --output /usr/bin/docker-compose $COMPOSE_URL \
&& chmod +x /usr/bin/docker-compose \
&& docker-compose version

# Install Dockerize
RUN DOCKERIZE_URL="https://github.com/powerman/dockerize/releases/download/v0.17.0/dockerize-$(uname -s | tr '[:upper:]' '[:lower:]')-$(arch | sed 's/aarch64/arm64/')" \
&& echo DOCKERIZE_URL: $DOCKERIZE_URL \
&& curl --silent --show-error --location --fail --retry 3 --output /usr/local/bin/dockerize $DOCKERIZE_URL \
&& chmod +x /usr/local/bin/dockerize \
&& dockerize --version

# Install RubyGems
RUN mkdir -p "$GEM_HOME" && chmod -R 777 "$GEM_HOME"

ENV BUNDLE_SILENCE_ROOT_WARNING 1

RUN mkdir /app
WORKDIR /app

CMD ["/bin/sh"]
3 changes: 3 additions & 0 deletions .github/workflows/build-ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ jobs:
- engine: ruby
version: 3.3.0
dockerfile: Dockerfile-3.3.0
- engine: ruby
version: 3.4.0
dockerfile: Dockerfile-3.4.0
# ADD NEW RUBIES HERE
- engine: jruby
version: 9.2.21.0
Expand Down
1 change: 1 addition & 0 deletions Gemfile-3.4
Loading

0 comments on commit f7b2946

Please sign in to comment.