Skip to content

Commit

Permalink
major update of the docker module (adding build and run functions)
Browse files Browse the repository at this point in the history
  • Loading branch information
gfursin committed Jun 9, 2016
1 parent 5ab3cc9 commit 4bd8eec
Show file tree
Hide file tree
Showing 30 changed files with 485 additions and 49 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*.pyc
*tmp/
*.ipynb_checkpoints/
program/pluton-blas-*/tmp-ck-*
14 changes: 14 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
=======================================================================
N: Anton Lokhmotov
E: [email protected]
H: https://www.hipeac.net/~anton
O: dividiti, UK
C:
W:
=======================================================================
N: Grigori Fursin
E: [email protected]
H: http://fursin.net/research
O: dividiti, UK / cTuning foundation, France
C:
W:
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* 2016.06.08 - major update of the docker module (adding build and run functions)
15 changes: 15 additions & 0 deletions CONTRIBUTIONS
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Acknowledgments:

N: Anton Lokhmotov
E: [email protected]
H: https://www.hipeac.net/~anton
O: dividiti
C: first implementation
W:

N: Grigori Fursin
E: [email protected]
H: http://fursin.net
O: cTuning foundation
C: unification and extension (build and run)
W:
1 change: 1 addition & 0 deletions COPYRIGHT
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(C)opyright 2016 cTuning foundation
28 changes: 28 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Copyright (c) cTuning Foundation
All rights reserved

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

3. Neither the name of Grigori Fursin and CTUNING FOUNDATION
nor the names of its contributors may be used to endorse
or promote products derived from this software without
specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Collective Knowledge repository for Docker images
# Automating creation and execution of Docker images via Collectiv Knowledge Framework





## Install Docker

Expand All @@ -13,6 +17,10 @@ This message shows that your installation appears to be working correctly.
**NB:** To run Docker without `sudo` on Linux, create a `docker` user group (e.g. see instructions for Ubuntu [here](https://docs.docker.com/engine/installation/linux/ubuntulinux/#create-a-docker-group).






## Build a CK Docker image

To build a CK Docker image named `ctuning/ck-ubuntu-16.04` from a `Dockerfile` in `docker/ubuntu-16.04`, run:
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions docker/.cm/alias-a-ck-ubuntu-16.04-crowdtune-gcc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ab4db058845a3e02
1 change: 1 addition & 0 deletions docker/.cm/alias-a-ck-ubuntu-16.04-interactive-report
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
74b62bf7222a67bd
2 changes: 1 addition & 1 deletion docker/.cm/alias-u-2ad0194934a99875
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ubuntu-16.04
ck-ubuntu-16.04
1 change: 1 addition & 0 deletions docker/.cm/alias-u-74b62bf7222a67bd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ck-ubuntu-16.04-interactive-report
1 change: 1 addition & 0 deletions docker/.cm/alias-u-ab4db058845a3e02
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ck-ubuntu-16.04-crowdtune-gcc
File renamed without changes.
20 changes: 20 additions & 0 deletions docker/ck-ubuntu-16.04-crowdtune-gcc/.cm/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"backup_data_uid": "ab4db058845a3e02",
"backup_module_uid": "88eef0cd8c43b68a",
"backup_module_uoa": "docker",
"control": {
"author": "Grigori Fursin",
"author_email": "[email protected]",
"author_webpage": "http://fursin.net",
"copyright": "See CK COPYRIGHT.txt for copyright details",
"engine": "CK",
"iso_datetime": "2016-06-09T12:49:00.164698",
"license": "See CK LICENSE.txt for licensing details",
"version": [
"1",
"7",
"2dev"
]
},
"data_name": "ubuntu-16.04-crowdtune-gcc"
}
8 changes: 8 additions & 0 deletions docker/ck-ubuntu-16.04-crowdtune-gcc/.cm/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"cmd": {
"default": {
"build": "-t $#CK_DOCKER_ORGANIZATION#$/$#CK_DOCKER_NAME#$ $#CK_PATH#$",
"run": "--rm -it $#CK_DOCKER_ORGANIZATION#$/$#CK_DOCKER_NAME#$"
}
}
}
32 changes: 32 additions & 0 deletions docker/ck-ubuntu-16.04-crowdtune-gcc/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
FROM ubuntu:16.04
MAINTAINER Grigori Fursin <[email protected]>

# Install standard packages.
RUN apt-get update && apt-get install -y \
python-all \
git

# Install extra deps for imaging
RUN apt-get install -y libjpeg8 libjpeg62-dev libfreetype6 libfreetype6-dev python-pillow

