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

Cu 86bygn3jn images placement for client registry mapper kafka fhir #288

Conversation

brett-onions
Copy link
Contributor

@brett-onions brett-onions commented Apr 26, 2024

Summary by CodeRabbit

  • New Features

    • Introduced new environment variables and configurations for PostgreSQL and related services in multiple components.
    • Added functionality to create databases and users in PostgreSQL for the Client Registry JeMPI and Dashboard Visualizer Superset.
    • Added new services for PostgreSQL setup in Docker Compose files.
  • Bug Fixes

    • Updated environment variable placeholders for consistency and clarity across configurations.
  • Chores

    • Updated package-metadata.json files to include specific image versions and node placements.
    • Added new configuration parameters for PostgreSQL replicas.

…ta-file-for-message-bus-kafka' into CU-86bygn3jn_Images-Placement-for-Client-Registry-Mapper-Kafka-FHIR
…ta-file-for-message-bus-helper-hapi-proxy' into CU-86bygn3jn_Images-Placement-for-Client-Registry-Mapper-Kafka-FHIR
…ta-file-for-kafka-unbundler-consumer' into CU-86bygn3jn_Images-Placement-for-Client-Registry-Mapper-Kafka-FHIR
…ta-file-for-kafka-mapper-consumer' into CU-86bygn3jn_Images-Placement-for-Client-Registry-Mapper-Kafka-FHIR
…ta-file-for-fhir-datastore-hapi-fhir' into CU-86bygn3jn_Images-Placement-for-Client-Registry-Mapper-Kafka-FHIR
…ta-file-for-mpi-mediator' into CU-86bygn3jn_Images-Placement-for-Client-Registry-Mapper-Kafka-FHIR
…ta-file-for-data-mapper-logstash' into CU-86bygn3jn_Images-Placement-for-Client-Registry-Mapper-Kafka-FHIR
…ta-file-for-client-registry-jempi' into CU-86bygn3jn_Images-Placement-for-Client-Registry-Mapper-Kafka-FHIR
…ta-file-for-client-registry-santempi' into CU-86bygn3jn_Images-Placement-for-Client-Registry-Mapper-Kafka-FHIR
@rcrichton
Copy link
Member

Copy link
Contributor

coderabbitai bot commented May 20, 2024

Walkthrough

The changes introduce significant updates to the configuration and deployment of PostgreSQL databases across multiple services. Key modifications include the use of environment variables for image versions and credentials, the addition of new services for PostgreSQL setup, and the creation of new scripts for database initialization. These changes enhance flexibility, improve maintainability, and streamline the setup process for PostgreSQL in various components.

Changes

File Path Change Summary
client-registry-jempi/docker-compose...yml Updated version format, replaced hardcoded image versions with environment variables.
client-registry-jempi/docker-compose...yml Updated environment variables for PostgreSQL configuration, added new postgres service.
client-registry-jempi/importer/postgres/... Added functionality to create databases and users, introduced new SQL queries for setup.
client-registry-jempi/importer/postgres/... Introduced docker-compose.config.yml for setting up Node.js environment for PostgreSQL setup.
client-registry-jempi/importer/postgres/... Updated package.json to include pg dependency version ^8.11.3.
client-registry-jempi/package-metadata.json Added new environment variables for PostgreSQL, Dgraph Zero, and Dgraph Ratel components.
client-registry-jempi/swarm.sh Included configuration for deploying PostgreSQL database setup.
dashboard-visualiser-superset/docker-compose.yml Added new postgres service and defined external network access.
dashboard-visualiser-superset/importer/postgres/... Introduced functionality to create databases and users in PostgreSQL.
dashboard-visualiser-superset/importer/postgres/... Introduced docker-compose.config.yml for setting up Node.js environment for PostgreSQL setup.
dashboard-visualiser-superset/importer/postgres/... Updated package.json to include pg dependency version ^8.11.3.
dashboard-visualiser-superset/package-metadata.json Updated environment variables for PostgreSQL configuration, added dependency on database-postgres.
dashboard-visualiser-superset/swarm.sh Modified deployment process for PostgreSQL users and tables.
test/cucumber/features/cluster-mode/... Removed references to the service jempi-postgresql-01.
test/cucumber/features/single-mode/... Removed references to the service jempi-postgresql-01.
.env.cluster Added new configurations for SUPERSET_POSTGRESQL_URL and JEMPI_POSTGRES_DB.
database-postgres/package-metadata.json Added new configuration parameter POSTGRES_REPLICAS with value "1".

Poem

