Skip to content

Commit

Permalink
Merge branch 'master' into tonycthsu/sidekiq-7
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyCTHsu committed Apr 13, 2023
2 parents 6e09652 + 7fc111a commit 013813d
Show file tree
Hide file tree
Showing 2,338 changed files with 75,708 additions and 78,833 deletions.
123 changes: 24 additions & 99 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,11 @@ step_bundle_install: &step_bundle_install
step_rubocop: &step_rubocop
run:
name: Delint with Rubocop
command: bundle exec rake rubocop
step_sorbet_type_checker: &step_sorbet_type_checker
run:
name: Run sorbet type checker
command: bundle exec rake typecheck
# There's no straightforward way to get the number of available processors & CPU threads in CircleCI.
# Currently it always return 18 physical processors and 36 threads, regardless of executor size.
# The workaround is to use `cpu.shares / 1024`:
# https://discuss.circleci.com/t/environment-variable-set-to-the-number-of-available-cpus/32670/4
command: PARALLEL_PROCESSOR_COUNT=$((`cat /sys/fs/cgroup/cpu/cpu.shares` / 1024)) bundle exec rake rubocop
step_appraisal_install: &step_appraisal_install
run:
name: Install Appraisal gems
Expand Down Expand Up @@ -194,6 +194,8 @@ filters_only_release_tags: &filters_only_release_tags

orbs:
orb:
orbs:
codecov: codecov/[email protected]
jobs:
build:
<<: *test_job_default
Expand Down Expand Up @@ -342,16 +344,6 @@ orbs:
keys:
- bundle-{{ .Environment.CIRCLE_CACHE_VERSION }}-{{ checksum ".circleci/images/primary/binary_version" }}-<<parameters.ruby_version>>-{{ checksum "lib/ddtrace/version.rb" }}-{{ .Branch }}-{{ checksum ".circleci/bundle_checksum" }}
- *step_rubocop
sorbet_type_checker:
<<: *test_job_default
steps:
- restore_cache:
keys:
- '{{ .Environment.CIRCLE_CACHE_VERSION }}-bundled-repo-<<parameters.ruby_version>>-{{ .Environment.CIRCLE_SHA1 }}'
- restore_cache:
keys:
- bundle-{{ .Environment.CIRCLE_CACHE_VERSION }}-{{ checksum ".circleci/images/primary/binary_version" }}-<<parameters.ruby_version>>-{{ checksum "lib/ddtrace/version.rb" }}-{{ .Branch }}-{{ checksum ".circleci/bundle_checksum" }}
- *step_sorbet_type_checker
coverage:
<<: *test_job_default
steps:
Expand All @@ -364,13 +356,12 @@ orbs:
- attach_workspace:
at: /tmp/workspace
- run:
name: Install codecov
command: bundle add codecov
- run:
name: Generate coverage report artifact "coverage/index.html"
name: Generate combined coverage report for all tests
command: COVERAGE_DIR=/tmp/workspace/coverage bundle exec rake coverage:report
- codecov/upload:
file: /tmp/workspace/coverage/report/coverage.xml
- run:
name: Generate coverage report artifact "coverage/versions/*/index.html"
name: Generate individual coverage report for each Ruby version
command: COVERAGE_DIR=/tmp/workspace/coverage bundle exec rake coverage:report_per_ruby_version
- store_artifacts:
path: /tmp/workspace/coverage/report/
Expand Down Expand Up @@ -529,15 +520,10 @@ job_configuration:
resource_class_to_use: medium+
- &config-3_2
<<: *filters_all_branches_and_tags
ruby_version: 'ruby-3.2.0-preview3'
image: ghcr.io/datadog/dd-trace-rb/ruby:3.2.0-preview3-dd
ruby_version: 'ruby-3.2.0'
image: ghcr.io/datadog/dd-trace-rb/ruby:3.2.0-dd
resource_class_to_use: medium+
# ADD NEW RUBIES HERE
- &config-jruby-9_2_8_0 # Test with older 9.2 release because 9.2.9.0 changed behavior, see https://github.com/DataDog/dd-trace-rb/pull/1409
<<: *filters_all_branches_and_tags
ruby_version: 'jruby-9.2.8.0'
image: ghcr.io/datadog/dd-trace-rb/jruby:9.2.8.0-dd
resource_class_to_use: medium+
- &config-jruby-9_2 # More recent release of 9.2
<<: *filters_all_branches_and_tags
ruby_version: 'jruby-9.2.21.0'
Expand All @@ -548,11 +534,6 @@ job_configuration:
ruby_version: 'jruby-9.3.9.0'
image: ghcr.io/datadog/dd-trace-rb/jruby:9.3.9.0-dd
resource_class_to_use: medium+
- &config-truffleruby-22_3_0
<<: *filters_all_branches_and_tags
ruby_version: 'truffleruby-22.3.0'
image: ghcr.io/datadog/dd-trace-rb/truffleruby:22.3.0-dd
resource_class_to_use: medium+

