diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1d53532f48..eb1f1eed78 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -201,7 +201,7 @@ onboarding_ruby: SCENARIO: [ CONTAINER_AUTO_INJECTION_INSTALL_SCRIPT] DEFAULT_VMS: ["True","False"] - ONBOARDING_FILTER_ENV: [dev, prod] - ONBOARDING_FILTER_WEBLOG: [test-app-ruby,test-app-ruby-container] + ONBOARDING_FILTER_WEBLOG: [test-app-ruby,test-app-ruby-multicontainer,test-app-ruby-multialpine] SCENARIO: [INSTALLER_AUTO_INJECTION] DEFAULT_VMS: ["True","False"] - ONBOARDING_FILTER_ENV: [dev, prod] diff --git a/lib-injection/build/docker/ruby/lib_injection_rails_app/Gemfile b/lib-injection/build/docker/ruby/lib_injection_rails_app/Gemfile index 494f8fee14..1d23f77fdf 100644 --- a/lib-injection/build/docker/ruby/lib_injection_rails_app/Gemfile +++ b/lib-injection/build/docker/ruby/lib_injection_rails_app/Gemfile @@ -13,6 +13,10 @@ gem "sqlite3", "~> 1.4" # Use the Puma web server [https://github.com/puma/puma] gem "puma", "~> 5.0" +gem 'mutex_m', '~> 0.2.0' +gem 'base64', '~> 0.1.0' +gem 'bigdecimal', '~> 1.2', '>= 1.2.7' + # Windows does not include zoneinfo files, so bundle the tzinfo-data gem gem "tzinfo-data", platforms: %i[ mingw mswin x64_mingw jruby ] diff --git a/utils/build/virtual_machine/weblogs/ruby/provision_test-app-ruby-multialpine.yml b/utils/build/virtual_machine/weblogs/ruby/provision_test-app-ruby-multialpine.yml new file mode 100644 index 0000000000..2e967f5cc6 --- /dev/null +++ b/utils/build/virtual_machine/weblogs/ruby/provision_test-app-ruby-multialpine.yml @@ -0,0 +1,24 @@ +weblog: + name: test-app-ruby-multialpine + install: + - os_type: linux + copy_files: + - name: copy-multicontainer-run-script + local_path: utils/build/virtual_machine/weblogs/common/create_and_run_app_multicontainer.sh + - name: copy-docker-compose-file + local_path: utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multialpine/docker-compose.yml + - name: copy-ruby-app + local_path: lib-injection/build/docker/ruby + - name: copy-ruby3_2-app-dockerfile + local_path: utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multialpine/Dockerfile.ruby_3_2-alpine + - name: copy-ruby3_1-app-dockerfile + local_path: utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multialpine/Dockerfile.ruby_3_1-alpine + - name: copy-ruby3_0-app-dockerfile + local_path: utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multialpine/Dockerfile.ruby_3_0-alpine + - name: copy-ruby2_7-app-dockerfile + local_path: utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multialpine/Dockerfile.ruby_2_7-alpine + - name: copy-reverseproxy-dockerfile + local_path: utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multialpine/Dockerfile.reverseproxy + - name: copy-reverseproxy-conf + local_path: utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multialpine/nginx.conf + remote-command: sh create_and_run_app_multicontainer.sh diff --git a/utils/build/virtual_machine/weblogs/ruby/provision_test-app-ruby-multicontainer.yml b/utils/build/virtual_machine/weblogs/ruby/provision_test-app-ruby-multicontainer.yml new file mode 100644 index 0000000000..a23781e4e5 --- /dev/null +++ b/utils/build/virtual_machine/weblogs/ruby/provision_test-app-ruby-multicontainer.yml @@ -0,0 +1,24 @@ +weblog: + name: test-app-ruby-multicontainer + install: + - os_type: linux + copy_files: + - name: copy-multicontainer-run-script + local_path: utils/build/virtual_machine/weblogs/common/create_and_run_app_multicontainer.sh + - name: copy-docker-compose-file + local_path: utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multicontainer/docker-compose.yml + - name: copy-ruby-app + local_path: lib-injection/build/docker/ruby + - name: copy-ruby3_2-app-dockerfile + local_path: utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multicontainer/Dockerfile.ruby_3_2 + - name: copy-ruby3_1-app-dockerfile + local_path: utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multicontainer/Dockerfile.ruby_3_1 + - name: copy-ruby3_0-app-dockerfile + local_path: utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multicontainer/Dockerfile.ruby_3_0 + - name: copy-ruby2_7-app-dockerfile + local_path: utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multicontainer/Dockerfile.ruby_2_7 + - name: copy-reverseproxy-dockerfile + local_path: utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multicontainer/Dockerfile.reverseproxy + - name: copy-reverseproxy-conf + local_path: utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multicontainer/nginx.conf + remote-command: sh create_and_run_app_multicontainer.sh diff --git a/utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multialpine/Dockerfile.reverseproxy b/utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multialpine/Dockerfile.reverseproxy new file mode 100644 index 0000000000..82cdb62223 --- /dev/null +++ b/utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multialpine/Dockerfile.reverseproxy @@ -0,0 +1,3 @@ +FROM public.ecr.aws/nginx/nginx:stable-perl + +COPY nginx.conf /etc/nginx/nginx.conf \ No newline at end of file diff --git a/utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multialpine/Dockerfile.ruby_2_7-alpine b/utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multialpine/Dockerfile.ruby_2_7-alpine new file mode 100644 index 0000000000..24a5927f11 --- /dev/null +++ b/utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multialpine/Dockerfile.ruby_2_7-alpine @@ -0,0 +1,27 @@ +FROM public.ecr.aws/docker/library/ruby:2.7-alpine + +ENV DEBIAN_FRONTEND=noninteractive + +# Set timezone to UTC by default +RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime + +# Upgrade RubyGems and Bundler +RUN gem update --system 3.4.1 +RUN gem install bundler -v '~> 2.3.26' +RUN mkdir -p "$GEM_HOME" && chmod -R 777 "$GEM_HOME" +ENV BUNDLE_SILENCE_ROOT_WARNING 1 + +# Setup directory +RUN mkdir /app +WORKDIR /app + +# Add files +COPY lib_injection_rails_app /app + +# Install gems +RUN bundle install + +# Set entrypoint +ENTRYPOINT ["/bin/bash", "-c"] + +CMD ["bin/rails server -b 0.0.0.0 -p 18080"] diff --git a/utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multialpine/Dockerfile.ruby_3_0-alpine b/utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multialpine/Dockerfile.ruby_3_0-alpine new file mode 100644 index 0000000000..e159f60fb1 --- /dev/null +++ b/utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multialpine/Dockerfile.ruby_3_0-alpine @@ -0,0 +1,27 @@ +FROM public.ecr.aws/docker/library/ruby:3.0-alpine + +ENV DEBIAN_FRONTEND=noninteractive + +# Set timezone to UTC by default +RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime + +# Upgrade RubyGems and Bundler +RUN gem update --system 3.4.1 +RUN gem install bundler -v '~> 2.3.26' +RUN mkdir -p "$GEM_HOME" && chmod -R 777 "$GEM_HOME" +ENV BUNDLE_SILENCE_ROOT_WARNING 1 + +# Setup directory +RUN mkdir /app +WORKDIR /app + +# Add files +COPY lib_injection_rails_app /app + +# Install gems +RUN bundle install + +# Set entrypoint +ENTRYPOINT ["/bin/bash", "-c"] + +CMD ["bin/rails server -b 0.0.0.0 -p 18080"] diff --git a/utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multialpine/Dockerfile.ruby_3_1-alpine b/utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multialpine/Dockerfile.ruby_3_1-alpine new file mode 100644 index 0000000000..27c3167d16 --- /dev/null +++ b/utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multialpine/Dockerfile.ruby_3_1-alpine @@ -0,0 +1,27 @@ +FROM public.ecr.aws/docker/library/ruby:3.1-alpine + +ENV DEBIAN_FRONTEND=noninteractive + +# Set timezone to UTC by default +RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime + +# Upgrade RubyGems and Bundler +RUN gem update --system 3.4.1 +RUN gem install bundler -v '~> 2.3.26' +RUN mkdir -p "$GEM_HOME" && chmod -R 777 "$GEM_HOME" +ENV BUNDLE_SILENCE_ROOT_WARNING 1 + +# Setup directory +RUN mkdir /app +WORKDIR /app + +# Add files +COPY lib_injection_rails_app /app + +# Install gems +RUN bundle install + +# Set entrypoint +ENTRYPOINT ["/bin/bash", "-c"] + +CMD ["bin/rails server -b 0.0.0.0 -p 18080"] diff --git a/utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multialpine/Dockerfile.ruby_3_2-alpine b/utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multialpine/Dockerfile.ruby_3_2-alpine new file mode 100644 index 0000000000..56dee57412 --- /dev/null +++ b/utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multialpine/Dockerfile.ruby_3_2-alpine @@ -0,0 +1,27 @@ +FROM public.ecr.aws/docker/library/ruby:3.2-alpine + +ENV DEBIAN_FRONTEND=noninteractive + +# Set timezone to UTC by default +RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime + +# Upgrade RubyGems and Bundler +RUN gem update --system 3.4.1 +RUN gem install bundler -v '~> 2.3.26' +RUN mkdir -p "$GEM_HOME" && chmod -R 777 "$GEM_HOME" +ENV BUNDLE_SILENCE_ROOT_WARNING 1 + +# Setup directory +RUN mkdir /app +WORKDIR /app + +# Add files +COPY lib_injection_rails_app /app + +# Install gems +RUN bundle install + +# Set entrypoint +ENTRYPOINT ["/bin/bash", "-c"] + +CMD ["bin/rails server -b 0.0.0.0 -p 18080"] diff --git a/utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multialpine/docker-compose.yml b/utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multialpine/docker-compose.yml new file mode 100644 index 0000000000..864d9125eb --- /dev/null +++ b/utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multialpine/docker-compose.yml @@ -0,0 +1,53 @@ +version: '2' + +services: + reverseproxy: + image: reverseproxy:latest + ports: + - 5985:8080 + restart: always + build: + context: . + dockerfile: Dockerfile.reverseproxy + healthcheck: + test: "curl -f http://localhost:8080" + + ruby_3_2: + env_file: "scenario_app.env" + image: system-tests/ruby_3_2:latest + restart: always + build: + context: . + dockerfile: Dockerfile.ruby_3_2-alpine + healthcheck: + test: "curl -f http://localhost:18080" + + ruby_3_1: + env_file: "scenario_app.env" + image: system-tests/ruby_3_1:latest + restart: always + build: + context: . + dockerfile: Dockerfile.ruby_3_1-alpine + healthcheck: + test: "curl -f http://localhost:18080" + + ruby_3_0: + env_file: "scenario_app.env" + image: system-tests/ruby_3_0:latest + restart: always + build: + context: . + dockerfile: Dockerfile.ruby_3_0-alpine + healthcheck: + test: "curl -f http://localhost:18080" + + ruby_2_7: + env_file: "scenario_app.env" + image: system-tests/ruby_2_7:latest + restart: always + build: + context: . + dockerfile: Dockerfile.ruby_2_7-alpine + healthcheck: + test: "curl -f http://localhost:18080" diff --git a/utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multialpine/nginx.conf b/utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multialpine/nginx.conf new file mode 100644 index 0000000000..88ce9b0818 --- /dev/null +++ b/utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multialpine/nginx.conf @@ -0,0 +1,71 @@ +worker_processes 1; + +events { worker_connections 1024; } + + +http { + + log_format compression '$remote_addr - $remote_user [$time_local] ' + '"$request" $status $upstream_addr ' + '"$http_referer" "$http_user_agent" "$gzip_ratio"'; + + upstream ruby_3_2_app { + server ruby_3_2:18080; + } + upstream ruby_3_1_app { + server ruby_3_1:18080; + } + upstream ruby_3_0_app { + server ruby_3_0:18080; + } + upstream ruby_2_7_app { + server ruby_2_7:18080; + } + server { + listen 8080; + access_log /var/log/nginx/access.log compression; + + location / { + default_type application/json; + return 200 "{ + 'app_type':'multicontainer', + 'apps':[{ + 'runtime':'3.2', + 'type':'alpine', + 'url':'/ruby_3_2/' + },{ + 'runtime':'3.1', + 'type':'alpine', + 'url':'/ruby_3_1/' + },{ + 'runtime':'3.0', + 'type':'alpine', + 'url':'/ruby_3_0/' + },{ + 'runtime':'2.7', + 'type':'alpine', + 'url':'/ruby_2_7/' + } + + ] + }"; + } + + location /ruby_3_2/ { + proxy_pass http://ruby_3_2_app/; + proxy_redirect off; + } + location /ruby_3_1/ { + proxy_pass http://ruby_3_1_app/; + proxy_redirect off; + } + location /ruby_3_0/ { + proxy_pass http://ruby_3_0_app/; + proxy_redirect off; + } + location /ruby_2_7/ { + proxy_pass http://ruby_2_7_app/; + proxy_redirect off; + } + } +} diff --git a/utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multicontainer/Dockerfile.reverseproxy b/utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multicontainer/Dockerfile.reverseproxy new file mode 100644 index 0000000000..82cdb62223 --- /dev/null +++ b/utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multicontainer/Dockerfile.reverseproxy @@ -0,0 +1,3 @@ +FROM public.ecr.aws/nginx/nginx:stable-perl + +COPY nginx.conf /etc/nginx/nginx.conf \ No newline at end of file diff --git a/utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multicontainer/Dockerfile.ruby_2_7 b/utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multicontainer/Dockerfile.ruby_2_7 new file mode 100644 index 0000000000..98804bcc73 --- /dev/null +++ b/utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multicontainer/Dockerfile.ruby_2_7 @@ -0,0 +1,46 @@ +FROM public.ecr.aws/docker/library/ruby:2.7 + +ENV DEBIAN_FRONTEND=noninteractive + +# Install prerequisites +RUN set -ex && \ + echo "===> Installing dependencies" && \ + apt-get -y update && \ + apt-get install -y --force-yes --no-install-recommends \ + curl wget tar gzip gnupg apt-transport-https ca-certificates tzdata locales && \ + \ + echo "===> Installing database libraries" && \ + apt-get install -y --force-yes --no-install-recommends sqlite3 && \ + \ + echo "===> Installing dev tools" && \ + mkdir -p /usr/share/man/man1 && \ + apt-get install -y --force-yes --no-install-recommends \ + sudo git openssh-client rsync vim \ + net-tools netcat-traditional parallel unzip zip bzip2 && \ + \ + echo "===> Cleaning up" && \ + rm -rf /var/lib/apt/lists/*; + +# Set timezone to UTC by default +RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime + +# Upgrade RubyGems and Bundler +RUN gem update --system 3.4.1 +RUN gem install bundler -v '~> 2.3.26' +RUN mkdir -p "$GEM_HOME" && chmod -R 777 "$GEM_HOME" +ENV BUNDLE_SILENCE_ROOT_WARNING 1 + +# Setup directory +RUN mkdir /app +WORKDIR /app + +# Add files +COPY lib_injection_rails_app /app + +# Install gems +RUN bundle install + +# Set entrypoint +ENTRYPOINT ["/bin/bash", "-c"] + +CMD ["bin/rails server -b 0.0.0.0 -p 18080"] diff --git a/utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multicontainer/Dockerfile.ruby_3_0 b/utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multicontainer/Dockerfile.ruby_3_0 new file mode 100644 index 0000000000..14ab84a309 --- /dev/null +++ b/utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multicontainer/Dockerfile.ruby_3_0 @@ -0,0 +1,46 @@ +FROM public.ecr.aws/docker/library/ruby:3.0 + +ENV DEBIAN_FRONTEND=noninteractive + +# Install prerequisites +RUN set -ex && \ + echo "===> Installing dependencies" && \ + apt-get -y update && \ + apt-get install -y --force-yes --no-install-recommends \ + curl wget tar gzip gnupg apt-transport-https ca-certificates tzdata locales && \ + \ + echo "===> Installing database libraries" && \ + apt-get install -y --force-yes --no-install-recommends sqlite3 && \ + \ + echo "===> Installing dev tools" && \ + mkdir -p /usr/share/man/man1 && \ + apt-get install -y --force-yes --no-install-recommends \ + sudo git openssh-client rsync vim \ + net-tools netcat-traditional parallel unzip zip bzip2 && \ + \ + echo "===> Cleaning up" && \ + rm -rf /var/lib/apt/lists/*; + +# Set timezone to UTC by default +RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime + +# Upgrade RubyGems and Bundler +RUN gem update --system 3.4.1 +RUN gem install bundler -v '~> 2.3.26' +RUN mkdir -p "$GEM_HOME" && chmod -R 777 "$GEM_HOME" +ENV BUNDLE_SILENCE_ROOT_WARNING 1 + +# Setup directory +RUN mkdir /app +WORKDIR /app + +# Add files +COPY lib_injection_rails_app /app + +# Install gems +RUN bundle install + +# Set entrypoint +ENTRYPOINT ["/bin/bash", "-c"] + +CMD ["bin/rails server -b 0.0.0.0 -p 18080"] diff --git a/utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multicontainer/Dockerfile.ruby_3_1 b/utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multicontainer/Dockerfile.ruby_3_1 new file mode 100644 index 0000000000..cd538d21ba --- /dev/null +++ b/utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multicontainer/Dockerfile.ruby_3_1 @@ -0,0 +1,46 @@ +FROM public.ecr.aws/docker/library/ruby:3.1 + +ENV DEBIAN_FRONTEND=noninteractive + +# Install prerequisites +RUN set -ex && \ + echo "===> Installing dependencies" && \ + apt-get -y update && \ + apt-get install -y --force-yes --no-install-recommends \ + curl wget tar gzip gnupg apt-transport-https ca-certificates tzdata locales && \ + \ + echo "===> Installing database libraries" && \ + apt-get install -y --force-yes --no-install-recommends sqlite3 && \ + \ + echo "===> Installing dev tools" && \ + mkdir -p /usr/share/man/man1 && \ + apt-get install -y --force-yes --no-install-recommends \ + sudo git openssh-client rsync vim \ + net-tools netcat-traditional parallel unzip zip bzip2 && \ + \ + echo "===> Cleaning up" && \ + rm -rf /var/lib/apt/lists/*; + +# Set timezone to UTC by default +RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime + +# Upgrade RubyGems and Bundler +RUN gem update --system 3.4.1 +RUN gem install bundler -v '~> 2.3.26' +RUN mkdir -p "$GEM_HOME" && chmod -R 777 "$GEM_HOME" +ENV BUNDLE_SILENCE_ROOT_WARNING 1 + +# Setup directory +RUN mkdir /app +WORKDIR /app + +# Add files +COPY lib_injection_rails_app /app + +# Install gems +RUN bundle install + +# Set entrypoint +ENTRYPOINT ["/bin/bash", "-c"] + +CMD ["bin/rails server -b 0.0.0.0 -p 18080"] diff --git a/utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multicontainer/Dockerfile.ruby_3_2 b/utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multicontainer/Dockerfile.ruby_3_2 new file mode 100644 index 0000000000..353fe878ef --- /dev/null +++ b/utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multicontainer/Dockerfile.ruby_3_2 @@ -0,0 +1,46 @@ +FROM public.ecr.aws/docker/library/ruby:3.2 + +ENV DEBIAN_FRONTEND=noninteractive + +# Install prerequisites +RUN set -ex && \ + echo "===> Installing dependencies" && \ + apt-get -y update && \ + apt-get install -y --force-yes --no-install-recommends \ + curl wget tar gzip gnupg apt-transport-https ca-certificates tzdata locales && \ + \ + echo "===> Installing database libraries" && \ + apt-get install -y --force-yes --no-install-recommends sqlite3 && \ + \ + echo "===> Installing dev tools" && \ + mkdir -p /usr/share/man/man1 && \ + apt-get install -y --force-yes --no-install-recommends \ + sudo git openssh-client rsync vim \ + net-tools netcat-traditional parallel unzip zip bzip2 && \ + \ + echo "===> Cleaning up" && \ + rm -rf /var/lib/apt/lists/*; + +# Set timezone to UTC by default +RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime + +# Upgrade RubyGems and Bundler +RUN gem update --system 3.4.1 +RUN gem install bundler -v '~> 2.3.26' +RUN mkdir -p "$GEM_HOME" && chmod -R 777 "$GEM_HOME" +ENV BUNDLE_SILENCE_ROOT_WARNING 1 + +# Setup directory +RUN mkdir /app +WORKDIR /app + +# Add files +COPY lib_injection_rails_app /app + +# Install gems +RUN bundle install + +# Set entrypoint +ENTRYPOINT ["/bin/bash", "-c"] + +CMD ["bin/rails server -b 0.0.0.0 -p 18080"] diff --git a/utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multicontainer/docker-compose.yml b/utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multicontainer/docker-compose.yml new file mode 100644 index 0000000000..4f451847ff --- /dev/null +++ b/utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multicontainer/docker-compose.yml @@ -0,0 +1,53 @@ +version: '2' + +services: + reverseproxy: + image: reverseproxy:latest + ports: + - 5985:8080 + restart: always + build: + context: . + dockerfile: Dockerfile.reverseproxy + healthcheck: + test: "curl -f http://localhost:8080" + + ruby_3_2: + env_file: "scenario_app.env" + image: system-tests/ruby_3_2:latest + restart: always + build: + context: . + dockerfile: Dockerfile.ruby_3_2 + healthcheck: + test: "true" + + ruby_3_1: + env_file: "scenario_app.env" + image: system-tests/ruby_3_1:latest + restart: always + build: + context: . + dockerfile: Dockerfile.ruby_3_1 + healthcheck: + test: "true" + + ruby_3_0: + env_file: "scenario_app.env" + image: system-tests/ruby_3_0:latest + restart: always + build: + context: . + dockerfile: Dockerfile.ruby_3_0 + healthcheck: + test: "true" + + ruby_2_7: + env_file: "scenario_app.env" + image: system-tests/ruby_2_7:latest + restart: always + build: + context: . + dockerfile: Dockerfile.ruby_2_7 + healthcheck: + test: "true" diff --git a/utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multicontainer/nginx.conf b/utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multicontainer/nginx.conf new file mode 100644 index 0000000000..15faeaf75f --- /dev/null +++ b/utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multicontainer/nginx.conf @@ -0,0 +1,71 @@ +worker_processes 1; + +events { worker_connections 1024; } + + +http { + + log_format compression '$remote_addr - $remote_user [$time_local] ' + '"$request" $status $upstream_addr ' + '"$http_referer" "$http_user_agent" "$gzip_ratio"'; + + upstream ruby_3_2_app { + server ruby_3_2:18080; + } + upstream ruby_3_1_app { + server ruby_3_1:18080; + } + upstream ruby_3_0_app { + server ruby_3_0:18080; + } + upstream ruby_2_7_app { + server ruby_2_7:18080; + } + server { + listen 8080; + access_log /var/log/nginx/access.log compression; + + location / { + default_type application/json; + return 200 "{ + 'app_type':'multicontainer', + 'apps':[{ + 'runtime':'3.2', + 'type':'container', + 'url':'/ruby_3_2/' + },{ + 'runtime':'3.1', + 'type':'container', + 'url':'/ruby_3_1/' + },{ + 'runtime':'3.0', + 'type':'container', + 'url':'/ruby_3_0/' + },{ + 'runtime':'2.7', + 'type':'container', + 'url':'/ruby_2_7/' + } + + ] + }"; + } + + location /ruby_3_2/ { + proxy_pass http://ruby_3_2_app/; + proxy_redirect off; + } + location /ruby_3_1/ { + proxy_pass http://ruby_3_1_app/; + proxy_redirect off; + } + location /ruby_3_0/ { + proxy_pass http://ruby_3_0_app/; + proxy_redirect off; + } + location /ruby_2_7/ { + proxy_pass http://ruby_2_7_app/; + proxy_redirect off; + } + } +}