Skip to content

Commit

Permalink
Joined apt-get update with install in dockers.
Browse files Browse the repository at this point in the history
  • Loading branch information
mihahauke committed May 31, 2017
1 parent fb7d289 commit dae2a8f
Show file tree
Hide file tree
Showing 8 changed files with 187 additions and 12 deletions.
Binary file modified RandomTeam_track1n2.zip
Binary file not shown.
102 changes: 102 additions & 0 deletions RandomTeam_track1n2/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
FROM ubuntu:16.04

# Cuda 7.5 with cudnn 5
#FROM nvidia/cuda:7.5-cudnn5-devel
# Cuda 8 with cudnn 5
FROM nvidia/cuda:8.0-cudnn5-devel

# ViZdoom dependencies
RUN apt-get update && apt-get install -y \
build-essential \
bzip2 \
cmake \
curl \
git \
libboost-all-dev \
libbz2-dev \
libfluidsynth-dev \
libfreetype6-dev \
libgme-dev \
libgtk2.0-dev \
libjpeg-dev \
libopenal-dev \
libpng12-dev \
libsdl2-dev \
libwildmidi-dev \
libzmq3-dev \
nano \
nasm \
pkg-config \
rsync \
software-properties-common \
sudo \
tar \
timidity \
unzip \
wget \
zlib1g-dev \
python3-dev \
python3 \
python3-pip



# Python with pip
#RUN apt-get install -y python-dev python python-pip
#RUN pip install pip --upgrade

# Python3 with pip3
RUN pip3 install pip --upgrade



# Vizdoom and other pip packages if needed
#RUN pip --no-cache-dir install \
# git+https://github.com/mwydmuch/ViZDoom \
# numpy \
#RUN pip --no-cache-dir install \
# https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.10.0-cp27-none-linux_x86_64.whl


# Vizdoom and other pip3 packages if needed
RUN pip3 --no-cache-dir install \
git+https://github.com/mwydmuch/ViZDoom \
opencv-python

RUN pip3 --no-cache-dir install \
https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.0.1-cp35-cp35m-linux_x86_64.whl


# Enables X11 sharing and creates user home directory
ENV USER_NAME cig2017
ENV HOME_DIR /home/$USER_NAME

# Replace HOST_UID/HOST_GUID with your user / group id (needed for X11)
ENV HOST_UID 1000
ENV HOST_GID 1000

RUN export uid=${HOST_UID} gid=${HOST_GID} && \
mkdir -p ${HOME_DIR} && \
echo "$USER_NAME:x:${uid}:${gid}:$USER_NAME,,,:$HOME_DIR:/bin/bash" >> /etc/passwd && \
echo "$USER_NAME:x:${uid}:" >> /etc/group && \
echo "$USER_NAME ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/$USER_NAME && \
chmod 0440 /etc/sudoers.d/$USER_NAME && \
chown ${uid}:${gid} -R ${HOME_DIR}

USER ${USER_NAME}
WORKDIR ${HOME_DIR}


# Copy agent files inside Docker image:
COPY config config
COPY sample_random_agent.py .


### Do not change this ###
COPY cig2017.wad .
COPY _vizdoom.cfg .
##########################
# Uncomment to use doom2.wad:
#COPY doom2.wad /usr/local/lib/python3.5/dist-packages/vizdoom

CMD ./sample_random_agent.py
Binary file added RandomTeam_track1n2/about.pdf
Binary file not shown.
31 changes: 31 additions & 0 deletions RandomTeam_track1n2/config/custom_config.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Change if needed
screen_resolution = RES_640X480
screen_format = CRCGCB
render_hud = true
render_crosshair = true
render_weapon = true
render_decals = false
render_particles = false

# Add more if needed
available_buttons =
{
TURN_LEFT
TURN_RIGHT
ATTACK

MOVE_RIGHT
MOVE_LEFT

MOVE_FORWARD
MOVE_BACKWARD
TURN_LEFT_RIGHT_DELTA
LOOK_UP_DOWN_DELTA
}


# Add more if needed
available_game_variables =
{
HEALTH
}
40 changes: 40 additions & 0 deletions RandomTeam_track1n2/sample_random_agent.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/env python3

import vizdoom as vzd
from random import choice

game = vzd.DoomGame()
game.load_config("config/custom_config.cfg")

# Name your agent and select color
# colors: 0 - green, 1 - gray, 2 - brown, 3 - red, 4 - light gray, 5 - light brown, 6 - light red, 7 - light blue
name = "SampleRandomAgent"
color = 0
game.add_game_args("+name {} +colorset {}".format(name, color))
game.init()

# Three sample actions: turn left/right and shoot
actions = [[1, 0, 0], [0, 1, 0], [0, 0, 1]]

# Play until the game (episode) is over.
while not game.is_episode_finished():

if game.is_player_dead():
# Use this to respawn immediately after death, new state will be available.
game.respawn_player()

# Or observe the game until automatic respawn.
# game.advance_action();
# continue;

# Analyze the state ... or not
s = game.get_state()

# Make your action.
game.make_action(choice(actions))

# Log your frags every ~5 seconds
if s.number % 175 == 0:
print("Frags:", game.get_game_variable(vzd.GameVariable.FRAGCOUNT))

game.close()
6 changes: 4 additions & 2 deletions host/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ RUN apt-get update && apt-get install -y \
timidity \
unzip \
wget \
zlib1g-dev
zlib1g-dev \
python3-dev \
python3 \
python3-pip

# Python3
RUN apt-get install -y python3-dev python3 python3-pip
RUN pip3 install pip --upgrade

RUN pip3 --no-cache-dir install \
Expand Down
14 changes: 6 additions & 8 deletions no_host/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ FROM ubuntu:16.04
FROM nvidia/cuda:8.0-cudnn5-devel

# ViZdoom dependencies
RUN apt-get update
RUN apt-get install -y \
RUN apt-get update && apt-get install -y \
build-essential \
bzip2 \
cmake \
Expand Down Expand Up @@ -35,18 +34,17 @@ RUN apt-get install -y \
timidity \
unzip \
wget \
zlib1g-dev
zlib1g-dev \
python3-dev \
python3 \
python3-pip



# Python with pip
#RUN apt-get install -y python-dev python python-pip
#RUN apt-get update && apt-get install -y python-dev python python-pip
#RUN pip install pip --upgrade

# Python3 with pip3
RUN apt-get install -y python3-dev python3 python3-pip
RUN pip3 install pip --upgrade



# Vizdoom and other pip packages if needed
Expand Down
6 changes: 4 additions & 2 deletions random/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ RUN apt-get update && apt-get install -y \
timidity \
unzip \
wget \
zlib1g-dev
zlib1g-dev \
python3-dev \
python3 \
python3-pip



Expand All @@ -43,7 +46,6 @@ RUN apt-get update && apt-get install -y \
#RUN pip install pip --upgrade

# Python3 with pip3
RUN apt-get update && apt-get install -y python3-dev python3 python3-pip
RUN pip3 install pip --upgrade


Expand Down

0 comments on commit dae2a8f

Please sign in to comment.