workflows:
version: 2
Expand All @@ -563,11 +544,6 @@ workflows:
name: lint
requires:
- build-2.7
- orb/sorbet_type_checker:
<<: *config-2_7-small
name: sorbet_type_checker
requires:
- build-2.7
- orb/coverage:
<<: *config-2_7-small
name: coverage
Expand All @@ -581,13 +557,10 @@ workflows:
- test-2.7
- test-3.0
- test-3.1
# TODO: Re-enable once 3.2 testing is green!
#- test-3.2
- test-3.2
# ADD NEW RUBIES HERE
- test-jruby-9.2.8.0
- test-jruby-9.2
- test-jruby-9.3
# soon™️ - test-truffleruby-22.3.0
- orb/changelog:
<<: *config-2_7-small
name: changelog
Expand Down Expand Up @@ -730,21 +703,12 @@ workflows:
- orb/build:
<<: *config-3_2
name: build-3.2
# TODO: Re-enable once 3.2 testing is green!
# - orb/test:
# <<: *config-3_2
# name: test-3.2
# requires:
# - build-3.2
# ADD NEW RUBIES HERE
- orb/build:
<<: *config-jruby-9_2_8_0
name: build-jruby-9.2.8.0
- orb/test:
<<: *config-jruby-9_2_8_0
name: test-jruby-9.2.8.0
<<: *config-3_2
name: test-3.2
requires:
- build-jruby-9.2.8.0
- build-3.2
# ADD NEW RUBIES HERE
- orb/build:
<<: *config-jruby-9_2
name: build-jruby-9.2
Expand All @@ -761,22 +725,11 @@ workflows:
name: test-jruby-9.3
requires:
- build-jruby-9.3
# TruffleRuby
# soon™️
# - orb/build:
# <<: *config-truffleruby-22_3_0
# name: build-truffleruby-22.3.0
# - orb/test:
# <<: *config-truffleruby-22_3_0
# name: test-truffleruby-22.3.0
# requires:
# - build-truffleruby-22.3.0
# Release jobs
- "deploy prerelease Gem":
<<: *filters_all_branches_and_tags
requires:
- lint
- sorbet_type_checker
- test-2.1
- test-2.2
- test-2.3
Expand All @@ -786,18 +739,14 @@ workflows:
- test-2.7
- test-3.0
- test-3.1
# TODO: Re-enable once 3.2 testing is green!
#- test-3.2
- test-3.2
# ADD NEW RUBIES HERE
- test-jruby-9.2.8.0
- test-jruby-9.2
- test-jruby-9.3
# soon™️ - test-truffleruby-22.3.0
- "deploy release":
<<: *filters_only_release_tags
requires:
- lint
- sorbet_type_checker
- test-2.1
- test-2.2
- test-2.3
Expand All @@ -807,13 +756,10 @@ workflows:
- test-2.7
- test-3.0
- test-3.1
# TODO: Re-enable once 3.2 testing is green!
#- test-3.2
- test-3.2
# ADD NEW RUBIES HERE
- test-jruby-9.2.8.0
- test-jruby-9.2
- test-jruby-9.3
# soon™️ - test-truffleruby-22.3.0
# This workflow runs the same `build` and `test` jobs as above on a schedule.
# Tasks related to housekeeping (e.g. prerelease) are not relevant
# to this daily check, as they are not expected to be impacted here.
Expand Down Expand Up @@ -968,22 +914,12 @@ workflows:
<<: *config-3_2
name: build-3.2
edge: true
# TODO: Re-enable once 3.2 testing is green!
# - orb/test:
# <<: *config-3_2
# name: test-3.2
# requires:
# - build-3.2
# ADD NEW RUBIES HERE
- orb/build:
<<: *config-jruby-9_2_8_0
name: build-jruby-9.2.8.0
edge: true
- orb/test:
<<: *config-jruby-9_2_8_0
name: test-jruby-9.2.8.0
<<: *config-3_2
name: test-3.2
requires:
- build-jruby-9.2.8.0
- build-3.2
# ADD NEW RUBIES HERE
- orb/build:
<<: *config-jruby-9_2
name: build-jruby-9.2
Expand All @@ -1002,14 +938,3 @@ workflows:
name: test-jruby-9.3
requires:
- build-jruby-9.3
# TruffleRuby
# soon™️
# - orb/build:
# <<: *config-truffleruby-22_3_0
# name: build-truffleruby-22.3.0
# edge: true
# - orb/test:
# <<: *config-truffleruby-22_3_0
# name: test-truffleruby-22.3.0
# requires:
# - build-truffleruby-22.3.0
13 changes: 9 additions & 4 deletions .circleci/images/primary/Dockerfile-2.1.10
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# ruby:2.1.10 was based on jessie, but never got a aarch64 image
# aarch64 used to be supported upon release but is not part of LTS, so archive.debian.org does not contain aarch64: https://www.debian.org/releases/jessie/

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

# taken from https://github.com/docker-library/ruby/blob/c5693b25aa865489fee130e572a3f11bccebd21b/2.1/Dockerfile
FROM buildpack-deps:stretch AS ruby-2.1.10-stretch

