Changeset 14084


Ignore:
Timestamp:
Nov 15, 2019 2:52:26 PM (4 weeks ago)
Author:
aramle
Message:

#5877 Now building CentOS image with Python 3

Location:
BaseDockerImages/branches/dev-2379
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • BaseDockerImages/branches/dev-2379/Dockerfile

    r14073 r14084  
    4141COPY ${SRC_DIR}/*.sh ${DOCKER_SRC_DIR}/
    4242COPY ${SRC_DIR}/jcc.patch ${DOCKER_SRC_DIR}/
     43COPY ${SRC_DIR}/jcc35.patch ${DOCKER_SRC_DIR}/
    4344RUN chmod +x ${DOCKER_SRC_DIR}/*.sh
    4445
     
    4647RUN ${DOCKER_SRC_DIR}/setup_openjdk.sh
    4748RUN ${DOCKER_SRC_DIR}/setup_requirements.sh
     49RUN ${DOCKER_SRC_DIR}/setup_gcc.sh
    4850RUN ${DOCKER_SRC_DIR}/setup_python.sh
    49 RUN ${DOCKER_SRC_DIR}/setup_gcc.sh
    5051RUN ${DOCKER_SRC_DIR}/setup_ant.sh
    51 RUN ${DOCKER_SRC_DIR}/setup_ipopt.sh
    5252RUN ${DOCKER_SRC_DIR}/setup_jcc.sh
    5353RUN ${DOCKER_SRC_DIR}/centos_python_env.sh
     54RUN ${DOCKER_SRC_DIR}/setup_ipopt.sh
    5455RUN rm -rf ${USR_PATH}
    5556RUN rm -rf /*.tgz
  • BaseDockerImages/branches/dev-2379/scripts/centos_python_env.sh

    r13405 r14084  
    2323    echo "Not setting matplotlib backend for CentOS 6"
    2424else
    25     sed -i "/^backend/c\\backend:Agg" $(python -c "import matplotlib;print(matplotlib.matplotlib_fname())")
     25    if [ "$PYTHON_VERSION" = "3" ]; then
     26        sed -i "/^backend/c\\backend:Agg" $(python3 -c "import matplotlib;print(matplotlib.matplotlib_fname())")
     27    else
     28        sed -i "/^backend/c\\backend:Agg" $(python -c "import matplotlib;print(matplotlib.matplotlib_fname())")
     29    fi
    2630fi
    2731
  • BaseDockerImages/branches/dev-2379/scripts/setup_gcc.sh

    r13415 r14084  
     1#!/bin/bash
    12#
    23#    Copyright (C) 2018 Modelon AB
  • BaseDockerImages/branches/dev-2379/scripts/setup_jcc.sh

    r13415 r14084  
    2020    if [ -f /etc/centos-release ] || [ -f /etc/fedora-release ];
    2121    then
    22         export JCC_JDK=$(readlink -f /usr/bin/java | cut -d '/' -f-5)
     22        export JCC_JDK=$(readlink -f /usr/bin/java | cut -d '/' -f-5)       
    2323    else
    24         export JCC_JDK=$(find /usr -type f -name "jni.h" | cut -d '/' -f-5 | grep "java-8")
     24        export JCC_JDK=$(find /usr -type f -name "jni.h" | cut -d '/' -f-5 | grep "java-11")
    2525    fi
    26 
     26    export JCC_LFLAGS=$(find /usr -type f -name "libjvm.so")
    2727    echo "GOT JCC_JDK="$JCC_JDK
    2828    lines=$(echo $JCC_JDK | wc -l)
     
    3333        exit 1
    3434    fi
    35 
    36     pip install jcc==2.23
     35    if [ "$PYTHON_VERSION" = "3" ]; then
     36        pip3 install jcc==3.5
     37        patch_name=jcc35.patch
     38    else
     39        pip install jcc==2.23
     40        patch_name=jcc.patch
     41    fi
    3742
    3843    JCC_INSTALL_DIR=$(find /usr -type d -name jcc | sed -n 1p)
    39     cp ${DOCKER_SRC_DIR}/jcc.patch ${JCC_INSTALL_DIR}
     44    cp ${DOCKER_SRC_DIR}/${patch_name} ${JCC_INSTALL_DIR}
    4045    cd ${JCC_INSTALL_DIR}
    41     patch < jcc.patch
     46    patch < ${patch_name}
    4247
    43     rm -i jcc.patch
     48    rm -rf ${patch_name}
    4449fi
  • BaseDockerImages/branches/dev-2379/scripts/setup_openjdk.sh

    r14077 r14084  
    1 #!/bin/sh
     1#!/bin/bash
    22#
    33#    Copyright (C) 2019 Modelon AB
     
    3434    yum -y install java-1.8.0-openjdk-devel
    3535elif [ "$LINUX_DISTRIBUTION" = "DEBIAN" ]; then
    36     apt-get -y install openjdk-11-jdk
     36    apt-get update
     37    apt-get install -y software-properties-common
     38    add-apt-repository ppa:openjdk-r/ppa
     39    apt-get update -q
     40    apt-get install -y openjdk-11-jdk
    3741else
    3842    echo "${ME}: No set openjdk distribution for current linux distribution, exiting..."
  • BaseDockerImages/branches/dev-2379/scripts/setup_python.sh

    r14077 r14084  
    1 #!/bin/sh
     1#!/bin/bash
    22#
    33#    Copyright (C) 2019 Modelon AB
     
    2121
    2222if [ "$PYTHON_VERSION" = "3" ]; then
    23     BUILD_PKGS_JM_REDHAT="python3-pip"
    24     BUILD_PKGS_JM_DEBIAN="python3-pip"
    25     BUILD_PYTHON_PIP_PACKAGES="html5lib==1.0.1 notebook==6.0.1 jupyter==1.0.0 colorama==0.4.1 nbformat==4.4.0 Jinja2==2.10.1 openpyxl==2.6.3 mock==3.0.5 natsort==6.0.0 six==1.12.0 MarkupSafe==1.1.1 lxml==4.4.1 matplotlib==3.1.1 scipy==1.3.1 cython==0.29.13 nose==1.3.7 ipython==7.8.0 ipykernel==5.1.2"
     23    BUILD_PKGS_JM_REDHAT="python3-pip python3-devel.x86_64"
     24    BUILD_PKGS_JM_DEBIAN="python3-pip python3-dev"
     25    BUILD_PYTHON_PIP_PACKAGES="html5lib==1.0.1 notebook==6.0.1 jupyter==1.0.0 colorama==0.4.1 nbformat==4.4.0 Jinja2==2.10.1 openpyxl==2.6.3 mock==3.0.5 natsort==6.0.0 six==1.12.0 MarkupSafe==1.1.1 lxml==4.4.1 matplotlib==3.1.1 scipy==1.3.1 cython==0.29.13 nose==1.3.7 ipython==7.8.0 ipykernel==5.1.2 jpype1==0.7.0"
    2626else
    2727    BUILD_PKGS_JM_DEBIAN="python-lucene python-dev python-jpype"
     
    3333if [ "$LINUX_DISTRIBUTION" = "CENTOS" ]; then
    3434    BUILD_PKGS_JM=$BUILD_PKGS_JM_REDHAT
    35     alias pckinstall="yum -y install"
     35    pckinstall="yum -y install"
    3636elif [ "$LINUX_DISTRIBUTION" = "REDHAT" ]; then
    3737    BUILD_PKGS_JM=$BUILD_PKGS_JM_REDHAT
    38     alias pckinstall="yum -y install"
     38    pckinstall="yum -y install"
    3939elif [ "$LINUX_DISTRIBUTION" = "DEBIAN" ]; then
    4040    BUILD_PKGS_JM=$BUILD_PKGS_JM_DEBIAN
    41     alias pckinstall="apt-get -y install"
     41    pckinstall="apt-get -y install"
    4242else
    4343    echo ERROR: current linux distribution not supported yet
     
    4545fi
    4646
    47 pckinstall $BUILD_PKGS_JM
     47${pckinstall} $BUILD_PKGS_JM
    4848
    4949
  • BaseDockerImages/branches/dev-2379/scripts/setup_requirements.sh

    r14073 r14084  
    1616set -e
    1717
    18 ME="$( basename "${BASH_SOURCE[0]}" )"
    19 
    2018. ${DOCKER_SRC_DIR}/settings.sh
    2119
     
    3028    BUILD_PKGS_JM=$BUILD_PKGS_JM_REDHAT
    3129    yum -y install epel-release  # for some python packages
    32     alias pckinstall="yum -y install"
     30    pckinstall="yum -y install"
    3331elif [ "$LINUX_DISTRIBUTION" = "REDHAT" ]; then
    3432    BUILD_PKGS_JM=$BUILD_PKGS_JM_REDHAT
    3533    yum -y install epel-release  # for some python packages
    36     alias pckinstall="yum -y install"
     34    pckinstall="yum -y install"
    3735elif [ "$LINUX_DISTRIBUTION" = "DEBIAN" ]; then
    3836    BUILD_PKGS_JM=$BUILD_PKGS_JM_DEBIAN
    3937    apt-get update
    4038    apt-get -y install tzdata #install separately due to issues with backends in docker
    41     alias pckinstall="apt-get -y install"
     39    pckinstall="apt-get -y install"
    4240else
    4341    echo ERROR: current linux distribution not supported yet
     
    4543fi
    4644
    47 pckinstall $BUILD_PKGS_JM_COMMON
    48 pckinstall $BUILD_PKGS_JM
     45${pckinstall} $BUILD_PKGS_JM_COMMON
     46${pckinstall} $BUILD_PKGS_JM
    4947
    5048
Note: See TracChangeset for help on using the changeset viewer.