# Install GCC to crowdtune
RUN apt-get install -y gcc

# Install the core Collective Knowledge (CK) module.
ENV CK_ROOT=/ck-master \
CK_REPOS=/CK \
CK_TOOLS=/CK-TOOLS \
PATH=${CK_ROOT}/bin:${PATH}

RUN mkdir -p ${CK_ROOT} ${CK_REPOS} ${CK_TOOLS}
RUN git clone https://github.com/ctuning/ck.git ${CK_ROOT}
RUN cd ${CK_ROOT} && python setup.py install && python -c "import ck.kernel as ck"

# Install other CK modules.
RUN ck pull repo:ck-web
RUN ck pull repo:ck-crowdtuning

# Start the CK web service.
# Note, that container will have it's own IP,
# that's why we need `hostname -i` below
CMD ck crowdsource program.optimization --gcc --user=docker --quiet
File renamed without changes.
20 changes: 20 additions & 0 deletions docker/ck-ubuntu-16.04-interactive-report/.cm/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"backup_data_uid": "74b62bf7222a67bd",
"backup_module_uid": "88eef0cd8c43b68a",
"backup_module_uoa": "docker",
"control": {
"author": "Grigori Fursin",
"author_email": "[email protected]",
"author_webpage": "http://fursin.net",
"copyright": "See CK COPYRIGHT.txt for copyright details",
"engine": "CK",
"iso_datetime": "2016-06-09T12:43:40.561942",
"license": "See CK LICENSE.txt for licensing details",
"version": [
"1",
"7",
"2dev"
]
},
"data_name": "ubuntu-16.04-interactive-report"
}
15 changes: 15 additions & 0 deletions docker/ck-ubuntu-16.04-interactive-report/.cm/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"cmd": {
"default": {
"build": "-t $#CK_DOCKER_ORGANIZATION#$/$#CK_DOCKER_NAME#$ $#CK_PATH#$",
"run": "--rm -it $#CK_DOCKER_ORGANIZATION#$/$#CK_DOCKER_NAME#$",
"run_extra_cmd": "--env CK_HOST=0.0.0.0 --env WFE_HOST=localhost --env CK_PORT=$#CK_PORT#$ --env WFE_PORT=$#CK_PORT#$ -p $#CK_PORT#$:$#CK_PORT#$"
}
},
"convert_input_to_vars": {
"port": {
"default": "3344",
"key": "CK_PORT"
}
}
}
43 changes: 43 additions & 0 deletions docker/ck-ubuntu-16.04-interactive-report/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
FROM ubuntu:16.04
MAINTAINER Anton Lokhmotov <[email protected]>
MAINTAINER Grigori Fursin <[email protected]>

# Install standard packages.
RUN apt-get update && apt-get install -y \
python-all \
git

# Install extra deps for imaging
RUN apt-get install -y libjpeg8 libjpeg62-dev libfreetype6 libfreetype6-dev python-pillow

# Install the core Collective Knowledge (CK) module.
ENV CK_ROOT=/ck-master \
CK_REPOS=/CK \
CK_TOOLS=/CK-TOOLS \
PATH=${CK_ROOT}/bin:${PATH}

RUN mkdir -p ${CK_ROOT} ${CK_REPOS} ${CK_TOOLS}
RUN git clone https://github.com/ctuning/ck.git ${CK_ROOT}
RUN cd ${CK_ROOT} && python setup.py install && python -c "import ck.kernel as ck"

# Install other CK modules.
RUN ck pull repo:ck-web
RUN ck pull repo:reproduce-ck-paper
RUN ck pull repo:reproduce-pamela-project

# Set the CK web service defaults.
ENV CK_PORT=3344 \
WFE_PORT=3344

# Expose CK port
EXPOSE ${CK_PORT}

