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.
EX-1476 Create step to create and populate ldev config
Create the step that will populate the ldev config. Signed-off-by: johnsonw <[email protected]>
- Loading branch information
Showing
21 changed files
with
536 additions
and
61 deletions.
There are no files selected for viewing
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,38 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.11.23 on 2020-10-01 17:00 | ||
from __future__ import unicode_literals | ||
|
||
import django.contrib.postgres.fields.jsonb | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("chroma_core", "0027_add_scan_mdt_jobs"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="ConfigureLDevJob", | ||
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", | ||
), | ||
), | ||
("ldev_entries", django.contrib.postgres.fields.jsonb.JSONField(default={})), | ||
], | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright (c) 2020 DDN. All rights reserved. | ||
# Use of this source code is governed by a MIT-style | ||
# license that can be found in the LICENSE file. | ||
|
||
from chroma_core.lib.job import Step | ||
from chroma_core.models import Job | ||
from chroma_help.help import help_text | ||
from django.contrib.postgres import fields | ||
|
||
import json | ||
|
||
|
||
class ConfigureLDevStep(Step): | ||
def run(self, kwargs): | ||
ldev_entries = kwargs["ldev_entries"] | ||
ldev_entries = json.loads(ldev_entries) | ||
|
||
for (fqdn, entries) in ldev_entries.items(): | ||
self.invoke_rust_agent_expect_result(fqdn, "create_ldev_conf", entries) | ||
|
||
|
||
class ConfigureLDevJob(Job): | ||
verb = "Configure LDev" | ||
ldev_entries = fields.JSONField(default={}) | ||
|
||
class Meta: | ||
app_label = "chroma_core" | ||
ordering = ["id"] | ||
|
||
@classmethod | ||
def long_description(cls): | ||
return help_text["configure_ldev"] | ||
|
||
def description(self): | ||
return self.long_description() | ||
|
||
def get_steps(self): | ||
return [(ConfigureLDevStep, {"ldev_entries": self.ldev_entries})] |
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
11 changes: 11 additions & 0 deletions
11
.../src/action_plugins/snapshots/iml_agent__action_plugins__ldev__tests__ldiskfs_create.snap
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,11 @@ | ||
--- | ||
source: iml-agent/src/action_plugins/ldev.rs | ||
expression: data | ||
--- | ||
mds1 mds2 MGS ldiskfs:/mnt/mgt | ||
mds1 mds2 fs-MDT0000 ldiskfs:/mnt/mdt0 | ||
mds2 mds1 fs-MDT0001 ldiskfs:/mnt/mdt1 | ||
oss1 oss2 fs-OST0000 ldiskfs:/mnt/ost0 | ||
oss2 oss1 fs-OST0001 ldiskfs:/mnt/ost1 | ||
oss1 oss2 fs-OST0002 ldiskfs:/mnt/ost2 | ||
oss2 oss1 fs-OST0003 ldiskfs:/mnt/ost3 |
90 changes: 90 additions & 0 deletions
90
...nt/src/action_plugins/snapshots/iml_agent__action_plugins__ldev__tests__parsing_data.snap
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,90 @@ | ||
--- | ||
source: iml-agent/src/action_plugins/ldev.rs | ||
expression: data | ||
--- | ||
{ | ||
LdevEntry { | ||
primary: "zeno1", | ||
failover: Some( | ||
"zeno5", | ||
), | ||
label: "zeno-OST0000", | ||
device: "zfs:lustre-zeno1/ost1", | ||
fs_type: Some( | ||
Zfs, | ||
), | ||
}, | ||
LdevEntry { | ||
primary: "zeno2", | ||
failover: None, | ||
label: "zeno-OST0001", | ||
device: "zfs:lustre-zeno2/ost1", | ||
fs_type: Some( | ||
Zfs, | ||
), | ||
}, | ||
LdevEntry { | ||
primary: "zeno3", | ||
failover: Some( | ||
"zeno7", | ||
), | ||
label: "zeno-OST0002", | ||
device: "zfs:lustre-zeno3/ost1", | ||
fs_type: Some( | ||
Zfs, | ||
), | ||
}, | ||
LdevEntry { | ||
primary: "zeno4", | ||
failover: Some( | ||
"zeno8", | ||
), | ||
label: "zeno-OST0003", | ||
device: "zfs:lustre-zeno4/ost1", | ||
fs_type: Some( | ||
Zfs, | ||
), | ||
}, | ||
LdevEntry { | ||
primary: "zeno5", | ||
failover: Some( | ||
"zeno1", | ||
), | ||
label: "zeno-OST0004", | ||
device: "zfs:lustre-zeno5/ost1", | ||
fs_type: Some( | ||
Zfs, | ||
), | ||
}, | ||
LdevEntry { | ||
primary: "zeno6", | ||
failover: None, | ||
label: "zeno-OST0005", | ||
device: "zfs:lustre-zeno6/ost1", | ||
fs_type: Some( | ||
Zfs, | ||
), | ||
}, | ||
LdevEntry { | ||
primary: "zeno7", | ||
failover: Some( | ||
"zeno3", | ||
), | ||
label: "zeno-OST0006", | ||
device: "zfs:lustre-zeno7/ost1", | ||
fs_type: Some( | ||
Zfs, | ||
), | ||
}, | ||
LdevEntry { | ||
primary: "zeno8", | ||
failover: Some( | ||
"zeno4", | ||
), | ||
label: "zeno-OST0007", | ||
device: "zfs:lustre-zeno8/ost1", | ||
fs_type: Some( | ||
Zfs, | ||
), | ||
}, | ||
} |
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
Oops, something went wrong.