diff --git a/service/ruby-on-rails/.gitattributes b/service/ruby-on-rails/.gitattributes new file mode 100644 index 0000000..31eeee0 --- /dev/null +++ b/service/ruby-on-rails/.gitattributes @@ -0,0 +1,7 @@ +# See https://git-scm.com/docs/gitattributes for more about git attribute files. + +# Mark the database schema as having been generated. +db/schema.rb linguist-generated + +# Mark any vendored files as having been vendored. +vendor/* linguist-vendored diff --git a/service/ruby-on-rails/.gitignore b/service/ruby-on-rails/.gitignore new file mode 100644 index 0000000..47e2845 --- /dev/null +++ b/service/ruby-on-rails/.gitignore @@ -0,0 +1,23 @@ +# See https://help.github.com/articles/ignoring-files for more about ignoring files. +# +# If you find yourself ignoring temporary files generated by your text editor +# or operating system, you probably want to add a global ignore instead: +# git config --global core.excludesfile '~/.gitignore_global' + +# Ignore bundler config. +.bundle + +# Ignore all logfiles and tempfiles. +log/* +tmp/* +!log/.keep +!tmp/.keep + +# Ignore pidfiles, but keep the directory. +tmp/pids/* +!tmp/pids/ +!tmp/pids/.keep + + +# Ignore master key for decrypting credentials and more. +config/master.key diff --git a/service/ruby-on-rails/.ruby-version b/service/ruby-on-rails/.ruby-version new file mode 100644 index 0000000..be94e6f --- /dev/null +++ b/service/ruby-on-rails/.ruby-version @@ -0,0 +1 @@ +3.2.2 diff --git a/service/ruby-on-rails/Dockerfile b/service/ruby-on-rails/Dockerfile new file mode 100644 index 0000000..c012b49 --- /dev/null +++ b/service/ruby-on-rails/Dockerfile @@ -0,0 +1,14 @@ +FROM ruby:3.2.2-slim + +ENV PORT=8080 + +RUN apt-get update -qq && apt-get install -y build-essential git pkg-config libpq-dev postgresql-client + +WORKDIR /workdir +COPY Gemfile Gemfile.lock /workdir/ +RUN bundle install +COPY . /workdir + +ENTRYPOINT ["/workdir/bin/docker-entrypoint"] + +CMD ["/workdir/bin/rails", "server", "-b", "0.0.0.0"] \ No newline at end of file diff --git a/service/ruby-on-rails/Gemfile b/service/ruby-on-rails/Gemfile new file mode 100644 index 0000000..ee4f611 --- /dev/null +++ b/service/ruby-on-rails/Gemfile @@ -0,0 +1,12 @@ +source "https://rubygems.org" + +ruby "3.2.2" + +gem "bootsnap", require: false +gem "rails", "~> 7.0.4", ">= 7.0.4.3" +gem "pg", "~> 1.1" +gem "puma", "~> 5.0" + +group :development, :test do + gem "debug", platforms: %i[ mri mingw x64_mingw ] +end diff --git a/service/ruby-on-rails/Gemfile.lock b/service/ruby-on-rails/Gemfile.lock new file mode 100644 index 0000000..4133919 --- /dev/null +++ b/service/ruby-on-rails/Gemfile.lock @@ -0,0 +1,170 @@ +GEM + remote: https://rubygems.org/ + specs: + actioncable (7.0.4.3) + actionpack (= 7.0.4.3) + activesupport (= 7.0.4.3) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + actionmailbox (7.0.4.3) + actionpack (= 7.0.4.3) + activejob (= 7.0.4.3) + activerecord (= 7.0.4.3) + activestorage (= 7.0.4.3) + activesupport (= 7.0.4.3) + mail (>= 2.7.1) + net-imap + net-pop + net-smtp + actionmailer (7.0.4.3) + actionpack (= 7.0.4.3) + actionview (= 7.0.4.3) + activejob (= 7.0.4.3) + activesupport (= 7.0.4.3) + mail (~> 2.5, >= 2.5.4) + net-imap + net-pop + net-smtp + rails-dom-testing (~> 2.0) + actionpack (7.0.4.3) + actionview (= 7.0.4.3) + activesupport (= 7.0.4.3) + rack (~> 2.0, >= 2.2.0) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.2.0) + actiontext (7.0.4.3) + actionpack (= 7.0.4.3) + activerecord (= 7.0.4.3) + activestorage (= 7.0.4.3) + activesupport (= 7.0.4.3) + globalid (>= 0.6.0) + nokogiri (>= 1.8.5) + actionview (7.0.4.3) + activesupport (= 7.0.4.3) + builder (~> 3.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.1, >= 1.2.0) + activejob (7.0.4.3) + activesupport (= 7.0.4.3) + globalid (>= 0.3.6) + activemodel (7.0.4.3) + activesupport (= 7.0.4.3) + activerecord (7.0.4.3) + activemodel (= 7.0.4.3) + activesupport (= 7.0.4.3) + activestorage (7.0.4.3) + actionpack (= 7.0.4.3) + activejob (= 7.0.4.3) + activerecord (= 7.0.4.3) + activesupport (= 7.0.4.3) + marcel (~> 1.0) + mini_mime (>= 1.1.0) + activesupport (7.0.4.3) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) + bootsnap (1.16.0) + msgpack (~> 1.2) + builder (3.2.4) + concurrent-ruby (1.2.2) + crass (1.0.6) + date (3.3.3) + debug (1.8.0) + irb (>= 1.5.0) + reline (>= 0.3.1) + erubi (1.12.0) + globalid (1.1.0) + activesupport (>= 5.0) + i18n (1.13.0) + concurrent-ruby (~> 1.0) + io-console (0.6.0) + irb (1.6.4) + reline (>= 0.3.0) + loofah (2.21.3) + crass (~> 1.0.2) + nokogiri (>= 1.12.0) + mail (2.8.1) + mini_mime (>= 0.1.1) + net-imap + net-pop + net-smtp + marcel (1.0.2) + method_source (1.0.0) + mini_mime (1.1.2) + minitest (5.18.0) + msgpack (1.7.1) + net-imap (0.3.4) + date + net-protocol + net-pop (0.1.2) + net-protocol + net-protocol (0.2.1) + timeout + net-smtp (0.3.3) + net-protocol + nio4r (2.5.9) + nokogiri (1.15.1-arm64-darwin) + racc (~> 1.4) + pg (1.5.3) + puma (5.6.5) + nio4r (~> 2.0) + racc (1.6.2) + rack (2.2.7) + rack-test (2.1.0) + rack (>= 1.3) + rails (7.0.4.3) + actioncable (= 7.0.4.3) + actionmailbox (= 7.0.4.3) + actionmailer (= 7.0.4.3) + actionpack (= 7.0.4.3) + actiontext (= 7.0.4.3) + actionview (= 7.0.4.3) + activejob (= 7.0.4.3) + activemodel (= 7.0.4.3) + activerecord (= 7.0.4.3) + activestorage (= 7.0.4.3) + activesupport (= 7.0.4.3) + bundler (>= 1.15.0) + railties (= 7.0.4.3) + rails-dom-testing (2.0.3) + activesupport (>= 4.2.0) + nokogiri (>= 1.6) + rails-html-sanitizer (1.5.0) + loofah (~> 2.19, >= 2.19.1) + railties (7.0.4.3) + actionpack (= 7.0.4.3) + activesupport (= 7.0.4.3) + method_source + rake (>= 12.2) + thor (~> 1.0) + zeitwerk (~> 2.5) + rake (13.0.6) + reline (0.3.4) + io-console (~> 0.5) + thor (1.2.2) + timeout (0.3.2) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + websocket-driver (0.7.5) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.5) + zeitwerk (2.6.8) + +PLATFORMS + arm64-darwin-22 + +DEPENDENCIES + bootsnap + debug + pg (~> 1.1) + puma (~> 5.0) + rails (~> 7.0.4, >= 7.0.4.3) + +RUBY VERSION + ruby 3.2.2p53 + +BUNDLED WITH + 2.4.13 diff --git a/service/ruby-on-rails/README.md b/service/ruby-on-rails/README.md new file mode 100644 index 0000000..a30ca38 --- /dev/null +++ b/service/ruby-on-rails/README.md @@ -0,0 +1,60 @@ +# Ruby on Rails - Eco Benchmark + +## Context + +https://github.com/Boavizta/ecobenchmark-applicationweb-backend + +## Application + +### Generation + +``` +rails new ecobenchmark \ + --api \ + --database=postgresql \ + --skip-action-mailer \ + --skip-action-mailbox \ + --skip-action-text \ + --skip-active-job \ + --skip-active-storage \ + --skip-action-cable \ + --skip-asset-pipeline \ + --skip-javascript \ + --skip-hotwire \ + --skip-test \ + --skip-system-test +``` + +### Specifities + +#### Creation timestamp + +To use `creation_date` as the creation timestamp instead of the Rails-default `created_at`, we set an alias in `app/models/application_record.rb` + +```rb +class ApplicationRecord < ActiveRecord::Base + # ... + + alias_attribute :created_at, :creation_date +end +``` + +#### Initial schema + +Because database tables are already defined, we create the database schema with a database migration file present in the `db/migrations` folder. + +The `if_not_exists` prevent the application to override the existing database. + +#### Docker-Composer hostname + +On the Docker-Compose network, the app is named "service", so the runner will make requests to "http://service:8080". + +By default, Rails blocks unknown hosts, so we need to add it to the configuration, in `config/environments/development.rb`. + +#### SQL requests implementation + +To respect the contribution guidelines, we use custom classes (in `app/lib` folder) to generate the responses for the GET requests. + +As for the POST requests, the SQL requests generated by the ORM are pretty much the same, the only minor difference is that the `id` attribute is not present in the INSERT INTO as an input, but as the output of the request. + +Thus, the request `INSERT INTO account(id, login, creation_date) values ($1, $2, $3)` becomes `INSERT INTO account(login, creation_date) values ($2, $3) RETURNING id`. \ No newline at end of file diff --git a/service/ruby-on-rails/Rakefile b/service/ruby-on-rails/Rakefile new file mode 100644 index 0000000..9a5ea73 --- /dev/null +++ b/service/ruby-on-rails/Rakefile @@ -0,0 +1,6 @@ +# Add your own tasks in files placed in lib/tasks ending in .rake, +# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. + +require_relative "config/application" + +Rails.application.load_tasks diff --git a/service/ruby-on-rails/app/controllers/accounts_controller.rb b/service/ruby-on-rails/app/controllers/accounts_controller.rb new file mode 100644 index 0000000..0be06ee --- /dev/null +++ b/service/ruby-on-rails/app/controllers/accounts_controller.rb @@ -0,0 +1,10 @@ +class AccountsController < ApplicationController + def create + @account = Account.new(login: params[:login]) + if @account.save + render json: @account, status: :created + else + render json: @account.errors, status: :bad_request + end + end +end diff --git a/service/ruby-on-rails/app/controllers/application_controller.rb b/service/ruby-on-rails/app/controllers/application_controller.rb new file mode 100644 index 0000000..4ac8823 --- /dev/null +++ b/service/ruby-on-rails/app/controllers/application_controller.rb @@ -0,0 +1,2 @@ +class ApplicationController < ActionController::API +end diff --git a/service/ruby-on-rails/app/controllers/concerns/.keep b/service/ruby-on-rails/app/controllers/concerns/.keep new file mode 100644 index 0000000..e69de29 diff --git a/service/ruby-on-rails/app/controllers/health_controller.rb b/service/ruby-on-rails/app/controllers/health_controller.rb new file mode 100644 index 0000000..39827e2 --- /dev/null +++ b/service/ruby-on-rails/app/controllers/health_controller.rb @@ -0,0 +1,5 @@ +class HealthController < ApplicationController + def check + head :no_content + end +end diff --git a/service/ruby-on-rails/app/controllers/lists_controller.rb b/service/ruby-on-rails/app/controllers/lists_controller.rb new file mode 100644 index 0000000..00bcb31 --- /dev/null +++ b/service/ruby-on-rails/app/controllers/lists_controller.rb @@ -0,0 +1,23 @@ + +class ListsController < ApplicationController + before_action :load_account + + def index + render json: ListResponse.generate(@account.id, params[:page]) + end + + def create + @list = @account.lists.new(params.permit(:name)) + if @list.save + render json: @list, status: :created + else + render json: @list.errors, status: :bad_request + end + end + + private + + def load_account + @account = Account.find(params[:account_id]) + end +end diff --git a/service/ruby-on-rails/app/controllers/stats_controller.rb b/service/ruby-on-rails/app/controllers/stats_controller.rb new file mode 100644 index 0000000..9433f72 --- /dev/null +++ b/service/ruby-on-rails/app/controllers/stats_controller.rb @@ -0,0 +1,5 @@ +class StatsController < ApplicationController + def index + render json: StatResponse.generate + end +end diff --git a/service/ruby-on-rails/app/controllers/tasks_controller.rb b/service/ruby-on-rails/app/controllers/tasks_controller.rb new file mode 100644 index 0000000..091e595 --- /dev/null +++ b/service/ruby-on-rails/app/controllers/tasks_controller.rb @@ -0,0 +1,19 @@ + +class TasksController < ApplicationController + before_action :load_list + + def create + @task = @list.tasks.new(params.permit(:name, :description)) + if @task.save + render json: @task, status: :created + else + render json: @task.errors, status: :bad_request + end + end + + private + + def load_list + @list = List.find(params[:list_id]) + end +end diff --git a/service/ruby-on-rails/app/lib/list_response.rb b/service/ruby-on-rails/app/lib/list_response.rb new file mode 100644 index 0000000..2b1a191 --- /dev/null +++ b/service/ruby-on-rails/app/lib/list_response.rb @@ -0,0 +1,42 @@ +class ListResponse + attr_reader :id, :name, :creation_date, :account_id + attr_accessor :tasks + + def self.generate(account_id, page = nil) + lists = [] + sql_results(account_id, page.to_i - 1).each do |sql_result| + list = lists.detect { |l| l.id == sql_result["id"] } + if list.nil? + list = new(sql_result) + lists << list + end + list.tasks << TaskResponse.new(sql_result) + end + lists + end + + def initialize(sql_result) + @id = sql_result["id"] + @name = sql_result["name"] + @creation_date = sql_result["creation_date"] + @account_id = sql_result["account_id"] + @tasks = [] + end + + private + + def self.sql_results(account_id, page) + ActiveRecord::Base.connection.execute(" + SELECT l.id, l.name, l.creation_date, l.account_id, t.id AS task_id, t.name AS task_name, t.description, t.creation_date AS task_creation_date + FROM list l + LEFT JOIN task t ON l.id = t.list_id + WHERE l.account_id = '#{account_id}' AND l.id IN ( + SELECT id + FROM list + WHERE account_id = '#{account_id}' + LIMIT 10 + OFFSET #{10 * (page < 0 ? 0 : page)} + ) + ") + end +end \ No newline at end of file diff --git a/service/ruby-on-rails/app/lib/stat_response.rb b/service/ruby-on-rails/app/lib/stat_response.rb new file mode 100644 index 0000000..308ed25 --- /dev/null +++ b/service/ruby-on-rails/app/lib/stat_response.rb @@ -0,0 +1,34 @@ +class StatResponse + attr_reader :account_id, :account_login, :nb_list, :avg_tasks + + def self.generate + stats = [] + sql_results.each do |sql_result| + stats << new(sql_result) + end + stats + end + + def initialize(sql_result) + @account_id = sql_result["id"] + @account_login = sql_result["login"] + @nb_list = sql_result["nb_list"].to_i + @avg_tasks = sql_result["avg_tasks"].to_f + end + + private + + def self.sql_results + ActiveRecord::Base.connection.execute(" + SELECT id, login, COUNT(list_id) AS nb_list, ROUND(AVG(nb_tasks), 2) AS avg_tasks + FROM ( + SELECT account.id, account.login, list.id list_id, COUNT(task.id) nb_tasks + FROM account + INNER JOIN list ON (list.account_id = account.id) + LEFT JOIN task ON (task.list_id = list.id) + GROUP BY account.id, account.login, list.id + ) t + GROUP BY id, login + ") + end +end \ No newline at end of file diff --git a/service/ruby-on-rails/app/lib/task_response.rb b/service/ruby-on-rails/app/lib/task_response.rb new file mode 100644 index 0000000..97db12d --- /dev/null +++ b/service/ruby-on-rails/app/lib/task_response.rb @@ -0,0 +1,10 @@ +class TaskResponse + attr_reader :id, :name, :description, :creation_date + + def initialize(sql_result) + @id = sql_result["task_id"] + @name = sql_result["task_name"] + @description = sql_result["description"] + @creation_date = sql_result["task_creation_date"] + end +end \ No newline at end of file diff --git a/service/ruby-on-rails/app/models/account.rb b/service/ruby-on-rails/app/models/account.rb new file mode 100644 index 0000000..906de09 --- /dev/null +++ b/service/ruby-on-rails/app/models/account.rb @@ -0,0 +1,7 @@ +class Account < ApplicationRecord + self.table_name = "account" + + has_many :lists + + validates :login, presence: true +end \ No newline at end of file diff --git a/service/ruby-on-rails/app/models/application_record.rb b/service/ruby-on-rails/app/models/application_record.rb new file mode 100644 index 0000000..aa83bea --- /dev/null +++ b/service/ruby-on-rails/app/models/application_record.rb @@ -0,0 +1,5 @@ +class ApplicationRecord < ActiveRecord::Base + primary_abstract_class + + alias_attribute :created_at, :creation_date +end diff --git a/service/ruby-on-rails/app/models/concerns/.keep b/service/ruby-on-rails/app/models/concerns/.keep new file mode 100644 index 0000000..e69de29 diff --git a/service/ruby-on-rails/app/models/list.rb b/service/ruby-on-rails/app/models/list.rb new file mode 100644 index 0000000..885a420 --- /dev/null +++ b/service/ruby-on-rails/app/models/list.rb @@ -0,0 +1,8 @@ +class List < ApplicationRecord + self.table_name = "list" + + belongs_to :account + has_many :tasks + + validates :name, presence: true +end diff --git a/service/ruby-on-rails/app/models/task.rb b/service/ruby-on-rails/app/models/task.rb new file mode 100644 index 0000000..e9b2791 --- /dev/null +++ b/service/ruby-on-rails/app/models/task.rb @@ -0,0 +1,5 @@ +class Task < ApplicationRecord + self.table_name = "task" + + belongs_to :list +end \ No newline at end of file diff --git a/service/ruby-on-rails/bin/bundle b/service/ruby-on-rails/bin/bundle new file mode 100755 index 0000000..42c7fd7 --- /dev/null +++ b/service/ruby-on-rails/bin/bundle @@ -0,0 +1,109 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'bundle' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "rubygems" + +m = Module.new do + module_function + + def invoked_as_script? + File.expand_path($0) == File.expand_path(__FILE__) + end + + def env_var_version + ENV["BUNDLER_VERSION"] + end + + def cli_arg_version + return unless invoked_as_script? # don't want to hijack other binstubs + return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update` + bundler_version = nil + update_index = nil + ARGV.each_with_index do |a, i| + if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN + bundler_version = a + end + next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/ + bundler_version = $1 + update_index = i + end + bundler_version + end + + def gemfile + gemfile = ENV["BUNDLE_GEMFILE"] + return gemfile if gemfile && !gemfile.empty? + + File.expand_path("../Gemfile", __dir__) + end + + def lockfile + lockfile = + case File.basename(gemfile) + when "gems.rb" then gemfile.sub(/\.rb$/, ".locked") + else "#{gemfile}.lock" + end + File.expand_path(lockfile) + end + + def lockfile_version + return unless File.file?(lockfile) + lockfile_contents = File.read(lockfile) + return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/ + Regexp.last_match(1) + end + + def bundler_requirement + @bundler_requirement ||= + env_var_version || + cli_arg_version || + bundler_requirement_for(lockfile_version) + end + + def bundler_requirement_for(version) + return "#{Gem::Requirement.default}.a" unless version + + bundler_gem_version = Gem::Version.new(version) + + bundler_gem_version.approximate_recommendation + end + + def load_bundler! + ENV["BUNDLE_GEMFILE"] ||= gemfile + + activate_bundler + end + + def activate_bundler + gem_error = activation_error_handling do + gem "bundler", bundler_requirement + end + return if gem_error.nil? + require_error = activation_error_handling do + require "bundler/version" + end + return if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION)) + warn "Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`" + exit 42 + end + + def activation_error_handling + yield + nil + rescue StandardError, LoadError => e + e + end +end + +m.load_bundler! + +if m.invoked_as_script? + load Gem.bin_path("bundler", "bundle") +end diff --git a/service/ruby-on-rails/bin/rails b/service/ruby-on-rails/bin/rails new file mode 100755 index 0000000..efc0377 --- /dev/null +++ b/service/ruby-on-rails/bin/rails @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +APP_PATH = File.expand_path("../config/application", __dir__) +require_relative "../config/boot" +require "rails/commands" diff --git a/service/ruby-on-rails/bin/rake b/service/ruby-on-rails/bin/rake new file mode 100755 index 0000000..4fbf10b --- /dev/null +++ b/service/ruby-on-rails/bin/rake @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +require_relative "../config/boot" +require "rake" +Rake.application.run diff --git a/service/ruby-on-rails/bin/setup b/service/ruby-on-rails/bin/setup new file mode 100755 index 0000000..ec47b79 --- /dev/null +++ b/service/ruby-on-rails/bin/setup @@ -0,0 +1,33 @@ +#!/usr/bin/env ruby +require "fileutils" + +# path to your application root. +APP_ROOT = File.expand_path("..", __dir__) + +def system!(*args) + system(*args) || abort("\n== Command #{args} failed ==") +end + +FileUtils.chdir APP_ROOT do + # This script is a way to set up or update your development environment automatically. + # This script is idempotent, so that you can run it at any time and get an expectable outcome. + # Add necessary setup steps to this file. + + puts "== Installing dependencies ==" + system! "gem install bundler --conservative" + system("bundle check") || system!("bundle install") + + # puts "\n== Copying sample files ==" + # unless File.exist?("config/database.yml") + # FileUtils.cp "config/database.yml.sample", "config/database.yml" + # end + + puts "\n== Preparing database ==" + system! "bin/rails db:prepare" + + puts "\n== Removing old logs and tempfiles ==" + system! "bin/rails log:clear tmp:clear" + + puts "\n== Restarting application server ==" + system! "bin/rails restart" +end diff --git a/service/ruby-on-rails/config.ru b/service/ruby-on-rails/config.ru new file mode 100644 index 0000000..4a3c09a --- /dev/null +++ b/service/ruby-on-rails/config.ru @@ -0,0 +1,6 @@ +# This file is used by Rack-based servers to start the application. + +require_relative "config/environment" + +run Rails.application +Rails.application.load_server diff --git a/service/ruby-on-rails/config/application.rb b/service/ruby-on-rails/config/application.rb new file mode 100644 index 0000000..91cd895 --- /dev/null +++ b/service/ruby-on-rails/config/application.rb @@ -0,0 +1,31 @@ +require_relative "boot" + +require "rails" +# Pick the frameworks you want: +require "active_model/railtie" +require "active_record/railtie" +require "action_controller/railtie" +require "action_view/railtie" + +# Require the gems listed in Gemfile, including any gems +# you've limited to :test, :development, or :production. +Bundler.require(*Rails.groups) + +module Ecobenchmark + class Application < Rails::Application + # Initialize configuration defaults for originally generated Rails version. + config.load_defaults 7.0 + + # Configuration for the application, engines, and railties goes here. + # + # These settings can be overridden in specific environments using the files + # in config/environments, which are processed later. + # + # config.time_zone = "Europe/Paris" + + # Only loads a smaller set of middleware suitable for API only apps. + # Middleware like session, flash, cookies can be added back manually. + # Skip views, helpers and assets when generating a new resource. + config.api_only = true + end +end diff --git a/service/ruby-on-rails/config/boot.rb b/service/ruby-on-rails/config/boot.rb new file mode 100644 index 0000000..988a5dd --- /dev/null +++ b/service/ruby-on-rails/config/boot.rb @@ -0,0 +1,4 @@ +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +require "bundler/setup" # Set up gems listed in the Gemfile. +require "bootsnap/setup" # Speed up boot time by caching expensive operations. diff --git a/service/ruby-on-rails/config/credentials.yml.enc b/service/ruby-on-rails/config/credentials.yml.enc new file mode 100644 index 0000000..de92371 --- /dev/null +++ b/service/ruby-on-rails/config/credentials.yml.enc @@ -0,0 +1 @@ +eJlUTMf5grg0faGyX7+9t9+QELy9f3q17wkr6iz9L2E9aU0nChd3Td3eNECY4qafr7EFbU8P452igioKPPeHmuYohXohCOd57B5uBsyb0GNGc19ivV9JZ+zowboLHpzG25cXXGJ/1k3R71ypvLHXwGg0LvG8gyDxei9nTvs2TKlWS/tkX3n8ACsshESkWC7+3WvK4QcsNCEpkrGKivs5xJUqRw8L56vGAJMQ5PGgIyLR+EBfrmXVvPDr3fHjj99TqczdA5aDjpiLwLj3ak5cuGT8j4sWlw6Q6SHGufCHssaTXJnd//oY21kNtpErYa2gTR2W1WRkF85uuErK7Mp3giKFgJC51F3w8e5R032VsMy4Vu99hRz9ClzNETh7WlwS3EVgPPjdg6AA2IgeMCw8UEFeLLPmSZN+EwWP--8iPlzLpLaLEhWCmN--F94K80VRBcZQQzxTJEQx+A== \ No newline at end of file diff --git a/service/ruby-on-rails/config/database.yml b/service/ruby-on-rails/config/database.yml new file mode 100644 index 0000000..26e1916 --- /dev/null +++ b/service/ruby-on-rails/config/database.yml @@ -0,0 +1,86 @@ +# PostgreSQL. Versions 9.3 and up are supported. +# +# Install the pg driver: +# gem install pg +# On macOS with Homebrew: +# gem install pg -- --with-pg-config=/usr/local/bin/pg_config +# On macOS with MacPorts: +# gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config +# On Windows: +# gem install pg +# Choose the win32 build. +# Install PostgreSQL and put its /bin directory on your path. +# +# Configure Using Gemfile +# gem "pg" +# +default: &default + adapter: postgresql + encoding: unicode + # For details on connection pooling, see Rails configuration guide + # https://guides.rubyonrails.org/configuring.html#database-pooling + pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> + +development: + <<: *default + database: ecobenchmark_development + + # The specified database role being used to connect to postgres. + # To create additional roles in postgres see `$ createuser --help`. + # When left blank, postgres will use the default role. This is + # the same name as the operating system user running Rails. + #username: ecobenchmark + + # The password associated with the postgres role (username). + #password: + + # Connect on a TCP socket. Omitted by default since the client uses a + # domain socket that doesn't need configuration. Windows does not have + # domain sockets, so uncomment these lines. + #host: localhost + + # The TCP port the server listens on. Defaults to 5432. + # If your server runs on a different port number, change accordingly. + #port: 5432 + + # Schema search path. The server defaults to $user,public + #schema_search_path: myapp,sharedapp,public + + # Minimum log levels, in increasing order: + # debug5, debug4, debug3, debug2, debug1, + # log, notice, warning, error, fatal, and panic + # Defaults to warning. + #min_messages: notice + +# Warning: The database defined as "test" will be erased and +# re-generated from your development database when you run "rake". +# Do not set this db to the same as development or production. +test: + <<: *default + database: ecobenchmark_test + +# As with config/credentials.yml, you never want to store sensitive information, +# like your database password, in your source code. If your source code is +# ever seen by anyone, they now have access to your database. +# +# Instead, provide the password or a full connection URL as an environment +# variable when you boot the app. For example: +# +# DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase" +# +# If the connection URL is provided in the special DATABASE_URL environment +# variable, Rails will automatically merge its configuration values on top of +# the values provided in this file. Alternatively, you can specify a connection +# URL environment variable explicitly: +# +# production: +# url: <%= ENV["MY_APP_DATABASE_URL"] %> +# +# Read https://guides.rubyonrails.org/configuring.html#configuring-a-database +# for a full overview on how database connection configuration can be specified. +# +production: + <<: *default + database: ecobenchmark_production + username: ecobenchmark + password: <%= ENV["ECOBENCHMARK_DATABASE_PASSWORD"] %> diff --git a/service/ruby-on-rails/config/environment.rb b/service/ruby-on-rails/config/environment.rb new file mode 100644 index 0000000..cac5315 --- /dev/null +++ b/service/ruby-on-rails/config/environment.rb @@ -0,0 +1,5 @@ +# Load the Rails application. +require_relative "application" + +# Initialize the Rails application. +Rails.application.initialize! diff --git a/service/ruby-on-rails/config/environments/development.rb b/service/ruby-on-rails/config/environments/development.rb new file mode 100644 index 0000000..694f814 --- /dev/null +++ b/service/ruby-on-rails/config/environments/development.rb @@ -0,0 +1,60 @@ +require "active_support/core_ext/integer/time" + +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # In the development environment your application's code is reloaded any time + # it changes. This slows down response time but is perfect for development + # since you don't have to restart the web server when you make code changes. + config.cache_classes = false + + # Do not eager load code on boot. + config.eager_load = false + + # Show full error reports. + config.consider_all_requests_local = true + + # Enable server timing + config.server_timing = true + + # Enable/disable caching. By default caching is disabled. + # Run rails dev:cache to toggle caching. + if Rails.root.join("tmp/caching-dev.txt").exist? + config.cache_store = :memory_store + config.public_file_server.headers = { + "Cache-Control" => "public, max-age=#{2.days.to_i}" + } + else + config.action_controller.perform_caching = false + + config.cache_store = :null_store + end + + # Print deprecation notices to the Rails logger. + config.active_support.deprecation = :log + + # Raise exceptions for disallowed deprecations. + config.active_support.disallowed_deprecation = :raise + + # Tell Active Support which deprecation messages to disallow. + config.active_support.disallowed_deprecation_warnings = [] + + # Raise an error on page load if there are pending migrations. + config.active_record.migration_error = :page_load + + # Highlight code that triggered database queries in logs. + config.active_record.verbose_query_logs = true + + + # Raises error for missing translations. + # config.i18n.raise_on_missing_translations = true + + # Annotate rendered view with file names. + # config.action_view.annotate_rendered_view_with_filenames = true + + # Uncomment if you wish to allow Action Cable access from any origin. + # config.action_cable.disable_request_forgery_protection = true + + # For Docker-Compose + config.hosts << "service" +end diff --git a/service/ruby-on-rails/config/environments/production.rb b/service/ruby-on-rails/config/environments/production.rb new file mode 100644 index 0000000..f501aaa --- /dev/null +++ b/service/ruby-on-rails/config/environments/production.rb @@ -0,0 +1,68 @@ +require "active_support/core_ext/integer/time" + +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # Code is not reloaded between requests. + config.cache_classes = true + + # Eager load code on boot. This eager loads most of Rails and + # your application in memory, allowing both threaded web servers + # and those relying on copy on write to perform better. + # Rake tasks automatically ignore this option for performance. + config.eager_load = true + + # Full error reports are disabled and caching is turned on. + config.consider_all_requests_local = false + + # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"] + # or in config/master.key. This key is used to decrypt credentials (and other encrypted files). + # config.require_master_key = true + + # Disable serving static files from the `/public` folder by default since + # Apache or NGINX already handles this. + config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present? + + # Enable serving of images, stylesheets, and JavaScripts from an asset server. + # config.asset_host = "http://assets.example.com" + + # Specifies the header that your server uses for sending files. + # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache + # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX + + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. + # config.force_ssl = true + + # Include generic and useful information about system operation, but avoid logging too much + # information to avoid inadvertent exposure of personally identifiable information (PII). + config.log_level = :info + + # Prepend all log lines with the following tags. + config.log_tags = [ :request_id ] + + # Use a different cache store in production. + # config.cache_store = :mem_cache_store + + # Enable locale fallbacks for I18n (makes lookups for any locale fall back to + # the I18n.default_locale when a translation cannot be found). + config.i18n.fallbacks = true + + # Don't log any deprecations. + config.active_support.report_deprecations = false + + # Use default logging formatter so that PID and timestamp are not suppressed. + config.log_formatter = ::Logger::Formatter.new + + # Use a different logger for distributed setups. + # require "syslog/logger" + # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name") + + if ENV["RAILS_LOG_TO_STDOUT"].present? + logger = ActiveSupport::Logger.new(STDOUT) + logger.formatter = config.log_formatter + config.logger = ActiveSupport::TaggedLogging.new(logger) + end + + # Do not dump schema after migrations. + config.active_record.dump_schema_after_migration = false +end diff --git a/service/ruby-on-rails/config/environments/test.rb b/service/ruby-on-rails/config/environments/test.rb new file mode 100644 index 0000000..eb2f171 --- /dev/null +++ b/service/ruby-on-rails/config/environments/test.rb @@ -0,0 +1,50 @@ +require "active_support/core_ext/integer/time" + +# The test environment is used exclusively to run your application's +# test suite. You never need to work with it otherwise. Remember that +# your test database is "scratch space" for the test suite and is wiped +# and recreated between test runs. Don't rely on the data there! + +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # Turn false under Spring and add config.action_view.cache_template_loading = true. + config.cache_classes = true + + # Eager loading loads your whole application. When running a single test locally, + # this probably isn't necessary. It's a good idea to do in a continuous integration + # system, or in some way before deploying your code. + config.eager_load = ENV["CI"].present? + + # Configure public file server for tests with Cache-Control for performance. + config.public_file_server.enabled = true + config.public_file_server.headers = { + "Cache-Control" => "public, max-age=#{1.hour.to_i}" + } + + # Show full error reports and disable caching. + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + config.cache_store = :null_store + + # Raise exceptions instead of rendering exception templates. + config.action_dispatch.show_exceptions = false + + # Disable request forgery protection in test environment. + config.action_controller.allow_forgery_protection = false + + # Print deprecation notices to the stderr. + config.active_support.deprecation = :stderr + + # Raise exceptions for disallowed deprecations. + config.active_support.disallowed_deprecation = :raise + + # Tell Active Support which deprecation messages to disallow. + config.active_support.disallowed_deprecation_warnings = [] + + # Raises error for missing translations. + # config.i18n.raise_on_missing_translations = true + + # Annotate rendered view with file names. + # config.action_view.annotate_rendered_view_with_filenames = true +end diff --git a/service/ruby-on-rails/config/initializers/cors.rb b/service/ruby-on-rails/config/initializers/cors.rb new file mode 100644 index 0000000..e5a82f1 --- /dev/null +++ b/service/ruby-on-rails/config/initializers/cors.rb @@ -0,0 +1,16 @@ +# Be sure to restart your server when you modify this file. + +# Avoid CORS issues when API is called from the frontend app. +# Handle Cross-Origin Resource Sharing (CORS) in order to accept cross-origin AJAX requests. + +# Read more: https://github.com/cyu/rack-cors + +# Rails.application.config.middleware.insert_before 0, Rack::Cors do +# allow do +# origins "example.com" +# +# resource "*", +# headers: :any, +# methods: [:get, :post, :put, :patch, :delete, :options, :head] +# end +# end diff --git a/service/ruby-on-rails/config/initializers/filter_parameter_logging.rb b/service/ruby-on-rails/config/initializers/filter_parameter_logging.rb new file mode 100644 index 0000000..adc6568 --- /dev/null +++ b/service/ruby-on-rails/config/initializers/filter_parameter_logging.rb @@ -0,0 +1,8 @@ +# Be sure to restart your server when you modify this file. + +# Configure parameters to be filtered from the log file. Use this to limit dissemination of +# sensitive information. See the ActiveSupport::ParameterFilter documentation for supported +# notations and behaviors. +Rails.application.config.filter_parameters += [ + :passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn +] diff --git a/service/ruby-on-rails/config/initializers/inflections.rb b/service/ruby-on-rails/config/initializers/inflections.rb new file mode 100644 index 0000000..3860f65 --- /dev/null +++ b/service/ruby-on-rails/config/initializers/inflections.rb @@ -0,0 +1,16 @@ +# Be sure to restart your server when you modify this file. + +# Add new inflection rules using the following format. Inflections +# are locale specific, and you may define rules for as many different +# locales as you wish. All of these examples are active by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.plural /^(ox)$/i, "\\1en" +# inflect.singular /^(ox)en/i, "\\1" +# inflect.irregular "person", "people" +# inflect.uncountable %w( fish sheep ) +# end + +# These inflection rules are supported but not enabled by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.acronym "RESTful" +# end diff --git a/service/ruby-on-rails/config/locales/en.yml b/service/ruby-on-rails/config/locales/en.yml new file mode 100644 index 0000000..8ca56fc --- /dev/null +++ b/service/ruby-on-rails/config/locales/en.yml @@ -0,0 +1,33 @@ +# Files in the config/locales directory are used for internationalization +# and are automatically loaded by Rails. If you want to use locales other +# than English, add the necessary files in this directory. +# +# To use the locales, use `I18n.t`: +# +# I18n.t "hello" +# +# In views, this is aliased to just `t`: +# +# <%= t("hello") %> +# +# To use a different locale, set it with `I18n.locale`: +# +# I18n.locale = :es +# +# This would use the information in config/locales/es.yml. +# +# The following keys must be escaped otherwise they will not be retrieved by +# the default I18n backend: +# +# true, false, on, off, yes, no +# +# Instead, surround them with single quotes. +# +# en: +# "true": "foo" +# +# To learn more, please read the Rails Internationalization guide +# available at https://guides.rubyonrails.org/i18n.html. + +en: + hello: "Hello world" diff --git a/service/ruby-on-rails/config/puma.rb b/service/ruby-on-rails/config/puma.rb new file mode 100644 index 0000000..daaf036 --- /dev/null +++ b/service/ruby-on-rails/config/puma.rb @@ -0,0 +1,43 @@ +# Puma can serve each request in a thread from an internal thread pool. +# The `threads` method setting takes two numbers: a minimum and maximum. +# Any libraries that use thread pools should be configured to match +# the maximum value specified for Puma. Default is set to 5 threads for minimum +# and maximum; this matches the default thread size of Active Record. +# +max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 } +min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count } +threads min_threads_count, max_threads_count + +# Specifies the `worker_timeout` threshold that Puma will use to wait before +# terminating a worker in development environments. +# +worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development" + +# Specifies the `port` that Puma will listen on to receive requests; default is 3000. +# +port ENV.fetch("PORT") { 3000 } + +# Specifies the `environment` that Puma will run in. +# +environment ENV.fetch("RAILS_ENV") { "development" } + +# Specifies the `pidfile` that Puma will use. +pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" } + +# Specifies the number of `workers` to boot in clustered mode. +# Workers are forked web server processes. If using threads and workers together +# the concurrency of the application would be max `threads` * `workers`. +# Workers do not work on JRuby or Windows (both of which do not support +# processes). +# +# workers ENV.fetch("WEB_CONCURRENCY") { 2 } + +# Use the `preload_app!` method when specifying a `workers` number. +# This directive tells Puma to first boot the application and load code +# before forking the application. This takes advantage of Copy On Write +# process behavior so workers use less memory. +# +# preload_app! + +# Allow puma to be restarted by `bin/rails restart` command. +plugin :tmp_restart diff --git a/service/ruby-on-rails/config/routes.rb b/service/ruby-on-rails/config/routes.rb new file mode 100644 index 0000000..df26c00 --- /dev/null +++ b/service/ruby-on-rails/config/routes.rb @@ -0,0 +1,10 @@ +Rails.application.routes.draw do + match "/healthcheck" => "health#check", via: :head + + post "/api/accounts" => "accounts#create" + post "/api/accounts/:account_id/lists" => "lists#create" + post "/api/lists/:list_id/tasks" => "tasks#create" + + get "/api/accounts/:account_id/lists" => "lists#index" + get "/api/stats" => "stats#index" +end diff --git a/service/ruby-on-rails/db/migrate/20230521074342_create_schema.rb b/service/ruby-on-rails/db/migrate/20230521074342_create_schema.rb new file mode 100644 index 0000000..d2872f1 --- /dev/null +++ b/service/ruby-on-rails/db/migrate/20230521074342_create_schema.rb @@ -0,0 +1,61 @@ +class CreateSchema < ActiveRecord::Migration[7.0] + def change + # Required for UUIDs + enable_extension "pgcrypto" + + # CREATE TABLE account + # ( + # id uuid primary key default gen_random_uuid(), + # login text, + # creation_date timestamptz default now() + # ); + # + # CREATE INDEX idx_account_creation_date + # ON account(creation_date); + create_table :account, id: :uuid, if_not_exists: true do |t| + t.text :login + t.timestamptz :creation_date, null: false, index: { name: :idx_account_creation_date } + end + + # CREATE TABLE list + # ( + # id uuid primary key default gen_random_uuid(), + # account_id uuid references account(id), + # name text, + # creation_date timestamptz default now() + # ); + # + # CREATE INDEX idx_list_account_id + # ON list(account_id); + # + # CREATE INDEX idx_list_creation_date + # ON list(creation_date); + create_table :list, id: :uuid, if_not_exists: true do |t| + t.references :account, type: :uuid, null: false, foreign_key: { to_table: :account }, index: { name: :idx_list_account_id } + t.text :name + t.timestamptz :creation_date, null: false, index: { name: :idx_list_creation_date } + end + + # CREATE TABLE task + # ( + # id uuid primary key default gen_random_uuid(), + # list_id uuid references list(id), + # name text, + # description text, + # creation_date timestamptz default now() + # ); + # + # CREATE INDEX idx_task_list_id + # ON task(list_id); + # + # CREATE INDEX idx_task_creation_date + # ON task(creation_date); + create_table :task, id: :uuid, if_not_exists: true do |t| + t.references :list, type: :uuid, null: false, foreign_key: { to_table: :list }, index: { name: :idx_task_list_id } + t.text :name + t.text :description + t.timestamptz :creation_date, null: false, index: { name: :idx_task_creation_date } + end + + end +end diff --git a/service/ruby-on-rails/db/schema.rb b/service/ruby-on-rails/db/schema.rb new file mode 100644 index 0000000..9ea630b --- /dev/null +++ b/service/ruby-on-rails/db/schema.rb @@ -0,0 +1,43 @@ +# This file is auto-generated from the current state of the database. Instead +# of editing this file, please use the migrations feature of Active Record to +# incrementally modify your database, and then regenerate this schema definition. +# +# This file is the source Rails uses to define your schema when running `bin/rails +# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to +# be faster and is potentially less error prone than running all of your +# migrations from scratch. Old migrations may fail to apply correctly if those +# migrations use external dependencies or application code. +# +# It's strongly recommended that you check this file into your version control system. + +ActiveRecord::Schema[7.0].define(version: 2023_05_21_074342) do + # These are extensions that must be enabled in order to support this database + enable_extension "pgcrypto" + enable_extension "plpgsql" + + create_table "account", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| + t.text "login" + t.timestamptz "creation_date", null: false + t.index ["creation_date"], name: "idx_account_creation_date" + end + + create_table "list", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| + t.uuid "account_id", null: false + t.text "name" + t.timestamptz "creation_date", null: false + t.index ["account_id"], name: "idx_list_account_id" + t.index ["creation_date"], name: "idx_list_creation_date" + end + + create_table "task", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| + t.uuid "list_id", null: false + t.text "name" + t.text "description" + t.timestamptz "creation_date", null: false + t.index ["creation_date"], name: "idx_task_creation_date" + t.index ["list_id"], name: "idx_task_list_id" + end + + add_foreign_key "list", "account" + add_foreign_key "task", "list" +end diff --git a/service/ruby-on-rails/db/seeds.rb b/service/ruby-on-rails/db/seeds.rb new file mode 100644 index 0000000..bc25fce --- /dev/null +++ b/service/ruby-on-rails/db/seeds.rb @@ -0,0 +1,7 @@ +# This file should contain all the record creation needed to seed the database with its default values. +# The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup). +# +# Examples: +# +# movies = Movie.create([{ name: "Star Wars" }, { name: "Lord of the Rings" }]) +# Character.create(name: "Luke", movie: movies.first) diff --git a/service/ruby-on-rails/docker-compose.yml b/service/ruby-on-rails/docker-compose.yml new file mode 100644 index 0000000..5e58b9e --- /dev/null +++ b/service/ruby-on-rails/docker-compose.yml @@ -0,0 +1,52 @@ +services: + runner: + image: jdrouet/eco-benchmark:runner-default + build: ../../runner + command: + - run + - "--vus" + - "2" + - "--duration" + - "1m" + - "--env" + - "SERVER_HOST=service:8080" + - "/config/scenario.js" + depends_on: + - service + + service: + image: jdrouet/eco-benchmark:service-ruby-on-rails-default + build: . + depends_on: + - database + environment: + - DATABASE_URL=postgres://postgres:mysecretpassword@database:5432/postgres + - DATABASE_POOL_MAX=20 + restart: unless-stopped + + database: + image: jdrouet/eco-benchmark:database-default + build: ../../migrations + environment: + - POSTGRES_PASSWORD=mysecretpassword + healthcheck: + test: "/usr/bin/psql -U postgres postgres -c \"\\d\"" + interval: 3s + timeout: 1s + retries: 20 + restart: unless-stopped + + validator: + image: grafana/k6 + build: ../../validator + command: + - run + - "--iterations" + - "1" + - "--env" + - "SERVER_HOST=service:8080" + - "/config/scenario.js" + volumes: + - ../../validator:/config:ro + depends_on: + - service diff --git a/service/ruby-on-rails/lib/tasks/.keep b/service/ruby-on-rails/lib/tasks/.keep new file mode 100644 index 0000000..e69de29 diff --git a/service/ruby-on-rails/log/.keep b/service/ruby-on-rails/log/.keep new file mode 100644 index 0000000..e69de29 diff --git a/service/ruby-on-rails/public/robots.txt b/service/ruby-on-rails/public/robots.txt new file mode 100644 index 0000000..c19f78a --- /dev/null +++ b/service/ruby-on-rails/public/robots.txt @@ -0,0 +1 @@ +# See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file diff --git a/service/ruby-on-rails/tmp/.keep b/service/ruby-on-rails/tmp/.keep new file mode 100644 index 0000000..e69de29 diff --git a/service/ruby-on-rails/tmp/pids/.keep b/service/ruby-on-rails/tmp/pids/.keep new file mode 100644 index 0000000..e69de29 diff --git a/service/ruby-on-rails/vendor/.keep b/service/ruby-on-rails/vendor/.keep new file mode 100644 index 0000000..e69de29