-
Notifications
You must be signed in to change notification settings - Fork 4
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
Feature/Admin CLI enhancements #210
Conversation
We could just call it |
I like |
k8s/templates/job-backup.yaml
Outdated
imagePullPolicy: {{ .Values.lifemonitor.imagePullPolicy }} | ||
command: ["/bin/sh","-c"] | ||
args: | ||
- base_path="/var/data/backup" ; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps this code would be easier to maintain if placed in a script in the lifemonitor image that is used to execute this job.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Script replaced by lm-admin backup
command (ee8401a)
lifemonitor/commands/db.py
Outdated
file = f"{datetime.now().strftime('%Y%m%d_%H%M%S')}.tar" | ||
target_path = os.path.join(directory, file) | ||
cmd = f"PGPASSWORD={params['password']} pg_dump -h {params['host']} -U {params['user']} -F t {params['dbname']} > {target_path}" | ||
os.system(cmd) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code is not checking the exit code from the called process. Rather than os.system
, we'd be better off just using subprocess.check_call
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed in 3a72fa2
https://crs4.github.io/life_monitor/lm_admin_guide needs to be updated accordingly |
Allow to make (and optionally synch with a remote site via FTP(s)) backups of both RO-Crates and database
This PR introduces a basic
manage.py
script which acts as entrypoint for the back-end CLI.The available commands are:
Usage: manage.py [OPTIONS] COMMAND [ARGS]... Options: --help Show this message and exit. Commands: api-key Manage admin API keys cache Manage cache db Manage database oauth Manage credentials for OAuth2 clients registry Manage workflow registries task-queue Manage task queue
The current version of the
db
command includes all the relevant subcommands to:Finally, the k8s chart includes a configurable CronJob to perform automatic backups on a user-defined cluster volume and, optionally, to sync that volume with a remote site via SFTP.