Skip to content

Commit

Permalink
Update Dockerfile base images to fix compatibility issues. (#1198)
Browse files Browse the repository at this point in the history
  • Loading branch information
bcipriano authored Sep 29, 2022
1 parent 3859a5d commit a6ceb2f
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 233 deletions.
62 changes: 11 additions & 51 deletions cueadmin/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,43 +1,22 @@
# -----------------
# 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/
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 \
Expand All @@ -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/
16 changes: 3 additions & 13 deletions cuebot/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 \
Expand All @@ -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
Expand Down
30 changes: 5 additions & 25 deletions cuegui/Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
Expand Down Expand Up @@ -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/
45 changes: 6 additions & 39 deletions cuesubmit/Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
Expand All @@ -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 \
Expand All @@ -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/
56 changes: 10 additions & 46 deletions pycue/Dockerfile
Original file line number Diff line number Diff line change
@@ -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/
Expand All @@ -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 \
Expand All @@ -48,30 +27,15 @@ RUN python -m grpc_tools.protoc \
# <https://github.com/protocolbuffers/protobuf/issues/1491> 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/
Loading

0 comments on commit a6ceb2f

Please sign in to comment.