Skip to content

Docker Notes

Mark Feit edited this page Jul 27, 2016 · 8 revisions

This page describes how to build a Docker container that runs a self-contained instance of pScheduler.

It's mostly notes, so don't take it as gospel.

The host system must be CentOS 7 or later.

The container must be in a

System preparation

# Configure the Docker repo
tee /etc/yum.repos.d/docker.repo <<-'EOF'
[dockerrepo]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/main/centos/$releasever/
enabled=1
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg
EOF

# Install Docker
yum -y install docker-engine

# Start the daemon
systemctl enable docker.service
service docker start

# Test it
docker run hello-world

Building the Container

# Grab CentOS 6.  Don't use 7; DBus is a hassle.
docker pull centos:6

# Start a container with a shell
docker run -t -i centos:6 /bin/bash

# Inside the container:

yum -y install git
git clone https://github.com/perfsonar/pscheduler.git

cd pscheduler

sed -i -e 's/^ADD_BACKPLANE_HOSTS/#ADD_BACKPLANE_HOSTS/' scripts/system-prep
./scripts/system-prep

make

Build image:

docker build -t pscheduler-demo .

Booting the Image

Launch the image, naming it psc1:

docker run --detach --hostname psc1 --name psc1 pscheduler-demo

Connect and

docker exec -i -t psc1 /bin/bash -c 'su - demo'

See if pScheduler works on the local machine:

psc task idle --duration PT1S

The output should look like this:

Task URL:
https://psc1/pscheduler/tasks/4eb7d6e8-e4aa-4718-b718-95b8ca1da387
Fetching first run...

Next run:
https://psc1/pscheduler/tasks/4eb7d6e8-e4aa-4718-b718-95b8ca1da387/runs/96e6cc94-2533-431e-b683-bedfb5321cd4
Starts 2016-07-27T04:14:39Z (~8 seconds)
Ends   2016-07-27T04:14:40Z (~0 seconds)

Duration ... PT1S

Try a task that uses both:

psc task simplestream --timeout PT5S --dest psc2

Output should look like this:

Task URL:
https://psc1/pscheduler/tasks/df8a2c74-3272-434c-a5f4-2a9acb73cced
Fetching first run...

Next run:
https://psc1/pscheduler/tasks/df8a2c74-3272-434c-a5f4-2a9acb73cced/runs/22ed5c1e-db94-4fc4-ab0b-80491a86ed04
Starts 2016-07-27T07:14:50Z (~6 seconds)
Ends   2016-07-27T07:14:55Z (~4 seconds)

Dawdled ......... P0D
Text Sent ....... Data sent at 2016-07-27 07:14:50.507086
Text Received ... Data sent at 2016-07-27 07:14:50.507086
Elapsed Time .... PT0.130897S
Clone this wiki locally