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

Release/v0.5.2 #922

Merged
merged 133 commits into from
Sep 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
133 commits
Select commit Hold shift + click to select a range
99db14e
introduce black
altendky Jul 2, 2021
e0c172d
shift check-format to the test ci job
altendky Jul 2, 2021
9fe57ac
"end of day" multiple plotters commit
altendky Jul 11, 2021
901a619
add a bunch more new-style log parsing
altendky Jul 11, 2021
e03dc38
log identification
altendky Jul 12, 2021
f4e0249
process command line identification
altendky Jul 12, 2021
e7b8c2b
Merge branch 'development' into black
altendky Jul 12, 2021
665a8dc
Merge mk01s' far more elegant madmax log parsing
graemes Jul 12, 2021
76cbd28
process command line parsing
altendky Jul 13, 2021
d87388b
fixup
altendky Jul 13, 2021
636e179
Merge branch 'development' into multiple_plotters
altendky Jul 13, 2021
9e74cd6
remove commented out code
altendky Jul 13, 2021
883f8f3
Add extra thread options
graemes Jul 13, 2021
6399326
Add new parameters to invocation
graemes Jul 13, 2021
575586c
Convert int parameter to string
graemes Jul 13, 2021
44202ba
add test cases
altendky Jul 13, 2021
5e74dc6
switch over is_plotting_command_line
altendky Jul 14, 2021
2700dce
more command line parsing testing
altendky Jul 14, 2021
af15ce0
cover existing test cases
altendky Jul 14, 2021
adadf9d
switch actual command line parsing to new style
altendky Jul 14, 2021
f734ff4
Merge branch 'development' into multiple_plotters
altendky Jul 15, 2021
fa4bc91
remove old command line parser
altendky Jul 15, 2021
235a978
catch up with latest chia network command line parsers
altendky Jul 15, 2021
4adce4a
update madMAx command line parser
altendky Jul 15, 2021
020ed6f
Merge remote-tracking branch 'origin/development' into madmax
graemes Jul 15, 2021
b67993e
Update plotman.yaml
graemes Jul 15, 2021
2524e03
Add changelog entry
graemes Jul 15, 2021
7e7f66d
Merge branch 'main' into main_to_development_v0.5.1
altendky Jul 16, 2021
d4517db
+dev
altendky Jul 16, 2021
be40b20
fresh changelog entries
altendky Jul 16, 2021
414f940
Merge pull request #871 from altendky/main_to_development_v0.5.1
altendky Jul 16, 2021
8d30788
stop failing on coverage
altendky Jul 16, 2021
eda2dc5
Merge pull request #872 from altendky/stop_failing_on_coverage
altendky Jul 16, 2021
0a4b250
mypy
altendky Jul 16, 2021
9842204
Merge branch 'development' into black
altendky Jul 16, 2021
6bdcfc3
Merge branch 'development' into madmax
graemes Jul 16, 2021
4541c53
Cleanup plot log / send disk_space to separate log
graemes Jul 17, 2021
523960e
Log cli to root log
graemes Jul 18, 2021
feae5e6
str int
graemes Jul 18, 2021
f75faf1
Disable disk space propagation
graemes Jul 18, 2021
f8bfec6
Log plot progress to root log
graemes Jul 18, 2021
3434083
Add function prefix
graemes Jul 18, 2021
3860aff
Track archiving more effectively
graemes Jul 18, 2021
01b71c9
Change archive daemon polling to system setting
graemes Jul 18, 2021
128a0c4
Fix archive log
graemes Jul 18, 2021
23cbc35
Add Changelog entry
graemes Jul 18, 2021
d1e483e
update with more complete logs for parsing
altendky Jul 19, 2021
97cd21b
Merge branch 'development' into multiple_plotters
altendky Jul 19, 2021
92ab721
update the bare madMAx cli parser
altendky Jul 19, 2021
a7f3603
update job.py to get the 'latest' madmax instead of hardcoding
altendky Jul 19, 2021
db6bc6a
Update src/plotman/resources/plotman.yaml
graemes Jul 19, 2021
b8d5e3a
Merge pull request #879 from altendky/update_madmax_cli_parsing
altendky Jul 20, 2021
d7416fa
Merge branch 'development' into madmax
altendky Jul 20, 2021
a942495
tweak changelog entry
altendky Jul 20, 2021
83960d1
mypy
altendky Jul 20, 2021
cbac77a
Merge pull request #869 from graemes/madmax
altendky Jul 21, 2021
05964e7
add combined major/minor for prometheus
altendky Jul 21, 2021
ab13fdf
changelog
altendky Jul 21, 2021
711ba7c
mypy
altendky Jul 21, 2021
599e96a
Merge pull request #885 from altendky/combined_major_minor_prometheus
altendky Jul 21, 2021
3cfb084
Merge branch 'development' into multiple_plotters
altendky Jul 25, 2021
0d889cf
.gitignore some more
altendky Jul 25, 2021
de572e0
Merge branch 'development' into altendky-patch-2
altendky Jul 25, 2021
a96d4df
Merge pull request #891 from ericaltendorf/altendky-patch-2
altendky Jul 25, 2021
bb816da
Merge branch 'development' into multiple_plotters
altendky Jul 25, 2021
d5c9e4e
replace the guts of Job
altendky Jul 25, 2021
706c14d
move to plotman.plotters.chianetwork.parse_chia_plot_time()
altendky Jul 26, 2021
bf5ea40
drop log_parser and plotinfo
altendky Jul 27, 2021
c1d9051
move the cli parser definitions
altendky Jul 27, 2021
958b997
various fixup
altendky Jul 29, 2021
e83a7a4
test chia phase for every line
altendky Jul 31, 2021
6ef44e2
verify marked ciha plots marked log file
altendky Jul 31, 2021
d4042ff
test madmax log phases per line
altendky Aug 1, 2021
2c3dbbe
Docker image: Launch both plotting & archiving as the default CMD
jinnatar Aug 6, 2021
7111a66
Update Chia reference, use :latest tag
jinnatar Aug 6, 2021
e54ab5d
Simplify supervisord config even more
jinnatar Aug 6, 2021
4c63409
Install both plotman & supervisor at the same time
jinnatar Aug 8, 2021
0ea2dc8
Use more descriptive variables for build-time UID & GID
jinnatar Aug 8, 2021
3549859
misc
altendky Aug 23, 2021
0632224
mypy
altendky Aug 23, 2021
ca22ced
back to just strings
altendky Aug 23, 2021
0df7c84
cleanup and madmax -k/--size parsing
altendky Aug 24, 2021
198dafa
fixup and sorting of dicts for testing comparison
altendky Aug 24, 2021
3b88e0f
misc
altendky Aug 28, 2021
b24073b
allow text after plot id in tmp file detection
altendky Aug 28, 2021
12365b1
add changelog entry for #913
altendky Aug 28, 2021
fa4f740
actually capture plot id from madmax logs
altendky Aug 28, 2021
3dfb193
mypy
altendky Aug 28, 2021
d933b5e
more tidying
altendky Aug 28, 2021
a5a0e40
mypy
altendky Aug 28, 2021
6197121
Merge pull request #913 from altendky/fixup_tmp_cleanup
altendky Aug 28, 2021
3506453
Merge branch 'development' into multiple_plotters
altendky Aug 28, 2021
ff50e33
Merge branch 'development' into docker-improvements
altendky Aug 28, 2021
dd3fa98
Update CHANGELOG.md
altendky Aug 28, 2021
b402778
Merge pull request #898 from Artanicus/docker-improvements
altendky Aug 28, 2021
0cb8c8f
test files don't need execute permissions
altendky Aug 28, 2021
cfb841e
Merge pull request #914 from altendky/permissions
altendky Aug 28, 2021
9270857
Merge branch 'development' into logging
altendky Aug 28, 2021
ecbb472
Update CHANGELOG.md
altendky Aug 29, 2021
f672659
Merge pull request #878 from graemes/logging
altendky Aug 29, 2021
4babe92
Merge branch 'development' into multiple_plotters
altendky Aug 29, 2021
0fef2e9
Merge pull request #850 from altendky/multiple_plotters
altendky Aug 29, 2021
1eb323e
Merge branch 'development' into black
altendky Aug 29, 2021
c40b421
black
altendky Aug 29, 2021
706fefc
mypy (black)
altendky Aug 29, 2021
77a86d2
undo some extra ci tweaks
altendky Aug 29, 2021
a9b6fe0
black == 21.7b0
altendky Aug 29, 2021
8da07d3
undo some extra ci tweaks
altendky Aug 29, 2021
bc48154
Merge pull request #821 from altendky/black
altendky Aug 29, 2021
ece1247
move plot command line creation to plotter modules
altendky Aug 29, 2021
2d6f2fa
some test coverage
altendky Aug 29, 2021
0acc490
Merge pull request #915 from altendky/plot_command_line_creation
altendky Aug 29, 2021
4cebc58
preliminary bladebit work
altendky Aug 30, 2021
bc22dbc
mypy
altendky Aug 30, 2021
fb9ec2e
add bladebit to configuration
altendky Aug 30, 2021
5da207a
misc bladebit fixes from running
altendky Aug 30, 2021
8026651
default to k32 when parsing bladebit
altendky Aug 30, 2021
4d6585a
require bladebit v1.0.1 for log flushing
altendky Sep 11, 2021
4e38197
require bladebit 1.1.0
altendky Sep 11, 2021
4cf168a
some bladebit config checks
altendky Sep 12, 2021
613e735
catch up with bladebit's 1.1.0 cli options
altendky Sep 12, 2021
8a45856
add bladebit support to changelog
altendky Sep 12, 2021
5d683d7
tweak bladebit changelog entry
altendky Sep 12, 2021
69e427d
black
altendky Sep 12, 2021
1a49f8d
detect bladebit plot id early
altendky Sep 12, 2021
1e89f3a
Merge pull request #916 from altendky/bladebit
altendky Sep 12, 2021
e17ff42
.rstrip("/") for some dst comparisons
altendky Sep 12, 2021
2d24cd9
changelog for 920
altendky Sep 12, 2021
2dc3068
some more .rstrip("/")
altendky Sep 13, 2021
4548d05
Merge pull request #920 from altendky/unused_matching
altendky Sep 13, 2021
e7f42f6
add bladebit section to example config
altendky Sep 13, 2021
318bf8a
Merge pull request #921 from altendky/bladebit_config_example
altendky Sep 13, 2021
0345d46
set v0.5.2
altendky Sep 13, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
.coveragerc
.gitignore
docker
!docker/supervisord.conf
9 changes: 9 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,15 @@ jobs:
python:
name: CPython 3.8
action: 3.8
- task:
name: Check format
tox: check-format
os:
name: Linux
runs-on: ubuntu-latest
python:
name: CPython 3.8
action: 3.8