# Start the CK web service.
# Note, that container will have it's own IP,
# that's why we need `hostname -i` below
CMD export CK_LOCAL_HOST=`hostname -i` ; \
if [ "${CK_HOST}" = "" ]; then export CK_HOST=$CK_LOCAL_HOST ; fi ; \
if [ "${WFE_HOST}" = "" ]; then export WFE_HOST=$CK_LOCAL_HOST ; fi ; \
ck start web \
--host=${CK_HOST} --port=${CK_PORT} \
--wfe_host=${WFE_HOST} --wfe_port=${WFE_PORT}
1 change: 1 addition & 0 deletions docker/ck-ubuntu-16.04/.cm/desc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
20 changes: 20 additions & 0 deletions docker/ck-ubuntu-16.04/.cm/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"backup_data_uid": "2ad0194934a99875",
"backup_module_uid": "88eef0cd8c43b68a",
"backup_module_uoa": "docker",
"control": {
"author": "Grigori Fursin",
"author_email": "[email protected]",
"author_webpage": "http://fursin.net",
"copyright": "See CK COPYRIGHT.txt for copyright details",
"engine": "CK",
"iso_datetime": "2016-05-26T16:14:49.133000",
"license": "See CK LICENSE.txt for licensing details",
"version": [
"1",
"7",
"2dev"
]
},
"data_name": "ubuntu-16.04"
}
15 changes: 15 additions & 0 deletions docker/ck-ubuntu-16.04/.cm/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"cmd": {
"default": {
"build": "-t $#CK_DOCKER_ORGANIZATION#$/$#CK_DOCKER_NAME#$ $#CK_PATH#$",
"run": "--rm -it $#CK_DOCKER_ORGANIZATION#$/$#CK_DOCKER_NAME#$",
"run_extra_cmd": "--env CK_HOST=0.0.0.0 --env WFE_HOST=localhost --env CK_PORT=$#CK_PORT#$ --env WFE_PORT=$#CK_PORT#$ -p $#CK_PORT#$:$#CK_PORT#$"
}
},
"convert_input_to_vars": {
"port": {
"default": "3344",
"key": "CK_PORT"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
FROM ubuntu:16.04
MAINTAINER Anton Lokhmotov <[email protected]>
MAINTAINER Grigori Fursin <[email protected]>

# Install standard packages.
RUN apt-get update && apt-get install -y \
python-all \
git

# Install extra deps for imaging
RUN apt-get install -y libjpeg8 libjpeg62-dev libfreetype6 libfreetype6-dev python-pillow

# Install the core Collective Knowledge (CK) module.
ENV CK_ROOT=/CK \
CK_REPOS=/CK_REPOS \
CK_TOOLS=/CK_TOOLS \
ENV CK_ROOT=/ck-master \
CK_REPOS=/CK \
CK_TOOLS=/CK-TOOLS \
PATH=${CK_ROOT}/bin:${PATH}

RUN mkdir -p ${CK_ROOT} ${CK_REPOS} ${CK_TOOLS}
Expand All @@ -21,13 +25,17 @@ RUN ck pull repo:ck-web

# Set the CK web service defaults.
ENV CK_PORT=3344 \
WFE_PORT=3344 \
WFE_HOST=localhost
WFE_PORT=3344

# Listen on the CK port.
# Expose CK port
EXPOSE ${CK_PORT}

# Start the CK web service.
CMD ck start web \
--host=`hostname -i` --port=${CK_PORT} \
# Note, that container will have it's own IP,
# that's why we need `hostname -i` below
CMD export CK_LOCAL_HOST=`hostname -i` ; \
if [ "${CK_HOST}" = "" ]; then export CK_HOST=$CK_LOCAL_HOST ; fi ; \
if [ "${WFE_HOST}" = "" ]; then export WFE_HOST=$CK_LOCAL_HOST ; fi ; \
ck start web \
--host=${CK_HOST} --port=${CK_PORT} \
--wfe_host=${WFE_HOST} --wfe_port=${WFE_PORT}
20 changes: 0 additions & 20 deletions docker/ubuntu-16.04/.cm/info.json

This file was deleted.

26 changes: 13 additions & 13 deletions module/docker/.cm/info.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
"backup_data_uid": "88eef0cd8c43b68a",
"backup_module_uid": "032630d041b4fd8a",
"backup_module_uoa": "module",
"backup_data_uid": "88eef0cd8c43b68a",
"backup_module_uid": "032630d041b4fd8a",
"backup_module_uoa": "module",
"control": {
"author": "Grigori Fursin",
"author_email": "[email protected]",
"author_webpage": "http://fursin.net",
"copyright": "See CK COPYRIGHT.txt for copyright details",
"engine": "CK",
"iso_datetime": "2016-05-26T16:14:35.436000",
"license": "See CK LICENSE.txt for licensing details",
"author": "Grigori Fursin",
"author_email": "[email protected]",
"author_webpage": "http://fursin.net",
"copyright": "See CK COPYRIGHT.txt for copyright details",
"engine": "CK",
"iso_datetime": "2016-05-26T16:14:35.436000",
"license": "See CK LICENSE.txt for licensing details",
"version": [
"1",
"7",
"1",
"7",
"2dev"
]
},
},
"data_name": "docker"
}
Loading

0 comments on commit 4bd8eec

Please sign in to comment.