-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from GuillaumeDerval/backend_v4
Let me introduce you the new backend.
- Loading branch information
Showing
489 changed files
with
4,777 additions
and
3,716 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,4 @@ dump | |
doc/_* | ||
tasks | ||
!tests/tasks | ||
!*/tests/tasks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# the code for this .Travis.yml has been mostly taken from https://github.com/haiwen/seafile-docker/blob/master/.travis.yml | ||
language: python | ||
python: | ||
- "2.7" | ||
env: | ||
global: | ||
- "HOST_IP=$(/sbin/ifconfig venet0:0 | grep 'inet addr' | awk -F: '{print $2}' | awk '{print $1}')" | ||
- DOCKER_HOST=tcp://$HOST_IP:2375 | ||
- SLIRP_PORTS=$(seq 2375 2500) | ||
- TEST_DOCKER_JOB_MANAGER=travis | ||
before_install: | ||
- echo exit 101 | sudo tee /usr/sbin/policy-rc.d | ||
- sudo chmod +x /usr/sbin/policy-rc.d | ||
install: | ||
- curl -sSL https://get.docker.com/ | sh | ||
- sudo apt-get install slirp | ||
- sudo usermod -aG docker "$USER" | ||
- git clone git://github.com/cptactionhank/sekexe | ||
- "pip install pymongo pytidylib docker-py sh web.py docutils simpleldap pyyaml rpyc cgroup-utils" | ||
before_script: | ||
- "sekexe/run 'mount -t tmpfs -o size=8g tmpfs /var/lib/docker && docker -d -H tcp://0.0.0.0:2375' &" | ||
- "while ! docker info &> /dev/null ; do echo 'retrying to connect to docker...'; sleep 1; done" | ||
script: nosetests . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Copyright (c) 2014-2015 Université Catholique de Louvain. | ||
# | ||
# This file is part of INGInious. | ||
# | ||
# INGInious is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Affero General Public License as published | ||
# by the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# INGInious is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Affero General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Affero General Public | ||
# License along with INGInious. If not, see <http://www.gnu.org/licenses/>. | ||
""" Starts an agent """ | ||
|
||
import logging | ||
import os | ||
from backend_agent.agent import RemoteAgent | ||
import common.base | ||
import argparse | ||
|
||
if __name__ == "__main__": | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument("port", help="Port to listen to", type=int) | ||
parser.add_argument("--dir", help="Path to a directory where the agent can store information, such as caches. Defaults to ./agent_data", | ||
default="./agent_data") | ||
parser.add_argument("--tasks", help="Path to the task directory. By default, it is hidden by the agent and automatically synchronized with the " | ||
"backend; if you define this argument, automatic sync will be disabled.") | ||
args = parser.parse_args() | ||
|
||
if not os.path.exists(args.dir): | ||
os.makedirs(args.dir) | ||
if not os.path.exists(os.path.join(args.dir, 'tmp')): | ||
os.makedirs(os.path.join(args.dir, 'tmp')) | ||
if args.tasks is None: | ||
taskdir = os.path.join(args.dir, 'tasks') | ||
sync_enabled = True | ||
else: | ||
taskdir = args.tasks | ||
sync_enabled = False | ||
|
||
if not os.path.exists(taskdir): | ||
os.makedirs(taskdir) | ||
|
||
common.base.init_common_lib(taskdir, [], 1) # we do not need to upload file, so not needed here | ||
|
||
# create logger | ||
logger = logging.getLogger("agent") | ||
logger.setLevel(logging.INFO) | ||
ch = logging.StreamHandler() | ||
ch.setLevel(logging.INFO) | ||
formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s") | ||
ch.setFormatter(formatter) | ||
logger.addHandler(ch) | ||
|
||
RemoteAgent(args.port, os.path.join(args.dir, 'tmp'), sync_enabled) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.