Skip to content

Commit

Permalink
Merge pull request #5 from Xalaxis/master
Browse files Browse the repository at this point in the history
Implement SHEEPIT_MEMORY_LIMIT to fix #1
  • Loading branch information
fkrauthan authored Aug 17, 2020
2 parents 06b208b + 4e323cc commit 92bc668
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.env
*.jar
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ FROM openjdk:8-jre-slim
ENV SHEEPIT_VERSION 6.2020.0
ENV SHEEPIT_USERNAME ""
ENV SHEEPIT_PASSWORD ""
# If we make the default memory limit a large number, then unless a lower number is set 'no memory limit' is applied (as 999GB is going to be larger than the maximum you'd ever want to use)
# I tried 1TB. It doesn't work.
ENV SHEEPIT_MEMORY_LIMIT "999GB"


RUN apt-get update && \
Expand All @@ -18,4 +21,4 @@ RUN addgroup --system sheepit \
RUN curl -o /sheepit-client.jar -SL "https://www.sheepit-renderfarm.com/media/applet/sheepit-client-$SHEEPIT_VERSION.jar"

USER sheepit
CMD java -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -jar /sheepit-client.jar -ui text -login $SHEEPIT_USERNAME -password $SHEEPIT_PASSWORD -cache-dir /var/cache/sheepit
CMD java -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -jar /sheepit-client.jar -ui text -login $SHEEPIT_USERNAME -password $SHEEPIT_PASSWORD -cache-dir /var/cache/sheepit -memory $SHEEPIT_MEMORY_LIMIT
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ docker run -d \
fkrauthan/sheepit:latest
```

To limit CPU and/or memory you can use the native Docker resource limitations.
To limit CPU you can use the native Docker resource limitations. For instance, to limit Sheepit to 50% of a 8-core CPU, use `--cpus=4`

To limit memory, you can use the environment variable SHEEPIT_MEMORY_LIMIT. E.g. `-e SHEEPIT_MEMORY_LIMIT=4GB`


About this Image
Expand Down

0 comments on commit 92bc668

Please sign in to comment.