summaryrefslogtreecommitdiff
path: root/python-plotmanx.spec
blob: 2b2a053c13ed89ed427a13965b8c2d67655a1aa8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
%global _empty_manifest_terminate_build 0
Name:		python-plotmanx
Version:	0.6.54
Release:	1
Summary:	Chia plotting manager
License:	Apache 2.0
URL:		https://github.com/ericaltendorf/plotman
Source0:	https://mirrors.nju.edu.cn/pypi/web/packages/a5/5c/7670cb71a64455ee75467b8ef32bed4a168fe20e4ddbd996890335ca1181/plotmanx-0.6.54.tar.gz
BuildArch:	noarch

Requires:	python3-appdirs
Requires:	python3-click
Requires:	python3-desert
Requires:	python3-marshmallow
Requires:	python3-pendulum
Requires:	python3-psutil
Requires:	python3-pyyaml
Requires:	python3-texttable
Requires:	python3-tornado
Requires:	python3-requests
Requires:	python3-prometheus-client
Requires:	python3-xlsxwriter
Requires:	python3-check-manifest
Requires:	python3-pytest
Requires:	python3-pytest-mock
Requires:	python3-pyfakefs
Requires:	python3-isort
Requires:	python3-check-manifest
Requires:	python3-pytest
Requires:	python3-pytest-mock
Requires:	python3-pyfakefs

%description
# Xman: another Chia plotting manager

