Skip to content

Commit

Permalink
add movingpandas docker and repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ray0727 committed Jul 14, 2022
1 parent 69213dc commit e32fd19
Show file tree
Hide file tree
Showing 7 changed files with 177 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "svn-mirror"]
path = svn-mirror
url = [email protected]:ARG-NCTU/svn-mirror.git
[submodule "movingpandas"]
path = movingpandas
url = [email protected]:ARG-NCTU/movingpandas.git
2 changes: 2 additions & 0 deletions Docker_pandas/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
docker build -t argnctu/pyivp:pandas .
15 changes: 15 additions & 0 deletions Docker_pandas/docker_join.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

BASH_OPTION=bash

IMG=argnctu/pyivp:pandas

xhost +
containerid=$(docker ps -aqf "ancestor=${IMG}") && echo $containerid
docker exec -it \
--privileged \
-e DISPLAY=${DISPLAY} \
-e LINES="$(tput lines)" \
${containerid} \
$BASH_OPTION
xhost -
52 changes: 52 additions & 0 deletions Docker_pandas/docker_run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/usr/bin/env bash

ARGS=("$@")

# Host home path
HOSTHOME=/home/$USER/pyivp
if [[ "$OSTYPE" == "darwin"* ]]; then
# Mac OSX
HOSTHOME=/Users/$USER/pyivp
fi

# Make sure processes in the container can connect to the x server
# Necessary so gazebo can create a context for OpenGL rendering (even headless)
XAUTH=/tmp/.docker.xauth
if [ ! -f $XAUTH ]; then
xauth_list=$(xauth nlist $DISPLAY)
xauth_list=$(sed -e 's/^..../ffff/' <<<"$xauth_list")
if [ ! -z "$xauth_list" ]; then
echo "$xauth_list" | xauth -f $XAUTH nmerge -
else
touch $XAUTH
fi
chmod a+r $XAUTH
fi

# Prevent executing "docker run" when xauth failed.
if [ ! -f $XAUTH ]; then
echo "[$XAUTH] was not properly created. Exiting..."
exit 1
fi

BASH_OPTION=bash

docker run \
-it \
--rm \
-e DISPLAY \
-e QT_X11_NO_MITSHM=1 \
-e XAUTHORITY=$XAUTH \
-v "$XAUTH:$XAUTH" \
-v "/home/$USER/pyivp:/home/arg/pyivp" \
-v "/tmp/.X11-unix:/tmp/.X11-unix" \
-v "/etc/localtime:/etc/localtime:ro" \
-v "/dev:/dev" \
-v "/var/run/docker.sock:/var/run/docker.sock" \
--workdir "/home/arg/pyivp" \
--name pyivp \
--network host \
--privileged \
--security-opt seccomp=unconfined \
argnctu/pyivp:pandas \
$BASH_OPTION
77 changes: 77 additions & 0 deletions Docker_pandas/dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
FROM continuumio/miniconda3

ENV SHELL=/bin/bash \
NB_USER=arg \
NB_UID=1000 \
LANG=en_US.UTF-8 \
LANGUAGE=en_US.UTF-8

ENV HOME=/home/${NB_USER}

RUN adduser --disabled-password \
--gecos "Default user" \
--uid ${NB_UID} \
${NB_USER}

RUN echo "root:root" | chpasswd
RUN echo "${NB_USER}:111111" | chpasswd
######################################## basic tools ####################################
# RUN apt-get --allow-releaseinfo-change update
RUN apt-get -o Acquire::ForceIPv4=true update && apt-get -yq dist-upgrade \
&& apt-get -o Acquire::ForceIPv4=true install -yq --no-install-recommends \
locales \
make \
git \
vim \
gedit \
wget \
sudo \
lsb-release \
build-essential \
net-tools \
dirmngr \
gnupg2 \
mercurial \
libopencv-dev \
libcanberra-gtk-module \
libcanberra-gtk3-module \
libpcap-dev \
python3-pip \
python3-setuptools \
python3-numpy \
python3-empy \
python3-lxml \
terminator \
screen \
nginx \
openssh-server \
libglfw3-dev \
iputils-ping \
libncurses5-dev \
libgtk2.0-dev \
libatk1.0-dev \
libcairo2-dev \
libx11-dev \
libxpm-dev \
libxt-dev \
python3-dev \
pybind11-dev \
cmake \
curl \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# create the environment
COPY environment.yml .
RUN conda env create -f environment.yml

# Make RUN commands use the new environment:
RUN echo "source activate" >> ~/.bashrc

##################################### Settings #####################################
RUN chown -R ${USER}:${USER} ${HOME}/
RUN echo "kl ALL=(ALL) ALL" > /etc/sudoers

WORKDIR ${HOME}


27 changes: 27 additions & 0 deletions Docker_pandas/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: movingpandas
channels:
- conda-forge
dependencies:
- python=3.9
- black
- cartopy
- codecov
- cython
- hvplot
- flake8
- geopandas
- geoviews
- geopy
- matplotlib
- numpy
- pandas
- panel
- pre-commit
- pytest
- pytest-cov
- rasterio
- scikit-learn
- seaborn
- shapely
- stonesoup
- jupyter
1 change: 1 addition & 0 deletions movingpandas
Submodule movingpandas added at 647d40

0 comments on commit e32fd19

Please sign in to comment.