Number of updates to support latest versions

This should still be compatible with 32-bit platforms.
This commit is contained in:
Sillyfrog 2019-03-30 23:04:02 +10:00
parent 702d922047
commit f46b8b2dba
4 changed files with 50 additions and 17 deletions

View File

@ -22,7 +22,7 @@ WORKDIR /opt/octoprint
#install ffmpeg #install ffmpeg
RUN cd /tmp \ RUN cd /tmp \
&& wget -O ffmpeg.tar.xz https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-32bit-static.tar.xz \ && wget -O ffmpeg.tar.xz https://www.johnvansickle.com/ffmpeg/old-releases/ffmpeg-4.0.3-32bit-static.tar.xz \
&& mkdir -p /opt/ffmpeg \ && mkdir -p /opt/ffmpeg \
&& tar xvf ffmpeg.tar.xz -C /opt/ffmpeg --strip-components=1 \ && tar xvf ffmpeg.tar.xz -C /opt/ffmpeg --strip-components=1 \
&& rm -Rf /tmp/* && rm -Rf /tmp/*
@ -38,8 +38,9 @@ RUN cd /tmp \
&& rm -Rf /tmp/* && rm -Rf /tmp/*
#Install Slic3r #Install Slic3r
COPY latestslic3r.py /opt/latestslic3r.py
RUN cd /opt/ \ RUN cd /opt/ \
&& curl https://dl.slic3r.org/linux/slic3r-linux-x86-1-2-9-stable.tar.gz | tar xz && curl https://dl.slic3r.org/linux/$(/opt/latestslic3r.py) | tar xj
# Dev builds have disappeared??? # Dev builds have disappeared???
#&& curl https://dl.slic3r.org/dev/linux/Slic3r-master-latest.tar.bz2 | tar xj #&& curl https://dl.slic3r.org/dev/linux/Slic3r-master-latest.tar.bz2 | tar xj
@ -52,27 +53,31 @@ USER octoprint
#This fixes issues with the volume command setting wrong permissions #This fixes issues with the volume command setting wrong permissions
RUN mkdir /home/octoprint/.octoprint RUN mkdir /home/octoprint/.octoprint
RUN echo v1.3.10
#Install Octoprint #Install Octoprint
RUN git clone --branch $tag https://github.com/foosel/OctoPrint.git /opt/octoprint \ RUN git clone --branch $tag https://github.com/foosel/OctoPrint.git /opt/octoprint \
&& virtualenv venv \ && virtualenv venv \
&& ./venv/bin/python setup.py install && ./venv/bin/python setup.py install
RUN /opt/octoprint/venv/bin/python -m pip install https://github.com/FormerLurker/Octolapse/archive/master.zip && \ RUN /opt/octoprint/venv/bin/python -m pip install \
/opt/octoprint/venv/bin/python -m pip install https://github.com/pablogventura/Octoprint-ETA/archive/master.zip && \ https://github.com/FormerLurker/Octolapse/archive/master.zip \
/opt/octoprint/venv/bin/python -m pip install https://github.com/1r0b1n0/OctoPrint-Tempsgraph/archive/master.zip && \ https://github.com/pablogventura/Octoprint-ETA/archive/master.zip \
/opt/octoprint/venv/bin/python -m pip install https://github.com/dattas/OctoPrint-DetailedProgress/archive/master.zip && \ https://github.com/1r0b1n0/OctoPrint-Tempsgraph/archive/master.zip \
/opt/octoprint/venv/bin/python -m pip install https://github.com/kennethjiang/OctoPrint-Slicer/archive/master.zip && \ https://github.com/dattas/OctoPrint-DetailedProgress/archive/master.zip \
/opt/octoprint/venv/bin/python -m pip install https://github.com/marian42/octoprint-preheat/archive/master.zip && \ https://github.com/kennethjiang/OctoPrint-Slicer/archive/master.zip \
/opt/octoprint/venv/bin/python -m pip install https://github.com/jneilliii/OctoPrint-TasmotaMQTT/archive/master.zip && \ https://github.com/marian42/octoprint-preheat/archive/master.zip \
/opt/octoprint/venv/bin/python -m pip install https://github.com/mikedmor/OctoPrint_MultiCam/archive/master.zip && \ https://github.com/jneilliii/OctoPrint-TasmotaMQTT/archive/master.zip \
/opt/octoprint/venv/bin/python -m pip install https://github.com/OctoPrint/OctoPrint-Slic3r/archive/master.zip && \ https://github.com/mikedmor/OctoPrint_MultiCam/archive/master.zip \
/opt/octoprint/venv/bin/python -m pip install https://github.com/mmone/OctoPrintKlipper/archive/master.zip && \ https://github.com/OctoPrint/OctoPrint-Slic3r/archive/master.zip \
/opt/octoprint/venv/bin/python -m pip install https://github.com/jneilliii/OctoPrint-TabOrder/archive/master.zip https://github.com/mmone/OctoPrintKlipper/archive/master.zip \
https://github.com/jneilliii/OctoPrint-TabOrder/archive/master.zip \
https://github.com/OctoPrint/OctoPrint-MQTT/archive/master.zip \
https://github.com/fraschetti/Octoslack/archive/master.zip \
https://github.com/MoonshineSG/OctoPrint-MultiColors/archive/master.zip
# Installing from sillyfrog until the PR is merged to master # Installing from sillyfrog until the PR is merged to master
RUN /opt/octoprint/venv/bin/python -m pip install https://github.com/sillyfrog/Octoslacka/archive/master.zip && \ RUN /opt/octoprint/venv/bin/python -m pip install https://github.com/sillyfrog/OctoPrint-PrintHistory/archive/master.zip
/opt/octoprint/venv/bin/python -m pip install https://github.com/sillyfrog/OctoPrint-MQTT/archive/devel.zip && \
/opt/octoprint/venv/bin/python -m pip install https://github.com/sillyfrog/OctoPrint-PrintHistory/archive/master.zip
VOLUME /home/octoprint/.octoprint VOLUME /home/octoprint/.octoprint
@ -101,5 +106,6 @@ RUN cp klipper/config/printer-anet-a8-2017.cfg /home/octoprint/printer.cfg
USER root USER root
COPY start.py / COPY start.py /
COPY runklipper.py /
CMD ["/start.py"] CMD ["/start.py"]

6
latestslic3r.py Executable file
View File

@ -0,0 +1,6 @@
#!/usr/bin/env python
import re
import urllib
page = urllib.urlopen('https://dl.slic3r.org/linux/').read()
print(re.search(r'slic3r-.+?-linux-x64\.tar\.bz2', page).group(0))

21
runklipper.py Executable file
View File

@ -0,0 +1,21 @@
#!/usr/bin/env python
import subprocess
import time
import os
import pwd
def main():
while 1:
klipper = subprocess.Popen(['/home/octoprint/klippy-env/bin/python', '/home/octoprint/klipper/klippy/klippy.py', '/home/octoprint/.octoprint/printer.cfg'])
if klipper.wait() == 0:
# Exited cleanly, don't sleep for long
time.sleep(1)
else:
# Something went wrong, wait a bit before trying again
time.sleep(30)
if __name__ == '__main__':
main()

View File

@ -38,7 +38,7 @@ def main():
mjpg_processes.append(subprocess.Popen(cmd)) mjpg_processes.append(subprocess.Popen(cmd))
# Start klipper # Start klipper
klipper = subprocess.Popen(['sudo', '-u', 'octoprint', '/home/octoprint/klippy-env/bin/python', '/home/octoprint/klipper/klippy/klippy.py', '/home/octoprint/.octoprint/printer.cfg']) klipper = subprocess.Popen(['sudo', '-u', 'octoprint', '/runklipper.py'])
os.setgid( os.setgid(
1000 1000