This is a tool for managing [Chia](https://github.com/Chia-Network/chia-blockchain)
plotting operations.  The tool runs on the plotting machine and provides
the following functionality:

- Automatic spawning of new plotting jobs, possibly overlapping ("staggered")
  on multiple temp directories, rate-limited globally and by per-temp-dir
limits.

- Rsync'ing of newly generated plots to a remote host (a farmer/harvester),
  called "archiving".

- Monitoring of ongoing plotting and archiving jobs, progress, resources used,
  temp files, etc.

- Control of ongoing plotting jobs (suspend, resume, plus kill and clean up
  temp files).

- Both an interactive live dashboard mode as well as command line mode tools.

- (very alpha) Analyzing performance statistics of past jobs, to aggregate on
  various plotting parameters or temp dir type.

Plotman is designed for the following configuration:

- A plotting machine with an array of `tmp` dirs, a single `tmp2` dir, and an
  array of `dst` dirs to which the plot jobs plot.  The `dst` dirs serve as a
temporary buffer space for generated plots.

- A farming machine with a large number of drives, made accessible via an
  `rsyncd` module, and to be entirely populated with plots.  These are known as
the `archive` directories.

- Plot jobs are run with STDOUT/STDERR redirected to a log file in a configured
directory.  This allows analysis of progress (plot phase) as well as timing
(e.g. for analyzing performance).

## Functionality

Plotman tools are stateless.  Rather than keep an internal record of what jobs
have been started, Plotman relies on the process tables, open files, and
logfiles of plot jobs to understand "what's going on".  This means the tools
can be stopped and started, even from a different login session, without loss
of information.  It also means Plotman can see and manage jobs started manually
or by other tools, as long as their STDOUT/STDERR redirected to a file in a
known logfile directory.  (Note: The tool relies on reading the chia plot
command line arguments and the format of the plot tool output.  Changes in
those may break this tool.)

Plot scheduling is done by waiting for a certain amount of wall time since the
last job was started, finding the best (e.g. least recently used) `tmp` dir for
plotting, and ensuring that job has progressed to at least a certain point
(e.g., phase 2, subphase 5).

Plots are output to the `dst` dirs, which serve as a temporary buffer until they
are rsync'd ("archived") to the farmer/harvester.  The archiver does several
things to attempt to avoid concurrent IO.  First, it only allows one rsync
process at a time (more sophisticated scheduling could remove this
restriction, but it's nontrivial).  Second, it inspects the pipeline of plot
jobs to see which `dst` dirs are about to have plots written to them.  This
is balanced against how full the `dst` drives are in a priority scheme.

It is, obviously, necessary that your rsync bandwidth exceeds your plotting
bandwidth.  Given this, in normal operation, the `dst` dirs remain empty until
a plot is finished, after which it is shortly thereafter picked up by the
archive job.  However, the decoupling provided by using `dst` drives as a
buffer means that should the farmer/harvester or the network become
unavailable, plotting continues uninterrupted.

## Screenshot Overview

The screenshot shows some of the main features of Plotman.

The first line shows the status.  The plotting status shows whether we just
started a plot, or, if not, why not (e.g., stagger time, tmp directories being
ready, etc.; in this case, the 1800s stagger between plots has not been reached
yet).  Archival status says whether we are currently archiving (and provides
the `rsync` pid) or whether there are no plots available in the `dst` drives to
archive.

The second line provides a key to some directory abbrevations used throughout.
For `tmp` and `dst` directories, we assume they have a common prefix, which is
computed and indicated here, after which they can be referred to (in context)
by their unique suffix.  For example, if we have `tmp` dirs `/mnt/tmp/00`,
`/mnt/tmp/01`, `/mnt/tmp/02`, etc., we show `/mnt/tmp` as the prefix here and
can then talk about `tmp` dirs `00` or `01` etc.  The `archive` directories are
the same except that these are paths on a remote host and accessed via an
`rsyncd` module (see `src/plotman/resources/plotman.yaml` for details).

The next table shows information about the active plotting jobs.  It is
abbreviated to show the most and least recently started jobs (the full list is
available via the command line mode).  It shows various information about the
plot jobs, including the plot ID (first 8 chars), the directories used,
walltime, the current plot phase and subphase, space used on the `tmp` drive,
pid, etc.

The next tables are a bit hard to read; there is actually a `tmp` table on the
left which is split into two tables for rendering purposes, and a `dst` table
on the right.  The `tmp` tables show the phases of the plotting jobs using
them, and whether or not they're ready to take a new plot job.  The `dst` table
shows how many plots have accumulated, how much free space is left, and the
phases of jobs that are destined to write to them, and finally, the priority
computed for the archive job to move the plots away.

The last table simply shows free space of drives on the remote
harverster/farmer.

Finally, the last section shows a log of actions performed -- namely, plot and
archive jobs initiated.  This is the one part of the interactive tool which is
stateful.  There is no permanent record of these executed command lines, so if
you start a new interactive plotman session, this log is empty.

## Limitations and Issues

The system is tested on Linux only.  Plotman should be generalizable to other
platforms, but this is not done yet.  Some of the issues around making calls
out to command line programs (e.g., running `df` over `ssh` to obtain the free
space on the remote archive directories) are very linux-y.

The interactive mode uses the `curses` library ... poorly.  Keypresses are
not received, screen resizing does not work, and the minimum terminal size
is pretty big.

Plotman assumes all plots are k32s.  Again, this is just an unimplemented
generalization.

Many features are inconsistently supported between either the "interactive"
mode or the command line mode.

There are many bugs and TODOs.

Plotman will always look for the `plotman.yaml` file within your computer at an OS-based
default location. To generate a default `plotman.yaml`, run:
```shell
> plotman config generate
```

To display the current location of your `plotman.yaml` file and check if it exists, run:
```shell
> plotman config path
```

([See also](https://github.com/ericaltendorf/plotman/pull/61#issuecomment-812967363)).

## Installation

Installation for Linux:

1. Plotman assumes that a functioning [Chia](https://github.com/Chia-Network/chia-blockchain)
   installation is present on the system. Activate your `chia` environment by typing
   `source /path/to/your/chia/install/activate`.
2. Then, install Plotman using the following command:
   ```shell
    pip install --force-reinstall git+https://github.com/ericaltendorf/plotman@main
    ```

   With the new installation we can install this
   or with this
   ```shell
    python3 -m pip install plotmanx
   ```

3. Plotman will look for `plotman.yaml` within your computer at an OS-based
   default location. To create a default `plotman.yaml` and display its location,
   run the following command:
   ```shell
   plotman config generate
   ```
   The default configuration file used as a starting point is located [here](src/plotmanx/resources/plotman.yaml)
4. That's it! You can now run Plotman by typing `plotman version` to verify its version.
   Run `plotman --help` to learn about the available commands.

### Development note:

If you are forking Plotman, simply replace the installation step with `pip install --editable .[dev]` from the project root directory to install *your* version of plotman with test and development extras.


# Maintenance

## Overview

This document holds guidance on maintaining aspects of plotman.

## Using docker

https://gist.github.com/snikch/ab15159e633d21619bdf6a056bec8830


## The `chia plots create` CLI parsing code

In [src/plotman/chia.py](src/plotman/chia.py) there is code copied from the `chia plots create` subcommand's CLI parser definition.
When new versions of `chia-blockchain` are released, their interface code should be added to plotman.
plotman commit [1b5db4e](https://github.com/ericaltendorf/plotman/commit/1b5db4e342b9ec1f7910663a453aec3a97ba51a6) provides an example of adding a new version.

In many cases, copying code is a poor choice.
It is believed that in this case it is appropriate since the chia code that plotman could import is not necessarily the code that is parsing the plotting process command lines anyways.
The chia command could come from another Python environment, a system package, a `.dmg`, etc.
This approach also offers future potential of using the proper version of parsing for the specific plot process being inspected.
Finally, this alleviates dealing with the dependency on the `chia-blockchain` package.
In generally, using dependencies is good.
This seems to be an exceptional case.





%package -n python3-plotmanx
Summary:	Chia plotting manager
Provides:	python-plotmanx
BuildRequires:	python3-devel
BuildRequires:	python3-setuptools
BuildRequires:	python3-pip
%description -n python3-plotmanx
# Xman: another Chia plotting manager

This is a tool for managing [Chia](https://github.com/Chia-Network/chia-blockchain)
plotting operations.  The tool runs on the plotting machine and provides
the following functionality:

- Automatic spawning of new plotting jobs, possibly overlapping ("staggered")
  on multiple temp directories, rate-limited globally and by per-temp-dir
limits.

- Rsync'ing of newly generated plots to a remote host (a farmer/harvester),
  called "archiving".

- Monitoring of ongoing plotting and archiving jobs, progress, resources used,
  temp files, etc.

- Control of ongoing plotting jobs (suspend, resume, plus kill and clean up
  temp files).

- Both an interactive live dashboard mode as well as command line mode tools.

- (very alpha) Analyzing performance statistics of past jobs, to aggregate on
  various plotting parameters or temp dir type.

Plotman is designed for the following configuration:

- A plotting machine with an array of `tmp` dirs, a single `tmp2` dir, and an
  array of `dst` dirs to which the plot jobs plot.  The `dst` dirs serve as a
temporary buffer space for generated plots.

- A farming machine with a large number of drives, made accessible via an
  `rsyncd` module, and to be entirely populated with plots.  These are known as
the `archive` directories.

- Plot jobs are run with STDOUT/STDERR redirected to a log file in a configured
directory.  This allows analysis of progress (plot phase) as well as timing
(e.g. for analyzing performance).

## Functionality

Plotman tools are stateless.  Rather than keep an internal record of what jobs
have been started, Plotman relies on the process tables, open files, and
logfiles of plot jobs to understand "what's going on".  This means the tools
can be stopped and started, even from a different login session, without loss
of information.  It also means Plotman can see and manage jobs started manually
or by other tools, as long as their STDOUT/STDERR redirected to a file in a
known logfile directory.  (Note: The tool relies on reading the chia plot
command line arguments and the format of the plot tool output.  Changes in
those may break this tool.)

Plot scheduling is done by waiting for a certain amount of wall time since the
last job was started, finding the best (e.g. least recently used) `tmp` dir for
plotting, and ensuring that job has progressed to at least a certain point
(e.g., phase 2, subphase 5).

Plots are output to the `dst` dirs, which serve as a temporary buffer until they
are rsync'd ("archived") to the farmer/harvester.  The archiver does several
things to attempt to avoid concurrent IO.  First, it only allows one rsync
process at a time (more sophisticated scheduling could remove this
restriction, but it's nontrivial).  Second, it inspects the pipeline of plot
jobs to see which `dst` dirs are about to have plots written to them.  This
is balanced against how full the `dst` drives are in a priority scheme.

It is, obviously, necessary that your rsync bandwidth exceeds your plotting
bandwidth.  Given this, in normal operation, the `dst` dirs remain empty until
a plot is finished, after which it is shortly thereafter picked up by the
archive job.  However, the decoupling provided by using `dst` drives as a
buffer means that should the farmer/harvester or the network become
unavailable, plotting continues uninterrupted.

## Screenshot Overview

The screenshot shows some of the main features of Plotman.

The first line shows the status.  The plotting status shows whether we just
started a plot, or, if not, why not (e.g., stagger time, tmp directories being
ready, etc.; in this case, the 1800s stagger between plots has not been reached
yet).  Archival status says whether we are currently archiving (and provides
the `rsync` pid) or whether there are no plots available in the `dst` drives to
archive.

The second line provides a key to some directory abbrevations used throughout.
For `tmp` and `dst` directories, we assume they have a common prefix, which is
computed and indicated here, after which they can be referred to (in context)
by their unique suffix.  For example, if we have `tmp` dirs `/mnt/tmp/00`,
`/mnt/tmp/01`, `/mnt/tmp/02`, etc., we show `/mnt/tmp` as the prefix here and
can then talk about `tmp` dirs `00` or `01` etc.  The `archive` directories are
the same except that these are paths on a remote host and accessed via an
`rsyncd` module (see `src/plotman/resources/plotman.yaml` for details).

The next table shows information about the active plotting jobs.  It is
abbreviated to show the most and least recently started jobs (the full list is
available via the command line mode).  It shows various information about the
plot jobs, including the plot ID (first 8 chars), the directories used,
walltime, the current plot phase and subphase, space used on the `tmp` drive,
pid, etc.

The next tables are a bit hard to read; there is actually a `tmp` table on the
left which is split into two tables for rendering purposes, and a `dst` table
on the right.  The `tmp` tables show the phases of the plotting jobs using
them, and whether or not they're ready to take a new plot job.  The `dst` table
shows how many plots have accumulated, how much free space is left, and the
phases of jobs that are destined to write to them, and finally, the priority
computed for the archive job to move the plots away.

The last table simply shows free space of drives on the remote
harverster/farmer.

Finally, the last section shows a log of actions performed -- namely, plot and
archive jobs initiated.  This is the one part of the interactive tool which is
stateful.  There is no permanent record of these executed command lines, so if
you start a new interactive plotman session, this log is empty.

## Limitations and Issues

The system is tested on Linux only.  Plotman should be generalizable to other
platforms, but this is not done yet.  Some of the issues around making calls
out to command line programs (e.g., running `df` over `ssh` to obtain the free
space on the remote archive directories) are very linux-y.

The interactive mode uses the `curses` library ... poorly.  Keypresses are
not received, screen resizing does not work, and the minimum terminal size
is pretty big.

Plotman assumes all plots are k32s.  Again, this is just an unimplemented
generalization.

Many features are inconsistently supported between either the "interactive"
mode or the command line mode.

There are many bugs and TODOs.

Plotman will always look for the `plotman.yaml` file within your computer at an OS-based
default location. To generate a default `plotman.yaml`, run:
```shell
> plotman config generate
```

To display the current location of your `plotman.yaml` file and check if it exists, run:
```shell
> plotman config path
```

([See also](https://github.com/ericaltendorf/plotman/pull/61#issuecomment-812967363)).

## Installation

Installation for Linux:

1. Plotman assumes that a functioning [Chia](https://github.com/Chia-Network/chia-blockchain)
   installation is present on the system. Activate your `chia` environment by typing
   `source /path/to/your/chia/install/activate`.
2. Then, install Plotman using the following command:
   ```shell
    pip install --force-reinstall git+https://github.com/ericaltendorf/plotman@main
    ```

   With the new installation we can install this
   or with this
   ```shell
    python3 -m pip install plotmanx
   ```

3. Plotman will look for `plotman.yaml` within your computer at an OS-based
   default location. To create a default `plotman.yaml` and display its location,
   run the following command:
   ```shell
   plotman config generate
   ```
   The default configuration file used as a starting point is located [here](src/plotmanx/resources/plotman.yaml)
4. That's it! You can now run Plotman by typing `plotman version` to verify its version.
   Run `plotman --help` to learn about the available commands.

### Development note:

If you are forking Plotman, simply replace the installation step with `pip install --editable .[dev]` from the project root directory to install *your* version of plotman with test and development extras.


# Maintenance

## Overview

This document holds guidance on maintaining aspects of plotman.

## Using docker

https://gist.github.com/snikch/ab15159e633d21619bdf6a056bec8830


## The `chia plots create` CLI parsing code

In [src/plotman/chia.py](src/plotman/chia.py) there is code copied from the `chia plots create` subcommand's CLI parser definition.
When new versions of `chia-blockchain` are released, their interface code should be added to plotman.
plotman commit [1b5db4e](https://github.com/ericaltendorf/plotman/commit/1b5db4e342b9ec1f7910663a453aec3a97ba51a6) provides an example of adding a new version.

In many cases, copying code is a poor choice.
It is believed that in this case it is appropriate since the chia code that plotman could import is not necessarily the code that is parsing the plotting process command lines anyways.
The chia command could come from another Python environment, a system package, a `.dmg`, etc.
This approach also offers future potential of using the proper version of parsing for the specific plot process being inspected.
Finally, this alleviates dealing with the dependency on the `chia-blockchain` package.
In generally, using dependencies is good.
This seems to be an exceptional case.





%package help
Summary:	Development documents and examples for plotmanx
Provides:	python3-plotmanx-doc
%description help
# Xman: another Chia plotting manager

This is a tool for managing [Chia](https://github.com/Chia-Network/chia-blockchain)
plotting operations.  The tool runs on the plotting machine and provides
the following functionality:

- Automatic spawning of new plotting jobs, possibly overlapping ("staggered")
  on multiple temp directories, rate-limited globally and by per-temp-dir
limits.

- Rsync'ing of newly generated plots to a remote host (a farmer/harvester),
  called "archiving".

- Monitoring of ongoing plotting and archiving jobs, progress, resources used,
  temp files, etc.

- Control of ongoing plotting jobs (suspend, resume, plus kill and clean up
  temp files).

- Both an interactive live dashboard mode as well as command line mode tools.

- (very alpha) Analyzing performance statistics of past jobs, to aggregate on
  various plotting parameters or temp dir type.

Plotman is designed for the following configuration:

- A plotting machine with an array of `tmp` dirs, a single `tmp2` dir, and an
  array of `dst` dirs to which the plot jobs plot.  The `dst` dirs serve as a
temporary buffer space for generated plots.

- A farming machine with a large number of drives, made accessible via an
  `rsyncd` module, and to be entirely populated with plots.  These are known as
the `archive` directories.

- Plot jobs are run with STDOUT/STDERR redirected to a log file in a configured
directory.  This allows analysis of progress (plot phase) as well as timing
(e.g. for analyzing performance).

## Functionality

Plotman tools are stateless.  Rather than keep an internal record of what jobs
have been started, Plotman relies on the process tables, open files, and
logfiles of plot jobs to understand "what's going on".  This means the tools
can be stopped and started, even from a different login session, without loss
of information.  It also means Plotman can see and manage jobs started manually
or by other tools, as long as their STDOUT/STDERR redirected to a file in a
known logfile directory.  (Note: The tool relies on reading the chia plot
command line arguments and the format of the plot tool output.  Changes in
those may break this tool.)

Plot scheduling is done by waiting for a certain amount of wall time since the
last job was started, finding the best (e.g. least recently used) `tmp` dir for
plotting, and ensuring that job has progressed to at least a certain point
(e.g., phase 2, subphase 5).

Plots are output to the `dst` dirs, which serve as a temporary buffer until they
are rsync'd ("archived") to the farmer/harvester.  The archiver does several
things to attempt to avoid concurrent IO.  First, it only allows one rsync
process at a time (more sophisticated scheduling could remove this
restriction, but it's nontrivial).  Second, it inspects the pipeline of plot
jobs to see which `dst` dirs are about to have plots written to them.  This
is balanced against how full the `dst` drives are in a priority scheme.

It is, obviously, necessary that your rsync bandwidth exceeds your plotting
bandwidth.  Given this, in normal operation, the `dst` dirs remain empty until
a plot is finished, after which it is shortly thereafter picked up by the
archive job.  However, the decoupling provided by using `dst` drives as a
buffer means that should the farmer/harvester or the network become
unavailable, plotting continues uninterrupted.

## Screenshot Overview

The screenshot shows some of the main features of Plotman.

The first line shows the status.  The plotting status shows whether we just
started a plot, or, if not, why not (e.g., stagger time, tmp directories being
ready, etc.; in this case, the 1800s stagger between plots has not been reached
yet).  Archival status says whether we are currently archiving (and provides
the `rsync` pid) or whether there are no plots available in the `dst` drives to
archive.

The second line provides a key to some directory abbrevations used throughout.
For `tmp` and `dst` directories, we assume they have a common prefix, which is
computed and indicated here, after which they can be referred to (in context)
by their unique suffix.  For example, if we have `tmp` dirs `/mnt/tmp/00`,
`/mnt/tmp/01`, `/mnt/tmp/02`, etc., we show `/mnt/tmp` as the prefix here and
can then talk about `tmp` dirs `00` or `01` etc.  The `archive` directories are
the same except that these are paths on a remote host and accessed via an
`rsyncd` module (see `src/plotman/resources/plotman.yaml` for details).

The next table shows information about the active plotting jobs.  It is
abbreviated to show the most and least recently started jobs (the full list is
available via the command line mode).  It shows various information about the
plot jobs, including the plot ID (first 8 chars), the directories used,
walltime, the current plot phase and subphase, space used on the `tmp` drive,
pid, etc.

The next tables are a bit hard to read; there is actually a `tmp` table on the
left which is split into two tables for rendering purposes, and a `dst` table
on the right.  The `tmp` tables show the phases of the plotting jobs using
them, and whether or not they're ready to take a new plot job.  The `dst` table
shows how many plots have accumulated, how much free space is left, and the
phases of jobs that are destined to write to them, and finally, the priority
computed for the archive job to move the plots away.

The last table simply shows free space of drives on the remote
harverster/farmer.

Finally, the last section shows a log of actions performed -- namely, plot and
archive jobs initiated.  This is the one part of the interactive tool which is
stateful.  There is no permanent record of these executed command lines, so if
you start a new interactive plotman session, this log is empty.

## Limitations and Issues

The system is tested on Linux only.  Plotman should be generalizable to other
platforms, but this is not done yet.  Some of the issues around making calls
out to command line programs (e.g., running `df` over `ssh` to obtain the free
space on the remote archive directories) are very linux-y.

The interactive mode uses the `curses` library ... poorly.  Keypresses are
not received, screen resizing does not work, and the minimum terminal size
is pretty big.

Plotman assumes all plots are k32s.  Again, this is just an unimplemented
generalization.

Many features are inconsistently supported between either the "interactive"
mode or the command line mode.

There are many bugs and TODOs.

Plotman will always look for the `plotman.yaml` file within your computer at an OS-based
default location. To generate a default `plotman.yaml`, run:
```shell
> plotman config generate
```

To display the current location of your `plotman.yaml` file and check if it exists, run:
```shell
> plotman config path
```

([See also](https://github.com/ericaltendorf/plotman/pull/61#issuecomment-812967363)).

## Installation

Installation for Linux:

1. Plotman assumes that a functioning [Chia](https://github.com/Chia-Network/chia-blockchain)
   installation is present on the system. Activate your `chia` environment by typing
   `source /path/to/your/chia/install/activate`.
2. Then, install Plotman using the following command:
   ```shell
    pip install --force-reinstall git+https://github.com/ericaltendorf/plotman@main
    ```

   With the new installation we can install this
   or with this
   ```shell
    python3 -m pip install plotmanx
   ```

3. Plotman will look for `plotman.yaml` within your computer at an OS-based
   default location. To create a default `plotman.yaml` and display its location,
   run the following command:
   ```shell
   plotman config generate
   ```
   The default configuration file used as a starting point is located [here](src/plotmanx/resources/plotman.yaml)
4. That's it! You can now run Plotman by typing `plotman version` to verify its version.
   Run `plotman --help` to learn about the available commands.

### Development note:

If you are forking Plotman, simply replace the installation step with `pip install --editable .[dev]` from the project root directory to install *your* version of plotman with test and development extras.


# Maintenance

## Overview

This document holds guidance on maintaining aspects of plotman.

## Using docker

https://gist.github.com/snikch/ab15159e633d21619bdf6a056bec8830


## The `chia plots create` CLI parsing code

In [src/plotman/chia.py](src/plotman/chia.py) there is code copied from the `chia plots create` subcommand's CLI parser definition.
When new versions of `chia-blockchain` are released, their interface code should be added to plotman.
plotman commit [1b5db4e](https://github.com/ericaltendorf/plotman/commit/1b5db4e342b9ec1f7910663a453aec3a97ba51a6) provides an example of adding a new version.

In many cases, copying code is a poor choice.
It is believed that in this case it is appropriate since the chia code that plotman could import is not necessarily the code that is parsing the plotting process command lines anyways.
The chia command could come from another Python environment, a system package, a `.dmg`, etc.
This approach also offers future potential of using the proper version of parsing for the specific plot process being inspected.
Finally, this alleviates dealing with the dependency on the `chia-blockchain` package.
In generally, using dependencies is good.
This seems to be an exceptional case.





%prep
%autosetup -n plotmanx-0.6.54

%build
%py3_build

%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
	find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
	find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
	find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
	find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
	find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .

%files -n python3-plotmanx -f filelist.lst
%dir %{python3_sitelib}/*

%files help -f doclist.lst
%{_docdir}/*

%changelog
* Tue Apr 25 2023 Python_Bot <Python_Bot@openeuler.org> - 0.6.54-1
- Package Spec generated