Skip to content

Commit

Permalink
Merge pull request #69 from autolab/dist_docker
Browse files Browse the repository at this point in the history
Distributed docker
  • Loading branch information
mihirpandya committed Aug 2, 2015
2 parents 5ec90a2 + eb18878 commit 5651be9
Show file tree
Hide file tree
Showing 11 changed files with 443 additions and 24 deletions.
2 changes: 2 additions & 0 deletions hosts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
54.186.238.205
54.68.89.235
8 changes: 4 additions & 4 deletions jobManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,11 @@
# is launched that will handle things from here on. If anything goes
# wrong, the job is made dead with the error.
#
import time
import threading
import logging
import time, threading, logging

from datetime import datetime
from config import Config
from worker import Worker

from jobQueue import JobQueue
from preallocator import Preallocator

Expand Down Expand Up @@ -92,6 +89,9 @@ def __manage(self):
elif Config.VMMS_NAME == "localDocker":
from vmms.localDocker import LocalDocker
vmms = LocalDocker()
elif Config.VMMS_NAME == "distDocker":
from vmms.distDocker import DistDocker
vmms = DistDocker()

vmms = {Config.VMMS_NAME: vmms}
preallocator = Preallocator(vmms)
Expand Down
4 changes: 1 addition & 3 deletions jobQueue.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
# JobManager: Class that creates a thread object that looks for new
# work on the job queue and assigns it to workers.
#
import time
import threading
import logging
import time, threading, logging

from datetime import datetime
from config import Config
Expand Down
3 changes: 3 additions & 0 deletions restful-tango/tangoREST.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ def __init__(self):
elif Config.VMMS_NAME == "localDocker":
from vmms.localDocker import LocalDocker
vmms = LocalDocker()
elif Config.VMMS_NAME == "distDocker":
from vmms.distDocker import DistDocker
vmms = DistDocker()


self.vmms = {Config.VMMS_NAME: vmms}
Expand Down
16 changes: 1 addition & 15 deletions vmms/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ RUN apt-get update
RUN apt-get install -y gcc
RUN apt-get install -y make
RUN apt-get install -y build-essential
RUN apt-get install -y wget

# Install autodriver
WORKDIR /home
Expand All @@ -24,25 +23,12 @@ RUN make clean && make
RUN cp autodriver /usr/bin/autodriver
RUN chmod +s /usr/bin/autodriver

# Install C0
WORKDIR /home
RUN wget http://c0.typesafety.net/dist/cc0-v0440-linux3.18.1-64bit-bin.tgz
RUN tar -xvzf cc0-*
WORKDIR /home/cc0
RUN bin/cc0 -d doc/src/exp.c0 doc/src/exp-test.c0
RUN ./a.out
RUN cp bin/cc0 /usr/bin/cc0

# Clean up
WORKDIR /home
RUN apt-get remove -y git
RUN apt-get remove -y wget
RUN apt-get -y autoremove
RUN rm -rf Tango/
RUN rm -f cc0-*
RUN rm -rf cc0/

# Check installation
RUN ls -l /home
RUN which autodriver
RUN which cc0
RUN which autodriver
49 changes: 49 additions & 0 deletions vmms/Dockerfile_122
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Autolab - autograding docker image

FROM ubuntu:14.04
MAINTAINER Mihir Pandya <mihir.m.pandya@gmail.com>

# Install necessary packages
RUN apt-get update
RUN apt-get install -y gcc
RUN apt-get install -y make
RUN apt-get install -y build-essential
RUN apt-get install -y wget
RUN apt-get install -y git

# Install autodriver
WORKDIR /home
RUN useradd autolab
RUN useradd autograde
RUN mkdir autolab autograde output
RUN chown autolab:autolab autolab
RUN chown autolab:autolab output
RUN chown autograde:autograde autograde
RUN git clone https://github.com/autolab/Tango.git
WORKDIR Tango/autodriver
RUN make clean && make
RUN cp autodriver /usr/bin/autodriver
RUN chmod +s /usr/bin/autodriver

# Install C0
WORKDIR /home
RUN wget http://c0.typesafety.net/dist/cc0-v0440-linux3.18.1-64bit-bin.tgz
RUN tar -xvzf cc0-*
WORKDIR /home/cc0
RUN bin/cc0 -d doc/src/exp.c0 doc/src/exp-test.c0
RUN ./a.out
RUN cp bin/cc0 /usr/bin/cc0

# Clean up
WORKDIR /home
RUN apt-get remove -y git
RUN apt-get remove -y wget
RUN apt-get -y autoremove
RUN rm -rf Tango/
RUN rm -f cc0-*
RUN rm -rf cc0/

# Check installation
RUN ls -l /home
RUN which autodriver
RUN which cc0
34 changes: 34 additions & 0 deletions vmms/Dockerfile_ubuntu
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Autolab - autograding docker image

FROM ubuntu:14.04
MAINTAINER Mihir Pandya <mihir.m.pandya@gmail.com>

RUN apt-get update
RUN apt-get install -y gcc
RUN apt-get install -y make
RUN apt-get install -y build-essential

# Install autodriver
WORKDIR /home
RUN useradd autolab
RUN useradd autograde
RUN mkdir autolab autograde output
RUN chown autolab:autolab autolab
RUN chown autolab:autolab output
RUN chown autograde:autograde autograde
RUN apt-get install -y git
RUN git clone https://github.com/autolab/Tango.git
WORKDIR Tango/autodriver
RUN make clean && make
RUN cp autodriver /usr/bin/autodriver
RUN chmod +s /usr/bin/autodriver

# Clean up
WORKDIR /home
RUN apt-get remove -y git
RUN apt-get -y autoremove
RUN rm -rf Tango/

# Check installation
RUN ls -l /home
RUN which autodriver
Loading

0 comments on commit 5651be9

Please sign in to comment.