Making PBS Pro Docker container Mirroring

Source: Internet
Author: User
Tags chmod openssl postgresql ssh docker run
making PBS Pro Docker container mirroring first prepare a dockerfile, the content is as follows, actually uses the CentOS7.2 mirror image
From Docker.io/centos

maintainer fanbin Kong "kongxx@hotmail.com"

RUN yum install-y sudo tar wget openssh-server Openssh-clients OpenSSL openssl-devel 
RUN yum install-y gcc make rpm-build libtool hwloc-devel \
      libx11-devel li Bxt-devel libedit-devel libical-devel \
      ncurses-devel perl postgresql-devel python-devel tcl-devel \
      tk-devel Swig expat-devel libxext libxft autoconf automake
RUN yum install-y expat libedit postgresql-server python sendmail t CL tk libical

RUN sed-i ' s/usepam yes/usepam no/g '/etc/ssh/sshd_config
run echo ' Root:letmein ' | chpasswd
RU N useradd admin
run echo "Admin:admin" | chpasswd
Run echo "admin   all= (All)       Nopasswd:all" >> Etc/sudoers

Run ssh-keygen-t dsa-f/etc/ssh/ssh_host_dsa_key
run ssh-keygen-t rsa-f Key
run mkdir/var/run/sshd

ADD setup.sh/root/setup.sh
run chmod +x/root/setup.sh

expose 22
CMD ["/usr/sbin/sshd", "D"]
Install script

Create a setup.sh file in the Docker sibling directory, because PBS Pro needs to compile and produce files related to the machine name, so the PBS Pro is not built into the Docker mirror (in fact, by modifying some files can be done in the mirror), Instead, it is installed in a container through an installation foot.

#!/bin/sh

pbs_master=pbsmaster

Install () {
    wget-c https://github.com/PBSPro/pbspro/archive/ v14.1.0.tar.gz
    tar zxvf v14.1.0.tar.gz
    cd pbspro-14.1.0 &&/autogen.sh &&/configure- Prefix=/opt/pbs && make && make install
    /opt/pbs/libexec/pbs_postinstall
    chmod 4755/opt/pbs/ SBIN/PBS_IFF/OPT/PBS/SBIN/PBS_RCP
}

Master () {
    install
    sed-i "1cpbs_server=${pbs_master}"/etc/ pbs.conf 
    sed-i ' s/pbs_start_mom=0/pbs_start_mom=1/g '/etc/pbs.conf
}

Slave () {
    Install
    Sed-i "1cpbs_server=${pbs_master}"/etc/pbs.conf
    sed-i ' s/pbs_start_server=1/pbs_start_server=0/g '/etc/ pbs.conf
    sed-i ' s/pbs_start_sched=1/pbs_start_sched=0/g '/etc/pbs.conf
    sed-i ' S/pbs_start_comm=1/pbs_ Start_comm=0/g '/etc/pbs.conf
    sed-i ' s/pbs_start_mom=0/pbs_start_mom=1/g '/etc/pbs.conf
}

$*
Generating Docker mirrors
sudo docker build-t pbs:v1.
running the Docker container Master
$ sudo docker run--privileged--name pbsmaster-h pbsmaster-d-P PBS:V1

Log in to the container as root and perform the installation

#./setup Master
slave
$ sudo docker run--privileged--name pbsslave-h pbsslave-d-P PBS:V1

Log in to the container as root and perform the installation

#./setup Slave
Modify the/etc/hosts files for master and slave nodes so that two machines can access each other start PBSRun on master and slave nodes, respectively
#/ETC/INIT.D/PBS Start
The master node will slave nodes if the cluster
# . /etc/profile.d/pbs.sh

# Add slave node to cluster
# qmgr-c ' Create node Pbsslave '
TestLog on to the master node as Admin user
$ . /etc/profile.d/pbs.sh

# View node status
$ pbsnodes-a

# Submit Job
$ Echo ' sleep 123 ' | qsub

# View Job
$ qstat-a

Reprint please indicate this link form link
This article link: http://blog.csdn.net/kongxx/article/details/52704468

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.