In the realm of code so bright,
PostgreSQL takes flight.
Variables now in their place,
Configurations with grace.
New scripts to guide the way,
Data flows without delay.
Hail to the changes, hip-hip-hooray! 🎉


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@drizzentic drizzentic marked this pull request as ready for review May 29, 2024 09:23
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 4347be6 and 8de8a4a.
Files selected for processing (24)
  • client-registry-jempi/docker-compose.combined-cluster.yml (3 hunks)
  • client-registry-jempi/docker-compose.combined.yml (7 hunks)
  • client-registry-jempi/docker-compose.dgraph-zero-cluster.yml (2 hunks)
  • client-registry-jempi/docker-compose.dgraph-zero.yml (1 hunks)
  • client-registry-jempi/docker-compose.dgraph.yml (4 hunks)
  • client-registry-jempi/package-metadata.json (1 hunks)
  • client-registry-santempi/docker-compose.yml (2 hunks)
  • client-registry-santempi/package-metadata.json (1 hunks)
  • data-mapper-logstash/docker-compose.yml (2 hunks)
  • data-mapper-logstash/package-metadata.json (1 hunks)
  • database-postgres/docker-compose-postgres.cluster.yml (2 hunks)
  • database-postgres/docker-compose-postgres.yml (1 hunks)
  • kafka-mapper-consumer/docker-compose.yml (1 hunks)
  • kafka-unbundler-consumer/docker-compose.yml (1 hunks)
  • kafka-unbundler-consumer/package-metadata.json (1 hunks)
  • message-bus-helper-hapi-proxy/docker-compose.yml (1 hunks)
  • message-bus-helper-hapi-proxy/package-metadata.json (1 hunks)
  • message-bus-kafka/docker-compose.cluster.kafka.yml (3 hunks)
  • message-bus-kafka/docker-compose.kafka-utils.yml (2 hunks)
  • message-bus-kafka/docker-compose.kafka.yml (2 hunks)
  • message-bus-kafka/package-metadata.json (1 hunks)
  • mpi-mediator/docker-compose.yml (2 hunks)
  • mpi-mediator/importer/docker-compose.config.yml (2 hunks)
  • mpi-mediator/package-metadata.json (1 hunks)
Files skipped from review due to trivial changes (17)
  • client-registry-jempi/docker-compose.combined-cluster.yml
  • client-registry-jempi/docker-compose.combined.yml
  • client-registry-jempi/docker-compose.dgraph-zero.yml
  • client-registry-jempi/docker-compose.dgraph.yml
  • client-registry-santempi/docker-compose.yml
  • data-mapper-logstash/docker-compose.yml
  • database-postgres/docker-compose-postgres.cluster.yml
  • database-postgres/docker-compose-postgres.yml
  • kafka-mapper-consumer/docker-compose.yml
  • kafka-unbundler-consumer/docker-compose.yml
  • kafka-unbundler-consumer/package-metadata.json
  • message-bus-helper-hapi-proxy/docker-compose.yml
  • message-bus-helper-hapi-proxy/package-metadata.json
  • message-bus-kafka/docker-compose.kafka.yml
  • mpi-mediator/docker-compose.yml
  • mpi-mediator/importer/docker-compose.config.yml
  • mpi-mediator/package-metadata.json
Additional comments not posted (9)
data-mapper-logstash/package-metadata.json (2)

9-9: The update to use an environment variable for the Logstash image aligns with the PR's goal for dynamic configuration.


11-11: Setting a maximum number of replicas per node is a good practice for resource management.

client-registry-santempi/package-metadata.json (1)

10-20: The introduction of environment variables for PostgreSQL credentials and image versions supports dynamic configuration and aligns with the PR's objectives.

message-bus-kafka/docker-compose.kafka-utils.yml (2)

5-12: The dynamic configuration for the Kafdrop service, including image and JVM options, enhances flexibility and aligns with the PR's objectives.


23-23: The dynamic configuration for the Kafka Minion service, including image and resource limits, enhances flexibility and aligns with the PR's objectives.

message-bus-kafka/package-metadata.json (1)

9-15: The introduction of environment variables for Kafka and Kafdrop settings supports dynamic configuration and aligns with the PR's objectives.

client-registry-jempi/docker-compose.dgraph-zero-cluster.yml (1)

Line range hint 8-41: The dynamic configuration for the Dgraph Zero services, including image references and placement constraints, enhances flexibility and aligns with the PR's objectives.

message-bus-kafka/docker-compose.cluster.kafka.yml (1)

Line range hint 10-70: The dynamic configuration for the Kafka services, including image references, placement constraints, and resource limits, enhances flexibility and aligns with the PR's objectives.

client-registry-jempi/package-metadata.json (1)

19-21: Validate the placement constraints are correctly implemented in the Docker Compose configurations.

