├── README.md ├── conda_forge ├── build.sh └── Dockerfile ├── cudatkit ├── build.sh └── Dockerfile ├── conda_builder_linux ├── build.sh ├── build │ ├── alias_32bit.sh │ ├── yum_cleanup.sh │ ├── yum_install_syslibs.sh │ ├── install_miniconda.sh │ └── internal_startup.sh ├── start_cpp11.sh ├── Dockerfile └── docker_wrapper.sh ├── hpc-contained ├── README.md └── Dockerfile ├── my-hello-world └── Dockerfile ├── destroy_all_images.sh ├── identidock ├── Dockerfile ├── docker-compose.yml ├── cmd.sh └── app │ └── identidock.py ├── LICENSE ├── .gitignore └── gdf-sandbox └── Dockerfile /README.md: -------------------------------------------------------------------------------- 1 | # dockerfiles 2 | Various Dockerfiles I use 3 | -------------------------------------------------------------------------------- /conda_forge/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t forge . 3 | -------------------------------------------------------------------------------- /cudatkit/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t cudatkit . 3 | -------------------------------------------------------------------------------- /conda_builder_linux/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t condab_centos7 . -------------------------------------------------------------------------------- /conda_builder_linux/build/alias_32bit.sh: -------------------------------------------------------------------------------- 1 | /bin/uname_x64 $@ | sed s/x86_64/i686/g -------------------------------------------------------------------------------- /hpc-contained/README.md: -------------------------------------------------------------------------------- 1 | $ docker build . -t hpc 2 | $ docker run --rm -it hpc:latest /bin/bash -------------------------------------------------------------------------------- /my-hello-world/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:latest 2 | LABEL maintainer "Anderson Banihirwe" 3 | 4 | RUN echo "Hello, World!" -------------------------------------------------------------------------------- /conda_builder_linux/start_cpp11.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | bash $(dirname "${BASH_SOURCE[0]}")/docker_wrapper.sh -e "ABI=5" $@ -------------------------------------------------------------------------------- /cudatkit/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nvidia/cuda:9.2-base-centos7 2 | 3 | MAINTAINER Anderson Banihirwe 4 | 5 | -------------------------------------------------------------------------------- /destroy_all_images.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Warning: This will destroy all your images and containers. It will not be possible to restore them! 3 | # Delete all containers 4 | docker rm $(docker ps -a -q) 5 | # Delete all images 6 | docker rmi $(docker images -q) -------------------------------------------------------------------------------- /conda_forge/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM condaforge/linux-anvil 2 | RUN sudo -n yum install -y openssh-clients 3 | COPY . /tmp/repo 4 | RUN export PATH="/opt/conda/bin:${PATH}" && \ 5 | conda config --add channels conda-forge 6 | RUN export PATH="/opt/conda/bin:${PATH}" 7 | -------------------------------------------------------------------------------- /conda_builder_linux/build/yum_cleanup.sh: -------------------------------------------------------------------------------- 1 | yum -y erase wireless-tools avahi curl > /dev/null 2>&1 2 | yum -y clean all 3 | 4 | # print out all installed packages, and then again by size 5 | yum list installed 6 | rpm -qa --queryformat '%10{size} - %-25{name} \t %{version}\n' | sort -n -------------------------------------------------------------------------------- /identidock/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.6 2 | 3 | RUN groupadd -r uwsgi && useradd -r -g uwsgi uwsgi 4 | 5 | RUN pip install Flask==0.12.1 uWSGI==2.0.15 requests==2.18.4 redis==2.10.6 6 | 7 | WORKDIR /app 8 | COPY app /app 9 | COPY cmd.sh / 10 | 11 | EXPOSE 9090 9191 12 | USER uwsgi 13 | 14 | CMD ["/cmd.sh"] -------------------------------------------------------------------------------- /identidock/docker-compose.yml: -------------------------------------------------------------------------------- 1 | identidock: 2 | build: . 3 | ports: 4 | - '5000:5000' 5 | environment: 6 | ENV: DEV 7 | volumes: 8 | - './app:/app' 9 | links: 10 | - dnmonster 11 | - redis 12 | dnmonster: 13 | image: 'amouat/dnmonster:1.0' 14 | redis: 15 | image: 'redis:3.0' 16 | -------------------------------------------------------------------------------- /identidock/cmd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | if [ "$ENV" = 'DEV' ]; then 5 | echo "Running Development Server" 6 | exec python "identidock.py" 7 | else 8 | echo "Running Production Server" 9 | exec uwsgi --http 0.0.0.0:9090 --wsgi-file /app/identidock.py \ 10 | --callable app --stats 0.0.0.0:9191 11 | fi -------------------------------------------------------------------------------- /conda_builder_linux/build/yum_install_syslibs.sh: -------------------------------------------------------------------------------- 1 | yum install -y curl.x86_64 bzip2.x86_64 yum-utils glibc-devel patch \ 2 | unzip bison yasm file make libtool.x86_64 pkgconfig.x86_64 \ 3 | glib2-devel libX11-devel libXext-devel libXrender-devel \ 4 | mesa-libGL-devel libICE-devel libSM-devel ncurses-devel \ 5 | openssh-clients.x86_64 patch.x86_64 dbus-devel gtk2-devel \ 6 | chrpath.x86_64 nano bzip2 xz sudo curl -------------------------------------------------------------------------------- /conda_builder_linux/build/install_miniconda.sh: -------------------------------------------------------------------------------- 1 | yum install -y wget 2 | 3 | wget -O Miniconda.sh http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh 4 | 5 | /bin/bash Miniconda.sh -b -p /opt/miniconda 6 | rm Miniconda.sh 7 | /opt/miniconda/bin/conda config --set show_channel_urls True 8 | /opt/miniconda/bin/conda update --yes --all 9 | /opt/miniconda/bin/conda install --yes git conda-build=3.* curl anaconda-client 10 | /opt/miniconda/bin/conda clean --tarballs --packages -------------------------------------------------------------------------------- /hpc-contained/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM continuumio/miniconda3:latest 2 | 3 | ENV HOME /root 4 | WORKDIR /root 5 | 6 | RUN apt-get -y update && \ 7 | apt-get install -y --fix-missing \ 8 | gcc g++ kmod make \ 9 | build-essential \ 10 | libssl-dev \ 11 | uuid-dev \ 12 | squashfs-tools && \ 13 | apt-get clean -y 14 | 15 | RUN git config --global user.name "andersy005" && \ 16 | git config --global user.email "axbanihirwe@ualr.edu" 17 | 18 | RUN conda config --set always_yes yes && \ 19 | conda config --add channels conda-forge && \ 20 | conda install \ 21 | jupyterlab pytest 22 | 23 | RUN pip install bash_kernel && python -m bash_kernel.install 24 | -------------------------------------------------------------------------------- /conda_builder_linux/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM centos/devtoolset-7-toolchain-centos7 2 | MAINTAINER Anderson Banihirwe 3 | 4 | USER root 5 | 6 | WORKDIR /build_scripts 7 | 8 | COPY build/yum_install_syslibs.sh \ 9 | build/install_miniconda.sh \ 10 | build/yum_cleanup.sh \ 11 | /build_scripts/ 12 | 13 | 14 | RUN bash yum_install_syslibs.sh && \ 15 | bash install_miniconda.sh && \ 16 | bash yum_cleanup.sh && \ 17 | rm -rf /build_scripts && \ 18 | mkdir -p /opt/share && \ 19 | mkdir -p /opt/miniconda/conda-bld/work/linux-64 && \ 20 | mkdir -p /opt/miniconda/conda-bld/work/linux-32 && \ 21 | mkdir -p /opt/miniconda/conda-bld/work/noarch && \ 22 | chmod -R 777 /opt && \ 23 | useradd -m --uid 1000 -G wheel dev && \ 24 | echo '%wheel ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers && \ 25 | echo 'Defaults:%wheel !requiretty' >> /etc/sudoers 26 | 27 | ADD build/internal_startup.sh /opt/share/internal_startup.sh 28 | ADD build/alias_32bit.sh /opt/share/alias_32bit.sh 29 | 30 | WORKDIR /home/dev 31 | 32 | USER dev -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Anderson Banihirwe 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /identidock/app/identidock.py: -------------------------------------------------------------------------------- 1 | from flask import Flask, Response, request 2 | import requests 3 | import hashlib 4 | import redis 5 | 6 | app = Flask(__name__) 7 | cache = redis.StrictRedis(host='redis', port=6379, db=0) 8 | salt = "UNIQUE_SALT" 9 | default_name = "Joe Bloggs" 10 | 11 | 12 | @app.route('/', methods=['GET', 'POST']) 13 | def mainpage(): 14 | 15 | name = default_name 16 | if request.method == 'POST': 17 | name = request.form['name'] 18 | 19 | salted_name = salt + name 20 | name_hash = hashlib.sha256(salted_name.encode()).hexdigest() 21 | header = 'Identidock' 22 | body = '''
23 | Hello 24 | 25 |
26 |

