mitodl / mitxpro

BSD 3-Clause "New" or "Revised" License
11 stars 2 forks source link

chore: upgrade docker-compose & CI postgres version to 15 #3004

Closed mudassir-hafeez closed 1 month ago

mudassir-hafeez commented 1 month ago

What are the relevant tickets?

#4440

Description (What does it do?)

This PR upgrades the docker-compose & CI PostgreSQL version to 15.

How can this be tested?

With Data Migration:

Follow these steps to upgrade PostgreSQL with data migration:

# 1. Using your old 12.19 database:
docker-compose exec -T db pg_dumpall -h db -U postgres > db_backup.sql
# 2. stop all containers
docker-compose stop
# 3 destroy the old database container
docker-compose rm -sv db
# 4. build+start the new database container
docker-compose up db -d
# 5. restore the database from backup
docker cp db_backup.sql $(docker-compose ps -q db):/tmp/backup.sql
docker-compose exec -T db psql -U postgres -d postgres -f /tmp/backup.sql
# 6. start the remaining containers
docker-compose up
# 7 verify postgres 15 is in use:
docker-compose exec -e PGPASSWORD=postgres db psql -h db -U postgres

Note: If you encounter password authentication failed for user "postgres" in STEP 6 due to no password being set for the user "postgres" in the SQL backup file, update the user password through the SQL shell docker-compose exec -it db psql -U postgres postgres:

Without Data Migration

Follow these steps to upgrade PostgreSQL without data migration:

docker-compose down
docker-compose up -d

Note: These commands will cleanly restart your Docker Compose setup.

gitguardian[bot] commented 1 month ago

āš ļø GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

šŸ”Ž Detected hardcoded secret in your pull request
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | | | -------------- | ------------------ | ------------------------------ | ---------------- | --------------- | -------------------- | | [9430286](https://dashboard.gitguardian.com/workspace/71358/incidents/9430286?occurrence=142913727) | Triggered | Generic Password | d0a35796c470afb3a2d21707aea7aafb94acc7a4 | docker-compose.yml | [View secret](https://github.com/mitodl/mitxpro/commit/d0a35796c470afb3a2d21707aea7aafb94acc7a4#diff-e45e45baeda1c1e73482975a664062aa56f20c03dd9d64a827aba57775bed0d3L28) |
šŸ›  Guidelines to remediate hardcoded secrets
1. Understand the implications of revoking this secret by investigating where it is used in your code. 2. Replace and store your secret safely. [Learn here](https://blog.gitguardian.com/secrets-api-management?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment) the best practices. 3. Revoke and [rotate this secret](https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/generics/generic_password#revoke-the-secret?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment). 4. If possible, [rewrite git history](https://blog.gitguardian.com/rewriting-git-history-cheatsheet?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment). Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data. To avoid such incidents in the future consider - following these [best practices](https://blog.gitguardian.com/secrets-api-management/?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment) for managing and storing secrets including API keys and other credentials - install [secret detection on pre-commit](https://docs.gitguardian.com/ggshield-docs/integrations/git-hooks/pre-commit?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment) to catch secret before it leaves your machine and ease remediation.

šŸ¦‰ GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.