env:
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ venv
.vscode
*.code-workspace
src/plotman.egg-info
.coverage
.idea
.tox
coverage.xml
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,25 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.5.2] - 2021-09-12
### Fixed
- Temp files are correctly identified for cleanup.
([#912](https://github.com/ericaltendorf/plotman/pull/913))
- Correct where trailing `/` on dst directories resulted in them being considered unused.
([#920](https://github.com/ericaltendorf/plotman/pull/920))
### Added
- `-v`/`--buckets3` and `-K`/`--rmulti2` are configurable for madMAx.
([#869](https://github.com/ericaltendorf/plotman/pull/869))
- A combined major/minor value for Prometheus status output.
([#885](https://github.com/ericaltendorf/plotman/pull/885))
- `supervisord` now used in Docker image.
([#898](https://github.com/ericaltendorf/plotman/pull/898))
- Output same entries to plotman.log from 'plotman interactive' and ' plotman plot/archive' "daemons".
([#878](https://github.com/ericaltendorf/plotman/pull/878))
- [BladeBit](https://github.com/harold-b/bladebit) support.
Requires BladeBit v1.1.0 for proper log monitoring.
([#916](https://github.com/ericaltendorf/plotman/pull/916))

## [0.5.1] - 2021-07-15
### Fixed
- Detects binary-installed Chia plotting processes again after being broken in v0.5.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.5.1
0.5.2
14 changes: 6 additions & 8 deletions build-docker-plotman.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,20 @@

DOCKER_REGISTRY="<docker-registry>"
PROJECT="chia-plotman"
TAG="plotter"
TAG="latest"
BASE_CONTAINER="ubuntu:20.04"
CHIA_GIT_REFERENCE="1.1.7"
CHIA_GIT_REFERENCE="1.2.3"

# The UID/GID should match the 'chia' owner of the directories on the host system
UID=10001
GID=10001

docker rmi ${LOCAL_REGISTRY}/${PROJECT}:${TAG}
build_UID=10001
build_GID=10001

docker build . \
--squash \
--build-arg BASE_CONTAINER=${BASE_CONTAINER} \
--build-arg CHIA_GIT_REFERENCE=${CHIA_GIT_REFERENCE} \
--build-arg UID=${UID} \
--build-arg GID=${GID} \
--build-arg UID=${build_UID} \
--build-arg GID=${build_GID} \
-f docker/Dockerfile \
-t ${DOCKER_REGISTRY}/${PROJECT}:${TAG}

Expand Down
7 changes: 4 additions & 3 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ RUN /bin/bash ./install.sh

COPY . /plotman

RUN ["/bin/bash", "-c", "source ./activate && pip install /plotman && deactivate"]
RUN ["/bin/bash", "-c", "source ./activate && pip install /plotman supervisor && deactivate"]

# Build deployment container
FROM ${BASE_CONTAINER} as plotman
Expand All @@ -31,6 +31,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update \
&& rm -rf /var/lib/apt/lists

COPY --from=plotman-builder /chia-blockchain /chia-blockchain
COPY ./docker/supervisord.conf /srv/supervisord.conf

RUN groupadd -g ${GID} chia
RUN useradd -m -u ${UID} -g ${GID} chia
Expand All @@ -50,7 +51,7 @@ USER chia
ENV VIRTUAL_ENV="/chia-blockchain/venv"
ENV PATH="$VIRTUAL_ENV/bin:$PATH"

# Kick off plots (assumes the environemnt is good to go)
CMD ["/bin/bash", "-c", "plotman plot" ]
# Kick off plots & archives (assumes the environemnt is good to go)
CMD ["/chia-blockchain/venv/bin/supervisord", "-c", "/srv/supervisord.conf" ]
# Alternative command to simply provide shell environment
# CMD ["/bin/bash", "-c", "trap : TERM INT; sleep infinity & wait" ]
8 changes: 8 additions & 0 deletions docker/supervisord.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[supervisord]
nodaemon=true

[program:plot]
command=plotman plot

[program:archive]
command=plotman archive
9 changes: 9 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"

[tool.black]
target-version = ['py36', 'py37', 'py38', 'py39']
include = '''
^/(
setup.py
| src/plotman/.*\.pyi?
)$
'''
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ test =
pytest-cov
pyfakefs
checks =
black == 21.7b0
check-manifest ~= 0.46
mypy == 0.902
types-pkg_resources ~= 0.1.2
Expand Down
5 changes: 3 additions & 2 deletions src/plotman/_tests/archive_test.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@


def test_compute_priority() -> None:
assert (archive.compute_priority( job.Phase(major=3, minor=1), 1000, 10) >
archive.compute_priority( job.Phase(major=3, minor=6), 1000, 10) )
assert archive.compute_priority(
job.Phase(major=3, minor=1), 1000, 10
) > archive.compute_priority(job.Phase(major=3, minor=6), 1000, 10)
52 changes: 34 additions & 18 deletions src/plotman/_tests/configuration_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,30 @@
from plotman import resources as plotman_resources


@pytest.fixture(name='config_text')
@pytest.fixture(name="config_text")
def config_text_fixture() -> str:
return importlib.resources.read_text(plotman_resources, "plotman.yaml")


@pytest.fixture(name='target_definitions_text')
@pytest.fixture(name="target_definitions_text")
def target_definitions_text_fixture() -> str:
return importlib.resources.read_text(
plotman_resources, "target_definitions.yaml",
plotman_resources,
"target_definitions.yaml",
)


def test_get_validated_configs__default(config_text: str, target_definitions_text: str) -> None:
def test_get_validated_configs__default(
config_text: str, target_definitions_text: str
) -> None:
"""Check that get_validated_configs() works with default/example plotman.yaml file."""
res = configuration.get_validated_configs(config_text, '', target_definitions_text)
res = configuration.get_validated_configs(config_text, "", target_definitions_text)
assert isinstance(res, configuration.PlotmanConfig)

def test_get_validated_configs__malformed(config_text: str, target_definitions_text: str) -> None:

def test_get_validated_configs__malformed(
config_text: str, target_definitions_text: str
) -> None:
"""Check that get_validated_configs() raises exception with invalid plotman.yaml contents."""
loaded_yaml = yaml.load(config_text, Loader=yaml.SafeLoader)

Expand All @@ -34,71 +40,81 @@ def test_get_validated_configs__malformed(config_text: str, target_definitions_t
malformed_config_text = yaml.dump(loaded_yaml, Dumper=yaml.SafeDumper)

with pytest.raises(configuration.ConfigurationException) as exc_info:
configuration.get_validated_configs(malformed_config_text, '/the_path', target_definitions_text)
configuration.get_validated_configs(
malformed_config_text, "/the_path", target_definitions_text
)

assert exc_info.value.args[0] == f"Config file at: '/the_path' is malformed"


def test_get_validated_configs__missing() -> None:
"""Check that get_validated_configs() raises exception when plotman.yaml does not exist."""
with pytest.raises(configuration.ConfigurationException) as exc_info:
configuration.read_configuration_text('/invalid_path')
configuration.read_configuration_text("/invalid_path")

assert exc_info.value.args[0] == (
f"No 'plotman.yaml' file exists at expected location: '/invalid_path'. To generate "
f"default config file, run: 'plotman config generate'"
)


def test_loads_without_user_interface(config_text: str, target_definitions_text: str) -> None:
def test_loads_without_user_interface(
config_text: str, target_definitions_text: str
) -> None:
loaded_yaml = yaml.load(config_text, Loader=yaml.SafeLoader)

del loaded_yaml["user_interface"]

stripped_config_text = yaml.dump(loaded_yaml, Dumper=yaml.SafeDumper)

reloaded_yaml = configuration.get_validated_configs(stripped_config_text, '', target_definitions_text)
reloaded_yaml = configuration.get_validated_configs(
stripped_config_text, "", target_definitions_text
)

assert reloaded_yaml.user_interface == configuration.UserInterface()


def test_loads_without_user_archiving(config_text: str, target_definitions_text: str) -> None:
def test_loads_without_user_archiving(
config_text: str, target_definitions_text: str
) -> None:
loaded_yaml = yaml.load(config_text, Loader=yaml.SafeLoader)

del loaded_yaml["archiving"]

stripped_config_text = yaml.dump(loaded_yaml, Dumper=yaml.SafeDumper)

reloaded_yaml = configuration.get_validated_configs(stripped_config_text, '', target_definitions_text)
reloaded_yaml = configuration.get_validated_configs(
stripped_config_text, "", target_definitions_text
)

assert reloaded_yaml.archiving is None


def test_get_dst_directories_gets_dst() -> None:
tmp = ['/tmp']
dst = ['/dst0', '/dst1']
tmp = ["/tmp"]
dst = ["/dst0", "/dst1"]
directories = configuration.Directories(tmp=tmp, dst=dst)

assert directories.get_dst_directories() == dst


def test_get_dst_directories_gets_tmp() -> None:
tmp = ['/tmp']
tmp = ["/tmp"]
directories = configuration.Directories(tmp=tmp)

assert directories.get_dst_directories() == tmp


def test_dst_is_dst() -> None:
tmp = ['/tmp']
dst = ['/dst0', '/dst1']
tmp = ["/tmp"]
dst = ["/dst0", "/dst1"]
directories = configuration.Directories(tmp=tmp, dst=dst)

assert not directories.dst_is_tmp()


def test_dst_is_tmp() -> None:
tmp = ['/tmp']
tmp = ["/tmp"]
directories = configuration.Directories(tmp=tmp)

assert directories.dst_is_tmp()
Loading