From 1880d688e8de938e90500ed951147fe586822366 Mon Sep 17 00:00:00 2001 From: Ariel Valentin Date: Fri, 30 Dec 2022 16:19:09 -0600 Subject: [PATCH] chore: Upgrade Docker Dependencies to latest This commit introduces a few changes to our development docker image: 1. Sets the default Ruby version to 3.1.3 as well as removes the ability to set a custom bundler version and uses the latest gem version 2. Upgrades to mysql 8 since there are no 5.7 images available for Apple Silicon 3. Makes it possible to start up the main service, named `app`, with all of the dependencies to make it possible to run tests in a container 4. Overrides GitHub Action MySQL service to use a different entrypoint script, which is not currently supported via the YAML configurations See https://github.com/open-telemetry/opentelemetry-ruby-contrib/issues/250 See https://stackoverflow.com/questions/60902904/how-to-pass-mysql-native-password-to-mysql-service-in-github-actions See https://github.com/github/trilogy/issues/26 --- ...i-instrumentation-with-services-canary.yml | 2 +- .../ci-instrumentation-with-services.yml | 11 ++------ Dockerfile | 9 +++---- docker-compose.yml | 25 ++++++++++++++++++- instrumentation/trilogy/Appraisals | 2 +- 5 files changed, 31 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci-instrumentation-with-services-canary.yml b/.github/workflows/ci-instrumentation-with-services-canary.yml index f5fdf644d..968860c76 100644 --- a/.github/workflows/ci-instrumentation-with-services-canary.yml +++ b/.github/workflows/ci-instrumentation-with-services-canary.yml @@ -126,7 +126,7 @@ jobs: env: REDIS_PASSWORD: "passw0rd" mysql: - image: mysql:5.6 + image: mysql:8.0.31 env: MYSQL_DATABASE: mysql MYSQL_ROOT_PASSWORD: root diff --git a/.github/workflows/ci-instrumentation-with-services.yml b/.github/workflows/ci-instrumentation-with-services.yml index 6f4d0e5a4..227c53aa0 100644 --- a/.github/workflows/ci-instrumentation-with-services.yml +++ b/.github/workflows/ci-instrumentation-with-services.yml @@ -117,15 +117,8 @@ jobs: env: REDIS_PASSWORD: "passw0rd" mysql: - image: mysql:5.6 - env: - MYSQL_DATABASE: mysql - MYSQL_ROOT_PASSWORD: root - MYSQL_PASSWORD: mysql - MYSQL_USER: mysql - ports: - - 3306:3306 - options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3 + image: mysql:8.0.31 + options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3 -e MYSQL_DATABASE=mysql -e MYSQL_ROOT_PASSWORD=root -e MYSQL_PASSWORD=mysql -e MYSQL_USER=mysql -p 3306:3306 --entrypoint sh mysql:8.0.31 -c "exec docker-entrypoint.sh mysqld --default-authentication-plugin=mysql_native_password" rabbitmq: image: rabbitmq:3.8-alpine ports: diff --git a/Dockerfile b/Dockerfile index 0e26e2842..e1c002bf7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ # Configuration for Ruby base image -ARG ALPINE_VERSION=3.10 -ARG RUBY_VERSION=2.6.5 +ARG ALPINE_VERSION=3.17 +ARG RUBY_VERSION=3.1 FROM ruby:"${RUBY_VERSION}-alpine${ALPINE_VERSION}" as ruby @@ -14,9 +14,6 @@ ARG APP_GID=1000 ARG APP_GROUP=app ARG APP_DIR=/app -# Rubygems Bundler version -ARG BUNDLER_VERSION=2.0.2 - ENV SHELL /bin/bash ARG PACKAGES="\ @@ -59,7 +56,7 @@ ENV PATH "${APP_DIR}/bin:${BUNDLE_BIN}:${PATH}" # Upgrade RubyGems and install required Bundler version RUN gem update --system && \ - gem install "bundler:${BUNDLER_VERSION}" && \ + gem update bundler && \ gem cleanup # Add custom app User and Group diff --git a/docker-compose.yml b/docker-compose.yml index 8d55a768c..0a42dd986 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -19,6 +19,28 @@ services: build: context: . working_dir: /app + environment: + - MEMCACHED_URL=memcached:11211 + - TEST_MYSQL_USER=root + - TEST_MYSQL_ROOT_PASSWORD=root + - TEST_MYSQL_HOST=mysql + - TEST_MYSQL_PORT=3306 + - TEST_MYSQ_DB=mysql + - TEST_POSTGRES_PASSWORD=postgres + - TEST_POSTGRES_USER=postgres + - TEST_POSTGRES_HOST=postgres + - TEST_POSTGRES_PORT=5432 + - TEST_POSTGRES_DB=postgres + depends_on: + - kafka + - jaeger + - mysql + - mongo + - memcached + - otelcol + - postgres + - rabbitmq + - redis ex-instrumentation-bunny: <<: *base @@ -148,7 +170,8 @@ services: - "27017:27017" mysql: - image: mysql:5.6 + image: mysql:8.0.31 + command: mysqld --default-authentication-plugin=mysql_native_password environment: - MYSQL_DATABASE=mysql - MYSQL_ROOT_PASSWORD=root diff --git a/instrumentation/trilogy/Appraisals b/instrumentation/trilogy/Appraisals index 8f525fee3..5d67be7ed 100644 --- a/instrumentation/trilogy/Appraisals +++ b/instrumentation/trilogy/Appraisals @@ -4,6 +4,6 @@ # # SPDX-License-Identifier: Apache-2.0 -appraise 'trilogy-2.0' do +appraise 'trilogy-2' do gem 'trilogy', '~> 2.0' end