You look like a: 27 | 28 | '''.format(name, name_hash) 29 | footer = '' 30 | 31 | return header + body + footer 32 | 33 | 34 | @app.route('/monster/') 35 | def get_identicon(name): 36 | 37 | image = cache.get(name) 38 | if image is None: 39 | print ("Cache miss", flush=True) 40 | r = requests.get('http://dnmonster:8080/monster/' + name + '?size=80') 41 | image = r.content 42 | cache.set(name, image) 43 | 44 | return Response(image, mimetype='image/png') 45 | 46 | if __name__ == '__main__': 47 | app.run(debug=True, host='0.0.0.0') -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | develop-eggs/ 12 | dist/ 13 | downloads/ 14 | eggs/ 15 | .eggs/ 16 | lib/ 17 | lib64/ 18 | parts/ 19 | sdist/ 20 | var/ 21 | wheels/ 22 | *.egg-info/ 23 | .installed.cfg 24 | *.egg 25 | MANIFEST 26 | 27 | # PyInstaller 28 | # Usually these files are written by a python script from a template 29 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 30 | *.manifest 31 | *.spec 32 | 33 | # Installer logs 34 | pip-log.txt 35 | pip-delete-this-directory.txt 36 | 37 | # Unit test / coverage reports 38 | htmlcov/ 39 | .tox/ 40 | .coverage 41 | .coverage.* 42 | .cache 43 | nosetests.xml 44 | coverage.xml 45 | *.cover 46 | .hypothesis/ 47 | .pytest_cache/ 48 | 49 | # Translations 50 | *.mo 51 | *.pot 52 | 53 | # Django stuff: 54 | *.log 55 | local_settings.py 56 | db.sqlite3 57 | 58 | # Flask stuff: 59 | instance/ 60 | .webassets-cache 61 | 62 | # Scrapy stuff: 63 | .scrapy 64 | 65 | # Sphinx documentation 66 | docs/_build/ 67 | 68 | # PyBuilder 69 | target/ 70 | 71 | # Jupyter Notebook 72 | .ipynb_checkpoints 73 | 74 | # pyenv 75 | .python-version 76 | 77 | # celery beat schedule file 78 | celerybeat-schedule 79 | 80 | # SageMath parsed files 81 | *.sage.py 82 | 83 | # Environments 84 | .env 85 | .venv 86 | env/ 87 | venv/ 88 | ENV/ 89 | env.bak/ 90 | venv.bak/ 91 | 92 | # Spyder project settings 93 | .spyderproject 94 | .spyproject 95 | 96 | # Rope project settings 97 | .ropeproject 98 | 99 | # mkdocs documentation 100 | /site 101 | 102 | # mypy 103 | .mypy_cache/ 104 | -------------------------------------------------------------------------------- /gdf-sandbox/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM continuumio/miniconda3:latest 2 | 3 | ENV HOME /root 4 | WORKDIR /root 5 | 6 | RUN apt-get -y update && \ 7 | apt-get install -y --fix-missing gcc g++ kmod && \ 8 | apt-get clean -y 9 | 10 | # Install cudatoolkit 11 | RUN curl -L -O https://developer.nvidia.com/compute/cuda/9.2/Prod2/local_installers/cuda_9.2.148_396.37_linux && \ 12 | sh cuda_9.2.148_396.37_linux --silent --toolkit && \ 13 | rm cuda_9.2.148_396.37_linux && \ 14 | cat /tmp/cuda_install*.log 15 | 16 | RUN conda config --set always_yes yes && \ 17 | conda config --add channels conda-forge && \ 18 | conda update --all && \ 19 | conda install \ 20 | make cmake \ 21 | git bzip2 curl pandas \ 22 | flatbuffers cffi mkl numpy openssl pip py pycparser pytest python \ 23 | readline setuptools sqlite tk wheel xz zlib llvmlite numba arrow-cpp \ 24 | xonsh xo && \ 25 | conda clean --all && \ 26 | conda info 27 | 28 | ENTRYPOINT /opt/conda/bin/xonsh 29 | RUN git config --global user.name "andersy005" && \ 30 | git config --global user.email "axbanihirwe@gmail.com" 31 | 32 | # Install libgdf 33 | RUN git clone https://github.com/andersy005/libgdf.git && \ 34 | cd libgdf && \ 35 | git remote add up https://github.com/gpuopenanalytics/libgdf.git && \ 36 | git submodule update --init --recursive 37 | RUN mkdir -p libgdf/build && \ 38 | cd libgdf/build && \ 39 | cmake .. && \ 40 | make && \ 41 | make install && \ 42 | cd .. 43 | 44 | # Install pygdf 45 | RUN git clone https://github.com/andersy005/pygdf.git && \ 46 | cd pygdf && \ 47 | git remote add up https://github.com/gpuopenanalytics/pygdf.git && \ 48 | git submodule update --init --recursive 49 | RUN cd pygdf \ 50 | python setup.py install && \ 51 | cd .. -------------------------------------------------------------------------------- /conda_builder_linux/docker_wrapper.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # this script accepts arbitrary arguments. It tries to split the ```docker run``` commands from those that should be 4 | # passed into the container itself. This allows people to simply use our run script for base functionality without 5 | # knowing about the docker run options, while also allowing them to add volumes or environment variables if they do 6 | # know how to tweak docker run 7 | 8 | # parse options and pick off docker-run options 9 | DOCKER_ARGS=() 10 | IMAGE="continuumio/conda_builder_linux:latest" 11 | while [[ $# > 0 ]] 12 | do 13 | key="$1" 14 | 15 | case $key in 16 | -I|--image) 17 | IMAGE="$2" 18 | shift # past argument 19 | ;; 20 | -d) 21 | # start in detached mode 22 | DETACHED=1 23 | ;; 24 | --) 25 | # End of docker options. 26 | # Anything beyond this point is part of the docker command. 27 | shift 28 | break 29 | ;; 30 | *) 31 | # pass through unknown options 32 | DOCKER_ARGS+=("$1") 33 | ;; 34 | esac 35 | shift # past argument or value 36 | done 37 | # build up the docker run command string with each of the options 38 | docker_run_string="run " 39 | 40 | if [[ ! -z "${DETACHED}" ]]; then 41 | docker_run_string+="-d " 42 | else 43 | docker_run_string+="-it " 44 | fi 45 | 46 | # try to map gitconfig and ssh private key for convenience 47 | user=$(id -u -n) 48 | home=$(eval echo "~${user}") 49 | 50 | docker_run_string+="-e USER=${user} " 51 | 52 | if [ -e $home/.ssh/id_rsa ]; then 53 | docker_run_string+="-v $home/.ssh/id_rsa:/id_rsa:ro " 54 | fi 55 | 56 | if [ -e $home/.gitconfig ]; then 57 | docker_run_string+="-v $home/.gitconfig:/home/dev/.gitconfig:ro " 58 | fi 59 | 60 | docker_run_string+="${DOCKER_ARGS[@]} " 61 | # these two need to come last: the image, and the command to run. 62 | docker_run_string+="$IMAGE " 63 | docker_run_string+="bash /opt/share/internal_startup.sh $@" 64 | 65 | docker ${docker_run_string} -------------------------------------------------------------------------------- /conda_builder_linux/build/internal_startup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ -z "${ABI}" ]]; then 4 | ABI_WARNING="WARNING: No ABI default set. Falling back to compatibility mode with GCC 4." 5 | export ABI=4 6 | fi 7 | 8 | # Setup home environment 9 | 10 | export PATH=/usr/local/bin:/opt/miniconda/bin:$PATH 11 | export LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib:/opt/miniconda/lib:$LD_LIBRARY_PATH 12 | export LIBRARY_PATH=/usr/local/lib64:/usr/local/lib:/opt/miniconda/lib:$LIBRARY_PATH 13 | export INCLUDE=/opt/miniconda/include:$INCLUDE 14 | export CXXFLAGS="${CXXFLAGS} -Wabi=2" 15 | 16 | if [ $ABI -lt 5 ]; then 17 | export CXXFLAGS="${CXXFLAGS} -D_GLIBCXX_USE_CXX11_ABI=0" 18 | else 19 | export CXXFLAGS="${CXXFLAGS} -D_GLIBCXX_USE_CXX11_ABI=1" 20 | fi 21 | 22 | echo "alias clone_recipes='git clone https://github.com/conda/conda-recipes'" >> ~/.bashrc 23 | 24 | if [[ "$ARCH" -eq "64" || -z "$ARCH" ]]; then 25 | ARCH_DOC=$'To build 32-bit code, set the ARCH environment 26 | variable to 32. (-e \"ARCH=32\" docker argument)' 27 | else 28 | ARCH_DOC=$'Pretending to be i686 (using multilib gcc) and 29 | filtering uname to output i686.' 30 | export CFLAGS="${CFLAGS} -m32" 31 | export CXXFLAGS="${CXXFLAGS} -m32" 32 | export CONDA_FORCE_32BIT=1 33 | # this will get picked up by subshells 34 | sudo mv /bin/uname /bin/uname_x64 35 | sudo ln -s /opt/share/alias_32bit.sh /bin/uname 36 | sudo chmod +x /bin/uname 37 | fi 38 | 39 | # jumping through hoops for file ownership - we can't have the owner be 40 | # the native linux owner, and we also can't have permissions too wide open, 41 | # or ssh complains. 42 | if [ -f /id_rsa ]; then 43 | mkdir -p .ssh 44 | sudo cp /id_rsa .ssh/ 45 | chmod 700 .ssh 46 | sudo chown default: .ssh/id_rsa 47 | sudo chmod 600 .ssh/id_rsa 48 | echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> $HOME/.ssh/config 49 | echo -e "Host bremen\n\tStrictHostKeyChecking no\n" >> $HOME/.ssh/config 50 | fi 51 | 52 | if [[ $# < 1 ]]; then 53 | # save stdout as file descriptor 3, and redirect stdout to stderr 54 | exec 3>&1 55 | exec 1>&2 56 | 57 | # interactive session 58 | echo "$ABI_WARNING" 59 | echo 60 | echo "Welcome to the conda-builder image, brought to you by Continuum Analytics." 61 | echo 62 | echo "Binaries produced with this image should be compatible with any Linux OS" 63 | echo "that is at least CentOS 7 or newer (Glibc lower bound), and anything " 64 | echo "that uses G++ 5.2 or older (libstdc++ upper bound)" 65 | echo 66 | echo " GCC is: $(gcc --version | head -1)" 67 | echo " Default C++ ABI: ${ABI} (C++$([ "${ABI}" == "4" ] && echo "98" || echo "11"))" 68 | echo " GLIBC is: $(getconf GNU_LIBC_VERSION)" 69 | echo " ld/binutils is: $(ld --version | head -1)" 70 | echo 71 | echo " Native arch is x86_64. ${ARCH_DOC}" 72 | echo 73 | echo " The dev user (currently signed in) has passwordless sudo access." 74 | echo " miniconda (3.6) is installed at /opt/miniconda_pkg." 75 | echo " git is also available." 76 | 77 | if [ -f "$HOME/.gitconfig" ]; then 78 | echo " Your .gitconfig has been imported." 79 | fi 80 | 81 | if [ -f /id_rsa ]; then 82 | echo " Your ssh private key has been imported for passwordless ssh." 83 | fi 84 | 85 | echo 86 | 87 | echo "Helpful aliases:" 88 | echo " clone_recipes: clones the conda/conda-recipes repo from Github" 89 | 90 | echo 91 | 92 | # restore stdout 93 | exec 1>&3 94 | 95 | exec bash 96 | else 97 | # Run whatever the user wants to pass in 98 | exec "$@" 99 | fi --------------------------------------------------------------------------------