Skip to content

Commit

Permalink
chore: Upgrade Docker Dependencies to latest
Browse files Browse the repository at this point in the history
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 #250
See https://stackoverflow.com/questions/60902904/how-to-pass-mysql-native-password-to-mysql-service-in-github-actions
See trilogy-libraries/trilogy#26
  • Loading branch information
arielvalentin committed Dec 31, 2022
1 parent 6e89c92 commit 1880d68
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 2 additions & 9 deletions .github/workflows/ci-instrumentation-with-services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
9 changes: 3 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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="\
Expand Down Expand Up @@ -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
Expand Down
25 changes: 24 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion instrumentation/trilogy/Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
#
# SPDX-License-Identifier: Apache-2.0

appraise 'trilogy-2.0' do
appraise 'trilogy-2' do
gem 'trilogy', '~> 2.0'
end

0 comments on commit 1880d68

Please sign in to comment.