client-registry-jempi/package-metadata.json Outdated Show resolved Hide resolved
…Placement-for-Client-Registry-Mapper-Kafka-FHIR
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 12

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 8de8a4a and 6774f8e.
Files selected for processing (18)
  • .env.cluster (3 hunks)
  • client-registry-jempi/docker-compose.api.yml (5 hunks)
  • client-registry-jempi/docker-compose.combined-cluster.yml (1 hunks)
  • client-registry-jempi/docker-compose.combined-dev.yml (2 hunks)
  • client-registry-jempi/docker-compose.combined.yml (7 hunks)
  • client-registry-jempi/importer/postgres/create-db.js (1 hunks)
  • client-registry-jempi/importer/postgres/docker-compose.config.yml (1 hunks)
  • client-registry-jempi/importer/postgres/package.json (1 hunks)
  • client-registry-jempi/package-metadata.json (2 hunks)
  • client-registry-jempi/swarm.sh (1 hunks)
  • dashboard-visualiser-superset/docker-compose.yml (2 hunks)
  • dashboard-visualiser-superset/importer/postgres/create-db.js (1 hunks)
  • dashboard-visualiser-superset/importer/postgres/docker-compose.config.yml (1 hunks)
  • dashboard-visualiser-superset/importer/postgres/package.json (1 hunks)
  • dashboard-visualiser-superset/package-metadata.json (2 hunks)
  • dashboard-visualiser-superset/swarm.sh (2 hunks)
  • test/cucumber/features/cluster-mode/jempi.cluster.feature (2 hunks)
  • test/cucumber/features/single-mode/jempi.feature (2 hunks)
Files skipped from review due to trivial changes (6)
  • client-registry-jempi/docker-compose.combined-dev.yml
  • client-registry-jempi/importer/postgres/package.json
  • dashboard-visualiser-superset/importer/postgres/docker-compose.config.yml
  • dashboard-visualiser-superset/importer/postgres/package.json
  • test/cucumber/features/cluster-mode/jempi.cluster.feature
  • test/cucumber/features/single-mode/jempi.feature
Files skipped from review as they are similar to previous changes (2)
  • client-registry-jempi/docker-compose.combined.yml
  • client-registry-jempi/package-metadata.json
Additional comments not posted (11)
client-registry-jempi/docker-compose.combined-cluster.yml (1)

1-1: The version format has been updated to use double quotes, which is consistent with YAML best practices for string representation.

client-registry-jempi/importer/postgres/docker-compose.config.yml (2)

1-1: The version format has been updated to use single quotes, which is consistent with YAML best practices for string representation.


5-6: The use of node:erbium-alpine is a good choice for a lightweight container. However, ensure that all necessary Node.js dependencies are compatible with this version.

Verification successful

The package.json file for the postgres-config project specifies only one dependency: pg version ^8.11.3. This version of the pg library is compatible with Node.js Erbium (v12).

  • The package.json does not specify any engine requirements.
  • There are no devDependencies listed.

Based on this information, the use of node:erbium-alpine should be compatible with the specified dependencies.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify Node.js compatibility with `node:erbium-alpine`.

# Test: Check package.json for engine specifications.
cat client-registry-jempi/importer/postgres/package.json | grep "engines"

Length of output: 73



Script:

#!/bin/bash
# Description: Inspect package.json for dependencies and their compatibility with Node.js Erbium.

# Display the entire package.json content for manual inspection.
cat client-registry-jempi/importer/postgres/package.json

# List all dependencies and their versions.
jq '.dependencies' client-registry-jempi/importer/postgres/package.json

# List all devDependencies and their versions.
jq '.devDependencies' client-registry-jempi/importer/postgres/package.json

Length of output: 418

dashboard-visualiser-superset/importer/postgres/create-db.js (1)

1-1: The inclusion of the pg module is essential for PostgreSQL operations. Ensure that the version used is compatible with the rest of the application.

Verification successful

The pg module version used in the project is ^8.11.3, as found in multiple package.json files, including dashboard-visualiser-superset/importer/postgres/package.json. This version should be compatible with the rest of the application, assuming no specific version conflicts are present.

  • dashboard-visualiser-superset/importer/postgres/package.json: "pg": "^8.11.3"
Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify PostgreSQL module version compatibility.

# Test: Check package.json for `pg` module version.
cat dashboard-visualiser-superset/package-metadata.json | grep "pg"

Length of output: 67



Script:

#!/bin/bash
# Description: Verify PostgreSQL module version compatibility.

# Test: Check package.json and package-lock.json for `pg` module version.
grep -H "pg" dashboard-visualiser-superset/package.json dashboard-visualiser-superset/package-lock.json

Length of output: 260



Script:

#!/bin/bash
# Description: Locate package.json and package-lock.json files and verify PostgreSQL module version compatibility.

# Find package.json and package-lock.json files in the repository
fd -e json -g "package*.json"

# Check for `pg` module version in the located package.json and package-lock.json files
fd -e json -g "package*.json" --exec grep -H "pg"

