Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
40f0ab0
add dockerfiles
DavideBaroliUniLu Sep 21, 2016
9908cfd
remove .bash_history
DavideBaroliUniLu Sep 21, 2016
0e20ae4
add testing of dockerfile in travis
DavideBaroliUniLu Sep 22, 2016
f3e8fa9
adding docker sudo permission
DavideBaroliUniLu Sep 22, 2016
8474f98
requirement for docker services
DavideBaroliUniLu Sep 22, 2016
81cc562
root permission move to run
DavideBaroliUniLu Sep 22, 2016
ac34923
small bug
DavideBaroliUniLu Sep 22, 2016
ca82497
spelling error
DavideBaroliUniLu Sep 22, 2016
a105884
move docker-run for README purpose, pulling from docker.io
DavideBaroliUniLu Sep 22, 2016
daf2b36
update travis, docker command in travis work only on linux ( issue #…
DavideBaroliUniLu Sep 22, 2016
66cfc12
fullfill the request;clean unused file
DavideBaroliUniLu Sep 22, 2016
7bf8f8b
make one Dockerfile
DavideBaroliUniLu Oct 10, 2016
d77a6b3
pushing the Dockerfile
DavideBaroliUniLu Oct 10, 2016
0b570ef
update travis.yml pulling from dockerhub autobuild-deployment; add ve…
DavideBaroliUniLu Oct 10, 2016
4d58be1
specify the tag
DavideBaroliUniLu Oct 10, 2016
5db4213
update README.md
DavideBaroliUniLu Oct 11, 2016
3b01a91
minor fix doc
DavideBaroliUniLu Oct 11, 2016
5a761f5
correct the dimension of container
DavideBaroliUniLu Oct 11, 2016
21be709
add info to use X11 in Win and Mac
DavideBaroliUniLu Oct 11, 2016
6640a29
write method in the RBFParameters class and tests
mtezzele Jul 20, 2016
845fa1b
readme updated with rbf and gui
Jul 20, 2016
cedb8d0
Gui improvements and tests (#80)
Jul 21, 2016
4217f4a
removed the repeated gui paragraph
mtezzele Jul 21, 2016
5fb2c36
now we can plot iges, vtk and stl on the gui during the execution
Jul 22, 2016
8011b67
some documentation and tests added for the gui new features
Jul 22, 2016
df51043
some documentation and tests added for the gui new features
Jul 22, 2016
ecdd9ad
changed picture and caption of gui in readme
Jul 22, 2016
7e91fba
now matplotlib figures are centered on the geometry
Jul 22, 2016
cb05388
changed some lines of code in plot method of vtkhandler class to make…
Jul 27, 2016
210ff58
RBF class and documentation
mtezzele Jul 27, 2016
12f939b
minor fixes
mtezzele Jul 27, 2016
84e1593
test rbf
mtezzele Jul 27, 2016
29925af
changed the order of the points in the plot of bounding box cause it …
Jul 28, 2016
dd90813
More tests for radial and doc (#88)
mtezzele Jul 28, 2016
39bdcea
pylint fixes and workaround for mac users
mtezzele Jul 29, 2016
2ac1b4d
utility to plot rbf control points
mtezzele Aug 2, 2016
61fdaa6
unvhandler fixes and freeform performances improved (#91)
sc-ita Aug 7, 2016
1c6f850
tutorial for rbf and documentation
mtezzele Aug 7, 2016
bdf5788
added link to youtube video tutorial
Aug 26, 2016
2451a83
nautical example added
Aug 26, 2016
6f300f3
add dockerfiles
DavideBaroliUniLu Sep 21, 2016
ba79d92
update travis.yml with docker running; update README.md
DavideBaroliUniLu Oct 10, 2016
bf3f933
Merge branch 'dbaroli/docker' of https://github.com/DavideBaroliUniLu…
DavideBaroliUniLu Oct 11, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@

sudo: true
#Required for docker build
dist: trusty
language: python

services:
- docker

matrix:
include:
- os: linux
Expand Down Expand Up @@ -43,17 +48,21 @@ install:
conda create --yes -n test python="2.7";
fi
- source activate test
- conda install --yes numpy scipy matplotlib pip nose vtk
- conda install --yes numpy scipy matplotlib pip nose vtk sip=4.18
- conda install --yes -c https://conda.anaconda.org/dlr-sc pythonocc-core
- pip install setuptools
- pip install enum34
- pip install numpy-stl
- pip install coveralls
- pip install coverage
- python setup.py install

script: coverage run test.py


script:
- coverage run test.py
# Docker in travis works only with linux.
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
docker run -u root docker.io/pygemdocker/pygem:latest /bin/sh -c "cd /home/PyGeM/build/PyGeM; coverage run test.py";
fi
after_success:
- coveralls

Expand Down
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,34 @@ To uninstall the package you have to rerun the installation and record the insta
> cat installed_files.txt | xargs rm -rf
```

Alternatively, a way to run the PyGeM library is to use our prebuilt and high-performance Docker images.
Docker containers are extremely lightweight, secure, and are based on open standards that run on all major Linux distributions, macOS and Microsoft Windows platforms.

Install Docker for your platform by following [these instructions](https://docs.docker.com/engine/getstarted/step_one/).
If using the Docker Toolbox (macOS versions < 10.10 or Windows versions < 10), make sure you run all commands inside the Docker Quickstart Terminal.

Now we will pull the docker.io/pygemdocker/pygem image from our cloud infrastructure:
```bash
> docker pull docker.io/pygemdocker/pygem:latest
```
Docker will pull the latest tag of the image pygemdocker/pygem from docker.io. The download is around 3.246 GB. The image is a great place to start experimenting with PyGeM and includes all dependencies already compiled for you.
Once the download is complete you can start PyGeM for the first time. Just run:
```bash
> docker run -ti pygemdocker/pygem:latest
```
To facilitate the devoloping, using the text editor,version control and other tools already installed on your computers,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*developing and a space after the comma.

it is possible to share files from the host into the container:

```bash
> docker run -ti -v $(pwd):/home/PyGeM/shared pygemdocker/pygem:latest
```
To allow the X11 forwarding in the container, on Linux system just run:

```bash
> docker run -ti --rm -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -v $(pwd):/home/PyGeM/shared pygemdocker/pygem:latest
```

For Windows system, you need to install Cygwin/X version and running the command in Cygwin terminal. While for mac system, you need to install xquartz.

## Documentation
**PyGeM** uses [Sphinx](http://www.sphinx-doc.org/en/stable/) for code documentation. To build the html versions of the docs simply:
Expand Down
86 changes: 86 additions & 0 deletions dockerfiles/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
FROM phusion/baseimage:0.9.19

# Get Ubuntu updates
USER root
RUN apt-get update -q && \
apt-get upgrade -y -o Dpkg::Options::="--force-confold" && \
apt-get -y install sudo && \
apt-get -y install locales && \
echo "C.UTF-8 UTF-8" > /etc/locale.gen && \
locale-gen && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Set locale environment
ENV LC_ALL=C.UTF-8 \
LANG=C.UTF-8 \
LANGUAGE=C.UTF-8

# OpenBLAS threads should be 1 to ensure performance
RUN echo 1 > /etc/container_environment/OPENBLAS_NUM_THREADS && \
echo 0 > /etc/container_environment/OPENBLAS_VERBOSE


# Set up user so that we do not run as root
RUN useradd -m -s /bin/bash -G sudo,docker_env PyGeM && \
echo "PyGeM:docker" | chpasswd && \
echo "PyGeM ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers

RUN touch /etc/service/syslog-forwarder/down
COPY set-home-permissions.sh /etc/my_init.d/set-home-permissions.sh
RUN chmod +x /etc/my_init.d/set-home-permissions.sh

USER PyGeM
ENV HOME /home/PyGeM
RUN touch $HOME/.sudo_as_admin_successful && \
mkdir $HOME/shared && \
mkdir $HOME/build
VOLUME /home/PyGeM/shared

WORKDIR /home/PyGeM
ENTRYPOINT ["sudo","/sbin/my_init","--quiet","--","sudo","-u","PyGeM","/bin/bash","-l","-c"]
CMD ["/bin/bash","-i"]

# utilities and libraries
USER root
RUN apt-get update -y; apt-get install -y --force-yes --fix-missing --no-install-recommends curl git unzip tree subversion vim cmake bison g++ gfortran openmpi-bin pkg-config wget libpcre3-dev bison flex swig libglu1-mesa pyqt4-dev-tools
RUN apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

RUN id PyGeM
RUN chown -R PyGeM:PyGeM $HOME

RUN cd /tmp && \
wget https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh && \
chmod +x miniconda.sh && \
bash miniconda.sh -b -p /usr/local/miniconda && \
rm /tmp/*
ENV PATH=/usr/local/miniconda/bin:$PATH

RUN echo "PATH=/usr/local/miniconda/bin:$PATH" >> ~/.profile
RUN /bin/bash -c 'source ~/.profile'

RUN hash -r && \
conda config --set always_yes yes --set changeps1 no && \
conda update -q conda
RUN conda info -a && \
conda create --yes -n test python="2.7";

RUN /bin/bash -c 'source activate test'
# The default sip version has api that is not compatible with qt4.
RUN conda install --yes numpy scipy matplotlib pip nose vtk sip=4.18
RUN conda install --yes -c https://conda.anaconda.org/dlr-sc pythonocc-core &&\
pip install setuptools && \
pip install enum34 && \
pip install numpy-stl && \
pip install coveralls && \
pip install coverage

RUN cd $HOME && \
cd build && \
git clone https://github.com/mathLab/PyGeM.git && \
cd PyGeM && \
python setup.py install

USER PyGeM


17 changes: 17 additions & 0 deletions dockerfiles/set-home-permissions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash
# User can pass e.g. --env HOST_UID=1003 so that UID in the container matches
# with the UID on the host. This is useful for Linux users, Mac and Windows
# already do transparent mapping of shared volumes.
if [ "$HOST_UID" ]; then
usermod -u $HOST_UID PyGeM
fi
if [ "$HOST_GID" ]; then
groupmod -g $HOST_GID PyGeM
fi
# This makes sure that all files in /home/fenics are accessible by the user
# fenics. We exclude the folder ~/shared to reduce IO out to the host. Docker
# for Mac, Docker for Windows and the UID/GID trick above should mean that file
# permissions work seamlessly now.
cd /home/PyGeM
find . -maxdepth 1 | grep -v "./shared" | xargs chown -R PyGeM:PyGeM