-
Notifications
You must be signed in to change notification settings - Fork 279
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #824 from altendky/release/v0.5
- Loading branch information
Showing
38 changed files
with
1,656 additions
and
448 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,5 @@ | ||
.git | ||
.github | ||
.coveragerc | ||
.gitignore | ||
docker |
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 |
---|---|---|
@@ -1 +1,9 @@ | ||
<!-- Please develop and target PRs against the development branch, not main. --> | ||
<!-- | ||
Thanks for your interest in and effort contributing to plotman. | ||
Please develop and target PRs against the development branch, not main. | ||
Please read the contribution page in the wiki. | ||
https://github.com/ericaltendorf/plotman/wiki/Contributing | ||
--> |
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 |
---|---|---|
|
@@ -2,4 +2,5 @@ __pycache__ | |
venv | ||
.DS_Store | ||
.vscode | ||
*.code-workspace | ||
src/plotman.egg-info |
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
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 |
---|---|---|
@@ -1 +1 @@ | ||
0.4.1 | ||
0.5 |
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,24 @@ | ||
#!/bin/bash | ||
|
||
DOCKER_REGISTRY="<docker-registry>" | ||
PROJECT="chia-plotman" | ||
TAG="plotter" | ||
BASE_CONTAINER="ubuntu:20.04" | ||
CHIA_GIT_REFERENCE="1.1.7" | ||
|
||
# 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} | ||
|
||
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} \ | ||
-f docker/Dockerfile \ | ||
-t ${DOCKER_REGISTRY}/${PROJECT}:${TAG} | ||
|
||
docker push ${DOCKER_REGISTRY}/${PROJECT}:${TAG} |
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,56 @@ | ||
# Build deployable artifacts | ||
ARG BASE_CONTAINER=ubuntu:20.04 | ||
FROM ${BASE_CONTAINER} as plotman-builder | ||
|
||
ARG CHIA_GIT_REFERENCE | ||
|
||
RUN DEBIAN_FRONTEND=noninteractive apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y curl jq python3 ansible tar bash ca-certificates git openssl unzip wget python3-pip sudo acl build-essential python3-dev python3.8-venv python3.8-distutils apt nfs-common python-is-python3 | ||
|
||
RUN echo "cloning ${CHIA_GIT_REFERENCE}" | ||
RUN git clone --branch "${CHIA_GIT_REFERENCE}" https://github.com/Chia-Network/chia-blockchain.git \ | ||
&& cd chia-blockchain \ | ||
&& git submodule update --init mozilla-ca | ||
|
||
WORKDIR /chia-blockchain | ||
# Placeholder for patches | ||
RUN /bin/bash ./install.sh | ||
|
||
COPY . /plotman | ||
|
||
RUN ["/bin/bash", "-c", "source ./activate && pip install /plotman && deactivate"] | ||
|
||
# Build deployment container | ||
FROM ${BASE_CONTAINER} as plotman | ||
|
||
ARG UID=10001 | ||
ARG GID=10001 | ||
|
||
RUN DEBIAN_FRONTEND=noninteractive apt-get update \ | ||
&& DEBIAN_FRONTEND=noninteractive apt-get install -y curl jq python3 python3.8-venv ca-certificates tzdata ssh rsync \ | ||
&& apt-get clean all \ | ||
&& rm -rf /var/lib/apt/lists | ||
|
||
COPY --from=plotman-builder /chia-blockchain /chia-blockchain | ||
|
||
RUN groupadd -g ${GID} chia | ||
RUN useradd -m -u ${UID} -g ${GID} chia | ||
|
||
RUN mkdir -p /data/chia/tmp \ | ||
&& mkdir -p /data/chia/plots \ | ||
&& mkdir -p /data/chia/logs | ||
|
||
VOLUME ["/data/chia/tmp","/data/chia/plots","/data/chia/logs"] | ||
|
||
RUN chown -R chia:chia /chia-blockchain \ | ||
&& chown -R chia:chia /data/chia | ||
|
||
WORKDIR /chia-blockchain | ||
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" ] | ||
# Alternative command to simply provide shell environment | ||
# CMD ["/bin/bash", "-c", "trap : TERM INT; sleep infinity & wait" ] |
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,19 @@ | ||
version: "3" | ||
|
||
services: | ||
chia_plotman: | ||
restart: always | ||
container_name: chia-plotman | ||
image: ${DOCKER_IMAGE} | ||
volumes: | ||
- ${HOME}/.ssh:/home/chia/.ssh | ||
- ${HOME}/.chia:/home/chia/.chia | ||
- ${HOME}/.config:/home/chia/.config | ||
- ${LOGS_DIR}:/data/chia/logs | ||
- ${PLOTS_DIR}:/data/chia/plots | ||
- ${PLOTS_TMP_DIR}:/data/chia/tmp | ||
- /tmp:/tmp | ||
logging: | ||
options: | ||
max-size: ${DOCKER_LOG_MAX_SIZE} | ||
max-file: ${DOCKER_LOG_MAX_FILE} |
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,7 @@ | ||
DOCKER_IMAGE=<docker-registry>/chia-plotman:plotter | ||
LOGS_DIR=/data/chia/logs | ||
PLOTS_DIR=/data/chia/plots | ||
PLOTS_TMP_DIR=/data/chia/tmp | ||
DOCKER_LOG_MAX_SIZE=4m | ||
DOCKER_LOG_MAX_FILE=10 | ||
|
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,26 @@ | ||
[mypy] | ||
show_error_codes = true | ||
strict = true | ||
mypy_path = src/ | ||
|
||
[mypy-appdirs] | ||
ignore_missing_imports = true | ||
|
||
[mypy-click] | ||
ignore_missing_imports = true | ||
|
||
[mypy-pendulum] | ||
# TODO: https://github.com/sdispater/pendulum/pull/551 | ||
implicit_reexport = true | ||
|
||
[mypy-psutil] | ||
ignore_missing_imports = true | ||
|
||
[mypy-pyfakefs] | ||
ignore_missing_imports = true | ||
|
||
[mypy-texttable] | ||
ignore_missing_imports = true | ||
|
||
[mypy-yaml] | ||
ignore_missing_imports = true |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
from plotman import archive, job | ||
|
||
|
||
def test_compute_priority(): | ||
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) ) |
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.