Length of output: 1847

dashboard-visualiser-superset/swarm.sh (1)

48-49: The script correctly handles the deployment of PostgreSQL configurations. Ensure that the referenced Docker Compose files and paths are correct and accessible.

Verification successful

The referenced Docker Compose files and paths are correct and accessible.

  • dashboard-visualiser-superset/importer/postgres/docker-compose.config.yml
  • dashboard-visualiser-superset/docker-compose.yml
Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify Docker Compose file paths.

# Test: Check file existence.
ls dashboard-visualiser-superset/importer/postgres/docker-compose.config.yml
ls dashboard-visualiser-superset/docker-compose.yml

Length of output: 255

client-registry-jempi/docker-compose.api.yml (2)

97-99: Confirm that the postgres network is defined as external and correctly configured to ensure it can be used by the services in this Docker Compose file.


37-37: The addition of the postgres network to the jempi-api service should be accompanied by a corresponding network definition in the Docker Compose file to ensure proper connectivity.

Verification successful

The postgres network is indeed defined in the Docker Compose file, and it is marked as an external network. This ensures proper connectivity for the jempi-api service.

  • The postgres network is listed under the networks section.
  • It is also referenced correctly in the jempi-api service configuration.
  • The network is defined as external, which means it should be created outside of this Docker Compose file.
Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the definition of the `postgres` network in the Docker Compose file.

# Test: Search for the network definition. Expect: Definition for `postgres` network.
rg --type yaml 'postgres:' client-registry-jempi/docker-compose.api.yml

Length of output: 115



Script:

#!/bin/bash
# Description: Extract and display the relevant sections of the Docker Compose file to verify the `postgres` network definitions.

# Extract lines around each occurrence of `postgres:` to understand the context.
rg --type yaml -A 5 -B 5 'postgres:' client-registry-jempi/docker-compose.api.yml

Length of output: 604

.env.cluster (1)

106-106: Ensure that the JEMPI_POSTGRES_DB variable is correctly configured to point to the PostgreSQL instances intended for the JeMPI service.

client-registry-jempi/importer/postgres/create-db.js (2)

20-88: Ensure that the SQL queries for table creation are syntactically correct and optimized for performance. Also, verify that the foreign key constraints are properly set up to maintain data integrity.


97-135: Confirm that the database and user creation processes handle errors appropriately and that the script logs sufficient information for debugging purposes. Also, ensure that the script releases database connections properly to avoid resource leaks.

client-registry-jempi/swarm.sh (1)

68-70: Ensure that the new PostgreSQL database configuration step in the deployment script is correctly integrated with the rest of the deployment processes and that it correctly handles potential errors.

dashboard-visualiser-superset/package-metadata.json Outdated Show resolved Hide resolved
client-registry-jempi/docker-compose.api.yml Outdated Show resolved Hide resolved
client-registry-jempi/docker-compose.api.yml Outdated Show resolved Hide resolved
.env.cluster Outdated Show resolved Hide resolved
.env.cluster Outdated Show resolved Hide resolved
dashboard-visualiser-superset/docker-compose.yml Outdated Show resolved Hide resolved
client-registry-jempi/importer/postgres/create-db.js Outdated Show resolved Hide resolved
@drizzentic drizzentic marked this pull request as draft May 30, 2024 09:14
@drizzentic drizzentic marked this pull request as ready for review May 30, 2024 09:15
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 6774f8e and 9f1dac8.

Files selected for processing (1)
  • client-registry-jempi/package-metadata.json (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • client-registry-jempi/package-metadata.json

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Outside diff range and nitpick comments (1)
database-postgres/package-metadata.json (1)

38-38: Specify the unit for POSTGRES_DEGRADED_MONITORING_TIMEOUT.

It's important to clarify whether the timeout is in seconds, minutes, or another unit to avoid configuration errors.

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 9f1dac8 and 33166dd.

Files selected for processing (1)
  • database-postgres/package-metadata.json (1 hunks)
Additional comments not posted (1)
database-postgres/package-metadata.json (1)

39-39: Verify the appropriateness of POSTGRES_REPLICAS.

Ensure that setting the number of replicas to "1" aligns with the system's scalability and fault tolerance requirements. Consider increasing the number of replicas if higher availability is needed.

@bradsawadye bradsawadye marked this pull request as draft May 31, 2024 10:18
@bradsawadye bradsawadye marked this pull request as ready for review May 31, 2024 10:19
@drizzentic drizzentic modified the milestone: .google.com May 31, 2024
@brett-onions brett-onions merged commit ec6ae59 into main May 31, 2024
@brett-onions brett-onions deleted the CU-86bygn3jn_Images-Placement-for-Client-Registry-Mapper-Kafka-FHIR branch May 31, 2024 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants