diff --git a/cueadmin/Dockerfile b/cueadmin/Dockerfile index 37caf1d5f..74b318d46 100644 --- a/cueadmin/Dockerfile +++ b/cueadmin/Dockerfile @@ -1,35 +1,14 @@ -# ----------------- -# BUILD -# ----------------- -FROM centos:7 as build - -# First line after FROM should be unique to avoid --cache-from weirdness. -RUN echo "CueAdmin build stage" +FROM python:3.9.14 WORKDIR /src -RUN yum -y install \ - epel-release \ - gcc \ - python-devel - -RUN yum -y install \ - python-pip \ - python36 \ - python36-devel \ - python36-pip - -RUN python -m pip install --upgrade 'pip<21' -RUN python3.6 -m pip install --upgrade pip - -RUN python -m pip install --upgrade 'setuptools<45' -RUN python3.6 -m pip install --upgrade setuptools +RUN python3 -m pip install --upgrade pip +RUN python3 -m pip install --upgrade setuptools COPY LICENSE ./ COPY requirements.txt ./ -RUN python -m pip install -r requirements.txt -RUN python3.6 -m pip install -r requirements.txt +RUN python3 -m pip install -r requirements.txt COPY proto/ ./proto COPY pycue/README.md ./pycue/ @@ -37,7 +16,7 @@ COPY pycue/setup.py ./pycue/ COPY pycue/opencue ./pycue/opencue COPY pycue/FileSequence ./pycue/FileSequence -RUN python -m grpc_tools.protoc \ +RUN python3 -m grpc_tools.protoc \ -I=./proto \ --python_out=./pycue/opencue/compiled_proto \ --grpc_python_out=./pycue/opencue/compiled_proto \ @@ -55,32 +34,13 @@ COPY cueadmin/cueadmin ./cueadmin/cueadmin COPY VERSION.in VERSIO[N] ./ RUN test -e VERSION || echo "$(cat VERSION.in)-custom" | tee VERSION -RUN cd pycue && python setup.py install - -RUN cd pycue && python3.6 setup.py install - -# TODO(bcipriano) Lint the code here. (Issue #78) - -RUN cd cueadmin && python setup.py test - -RUN cd cueadmin && python3.6 setup.py test +RUN cd pycue && python3 setup.py install +RUN cd cueadmin && python3 setup.py test RUN cp LICENSE requirements.txt VERSION cueadmin/ RUN versioned_name="cueadmin-$(cat ./VERSION)-all" \ - && mv cueadmin $versioned_name \ - && tar -cvzf $versioned_name.tar.gz $versioned_name/* - - -# ----------------- -# RUN -# ----------------- -FROM centos:7 - -# First line after FROM should be unique to avoid --cache-from weirdness. -RUN echo "CueAdmin runtime stage" - -WORKDIR /opt/opencue - -COPY --from=build /src/cueadmin-*-all.tar.gz ./ - + && mv cueadmin "${versioned_name}" \ + && tar -cvzf "${versioned_name}.tar.gz" ${versioned_name}/* \ + && mkdir -p /opt/opencue \ + && cp "${versioned_name}.tar.gz" /opt/opencue/ diff --git a/cuebot/Dockerfile b/cuebot/Dockerfile index 2dd5ae960..d82b861cc 100644 --- a/cuebot/Dockerfile +++ b/cuebot/Dockerfile @@ -1,19 +1,16 @@ # ----------------- # BUILD # ----------------- -FROM gradle:6.0.1-jdk11 AS build +FROM gradle:6.0.1-jdk13 AS build USER gradle -# First line after FROM should be unique to avoid --cache-from weirdness. -RUN echo "Cuebot build stage" - COPY --chown=gradle:gradle ./cuebot /home/gradle/cuebot/ COPY --chown=gradle:gradle ./proto /home/gradle/proto/ WORKDIR /home/gradle/cuebot -RUN gradle build --stacktrace +RUN gradle build --info --stacktrace COPY --chown=gradle:gradle VERSION.in VERSIO[N] ./ RUN test -e VERSION || echo "$(cat VERSION.in)-custom" | tee VERSION @@ -25,12 +22,8 @@ RUN mv ./build/libs/cuebot.jar ./build/libs/cuebot-$(cat ./VERSION)-all.jar # ----------------- FROM jc21/rpmbuild-centos7:latest AS rpm -# Random first line after from - USER rpmbuilder -RUN echo "Cuebot RPM Stage" - COPY --chown=rpmbuilder:rpmbuilder LICENSE ./ COPY --from=build \ @@ -49,10 +42,7 @@ RUN chmod +x create_rpm.sh && ./create_rpm.sh cuebot "$(cat VERSION)" # ----------------- # RUN # ----------------- -FROM openjdk:11-jre-slim-buster - -# First line after FROM should be unique to avoid --cache-from weirdness. -RUN echo "Cuebot runtime stage" +FROM openjdk:18-slim-buster ARG CUEBOT_GRPC_CUE_PORT=8443 ARG CUEBOT_GRPC_RQD_PORT=8444 diff --git a/cuegui/Dockerfile b/cuegui/Dockerfile index f3cd788ce..8b0b189f9 100644 --- a/cuegui/Dockerfile +++ b/cuegui/Dockerfile @@ -1,10 +1,4 @@ -# ----------------- -# BUILD -# ----------------- -FROM centos:7 as build - -# First line after FROM should be unique to avoid --cache-from weirdness. -RUN echo "CueGUI build stage" +FROM --platform=linux/x86_64 centos:7 WORKDIR /src @@ -26,13 +20,11 @@ RUN yum -y install \ xcb-util-wm.x86_64 RUN yum -y install \ - python-pip \ python36 \ python36-devel \ python36-pip RUN python3.6 -m pip install --upgrade pip - RUN python3.6 -m pip install --upgrade setuptools RUN dbus-uuidgen > /etc/machine-id @@ -74,19 +66,7 @@ RUN cd cuegui && xvfb-run -d python3.6 setup.py test RUN cp LICENSE requirements.txt requirements_gui.txt VERSION cuegui/ RUN versioned_name="cuegui-$(cat ./VERSION)-all" \ - && mv cuegui $versioned_name \ - && tar -cvzf $versioned_name.tar.gz $versioned_name/* - - -# ----------------- -# RUN -# ----------------- -FROM centos:7 - -# First line after FROM should be unique to avoid --cache-from weirdness. -RUN echo "CueGUI runtime stage" - -WORKDIR /opt/opencue - -COPY --from=build /src/cuegui-*-all.tar.gz ./ - + && mv cuegui "${versioned_name}" \ + && tar -cvzf "${versioned_name}.tar.gz" ${versioned_name}/* \ + && mkdir -p /opt/opencue \ + && cp "${versioned_name}.tar.gz" /opt/opencue/ diff --git a/cuesubmit/Dockerfile b/cuesubmit/Dockerfile index 252936fa9..cc8f51178 100644 --- a/cuesubmit/Dockerfile +++ b/cuesubmit/Dockerfile @@ -1,10 +1,4 @@ -# ----------------- -# BUILD -# ----------------- -FROM centos:7 as build - -# First line after FROM should be unique to avoid --cache-from weirdness. -RUN echo "CueSubmit build stage" +FROM --platform=linux/x86_64 centos:7 WORKDIR /src @@ -15,22 +9,17 @@ RUN yum -y install \ python-devel RUN yum -y install \ - python-pip \ python36 \ python36-devel \ python36-pip -RUN python -m pip install --upgrade 'pip<21' RUN python3.6 -m pip install --upgrade pip - -RUN python -m pip install --upgrade 'setuptools<45' RUN python3.6 -m pip install --upgrade setuptools COPY LICENSE ./ COPY requirements.txt ./ COPY requirements_gui.txt ./ -RUN python -m pip install -r requirements.txt -r requirements_gui.txt RUN python3.6 -m pip install -r requirements.txt -r requirements_gui.txt COPY proto/ ./proto @@ -39,7 +28,7 @@ COPY pycue/setup.py ./pycue/ COPY pycue/opencue ./pycue/opencue COPY pycue/FileSequence ./pycue/FileSequence -RUN python -m grpc_tools.protoc \ +RUN python3.6 -m grpc_tools.protoc \ -I=./proto \ --python_out=./pycue/opencue/compiled_proto \ --grpc_python_out=./pycue/opencue/compiled_proto \ @@ -65,36 +54,14 @@ COPY cuesubmit/cuesubmit ./cuesubmit/cuesubmit COPY VERSION.in VERSIO[N] ./ RUN test -e VERSION || echo "$(cat VERSION.in)-custom" | tee VERSION -RUN cd pycue && python setup.py install - RUN cd pycue && python3.6 setup.py install - -RUN cd pyoutline && python setup.py install - RUN cd pyoutline && python3.6 setup.py install - -# TODO(bcipriano) Lint the code here. (Issue #78) - -RUN cd cuesubmit && python setup.py test - RUN cd cuesubmit && python3.6 setup.py test RUN cp LICENSE requirements.txt requirements_gui.txt VERSION cuesubmit/ RUN versioned_name="cuesubmit-$(cat ./VERSION)-all" \ - && mv cuesubmit $versioned_name \ - && tar -cvzf $versioned_name.tar.gz $versioned_name/* - - -# ----------------- -# RUN -# ----------------- -FROM centos:7 - -# First line after FROM should be unique to avoid --cache-from weirdness. -RUN echo "CueSubmit runtime stage" - -WORKDIR /opt/opencue - -COPY --from=build /src/cuesubmit-*-all.tar.gz ./ - + && mv cuesubmit "${versioned_name}" \ + && tar -cvzf "${versioned_name}.tar.gz" ${versioned_name}/* \ + && mkdir -p /opt/opencue \ + && cp "${versioned_name}.tar.gz" /opt/opencue/ diff --git a/pycue/Dockerfile b/pycue/Dockerfile index 54f8a2dc2..e93f9526a 100644 --- a/pycue/Dockerfile +++ b/pycue/Dockerfile @@ -1,35 +1,14 @@ -# ----------------- -# BUILD -# ----------------- -FROM centos:7 as build - -# First line after FROM should be unique to avoid --cache-from weirdness. -RUN echo "PyCue build stage" +FROM python:3.9.14 WORKDIR /src -RUN yum -y install \ - epel-release \ - gcc \ - python-devel - -RUN yum -y install \ - python-pip \ - python36 \ - python36-devel \ - python36-pip - -RUN python -m pip install --upgrade 'pip<21' -RUN python3.6 -m pip install --upgrade pip - -RUN python -m pip install --upgrade 'setuptools<45' -RUN python3.6 -m pip install --upgrade setuptools +RUN python3 -m pip install --upgrade pip +RUN python3 -m pip install --upgrade setuptools COPY LICENSE ./ COPY requirements.txt ./ -RUN python -m pip install -r requirements.txt -RUN python3.6 -m pip install -r requirements.txt +RUN python3 -m pip install -r requirements.txt COPY proto/ ./proto COPY pycue/README.md ./pycue/ @@ -38,7 +17,7 @@ COPY pycue/FileSequence ./pycue/FileSequence COPY pycue/tests/ ./pycue/tests COPY pycue/opencue ./pycue/opencue -RUN python -m grpc_tools.protoc \ +RUN python3 -m grpc_tools.protoc \ -I=./proto \ --python_out=./pycue/opencue/compiled_proto \ --grpc_python_out=./pycue/opencue/compiled_proto \ @@ -48,30 +27,15 @@ RUN python -m grpc_tools.protoc \ # for more info. RUN 2to3 -wn -f import pycue/opencue/compiled_proto/*_pb2*.py -# TODO(bcipriano) Lint the code here. (Issue #78) - COPY VERSION.in VERSIO[N] ./ RUN test -e VERSION || echo "$(cat VERSION.in)-custom" | tee VERSION -RUN cd pycue && python setup.py test - -RUN cd pycue && python3.6 setup.py test +RUN cd pycue && python3 setup.py test RUN cp LICENSE requirements.txt VERSION pycue/ RUN versioned_name="pycue-$(cat ./VERSION)-all" \ - && mv pycue $versioned_name \ - && tar -cvzf $versioned_name.tar.gz $versioned_name/* - - -# ----------------- -# RUN -# ----------------- -FROM centos:7 - -# First line after FROM should be unique to avoid --cache-from weirdness. -RUN echo "PyCue runtime stage" - -WORKDIR /opt/opencue - -COPY --from=build /src/pycue-*-all.tar.gz ./ + && mv pycue "${versioned_name}" \ + && tar -cvzf "${versioned_name}.tar.gz" ${versioned_name}/* \ + && mkdir /opt/opencue \ + && cp "${versioned_name}.tar.gz" /opt/opencue/ diff --git a/pyoutline/Dockerfile b/pyoutline/Dockerfile index fb24d1136..e898452e1 100644 --- a/pyoutline/Dockerfile +++ b/pyoutline/Dockerfile @@ -1,35 +1,14 @@ -# ----------------- -# BUILD -# ----------------- -FROM centos:7 as build - -# First line after FROM should be unique to avoid --cache-from weirdness. -RUN echo "PyCue build stage" +FROM python:3.9.14 WORKDIR /src -RUN yum -y install \ - epel-release \ - gcc \ - python-devel - -RUN yum -y install \ - python-pip \ - python36 \ - python36-devel \ - python36-pip - -RUN python -m pip install --upgrade 'pip<21' -RUN python3.6 -m pip install --upgrade pip - -RUN python -m pip install --upgrade 'setuptools<45' -RUN python3.6 -m pip install --upgrade setuptools +RUN python3 -m pip install --upgrade pip +RUN python3 -m pip install --upgrade setuptools COPY LICENSE ./ COPY requirements.txt ./ -RUN python -m pip install -r requirements.txt -RUN python3.6 -m pip install -r requirements.txt +RUN python3 -m pip install -r requirements.txt COPY proto/ ./proto COPY pycue/README.md ./pycue/ @@ -37,7 +16,7 @@ COPY pycue/setup.py ./pycue/ COPY pycue/opencue ./pycue/opencue COPY pycue/FileSequence ./pycue/FileSequence -RUN python -m grpc_tools.protoc \ +RUN python3 -m grpc_tools.protoc \ -I=./proto \ --python_out=./pycue/opencue/compiled_proto \ --grpc_python_out=./pycue/opencue/compiled_proto \ @@ -58,28 +37,13 @@ COPY pyoutline/outline ./pyoutline/outline COPY VERSION.in VERSIO[N] ./ RUN test -e VERSION || echo "$(cat VERSION.in)-custom" | tee VERSION -RUN cd pycue && python setup.py install -RUN cd pycue && python3.6 setup.py install - -RUN cd pyoutline && python setup.py test -RUN cd pyoutline && python3.6 setup.py test +RUN cd pycue && python3 setup.py install +RUN cd pyoutline && python3 setup.py test RUN cp LICENSE requirements.txt VERSION pyoutline/ RUN versioned_name="pyoutline-$(cat ./VERSION)-all" \ - && mv pyoutline $versioned_name \ - && tar -cvzf $versioned_name.tar.gz $versioned_name/* - - -# ----------------- -# RUN -# ----------------- -FROM centos:7 - -# First line after FROM should be unique to avoid --cache-from weirdness. -RUN echo "PyCue runtime stage" - -WORKDIR /opt/opencue - -COPY --from=build /src/pyoutline-*-all.tar.gz ./ - + && mv pyoutline "${versioned_name}" \ + && tar -cvzf "${versioned_name}.tar.gz" ${versioned_name}/* \ + && mkdir -p /opt/opencue \ + && cp "${versioned_name}.tar.gz" /opt/opencue/ diff --git a/rqd/Dockerfile b/rqd/Dockerfile index fd772c59e..15f5ac21c 100644 --- a/rqd/Dockerfile +++ b/rqd/Dockerfile @@ -1,4 +1,6 @@ -FROM centos:7 +FROM --platform=linux/x86_64 centos:7 + +WORKDIR /opt/opencue RUN yum -y install \ epel-release \ @@ -7,23 +9,16 @@ RUN yum -y install \ time RUN yum -y install \ - python-pip \ python36 \ python36-devel \ python36-pip -RUN python -m pip install --upgrade 'pip<21' RUN python3.6 -m pip install --upgrade pip - -RUN python -m pip install --upgrade 'setuptools<45' RUN python3.6 -m pip install --upgrade setuptools -WORKDIR /opt/opencue - COPY LICENSE ./ COPY requirements.txt ./ -RUN python -m pip install -r requirements.txt RUN python3.6 -m pip install -r requirements.txt COPY proto/ ./proto @@ -43,13 +38,9 @@ RUN python3.6 -m grpc_tools.protoc \ # for more info. RUN 2to3 -wn -f import rqd/rqd/compiled_proto/*_pb2*.py -# TODO(bcipriano) Lint the code here. (Issue #78) - COPY VERSION.in VERSIO[N] ./ RUN test -e VERSION || echo "$(cat VERSION.in)-custom" | tee VERSION -# Test in Python 2 and 3, but only install in the Python 3 environment. -RUN cd rqd && python setup.py test RUN cd rqd && python3.6 setup.py test RUN cd rqd && python3.6 setup.py install