- Use gevent
- For now we start threads for each agent/connection/job/...
- This is inneficient, as most of them only wait for one or other socket (either from Docker or from RPyC)
- Using gevent will be faster and pose less stress to the OS, that is already way too stressed by Docker
- This needs some work:
- RPyC and Docker-py do not support gevent from scratch
- https://github.com/smurfix/playground/blob/master/Pinako/geventrpyc/__init__.py provides a gevent-compatible RPyC server
- Docker-py may work from scratch, as it uses only pythonic features, but this needs to be tested
- Websockets? To handle the task page (status update of jobs)
- probably needs gevent
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
from __future__ import print_function | |
import base64 | |
import json | |
import os.path | |
import pprint | |
import sys | |
import time | |
import zlib | |
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
import re | |
from typing import List | |
import abc | |
from inginious.frontend.plugin_manager import PluginManager | |
class SubmissionReader: | |
class __Button: | |
def __init__(self, submission_reader: "SubmissionReader", name: str, prio: int): |
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
import asyncio | |
import random | |
from bleak import discover, BleakClient | |
ADDRESS = None | |
UUID = "622d0101-2416-0fa7-e132-2f1495cc2ce0" # can be found by connecting to the mamaRoo and inspecting the thing it advertises. | |
async def find_mamaroo(): | |
if ADDRESS is not None: |
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
import json | |
import requests | |
from bs4 import BeautifulSoup | |
# Change this | |
OUTPUT_FILE = 'euromomo.json' | |
# Change this if the script breaks | |
BASE_PAGE = "https://www.euromomo.eu/graphs-and-maps/" | |
JS_FILE_PATTERN = "src-templates-graphs-and-maps-js" |
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
# License: MIT | |
import socket | |
from slacker import Slacker | |
import datetime | |
import time | |
import threading | |
SLACK_TOKEN = 'xoxb-00000000000-000000000000-000000000000000000000000' | |
CHANNEL_NAME = "your-channel-on-slack" |
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
import asyncio | |
import logging | |
import time | |
from multiprocessing import Process | |
from zmq.asyncio import ZMQEventLoop, Context | |
from inginious.agent import Agent | |
from inginious.backend.backend import Backend | |
from inginious.client.client import Client | |
from inginious.common.messages import BackendKillJob, BackendNewJob |
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
import java.util.*; | |
/** | |
* A mutable map for Integer keys based on a trie using the binary representation of keys | |
* | |
* @param <V> values to be contained in the structure | |
*/ | |
public class MutableIntMap<V> extends AbstractMap<Integer, V> implements NavigableMap<Integer, V> { | |
protected int treeSize; | |
protected int[] tree; |
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
Host studssh.info.ucl.ac.be studssh | |
User gderval | |
IdentityFile ~/.ssh/id_rsa_ingi | |
Host !studssh.info.ucl.ac.be !studssh *.info.ucl.ac.be baluran bibinoi bulusan calbuco cayambe chacana colachi davidof denison furnas kadovar khangar tibesti trident tsurumi virunga vulcano yunaska permeke tuteur inginious stromboli studmanager | |
ProxyCommand ssh -4 studssh.info.ucl.ac.be -W %h:%p | |
IdentityFile ~/.ssh/id_rsa_ingi | |
Host vega.ulb.ac.be | |
ProxyCommand ssh -4 studssh.info.ucl.ac.be -W %h:%p |
There is a problem with the assumption that the OS will handle the charge of multiples tasks running concurrently(right now, INGInious immediately launches tasks it receives, (nearly) without limits), mainly because of memory usage.
For a strange reason, processes are never/not enough put to swap, leading to OOM in other containers.
NewerOlder