Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to setup script #274

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Conversation

connersaeli
Copy link
Contributor

@connersaeli connersaeli commented Mar 8, 2024

Description

This PR contains a set of 2 changes to the SUPReMM setup script:

  1. Support for versions of Mongo greater than or equal to 5.0
  2. Bugfix for incorrectly configured resources

Depends on #275

Motivation and Context

With the introduction of Mongo version 5.0, the shell is now accessed with mongosh instead of mongo. More info here. This breaks the supremm-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 old mongo command. The proposed solution is to use the existing pymongo dependency to configure the schema. Using pymongo 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 to mongosh.
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

version: '3.1'

services:
  supremm:
    image: tools-ext-01.ccr.xdmod.org/xdmod-job_performance-10.5.0:rockylinux8-0.1
    volumes:
      - .:/scratch/supremm
    stdin_open: true
    tty: true

  mongo:
    image: mongo:6.0
    restart: always
    ports:
      - "27017:27017"
    environment:
      MONGO_INITDB_ROOT_USERNAME: root
      MONGO_INITDB_ROOT_PASSWORD: xdmod

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 Mongo supremm db. The valid URI for the mongodb in this test setup is:

mongodb://root:xdmod@mongo/supremm?authSource=admin

Checklist

  • The pull request description is suitable for a Changelog entry
  • The milestone is set correctly on the pull request
  • The appropriate labels have been added to the pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant