mongoid 7.6.2 → 8.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +2 -0
- data/README.md +3 -3
- data/Rakefile +21 -85
- data/lib/config/locales/en.yml +46 -56
- data/lib/mongoid/association/accessors.rb +32 -3
- data/lib/mongoid/association/bindable.rb +48 -0
- data/lib/mongoid/association/builders.rb +4 -2
- data/lib/mongoid/association/depending.rb +4 -8
- data/lib/mongoid/association/eager_loadable.rb +29 -7
- data/lib/mongoid/association/embedded/batchable.rb +28 -5
- data/lib/mongoid/association/embedded/embedded_in/binding.rb +24 -2
- data/lib/mongoid/association/embedded/embedded_in.rb +2 -1
- data/lib/mongoid/association/embedded/embeds_many/binding.rb +1 -0
- data/lib/mongoid/association/embedded/embeds_many/buildable.rb +1 -1
- data/lib/mongoid/association/embedded/embeds_many/proxy.rb +40 -18
- data/lib/mongoid/association/embedded/embeds_one/buildable.rb +18 -4
- data/lib/mongoid/association/embedded/embeds_one/proxy.rb +21 -2
- data/lib/mongoid/association/macros.rb +2 -1
- data/lib/mongoid/association/many.rb +5 -0
- data/lib/mongoid/association/nested/many.rb +5 -39
- data/lib/mongoid/association/nested/nested_buildable.rb +0 -14
- data/lib/mongoid/association/proxy.rb +12 -0
- data/lib/mongoid/association/referenced/auto_save.rb +3 -2
- data/lib/mongoid/association/referenced/belongs_to/binding.rb +1 -0
- data/lib/mongoid/association/referenced/belongs_to/buildable.rb +1 -1
- data/lib/mongoid/association/referenced/belongs_to.rb +1 -1
- data/lib/mongoid/association/referenced/counter_cache.rb +8 -8
- data/lib/mongoid/association/referenced/has_and_belongs_to_many/proxy.rb +64 -11
- data/lib/mongoid/association/referenced/has_and_belongs_to_many.rb +4 -1
- data/lib/mongoid/association/referenced/has_many/enumerable.rb +10 -18
- data/lib/mongoid/association/referenced/has_many/proxy.rb +11 -107
- data/lib/mongoid/association/referenced/has_one/buildable.rb +1 -1
- data/lib/mongoid/association/referenced/has_one/proxy.rb +8 -11
- data/lib/mongoid/association/referenced/syncable.rb +2 -2
- data/lib/mongoid/association/relatable.rb +38 -4
- data/lib/mongoid/attributes/processing.rb +9 -2
- data/lib/mongoid/attributes.rb +30 -27
- data/lib/mongoid/cacheable.rb +2 -2
- data/lib/mongoid/changeable.rb +37 -2
- data/lib/mongoid/clients/factory.rb +0 -4
- data/lib/mongoid/clients/options.rb +4 -0
- data/lib/mongoid/clients/sessions.rb +2 -14
- data/lib/mongoid/config.rb +15 -73
- data/lib/mongoid/contextual/aggregable/memory.rb +22 -20
- data/lib/mongoid/contextual/aggregable/mongo.rb +1 -1
- data/lib/mongoid/contextual/map_reduce.rb +2 -2
- data/lib/mongoid/contextual/memory.rb +63 -47
- data/lib/mongoid/contextual/mongo.rb +173 -287
- data/lib/mongoid/contextual/none.rb +33 -15
- data/lib/mongoid/copyable.rb +32 -8
- data/lib/mongoid/criteria/includable.rb +24 -20
- data/lib/mongoid/criteria/marshalable.rb +10 -2
- data/lib/mongoid/criteria/queryable/extensions/array.rb +2 -15
- data/lib/mongoid/criteria/queryable/extensions/big_decimal.rb +25 -4
- data/lib/mongoid/criteria/queryable/extensions/boolean.rb +1 -1
- data/lib/mongoid/criteria/queryable/extensions/date.rb +6 -1
- data/lib/mongoid/criteria/queryable/extensions/date_time.rb +6 -1
- data/lib/mongoid/criteria/queryable/extensions/hash.rb +0 -16
- data/lib/mongoid/criteria/queryable/extensions/numeric.rb +1 -1
- data/lib/mongoid/criteria/queryable/extensions/object.rb +2 -1
- data/lib/mongoid/criteria/queryable/extensions/range.rb +13 -5
- data/lib/mongoid/criteria/queryable/extensions/regexp.rb +1 -1
- data/lib/mongoid/criteria/queryable/extensions/symbol.rb +3 -1
- data/lib/mongoid/criteria/queryable/extensions/time.rb +6 -1
- data/lib/mongoid/criteria/queryable/extensions/time_with_zone.rb +6 -1
- data/lib/mongoid/criteria/queryable/mergeable.rb +0 -12
- data/lib/mongoid/criteria/queryable/optional.rb +3 -9
- data/lib/mongoid/criteria/queryable/options.rb +1 -1
- data/lib/mongoid/criteria/queryable/selectable.rb +2 -133
- data/lib/mongoid/criteria/queryable/selector.rb +90 -5
- data/lib/mongoid/criteria/queryable/smash.rb +39 -6
- data/lib/mongoid/criteria/queryable/storable.rb +1 -1
- data/lib/mongoid/criteria/queryable.rb +11 -6
- data/lib/mongoid/criteria.rb +1 -28
- data/lib/mongoid/deprecable.rb +36 -0
- data/lib/mongoid/deprecation.rb +25 -0
- data/lib/mongoid/document.rb +88 -33
- data/lib/mongoid/equality.rb +4 -4
- data/lib/mongoid/errors/document_not_found.rb +6 -2
- data/lib/mongoid/errors/invalid_dot_dollar_assignment.rb +23 -0
- data/lib/mongoid/errors/invalid_field.rb +5 -1
- data/lib/mongoid/errors/invalid_field_type.rb +26 -0
- data/lib/mongoid/errors/too_many_nested_attribute_records.rb +1 -1
- data/lib/mongoid/errors.rb +2 -3
- data/lib/mongoid/extensions/array.rb +8 -6
- data/lib/mongoid/extensions/big_decimal.rb +29 -10
- data/lib/mongoid/extensions/binary.rb +42 -0
- data/lib/mongoid/extensions/boolean.rb +8 -2
- data/lib/mongoid/extensions/date.rb +26 -20
- data/lib/mongoid/extensions/date_time.rb +1 -1
- data/lib/mongoid/extensions/float.rb +4 -5
- data/lib/mongoid/extensions/hash.rb +13 -32
- data/lib/mongoid/extensions/integer.rb +4 -5
- data/lib/mongoid/extensions/object.rb +2 -0
- data/lib/mongoid/extensions/range.rb +41 -10
- data/lib/mongoid/extensions/regexp.rb +11 -4
- data/lib/mongoid/extensions/set.rb +11 -4
- data/lib/mongoid/extensions/string.rb +2 -13
- data/lib/mongoid/extensions/symbol.rb +3 -14
- data/lib/mongoid/extensions/time.rb +27 -16
- data/lib/mongoid/extensions/time_with_zone.rb +1 -2
- data/lib/mongoid/extensions.rb +1 -0
- data/lib/mongoid/factory.rb +42 -7
- data/lib/mongoid/fields/foreign_key.rb +7 -0
- data/lib/mongoid/fields/validators/macro.rb +3 -9
- data/lib/mongoid/fields.rb +49 -7
- data/lib/mongoid/findable.rb +21 -16
- data/lib/mongoid/indexable/specification.rb +1 -1
- data/lib/mongoid/indexable/validators/options.rb +4 -1
- data/lib/mongoid/interceptable.rb +69 -9
- data/lib/mongoid/matchable.rb +1 -6
- data/lib/mongoid/matcher/eq_impl_with_regexp.rb +5 -3
- data/lib/mongoid/matcher/regex.rb +9 -8
- data/lib/mongoid/matcher.rb +0 -1
- data/lib/mongoid/persistable/creatable.rb +14 -5
- data/lib/mongoid/persistable/updatable.rb +12 -5
- data/lib/mongoid/persistence_context.rb +8 -42
- data/lib/mongoid/query_cache.rb +6 -258
- data/lib/mongoid/railties/controller_runtime.rb +1 -1
- data/lib/mongoid/reloadable.rb +7 -3
- data/lib/mongoid/scopable.rb +9 -11
- data/lib/mongoid/selectable.rb +1 -2
- data/lib/mongoid/shardable.rb +11 -35
- data/lib/mongoid/stateful.rb +27 -1
- data/lib/mongoid/threaded.rb +0 -3
- data/lib/mongoid/timestamps/created.rb +1 -1
- data/lib/mongoid/timestamps/updated.rb +1 -1
- data/lib/mongoid/touchable.rb +2 -3
- data/lib/mongoid/traversable.rb +1 -0
- data/lib/mongoid/validatable/uniqueness.rb +2 -1
- data/lib/mongoid/version.rb +1 -5
- data/lib/mongoid/warnings.rb +3 -5
- data/lib/mongoid.rb +1 -0
- data/spec/config/mongoid.yml +16 -0
- data/spec/integration/app_spec.rb +8 -20
- data/spec/integration/associations/belongs_to_spec.rb +18 -0
- data/spec/integration/associations/embedded_spec.rb +15 -0
- data/spec/integration/associations/embeds_many_spec.rb +15 -2
- data/spec/integration/associations/embeds_one_spec.rb +18 -0
- data/spec/integration/associations/foreign_key_spec.rb +9 -0
- data/spec/integration/associations/has_and_belongs_to_many_spec.rb +21 -0
- data/spec/integration/associations/has_one_spec.rb +97 -1
- data/spec/integration/associations/scope_option_spec.rb +1 -1
- data/spec/integration/callbacks_models.rb +95 -1
- data/spec/integration/callbacks_spec.rb +226 -4
- data/spec/integration/criteria/range_spec.rb +95 -1
- data/spec/integration/discriminator_key_spec.rb +115 -76
- data/spec/integration/dots_and_dollars_spec.rb +277 -0
- data/spec/integration/i18n_fallbacks_spec.rb +1 -15
- data/spec/integration/matcher_examples_spec.rb +20 -13
- data/spec/integration/matcher_operator_data/regex.yml +0 -21
- data/spec/integration/matcher_operator_data/type_decimal.yml +3 -2
- data/spec/integration/matcher_operator_spec.rb +3 -5
- data/spec/integration/persistence/range_field_spec.rb +350 -0
- data/spec/mongoid/association/counter_cache_spec.rb +1 -1
- data/spec/mongoid/association/depending_spec.rb +9 -9
- data/spec/mongoid/association/eager_spec.rb +2 -1
- data/spec/mongoid/association/embedded/embedded_in/binding_spec.rb +2 -1
- data/spec/mongoid/association/embedded/embedded_in/buildable_spec.rb +54 -0
- data/spec/mongoid/association/embedded/embedded_in/proxy_spec.rb +69 -9
- data/spec/mongoid/association/embedded/embeds_many/buildable_spec.rb +112 -0
- data/spec/mongoid/association/embedded/embeds_many/proxy_spec.rb +198 -8
- data/spec/mongoid/association/embedded/embeds_many_models.rb +36 -0
- data/spec/mongoid/association/embedded/embeds_many_query_spec.rb +12 -0
- data/spec/mongoid/association/embedded/embeds_many_spec.rb +68 -0
- data/spec/mongoid/association/embedded/embeds_one/buildable_spec.rb +25 -0
- data/spec/mongoid/association/embedded/embeds_one_models.rb +19 -0
- data/spec/mongoid/association/embedded/embeds_one_spec.rb +28 -0
- data/spec/mongoid/association/referenced/belongs_to/binding_spec.rb +2 -1
- data/spec/mongoid/association/referenced/belongs_to/buildable_spec.rb +54 -0
- data/spec/mongoid/association/referenced/belongs_to/proxy_spec.rb +15 -0
- data/spec/mongoid/association/referenced/belongs_to_models.rb +11 -0
- data/spec/mongoid/association/referenced/belongs_to_spec.rb +2 -2
- data/spec/mongoid/association/referenced/has_and_belongs_to_many/proxy_spec.rb +36 -51
- data/spec/mongoid/association/referenced/has_and_belongs_to_many_models.rb +25 -0
- data/spec/mongoid/association/referenced/has_and_belongs_to_many_spec.rb +35 -2
- data/spec/mongoid/association/referenced/has_many/buildable_spec.rb +109 -0
- data/spec/mongoid/association/referenced/has_many/enumerable_spec.rb +2 -56
- data/spec/mongoid/association/referenced/has_many/proxy_spec.rb +60 -156
- data/spec/mongoid/association/referenced/has_many_models.rb +3 -1
- data/spec/mongoid/association/referenced/has_many_spec.rb +25 -0
- data/spec/mongoid/association/referenced/has_one/buildable_spec.rb +2 -2
- data/spec/mongoid/association/referenced/has_one/proxy_spec.rb +107 -1
- data/spec/mongoid/association/referenced/has_one_models.rb +16 -0
- data/spec/mongoid/association/syncable_spec.rb +14 -0
- data/spec/mongoid/atomic/paths_spec.rb +0 -14
- data/spec/mongoid/attributes/nested_spec.rb +73 -198
- data/spec/mongoid/attributes/nested_spec_models.rb +48 -0
- data/spec/mongoid/attributes/projector_spec.rb +1 -5
- data/spec/mongoid/attributes_spec.rb +480 -27
- data/spec/mongoid/cacheable_spec.rb +3 -3
- data/spec/mongoid/changeable_spec.rb +130 -13
- data/spec/mongoid/clients/factory_spec.rb +22 -60
- data/spec/mongoid/clients/sessions_spec.rb +0 -38
- data/spec/mongoid/clients_spec.rb +2 -2
- data/spec/mongoid/config_spec.rb +52 -15
- data/spec/mongoid/contextual/aggregable/memory_spec.rb +371 -231
- data/spec/mongoid/contextual/aggregable/memory_table.yml +88 -0
- data/spec/mongoid/contextual/aggregable/memory_table_spec.rb +62 -0
- data/spec/mongoid/contextual/map_reduce_spec.rb +2 -16
- data/spec/mongoid/contextual/memory_spec.rb +467 -156
- data/spec/mongoid/contextual/mongo_spec.rb +566 -426
- data/spec/mongoid/contextual/none_spec.rb +11 -19
- data/spec/mongoid/copyable_spec.rb +451 -2
- data/spec/mongoid/criteria/findable_spec.rb +86 -210
- data/spec/mongoid/criteria/includable_spec.rb +1492 -0
- data/spec/mongoid/criteria/includable_spec_models.rb +54 -0
- data/spec/mongoid/criteria/marshalable_spec.rb +18 -1
- data/spec/mongoid/criteria/queryable/extensions/array_spec.rb +7 -19
- data/spec/mongoid/criteria/queryable/extensions/big_decimal_spec.rb +134 -26
- data/spec/mongoid/criteria/queryable/extensions/bignum_spec.rb +1 -2
- data/spec/mongoid/criteria/queryable/extensions/date_spec.rb +11 -0
- data/spec/mongoid/criteria/queryable/extensions/date_time_spec.rb +11 -0
- data/spec/mongoid/criteria/queryable/extensions/fixnum_spec.rb +1 -2
- data/spec/mongoid/criteria/queryable/extensions/hash_spec.rb +0 -15
- data/spec/mongoid/criteria/queryable/extensions/numeric_spec.rb +73 -7
- data/spec/mongoid/criteria/queryable/extensions/time_spec.rb +11 -0
- data/spec/mongoid/criteria/queryable/extensions/time_with_zone_spec.rb +11 -0
- data/spec/mongoid/criteria/queryable/optional_spec.rb +0 -484
- data/spec/mongoid/criteria/queryable/selectable_logical_spec.rb +50 -2
- data/spec/mongoid/criteria/queryable/selectable_spec.rb +77 -85
- data/spec/mongoid/criteria/queryable/selectable_where_spec.rb +0 -200
- data/spec/mongoid/criteria/queryable/selector_spec.rb +16 -77
- data/spec/mongoid/criteria/queryable/storable_spec.rb +0 -72
- data/spec/mongoid/criteria_spec.rb +469 -1203
- data/spec/mongoid/document_fields_spec.rb +173 -24
- data/spec/mongoid/document_spec.rb +32 -41
- data/spec/mongoid/equality_spec.rb +12 -12
- data/spec/mongoid/errors/document_not_found_spec.rb +29 -2
- data/spec/mongoid/errors/invalid_field_spec.rb +1 -1
- data/spec/mongoid/errors/invalid_field_type_spec.rb +55 -0
- data/spec/mongoid/errors/mongoid_error_spec.rb +3 -1
- data/spec/mongoid/errors/no_environment_spec.rb +3 -3
- data/spec/mongoid/errors/too_many_nested_attribute_records_spec.rb +1 -1
- data/spec/mongoid/extensions/array_spec.rb +16 -2
- data/spec/mongoid/extensions/big_decimal_spec.rb +697 -212
- data/spec/mongoid/extensions/binary_spec.rb +44 -9
- data/spec/mongoid/extensions/boolean_spec.rb +68 -82
- data/spec/mongoid/extensions/date_class_mongoize_spec.rb +7 -3
- data/spec/mongoid/extensions/date_spec.rb +71 -1
- data/spec/mongoid/extensions/date_time_spec.rb +15 -9
- data/spec/mongoid/extensions/float_spec.rb +48 -76
- data/spec/mongoid/extensions/hash_spec.rb +30 -236
- data/spec/mongoid/extensions/integer_spec.rb +45 -66
- data/spec/mongoid/extensions/range_spec.rb +255 -54
- data/spec/mongoid/extensions/regexp_spec.rb +58 -33
- data/spec/mongoid/extensions/set_spec.rb +106 -0
- data/spec/mongoid/extensions/string_spec.rb +53 -25
- data/spec/mongoid/extensions/symbol_spec.rb +18 -25
- data/spec/mongoid/extensions/time_spec.rb +634 -66
- data/spec/mongoid/extensions/time_with_zone_spec.rb +17 -31
- data/spec/mongoid/factory_spec.rb +61 -1
- data/spec/mongoid/fields_spec.rb +321 -50
- data/spec/mongoid/findable_spec.rb +64 -29
- data/spec/mongoid/indexable/specification_spec.rb +2 -2
- data/spec/mongoid/indexable_spec.rb +16 -19
- data/spec/mongoid/interceptable_spec.rb +584 -5
- data/spec/mongoid/interceptable_spec_models.rb +235 -4
- data/spec/mongoid/matcher/extract_attribute_spec.rb +1 -5
- data/spec/mongoid/mongoizable_spec.rb +285 -0
- data/spec/mongoid/persistable/creatable_spec.rb +2 -2
- data/spec/mongoid/persistable/deletable_spec.rb +2 -2
- data/spec/mongoid/persistable/destroyable_spec.rb +2 -2
- data/spec/mongoid/persistable/upsertable_spec.rb +14 -0
- data/spec/mongoid/persistence_context_spec.rb +24 -0
- data/spec/mongoid/query_cache_middleware_spec.rb +0 -18
- data/spec/mongoid/query_cache_spec.rb +1 -156
- data/spec/mongoid/reloadable_spec.rb +35 -2
- data/spec/mongoid/scopable_spec.rb +36 -34
- data/spec/mongoid/serializable_spec.rb +14 -7
- data/spec/mongoid/shardable_models.rb +0 -14
- data/spec/mongoid/shardable_spec.rb +61 -153
- data/spec/mongoid/stateful_spec.rb +28 -0
- data/spec/mongoid/timestamps_spec.rb +390 -0
- data/spec/mongoid/timestamps_spec_models.rb +67 -0
- data/spec/mongoid/touchable_spec.rb +116 -0
- data/spec/mongoid/touchable_spec_models.rb +12 -8
- data/spec/mongoid/traversable_spec.rb +4 -11
- data/spec/mongoid/validatable/presence_spec.rb +1 -1
- data/spec/mongoid/validatable/uniqueness_spec.rb +60 -31
- data/spec/mongoid/warnings_spec.rb +35 -0
- data/spec/mongoid_spec.rb +1 -7
- data/spec/rails/controller_extension/controller_runtime_spec.rb +2 -2
- data/spec/rails/mongoid_spec.rb +4 -16
- data/spec/shared/lib/mrss/cluster_config.rb +40 -5
- data/spec/shared/lib/mrss/constraints.rb +46 -7
- data/spec/shared/lib/mrss/docker_runner.rb +21 -17
- data/spec/shared/lib/mrss/eg_config_utils.rb +31 -0
- data/spec/shared/lib/mrss/event_subscriber.rb +5 -15
- data/spec/shared/lib/mrss/lite_constraints.rb +2 -10
- data/spec/shared/lib/mrss/server_version_registry.rb +29 -18
- data/spec/shared/lib/mrss/spec_organizer.rb +3 -32
- data/spec/shared/lib/mrss/utils.rb +6 -28
- data/spec/shared/share/Dockerfile.erb +114 -38
- data/spec/shared/shlib/distro.sh +0 -10
- data/spec/shared/shlib/server.sh +83 -64
- data/spec/shared/shlib/set_env.sh +81 -16
- data/spec/support/constraints.rb +24 -0
- data/spec/support/expectations.rb +17 -20
- data/spec/support/macros.rb +30 -0
- data/spec/support/models/augmentation.rb +12 -0
- data/spec/support/models/band.rb +3 -0
- data/spec/support/models/catalog.rb +24 -0
- data/spec/support/models/circus.rb +3 -0
- data/spec/support/models/fanatic.rb +8 -0
- data/spec/support/models/implant.rb +9 -0
- data/spec/support/models/label.rb +2 -0
- data/spec/support/models/passport.rb +9 -0
- data/spec/support/models/person.rb +1 -0
- data/spec/support/models/player.rb +2 -0
- data/spec/support/models/powerup.rb +12 -0
- data/spec/support/models/registry.rb +1 -0
- data/spec/support/models/school.rb +14 -0
- data/spec/support/models/shield.rb +18 -0
- data/spec/support/models/student.rb +14 -0
- data/spec/support/models/weapon.rb +12 -0
- data.tar.gz.sig +0 -0
- metadata +695 -650
- metadata.gz.sig +0 -0
- data/lib/mongoid/errors/eager_load.rb +0 -23
- data/lib/mongoid/errors/in_memory_regexp_timeout.rb +0 -26
- data/lib/mongoid/errors/invalid_value.rb +0 -17
- data/lib/mongoid/field_readable.rb +0 -70
- data/lib/mongoid/matcher/regexp_budget.rb +0 -389
- data/spec/integration/matcher_regexp_timeout_spec.rb +0 -215
- data/spec/integration/query_operator_guard_spec.rb +0 -89
- data/spec/mongoid/errors/eager_load_spec.rb +0 -31
- data/spec/mongoid/matcher/regexp_budget_spec.rb +0 -570
- data/spec/shared/CANDIDATE.md +0 -28
- data/spec/shared/lib/mrss/release/candidate.rb +0 -287
- data/spec/shared/lib/mrss/release/product_data.rb +0 -144
- data/spec/shared/lib/tasks/candidate.rake +0 -64
|
@@ -5,6 +5,37 @@ require 'tilt'
|
|
|
5
5
|
|
|
6
6
|
module Mrss
|
|
7
7
|
module EgConfigUtils
|
|
8
|
+
|
|
9
|
+
DEBIAN_FOR_RUBY = {
|
|
10
|
+
'ruby-2.3' => 'debian92',
|
|
11
|
+
'ruby-2.4' => 'debian92',
|
|
12
|
+
'ruby-2.5' => 'debian10',
|
|
13
|
+
'ruby-2.6' => 'debian10',
|
|
14
|
+
'ruby-2.7' => 'debian10',
|
|
15
|
+
'ruby-3.0' => 'debian10',
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
def standard_debian_rubies(rubies, key: nil, &block)
|
|
19
|
+
rubies.flatten!
|
|
20
|
+
text = block.call
|
|
21
|
+
contents = YAML.load(text)
|
|
22
|
+
out = rubies.map do |ruby|
|
|
23
|
+
contents.merge(
|
|
24
|
+
'matrix_name' => "#{contents['matrix_name']} - #{ruby}",
|
|
25
|
+
'matrix_spec' => contents['matrix_spec'].merge(
|
|
26
|
+
'ruby' => ruby,
|
|
27
|
+
key || 'os' => DEBIAN_FOR_RUBY.fetch(ruby),
|
|
28
|
+
),
|
|
29
|
+
)
|
|
30
|
+
end.to_yaml
|
|
31
|
+
text =~ /\A\n?(\s+)/
|
|
32
|
+
unless text
|
|
33
|
+
raise "Couldn't figure out indentation level"
|
|
34
|
+
end
|
|
35
|
+
indent = ' ' * ($1.length - 2)
|
|
36
|
+
"\n" + out.sub(/\A---.*\n/, indent).gsub("\n", "\n#{indent}")
|
|
37
|
+
end
|
|
38
|
+
|
|
8
39
|
def transform_config(template_path, context)
|
|
9
40
|
Tilt.new(template_path, engine_class: Erubi::CaptureEndEngine).render(context)
|
|
10
41
|
end
|
|
@@ -84,32 +84,22 @@ module Mrss
|
|
|
84
84
|
|
|
85
85
|
# Locates command stated events for the specified command name,
|
|
86
86
|
# asserts that there is exactly one such event, and returns it.
|
|
87
|
-
def single_command_started_event(command_name, include_auth: false
|
|
87
|
+
def single_command_started_event(command_name, include_auth: false)
|
|
88
88
|
events = if include_auth
|
|
89
89
|
started_events
|
|
90
90
|
else
|
|
91
91
|
non_auth_command_started_events
|
|
92
92
|
end
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
# Locates command succeeded events for the specified command name,
|
|
97
|
-
# asserts that there is exactly one such event, and returns it.
|
|
98
|
-
def single_command_succeeded_event(command_name, database_name: nil)
|
|
99
|
-
get_one_event(succeeded_events, command_name, 'succeeded', database_name: database_name)
|
|
100
|
-
end
|
|
101
|
-
|
|
102
|
-
def get_one_event(events, command_name, kind, database_name: nil)
|
|
103
|
-
events = events.select do |event|
|
|
104
|
-
event.command_name == command_name and
|
|
105
|
-
database_name.nil? || database_name == event.database_name
|
|
93
|
+
events.select! do |event|
|
|
94
|
+
event.command[command_name]
|
|
106
95
|
end
|
|
107
96
|
if events.length != 1
|
|
108
|
-
raise "Expected a single
|
|
97
|
+
raise "Expected a single #{command_name} event but we have #{events.length}"
|
|
109
98
|
end
|
|
110
99
|
events.first
|
|
111
100
|
end
|
|
112
101
|
|
|
102
|
+
|
|
113
103
|
# Get the first succeeded event published for the name, and then delete it.
|
|
114
104
|
#
|
|
115
105
|
# @param [ String ] name The event name.
|
|
@@ -98,8 +98,8 @@ module Mrss
|
|
|
98
98
|
def min_libmongocrypt_version(version)
|
|
99
99
|
require_libmongocrypt
|
|
100
100
|
before(:all) do
|
|
101
|
-
actual_version =
|
|
102
|
-
min_version =
|
|
101
|
+
actual_version = Gem::Version.new(Mongo::Crypt::Binding.mongocrypt_version(nil))
|
|
102
|
+
min_version = Gem::Version.new(version)
|
|
103
103
|
unless actual_version >= min_version
|
|
104
104
|
skip "libmongocrypt version #{min_version} required, but version #{actual_version} is available"
|
|
105
105
|
end
|
|
@@ -209,14 +209,6 @@ module Mrss
|
|
|
209
209
|
end
|
|
210
210
|
end
|
|
211
211
|
|
|
212
|
-
def require_no_fallbacks
|
|
213
|
-
before(:all) do
|
|
214
|
-
if %w(yes true 1).include?((ENV['TEST_I18N_FALLBACKS'] || '').downcase)
|
|
215
|
-
skip 'Set TEST_I18N_FALLBACKS=0 environment variable to run these tests'
|
|
216
|
-
end
|
|
217
|
-
end
|
|
218
|
-
end
|
|
219
|
-
|
|
220
212
|
# This is a macro for retrying flaky tests on CI that occasionally fail.
|
|
221
213
|
# Note that the tests will only be retried on CI.
|
|
222
214
|
#
|
|
@@ -19,26 +19,11 @@ module Mrss
|
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
def initialize(desired_version, arch)
|
|
22
|
-
@desired_version, @arch = desired_version, arch
|
|
22
|
+
@desired_version, @arch = desired_version, arch
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
attr_reader :desired_version, :arch
|
|
26
26
|
|
|
27
|
-
def target_arch
|
|
28
|
-
# can't use RbConfig::CONFIG["arch"] because JRuby doesn't
|
|
29
|
-
# return anything meaningful there.
|
|
30
|
-
#
|
|
31
|
-
# also, need to use `uname -a` instead of (e.g.) `uname -p`
|
|
32
|
-
# because debian (at least) does not return anything meaningful
|
|
33
|
-
# for `uname -p`.
|
|
34
|
-
uname = `uname -a`.strip
|
|
35
|
-
@target_arch ||= case uname
|
|
36
|
-
when /aarch/ then "aarch64"
|
|
37
|
-
when /x86/ then "x86_64"
|
|
38
|
-
else raise "unsupported architecture #{uname.inspect}"
|
|
39
|
-
end
|
|
40
|
-
end
|
|
41
|
-
|
|
42
27
|
def download_url
|
|
43
28
|
@download_url ||= begin
|
|
44
29
|
version, version_ok = detect_version(current_catalog)
|
|
@@ -55,19 +40,45 @@ module Mrss
|
|
|
55
40
|
end
|
|
56
41
|
dl = version['downloads'].detect do |dl|
|
|
57
42
|
dl['archive']['url'].index("enterprise-#{arch}") &&
|
|
58
|
-
dl['arch'] ==
|
|
43
|
+
dl['arch'] == 'x86_64'
|
|
59
44
|
end
|
|
60
45
|
unless dl
|
|
61
46
|
raise MissingDownloadUrl, "No download for #{arch} for #{version['version']}"
|
|
62
47
|
end
|
|
63
48
|
url = dl['archive']['url']
|
|
64
49
|
end
|
|
50
|
+
rescue MissingDownloadUrl
|
|
51
|
+
if %w(2.6 3.0).include?(desired_version) && arch == 'ubuntu1604'
|
|
52
|
+
# 2.6 and 3.0 are only available for ubuntu1204 and ubuntu1404.
|
|
53
|
+
# Those ubuntus have ancient Pythons that don't work due to not
|
|
54
|
+
# implementing recent TLS protocols.
|
|
55
|
+
# Because of this we test on ubuntu1604 which has a newer Python.
|
|
56
|
+
# But we still need to retrieve ubuntu1404-targeting builds.
|
|
57
|
+
url = self.class.new('3.2', arch).download_url
|
|
58
|
+
unless url.include?('3.2.')
|
|
59
|
+
raise 'URL not in expected format'
|
|
60
|
+
end
|
|
61
|
+
url = case desired_version
|
|
62
|
+
when '2.6'
|
|
63
|
+
url.sub(/\b3\.2\.\d+/, '2.6.12')
|
|
64
|
+
when '3.0'
|
|
65
|
+
url.sub(/\b3\.2\.\d+/, '3.0.15')
|
|
66
|
+
else
|
|
67
|
+
raise NotImplementedError
|
|
68
|
+
end.sub('ubuntu1604', 'ubuntu1404')
|
|
69
|
+
else
|
|
70
|
+
raise
|
|
71
|
+
end
|
|
65
72
|
end
|
|
66
73
|
|
|
67
74
|
private
|
|
68
75
|
|
|
69
76
|
def uri_open(*args)
|
|
70
|
-
|
|
77
|
+
if RUBY_VERSION < '2.5'
|
|
78
|
+
open(*args)
|
|
79
|
+
else
|
|
80
|
+
URI.open(*args)
|
|
81
|
+
end
|
|
71
82
|
end
|
|
72
83
|
|
|
73
84
|
def detect_version(catalog)
|
|
@@ -25,19 +25,19 @@ module Mrss
|
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
def initialize(root: nil, classifiers:, priority_order:,
|
|
28
|
-
spec_root: nil, rspec_json_path: nil, rspec_all_json_path: nil,
|
|
28
|
+
spec_root: nil, rspec_json_path: nil, rspec_all_json_path: nil,
|
|
29
|
+
randomize: false
|
|
29
30
|
)
|
|
30
31
|
@spec_root = spec_root || File.join(root, 'spec')
|
|
31
32
|
@classifiers = classifiers
|
|
32
33
|
@priority_order = priority_order
|
|
33
34
|
@rspec_json_path = rspec_json_path || File.join(root, 'tmp/rspec.json')
|
|
34
35
|
@rspec_all_json_path = rspec_all_json_path || File.join(root, 'tmp/rspec-all.json')
|
|
35
|
-
@rspec_xml_path = rspec_xml_path || File.join(root, 'tmp/rspec.xml')
|
|
36
36
|
@randomize = !!randomize
|
|
37
37
|
end
|
|
38
38
|
|
|
39
39
|
attr_reader :spec_root, :classifiers, :priority_order
|
|
40
|
-
attr_reader :rspec_json_path, :rspec_all_json_path
|
|
40
|
+
attr_reader :rspec_json_path, :rspec_all_json_path
|
|
41
41
|
|
|
42
42
|
def randomize?
|
|
43
43
|
@randomize
|
|
@@ -47,25 +47,6 @@ module Mrss
|
|
|
47
47
|
@seed ||= (rand * 100_000).to_i
|
|
48
48
|
end
|
|
49
49
|
|
|
50
|
-
# Remove all XML files from tmp directory before running tests
|
|
51
|
-
def cleanup_xml_files
|
|
52
|
-
xml_pattern = File.join(File.dirname(rspec_xml_path), '*.xml')
|
|
53
|
-
Dir.glob(xml_pattern).each do |xml_file|
|
|
54
|
-
FileUtils.rm_f(xml_file)
|
|
55
|
-
end
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
# Move the XML file to a timestamped version for evergreen upload
|
|
59
|
-
def archive_xml_file(category)
|
|
60
|
-
return unless File.exist?(rspec_xml_path)
|
|
61
|
-
|
|
62
|
-
timestamp = Time.now.strftime('%Y%m%d_%H%M%S_%3N')
|
|
63
|
-
archived_path = rspec_xml_path.sub(/\.xml$/, "-#{category}-#{timestamp}.xml")
|
|
64
|
-
|
|
65
|
-
FileUtils.mv(rspec_xml_path, archived_path)
|
|
66
|
-
puts "Archived XML results to #{archived_path}"
|
|
67
|
-
end
|
|
68
|
-
|
|
69
50
|
def buckets
|
|
70
51
|
@buckets ||= {}.tap do |buckets|
|
|
71
52
|
Find.find(spec_root) do |path|
|
|
@@ -115,8 +96,6 @@ module Mrss
|
|
|
115
96
|
|
|
116
97
|
def run_buckets(*buckets)
|
|
117
98
|
FileUtils.rm_f(rspec_all_json_path)
|
|
118
|
-
# Clean up all XML files before starting test runs
|
|
119
|
-
cleanup_xml_files
|
|
120
99
|
|
|
121
100
|
buckets.each do |bucket|
|
|
122
101
|
if bucket && !self.buckets[bucket]
|
|
@@ -152,12 +131,7 @@ module Mrss
|
|
|
152
131
|
def run_files(category, paths)
|
|
153
132
|
puts "Running #{category.to_s.gsub('_', ' ')} tests"
|
|
154
133
|
FileUtils.rm_f(rspec_json_path)
|
|
155
|
-
FileUtils.rm_f(rspec_xml_path) # Clean up XML file before running this bucket
|
|
156
|
-
|
|
157
134
|
cmd = %w(rspec) + paths
|
|
158
|
-
# Add junit formatter for XML output
|
|
159
|
-
cmd += ['--format', 'Rfc::Riff', '--format', 'RspecJunitFormatter', '--out', rspec_xml_path]
|
|
160
|
-
|
|
161
135
|
if randomize?
|
|
162
136
|
cmd += %W(--order rand:#{seed})
|
|
163
137
|
end
|
|
@@ -173,9 +147,6 @@ module Mrss
|
|
|
173
147
|
FileUtils.cp(rspec_json_path, rspec_all_json_path)
|
|
174
148
|
end
|
|
175
149
|
end
|
|
176
|
-
|
|
177
|
-
# Archive XML file after running this bucket
|
|
178
|
-
archive_xml_file(category)
|
|
179
150
|
end
|
|
180
151
|
|
|
181
152
|
true
|
|
@@ -3,35 +3,13 @@
|
|
|
3
3
|
|
|
4
4
|
module Mrss
|
|
5
5
|
module Utils
|
|
6
|
-
extend self
|
|
7
6
|
|
|
8
|
-
def print_backtrace(dest=STDERR)
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
# Parses the given version string, accounting for suffix information that
|
|
15
|
-
# Gem::Version cannot successfully parse.
|
|
16
|
-
#
|
|
17
|
-
# @param [ String ] version the version to parse
|
|
18
|
-
#
|
|
19
|
-
# @return [ Gem::Version ] the parsed version
|
|
20
|
-
#
|
|
21
|
-
# @raise [ ArgumentError ] if the string cannot be parsed.
|
|
22
|
-
def parse_version(version)
|
|
23
|
-
Gem::Version.new(version)
|
|
24
|
-
rescue ArgumentError
|
|
25
|
-
match = version.match(/\A(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)?(-[A-Za-z\+\d]+)?\z/)
|
|
26
|
-
raise ArgumentError.new("Malformed version number string #{version}") if match.nil?
|
|
27
|
-
|
|
28
|
-
Gem::Version.new(
|
|
29
|
-
[
|
|
30
|
-
match[:major],
|
|
31
|
-
match[:minor],
|
|
32
|
-
match[:patch]
|
|
33
|
-
].join('.')
|
|
34
|
-
)
|
|
7
|
+
module_function def print_backtrace(dest=STDERR)
|
|
8
|
+
begin
|
|
9
|
+
hello world
|
|
10
|
+
rescue => e
|
|
11
|
+
dest.puts e.backtrace.join("\n")
|
|
12
|
+
end
|
|
35
13
|
end
|
|
36
14
|
end
|
|
37
15
|
end
|
|
@@ -1,9 +1,26 @@
|
|
|
1
|
+
# Python toolchain as of this writing is available on rhel62, debian92 and
|
|
2
|
+
# ubuntu1604.
|
|
3
|
+
#
|
|
4
|
+
# To run rhel62 in docker, host system must be configured to emulate syscalls:
|
|
5
|
+
# https://github.com/CentOS/sig-cloud-instance-images/issues/103
|
|
6
|
+
|
|
1
7
|
<%
|
|
2
8
|
|
|
9
|
+
python_toolchain_url = "https://s3.amazonaws.com//mciuploads/mongo-python-driver-toolchain/#{distro}/ba92de2700c04ee2d4f82c3ffdfc33105140cb04/mongo_python_driver_toolchain_#{distro.gsub('-', '_')}_ba92de2700c04ee2d4f82c3ffdfc33105140cb04_19_11_14_15_33_33.tar.gz"
|
|
10
|
+
server_version = '4.3.3'
|
|
11
|
+
server_url = "http://downloads.10gen.com/linux/mongodb-linux-x86_64-enterprise-#{distro}-#{server_version}.tgz"
|
|
12
|
+
server_archive_basename = File.basename(server_url)
|
|
13
|
+
server_extracted_dir = server_archive_basename.sub(/\.(tar\.gz|tgz)$/, '')
|
|
14
|
+
|
|
15
|
+
# When changing, also update the hash in shlib/set_env.sh.
|
|
16
|
+
TOOLCHAIN_VERSION='219833abad4d9d3bf43c0fef101a8ca082ac4ae9'
|
|
17
|
+
|
|
3
18
|
def ruby_toolchain_url(ruby)
|
|
4
|
-
"http://boxes.10gen.com/build/toolchain-drivers/mongo-ruby-
|
|
19
|
+
"http://boxes.10gen.com/build/toolchain-drivers/mongo-ruby-driver/#{TOOLCHAIN_VERSION}/#{distro}/#{ruby}.tar.xz"
|
|
5
20
|
end
|
|
6
21
|
|
|
22
|
+
#ruby_toolchain_url = "https://s3.amazonaws.com//mciuploads/mongo-ruby-toolchain/#{distro}/#{TOOLCHAIN_VERSION}/mongo_ruby_driver_toolchain_#{distro.gsub('-', '_')}_patch_#{TOOLCHAIN_VERSION}_#{toolchain_lower}.tar.gz"
|
|
23
|
+
|
|
7
24
|
%>
|
|
8
25
|
|
|
9
26
|
FROM <%= base_image %>
|
|
@@ -20,6 +37,18 @@ ENV DOCKER=1
|
|
|
20
37
|
|
|
21
38
|
<% end %>
|
|
22
39
|
|
|
40
|
+
<% if ruby_head? %>
|
|
41
|
+
|
|
42
|
+
# To use current versions of mlaunch, Python 3.7+ is required.
|
|
43
|
+
# Many distros ship with older Pythons, therefore we need to install
|
|
44
|
+
# a newer Python from somewhere. This section installs the Python
|
|
45
|
+
# toolchain which comes with recent Pythons.
|
|
46
|
+
|
|
47
|
+
#RUN curl --retry 3 -fL <%= python_toolchain_url %> -o python-toolchain.tar.gz
|
|
48
|
+
#RUN tar -xC /opt -zf python-toolchain.tar.gz
|
|
49
|
+
|
|
50
|
+
<% end %>
|
|
51
|
+
|
|
23
52
|
<% if debian? %>
|
|
24
53
|
|
|
25
54
|
# zsh is not required for any scripts but it is a better interactive shell
|
|
@@ -27,7 +56,7 @@ ENV DOCKER=1
|
|
|
27
56
|
# Ruby runtime dependencies: libyaml-0-2
|
|
28
57
|
# Compiling ruby libraries: gcc make
|
|
29
58
|
# Compiling python packages: python3-dev
|
|
30
|
-
# JRuby: openjdk-
|
|
59
|
+
# JRuby: openjdk-8-jdk-headless
|
|
31
60
|
# Server dependencies: libsnmp30 libcurl3/libcurl4
|
|
32
61
|
# Determining OS we are running on: lsb-release
|
|
33
62
|
# Load balancer testing: haproxy
|
|
@@ -48,45 +77,75 @@ ENV DOCKER=1
|
|
|
48
77
|
# therefore install python-pip in all configurations here.
|
|
49
78
|
|
|
50
79
|
<% packages = %w(
|
|
51
|
-
procps lsb-release bzip2 curl
|
|
52
|
-
git make gcc
|
|
80
|
+
procps lsb-release bzip2 curl zsh
|
|
81
|
+
git make gcc libyaml-0-2 libgmp-dev zlib1g-dev libsnappy-dev
|
|
53
82
|
krb5-user krb5-kdc krb5-admin-server libsasl2-dev libsasl2-modules-gssapi-mit
|
|
54
|
-
haproxy
|
|
55
|
-
|
|
56
|
-
|
|
83
|
+
haproxy
|
|
84
|
+
python3-pip
|
|
85
|
+
tzdata shared-mime-info
|
|
57
86
|
) %>
|
|
58
87
|
|
|
59
88
|
<% if distro =~ /ubuntu2004/ %>
|
|
60
89
|
<% packages << 'libsnmp35' %>
|
|
61
|
-
<% elsif distro =~ /ubuntu2204|debian11/ %>
|
|
62
|
-
<% packages << 'libsnmp40' %>
|
|
63
90
|
<% else %>
|
|
64
91
|
<% packages << 'libsnmp30' %>
|
|
65
92
|
<% end %>
|
|
66
93
|
|
|
67
|
-
<% if distro !~ /ubuntu2004
|
|
94
|
+
<% if distro !~ /ubuntu2004/ %>
|
|
68
95
|
<% packages << 'python-pip' %>
|
|
69
96
|
<% end %>
|
|
70
97
|
|
|
71
|
-
<% if distro =~ /
|
|
72
|
-
<% packages << '
|
|
98
|
+
<% if distro =~ /debian10/ %>
|
|
99
|
+
<% packages << 'openjdk-11-jdk-headless' %>
|
|
100
|
+
<% elsif distro =~ /ubuntu1404/ %>
|
|
101
|
+
# Ubuntu 14.04 only has openjdk 7, this is too old to be useful
|
|
102
|
+
<% else %>
|
|
103
|
+
<% packages << 'openjdk-8-jdk-headless' %>
|
|
73
104
|
<% end %>
|
|
74
105
|
|
|
75
|
-
|
|
76
|
-
|
|
106
|
+
# ubuntu1404, ubuntu1604: libcurl3
|
|
107
|
+
# ubuntu1804, ubuntu2004, debian10: libcurl4
|
|
108
|
+
<% if distro =~ /ubuntu1804|ubuntu2004|debian10/ %>
|
|
109
|
+
<% packages << 'libcurl4' %>
|
|
110
|
+
<% else %>
|
|
111
|
+
<% packages << 'libcurl3' %>
|
|
77
112
|
<% end %>
|
|
78
113
|
|
|
79
|
-
|
|
114
|
+
<% if distro =~ /ubuntu1804|ubuntu2004/ %>
|
|
115
|
+
<% packages << 'nodejs' %>
|
|
116
|
+
<% end %>
|
|
80
117
|
|
|
81
|
-
<% if
|
|
82
|
-
|
|
83
|
-
RUN echo "deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/kitware.list >/dev/null
|
|
118
|
+
<% if distro =~ /ubuntu2004/ %>
|
|
119
|
+
<% packages += %w(ruby ruby2.7 bundler) %>
|
|
84
120
|
<% end %>
|
|
85
|
-
|
|
86
|
-
RUN apt-get update && apt-get install -y
|
|
87
|
-
|
|
121
|
+
|
|
122
|
+
RUN apt-get update && apt-get install -y <%= packages.join(' ') %>
|
|
123
|
+
|
|
88
124
|
<% else %>
|
|
89
125
|
|
|
126
|
+
<% if distro =~ /rhel6/ %>
|
|
127
|
+
|
|
128
|
+
# CentOS 6 is dead - to use it retrieve the packages from vault:
|
|
129
|
+
# https://stackoverflow.com/questions/53562691/error-cannot-retrieve-repository-metadata-repomd-xml-for-repository-base-pl
|
|
130
|
+
|
|
131
|
+
<%
|
|
132
|
+
|
|
133
|
+
cfg = <<-CFG
|
|
134
|
+
[base]
|
|
135
|
+
name=CentOS-$releasever - Base
|
|
136
|
+
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
|
|
137
|
+
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
|
|
138
|
+
baseurl=http://vault.centos.org/6.10/os/x86_64/
|
|
139
|
+
gpgcheck=1
|
|
140
|
+
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
|
|
141
|
+
CFG
|
|
142
|
+
|
|
143
|
+
%>
|
|
144
|
+
|
|
145
|
+
RUN printf "<%= cfg.gsub("\n", "\\n") %>" >/etc/yum.repos.d/CentOS-Base.repo
|
|
146
|
+
|
|
147
|
+
<% end %>
|
|
148
|
+
|
|
90
149
|
# Enterprise server: net-snmp
|
|
91
150
|
# lsb_release: redhat-lsb-core
|
|
92
151
|
# our runner scripts: which
|
|
@@ -95,16 +154,31 @@ ENV DOCKER=1
|
|
|
95
154
|
# Kerberos tests: krb5-workstation + cyrus-sasl-devel to build the
|
|
96
155
|
# mongo_kerberos gem + cyrus-sasl-gssapi for authentication to work
|
|
97
156
|
# Local Kerberos server: krb5-server
|
|
98
|
-
# JRuby: java-
|
|
157
|
+
# JRuby: java-1.8.0-openjdk
|
|
99
158
|
#
|
|
100
159
|
# Note: lacking cyrus-sasl-gssapi produces a cryptic message
|
|
101
160
|
# "SASL(-4): no mechanism available: No worthy mechs found"
|
|
102
161
|
# https://github.com/farorm/python-ad/issues/10
|
|
103
162
|
|
|
104
|
-
RUN yum
|
|
105
|
-
krb5-workstation cyrus-sasl-devel cyrus-sasl-gssapi java-
|
|
106
|
-
net-snmp
|
|
163
|
+
RUN yum install -y redhat-lsb-core which git gcc libyaml krb5-server \
|
|
164
|
+
krb5-workstation cyrus-sasl-devel cyrus-sasl-gssapi java-1.8.0-openjdk \
|
|
165
|
+
net-snmp python3
|
|
166
|
+
|
|
167
|
+
<% if distro =~ /rhel6/ %>
|
|
168
|
+
|
|
169
|
+
# RHEL 6 ships with Python 2.6.
|
|
170
|
+
|
|
171
|
+
RUN yum install -y centos-release-scl && \
|
|
172
|
+
yum install -y python27-python python27-python-devel
|
|
173
|
+
ENV PATH=/opt/rh/python27/root/usr/bin:$PATH \
|
|
174
|
+
LD_LIBRARY_PATH=/opt/rh/python27/root/usr/lib64
|
|
175
|
+
|
|
176
|
+
<% else %>
|
|
177
|
+
|
|
178
|
+
RUN yum install -y python-devel
|
|
107
179
|
|
|
180
|
+
<% end %>
|
|
181
|
+
|
|
108
182
|
<% end %>
|
|
109
183
|
|
|
110
184
|
<% if preload? %>
|
|
@@ -146,7 +220,7 @@ ENV DOCKER=1
|
|
|
146
220
|
<% when 'git' %>
|
|
147
221
|
# dateutil dependency is missing in mtools: https://github.com/rueckstiess/mtools/issues/864
|
|
148
222
|
RUN python3 -m pip install virtualenv 'pymongo>=4' python-dateutil psutil
|
|
149
|
-
|
|
223
|
+
|
|
150
224
|
# Install mtools from git because released versions do not work with pymongo 4.0
|
|
151
225
|
RUN git clone https://github.com/p-mongodb/mtools && \
|
|
152
226
|
cd mtools && \
|
|
@@ -160,24 +234,31 @@ ENV DOCKER=1
|
|
|
160
234
|
<% if @env.fetch('MONGODB_VERSION') >= '4.4' %>
|
|
161
235
|
# ubuntu1604 installs MarkupSafe 0.0.0 here instead of 2.0.0+
|
|
162
236
|
# as specified by dependencies, causing OCSP mock to not work.
|
|
163
|
-
RUN python3 -mpip install asn1crypto oscrypto flask --upgrade
|
|
237
|
+
RUN python3 -mpip install asn1crypto oscrypto flask --upgrade
|
|
164
238
|
<% end %>
|
|
165
239
|
|
|
166
|
-
# FLE
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
240
|
+
# FLE is tested against 4.0+ servers.
|
|
241
|
+
<% if @env.fetch('MONGODB_VERSION') >= '4.0' %>
|
|
242
|
+
# Requirements in drivers-evergreen-tools:
|
|
243
|
+
# boto3~=1.19 cryptography~=3.4.8 pykmip~=0.10.0
|
|
244
|
+
# cryptography does not install due to lacking setuptools_rust
|
|
245
|
+
# (either that version or anything that isn't part of system packages)
|
|
246
|
+
RUN python3 -mpip install boto3~=1.19 cryptography pykmip~=0.10.0
|
|
247
|
+
<% end %>
|
|
172
248
|
|
|
173
249
|
<% unless ruby_head? || system_ruby? %>
|
|
174
250
|
|
|
175
251
|
RUN curl --retry 3 -fL <%= ruby_toolchain_url(ruby) %> |tar -xC /opt -Jf -
|
|
176
252
|
ENV PATH=/opt/rubies/<%= ruby %>/bin:$PATH \
|
|
177
253
|
USE_OPT_TOOLCHAIN=1
|
|
254
|
+
#ENV PATH=/opt/rubies/python/3/bin:$PATH
|
|
178
255
|
|
|
179
256
|
<% end %>
|
|
180
257
|
|
|
258
|
+
RUN curl --retry 3 -fL <%= server_download_url %> |tar xzf - && \
|
|
259
|
+
mv mongo*/ /opt/mongodb
|
|
260
|
+
ENV USE_OPT_MONGODB=1 USE_SYSTEM_PYTHON_PACKAGES=1
|
|
261
|
+
|
|
181
262
|
<% end %>
|
|
182
263
|
|
|
183
264
|
<% if distro =~ /debian|ubuntu/ %>
|
|
@@ -217,8 +298,6 @@ WORKDIR /app
|
|
|
217
298
|
ENV DOCKER_PRELOAD=1
|
|
218
299
|
<% end %>
|
|
219
300
|
|
|
220
|
-
RUN npm install --global yarn
|
|
221
|
-
|
|
222
301
|
ENV MONGO_ORCHESTRATION_HOME=/tmpfs \
|
|
223
302
|
PROJECT_DIRECTORY=/app \
|
|
224
303
|
<%= @env.map { |k, v| %Q`#{k}="#{v.gsub('$', "\\$").gsub('"', "\\\"")}"` }.join(" \\\n ") %>
|
|
@@ -229,9 +308,6 @@ ENV MONGO_ORCHESTRATION_HOME=/tmpfs \
|
|
|
229
308
|
|
|
230
309
|
COPY . .
|
|
231
310
|
|
|
232
|
-
RUN bash -c '. .evergreen/download-mongodb.sh && get_distro && get_mongodb_download_url_for "$DISTRO" "<%= server_version %>" && curl --retry 3 -fL $MONGODB_DOWNLOAD_URL |tar xzf - && mv mongo*/ /opt/mongodb'
|
|
233
|
-
ENV USE_OPT_MONGODB=1 USE_SYSTEM_PYTHON_PACKAGES=1
|
|
234
|
-
|
|
235
311
|
<% if expose? %>
|
|
236
312
|
|
|
237
313
|
<% ports = [] %>
|
data/spec/shared/shlib/distro.sh
CHANGED
|
@@ -64,16 +64,6 @@ _detect_distro() {
|
|
|
64
64
|
release=`echo $release |sed -e s/7/70/ -e s/6/62/ -e s/8/80/`
|
|
65
65
|
distro=rhel$release
|
|
66
66
|
fi
|
|
67
|
-
elif test -f /etc/os-release; then
|
|
68
|
-
name=`grep -o '^NAME=.*' /etc/os-release | awk -F '"' '{ print $2 }'`
|
|
69
|
-
version=`grep -o '^VERSION=.*' /etc/os-release | awk -F '"' '{ print $2 }'`
|
|
70
|
-
if test "$name" = "Amazon Linux"; then
|
|
71
|
-
distro=amazon$version
|
|
72
|
-
else
|
|
73
|
-
cat /etc/os-release
|
|
74
|
-
echo 'Unknown distro' 1>&2
|
|
75
|
-
exit 1
|
|
76
|
-
fi
|
|
77
67
|
else
|
|
78
68
|
lsb_release -a
|
|
79
69
|
echo 'Unknown distro' 1>&2
|