Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR contains a set of 2 changes to the SUPReMM setup script:
Depends on #275
Motivation and Context
With the introduction of Mongo version 5.0, the shell is now accessed with
mongosh
instead ofmongo
. More info here. This breaks thesupremm-setup
script when configuring against versions of mongo >=5.0 because the script attempts to update the schema with a python subprocess that calls the oldmongo
command. The proposed solution is to use the existingpymongo
dependency to configure the schema. Usingpymongo
also means that the mongo shell does not need to be installed on the same host as the summarization software.There is also a fix for a bug that would erroneously set a resource's configuration with the default settings for a resource's datasource (pcp or prometheus). For example, if a resource were configured for prometheus, the configuration file would still populate the "pcp_log_dir" setting with the default configuration.
Tests Performed
Tested in docker container against versions of mongo prior to the change from
mongo
tomongosh
.NOTE: Be sure to change the tag of the mongo version when testing.
Clone this repo and create the following compose file at the top-level.
docker-compose.yml
Start the services and
docker compose up -d docker exec -it docker-supremm-1 /bin/bash
Inside
supremm
container:cd scratch/supremm ./tests/ci/setup.sh build python3 setup.py install supremm-setup
Select (m) to continue with the MongoDB setup. The changes from this PR first validate the URI then attempts to write the schemas to the
schema
collection in the Mongosupremm
db. The valid URI for the mongodb in this test setup is:mongodb://root:xdmod@mongo/supremm?authSource=admin
Checklist