Expand Down Expand Up @@ -71,8 +73,7 @@ RUN set -ex \
# install things globally, for great justice
# and don't create ".bundle" in all our apps
ENV GEM_HOME /usr/local/bundle
ENV BUNDLE_PATH="$GEM_HOME" \
BUNDLE_BIN="$GEM_HOME/bin" \
ENV BUNDLE_BIN="$GEM_HOME/bin" \
BUNDLE_SILENCE_ROOT_WARNING=1 \
BUNDLE_APP_CONFIG="$GEM_HOME"
ENV PATH $BUNDLE_BIN:$PATH
Expand Down Expand Up @@ -112,7 +113,7 @@ ENV LANGUAGE en_US:en
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 \
&& 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 \
Expand All @@ -131,7 +132,11 @@ RUN echo 'deb http://ftp.debian.org/debian stretch-backports main\ndeb-src http:
&& rm -rf /var/lib/apt/lists/*

# Install Dockerize
RUN curl -sfL $(curl -s https://api.github.com/repos/powerman/dockerize/releases/latest | grep -i /dockerize-$(uname -s)-$(dpkg --print-architecture)\" | cut -d\" -f4) | install /dev/stdin /usr/local/bin/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

RUN mkdir /app
WORKDIR /app
Expand Down
15 changes: 10 additions & 5 deletions .circleci/images/primary/Dockerfile-2.2.10
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# ruby:2.2.10-jessie was based on jessie, and had a aarch64 image
# aarch64 used to be supported upon release but is not part of LTS,
# so archive.debian.org does not contain aarch64: https://www.debian.org/releases/jessie/
#

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

# taken from https://github.com/docker-library/ruby/blob/b5ef401d348ca9b1d9f6a5cb4b25f32bf013daca/2.2/jessie/Dockerfile
FROM buildpack-deps:stretch AS ruby-2.2.10-stretch

Expand Down Expand Up @@ -72,8 +74,7 @@ RUN set -ex \
# install things globally, for great justice
# and don't create ".bundle" in all our apps
ENV GEM_HOME /usr/local/bundle
ENV BUNDLE_PATH="$GEM_HOME" \
BUNDLE_BIN="$GEM_HOME/bin" \
ENV BUNDLE_BIN="$GEM_HOME/bin" \
BUNDLE_SILENCE_ROOT_WARNING=1 \
BUNDLE_APP_CONFIG="$GEM_HOME"
ENV PATH $BUNDLE_BIN:$PATH
Expand Down Expand Up @@ -113,7 +114,7 @@ ENV LANGUAGE en_US:en
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 \
&& 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 \
Expand All @@ -132,7 +133,11 @@ RUN echo 'deb http://ftp.debian.org/debian stretch-backports main\ndeb-src http:
&& rm -rf /var/lib/apt/lists/*

# Install Dockerize
RUN curl -sfL $(curl -s https://api.github.com/repos/powerman/dockerize/releases/latest | grep -i /dockerize-$(uname -s)-$(dpkg --print-architecture)\" | cut -d\" -f4) | install /dev/stdin /usr/local/bin/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

RUN mkdir /app
WORKDIR /app
Expand Down
10 changes: 8 additions & 2 deletions .circleci/images/primary/Dockerfile-2.3.8
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Note: See the "Publishing updates to images" note in ./README.md for how to publish new builds of this container image

# Last version: https://github.com/docker-library/ruby/blob/31f66490fdb837ddcc5896e3275f2188f2b7b6dd/2.3/stretch/Dockerfile
FROM ruby:2.3.8-stretch

Expand Down Expand Up @@ -30,7 +32,7 @@ ENV LANGUAGE en_US:en
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 \
&& 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 \
Expand All @@ -49,7 +51,11 @@ RUN echo 'deb http://ftp.debian.org/debian stretch-backports main\ndeb-src http:
&& rm -rf /var/lib/apt/lists/*

# Install Dockerize
RUN curl -sfL $(curl -s https://api.github.com/repos/powerman/dockerize/releases/latest | grep -i /dockerize-$(uname -s)-$(dpkg --print-architecture)\" | cut -d\" -f4) | install /dev/stdin /usr/local/bin/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"
Expand Down
15 changes: 11 additions & 4 deletions .circleci/images/primary/Dockerfile-2.4.10
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Note: See the "Publishing updates to images" note in ./README.md for how to publish new builds of this container image

FROM ruby:2.4.10-buster

# Make apt non-interactive
Expand Down Expand Up @@ -29,7 +31,7 @@ ENV LANGUAGE en_US:en
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 \
&& 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 \
Expand All @@ -40,19 +42,24 @@ RUN set -ex \

# 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 curl -sfL $(curl -s https://api.github.com/repos/powerman/dockerize/releases/latest | grep -i /dockerize-$(uname -s)-$(dpkg --print-architecture)\" | cut -d\" -f4) | install /dev/stdin /usr/local/bin/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"

# Install RubyGems and Bundler
RUN gem update --system
RUN gem install bundler
RUN gem update --system 3.3.26
RUN gem install bundler -v '~> 2.3.26'
ENV BUNDLE_SILENCE_ROOT_WARNING 1

RUN mkdir /app
Expand Down
Loading

0 comments on commit 013813d

Please sign in to comment.