This repository has been archived by the owner on Jul 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement MountSnapshotJob / UnmountSnapshotJob (#2156)
* First try on MountSnapshotJob Signed-off-by: Michael Pankov <work@michaelpankov.com> * Add a migration Signed-off-by: Michael Pankov <work@michaelpankov.com> * Renumber the migration Signed-off-by: Michael Pankov <work@michaelpankov.com> * Address CodeFactor Signed-off-by: Michael Pankov <work@michaelpankov.com> * Use host.fqdn Signed-off-by: Michael Pankov <work@michaelpankov.com> * Format the migration Signed-off-by: Michael Pankov <work@michaelpankov.com> * Take care of review Signed-off-by: Michael Pankov <work@michaelpankov.com> * Implement UnmountSnapshotJob Signed-off-by: Michael Pankov <work@michaelpankov.com> * Redo the migration Signed-off-by: Michael Pankov <work@michaelpankov.com> * Add dependencies Signed-off-by: Michael Pankov <work@michaelpankov.com> * Add snapshot Create/Destroy jobs (#2159) Signed-off-by: Igor Pashev <pashev.igor@gmail.com> Co-authored-by: Igor Pashev <pashev.igor@gmail.com>
- Loading branch information
Showing
4 changed files
with
240 additions
and
0 deletions.
There are no files selected for viewing
58 changes: 58 additions & 0 deletions
58
chroma_core/migrations/0024_mountsnapshotjob_unmountsnapshotjob.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.11.23 on 2020-08-14 09:30 | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("chroma_core", "0023_remove_stratagem_client_job"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="MountSnapshotJob", | ||
fields=[ | ||
( | ||
"job_ptr", | ||
models.OneToOneField( | ||
auto_created=True, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
parent_link=True, | ||
primary_key=True, | ||
serialize=False, | ||
to="chroma_core.Job", | ||
), | ||
), | ||
("fqdn", models.CharField(max_length=256)), | ||
("fsname", models.CharField(max_length=8)), | ||
("name", models.CharField(max_length=512)), | ||
], | ||
options={"ordering": ["id"],}, | ||
bases=("chroma_core.job",), | ||
), | ||
migrations.CreateModel( | ||
name="UnmountSnapshotJob", | ||
fields=[ | ||
( | ||
"job_ptr", | ||
models.OneToOneField( | ||
auto_created=True, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
parent_link=True, | ||
primary_key=True, | ||
serialize=False, | ||
to="chroma_core.Job", | ||
), | ||
), | ||
("fqdn", models.CharField(max_length=256)), | ||
("fsname", models.CharField(max_length=8)), | ||
("name", models.CharField(max_length=512)), | ||
], | ||
options={"ordering": ["id"],}, | ||
bases=("chroma_core.job",), | ||
), | ||
] |
63 changes: 63 additions & 0 deletions
63
chroma_core/migrations/0025_createsnapshotjob_destroysnapshotjob.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.11.27 on 2020-08-13 18:55 | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("chroma_core", "0024_mountsnapshotjob_unmountsnapshotjob"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="CreateSnapshotJob", | ||
fields=[ | ||
( | ||
"job_ptr", | ||
models.OneToOneField( | ||
auto_created=True, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
parent_link=True, | ||
primary_key=True, | ||
serialize=False, | ||
to="chroma_core.Job", | ||
), | ||
), | ||
("fqdn", models.CharField(help_text=b"MGS host to create the snapshot on", max_length=256)), | ||
("fsname", models.CharField(help_text=b"Lustre filesystem name", max_length=8)), | ||
("name", models.CharField(help_text=b"Snapshot name", max_length=64)), | ||
( | ||
"comment", | ||
models.CharField(help_text=b"Optional comment for the snapshot", max_length=1024, null=True), | ||
), | ||
], | ||
options={"ordering": ["id"],}, | ||
bases=("chroma_core.job",), | ||
), | ||
migrations.CreateModel( | ||
name="DestroySnapshotJob", | ||
fields=[ | ||
( | ||
"job_ptr", | ||
models.OneToOneField( | ||
auto_created=True, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
parent_link=True, | ||
primary_key=True, | ||
serialize=False, | ||
to="chroma_core.Job", | ||
), | ||
), | ||
("fqdn", models.CharField(help_text=b"MGS host to destroy the snapshot on", max_length=256)), | ||
("fsname", models.CharField(help_text=b"Lustre filesystem name", max_length=8)), | ||
("name", models.CharField(help_text=b"Snapshot name", max_length=64)), | ||
("force", models.BooleanField(default=False, help_text=b"Destroy the snapshot with force")), | ||
], | ||
options={"ordering": ["id"],}, | ||
bases=("chroma_core.job",), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters