diff --git a/app/models/submission.rb b/app/models/submission.rb index d5317c3d..f3395017 100644 --- a/app/models/submission.rb +++ b/app/models/submission.rb @@ -200,8 +200,7 @@ class Submission < ApplicationRecord def prepared_runner request_time = Time.zone.now begin - @used_execution_environment = AwsStudy.get_execution_environment(user, exercise) - runner = Runner.for(user, @used_execution_environment) + runner = Runner.for(user, exercise.execution_environment) files = collect_files files.reject!(&:teacher_defined_assessment?) if cause == 'run' Rails.logger.debug { "#{Time.zone.now.getutc.inspect}: Copying files to Runner #{runner.id} for #{user_type} #{user_id} and Submission #{id}." } diff --git a/lib/aws_study.rb b/lib/aws_study.rb deleted file mode 100644 index 48b732b1..00000000 --- a/lib/aws_study.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -class AwsStudy - def self.get_for(exercise) - java20_collection = ExerciseCollection.find_by(name: 'java2020', id: 11) - java20_bonus_collection = ExerciseCollection.find_by(name: 'java2020-bonusexercise', id: 12) - - exercise.exercise_collections.any? {|ec| [java20_collection, java20_bonus_collection].include?(ec) } - end - - def self.get_execution_environment(user, exercise) - # Poseidon is disabled and thus no AWS support available - return exercise.execution_environment unless Runner::Strategy::Poseidon == Runner.strategy_class - - java20_exercise = get_for(exercise) - # Exercise is not part of the experiment - return exercise.execution_environment unless java20_exercise - - user_group = UserGroupSeparator.get_aws_group(user.id) - case user_group - when :use_aws - # AWS functions are currently identified with their name - aws_function = ExecutionEnvironment.find_by(docker_image: 'java11Exec') - # Fallback to the default execution environment if no AWS function is found - aws_function || exercise.execution_environment - else # :no_aws - exercise.execution_environment - end - end -end diff --git a/lib/user_group_separator.rb b/lib/user_group_separator.rb index 32219ba6..c82dead0 100644 --- a/lib/user_group_separator.rb +++ b/lib/user_group_separator.rb @@ -32,16 +32,4 @@ class UserGroupSeparator :no_community_solution end end - - # Different user groups for using AWS lambda functions instead of Nomad based on the user_id - # This test is independent from any other A/B Test - def self.get_aws_group(user_id) - user_group = user_id % 2 # => 0, 1 - case user_group - when 0 - :no_aws - else # 1 - :use_aws - end - end end