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

Prepare update-db-script for v2.6.0 #1788

Conversation

ychiucco
Copy link
Collaborator

@ychiucco ychiucco commented Sep 20, 2024

Checklist before merging

  • I added an appropriate entry to CHANGELOG.md
  • I added logging to new code - if appropriate.
  • I merged main into the current branch.

@tcompa tcompa changed the title Deprecate use of users slurm_user, cache_dir and slurm_accounts Prepare update-db-script for v2.6.0 Sep 20, 2024
Copy link

github-actions bot commented Sep 20, 2024

Coverage report

This PR does not seem to contain any modification to coverable code.

@ychiucco
Copy link
Collaborator Author

dropdb fractal_test
createdb fractal_test
psql -U postgres -h localhost -d fractal_test -f tests/data/testing_databases/clean_db_fractal_2.4.0.sql
poetry run fractalctl set-db
echo -e "yes\nyes\nyes\nyes\nyes"| poetry run fractalctl update-db-data


**WARNING**
This command acts directly on database data. If you have any doubt about this, do not run it!

Expected use case:
You have updated fractal-server from some old version to a target version, and now need to fix some database data.
The detected target version is '2.6.0' (corresponding to the update-db-data module '2_6_0.py').
Note that the old and target versions MUST be consecutive, that is, you cannot skip an intermediate version.
The list of released versions is available at https://github.com/fractal-analytics-platform/fractal-server/blob/main/CHANGELOG.md.

Do you confirm that the old and target versions are consecutive? (yes/no)
Do you confirm that the target version is 2.6.0? (yes/no)
Have you run 'fractalctl set-db' with the target version? (yes/no)
Have you made a backup of your database (e.g. via `pg_dump`)? (yes/no)
Are you sure you want to proceed? (yes/no)
OK, now starting data-migration script

WARNING:fix_db:START execution of fix_db function
WARNING:fix_db:START handling user 1: 'admin@example.org'
WARNING:fix_db:New user 1 settings:
ssh_host=None ssh_username=None slurm_user=None cache_dir='/tmp/__REDACTED_CACHE_DIR__' ssh_tasks_dir=None id=1 ssh_private_key_path=None ssh_jobs_dir=None slurm_accounts=[]
WARNING:fix_db:END handling user 1: 'admin@example.org'
WARNING:fix_db:START handling user 6: 'user@example.org'
WARNING:fix_db:New user 6 settings:
ssh_host=None ssh_username=None slurm_user='__REDACTED_SLURM_USER_' cache_dir='/tmp/__REDACTED_CACHE_DIR__' ssh_tasks_dir=None id=2 ssh_private_key_path=None ssh_jobs_dir=None slurm_accounts=[]
WARNING:fix_db:END handling user 6: 'user@example.org'
WARNING:fix_db:START handling user 27: 'admin@fractal.xy'
WARNING:fix_db:New user 27 settings:
ssh_host=None ssh_username=None slurm_user='slurm' cache_dir=None ssh_tasks_dir=None id=3 ssh_private_key_path=None ssh_jobs_dir=None slurm_accounts=[]
WARNING:fix_db:END handling user 27: 'admin@fractal.xy'
WARNING:fix_db:START handling user 28: 'vanilla@example.org'
WARNING:fix_db:New user 28 settings:
ssh_host=None ssh_username=None slurm_user='vanilla-slurm' cache_dir=None ssh_tasks_dir=None id=4 ssh_private_key_path=None ssh_jobs_dir=None slurm_accounts=[]
WARNING:fix_db:END handling user 28: 'vanilla@example.org'
WARNING:fix_db:END of execution of fix_db function

@ychiucco ychiucco merged commit 7228364 into 1774-introduce-user-settings Sep 20, 2024
14 checks passed
@ychiucco ychiucco deleted the 1786-deprecate-use-of-users-slurm_user-cache_dir-and-slurm_accounts branch September 20, 2024 11:29
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.

1 participant