Exemplo n.º 1
0
def project(request, projectid):
    """Get or updates a new Carme project."""
    assert isinstance(request, HttpRequest)
    """If it was a post then set the configuration"""
    if request.method == "POST":
        carmewrapper.setStatus(projectid, "Task", "Config")
        app.tasks.configAll(projectid, request.POST)

    return JsonResponse(carmewrapper.getProjectDetails(projectid))
Exemplo n.º 2
0
def projects(request):
    """Makes a new Carme project."""
    assert isinstance(request, HttpRequest)
    """If it was a post then set the configuration"""
    if request.method == "POST":
        projectid = str(uuid.uuid4())
        app.tasks.new(projectid)
        carmewrapper.setStatus(projectid, "Task", "Config")
        app.tasks.configAll(projectid, request.POST)
        return JsonResponse({'projectid': projectid})
    else:
        return JsonResponse({})
Exemplo n.º 3
0
def form(request):
    """Renders the Carme form setup page."""
    assert isinstance(request, HttpRequest)
    
    """If it was a post then set the make the project and go to the page"""
    if request.method == "POST":
        projectid = str(uuid.uuid4())
        app.tasks.new(projectid)
        carmewrapper.setStatus(projectid, "Task", "Config")
        app.tasks.configAll(projectid, request.POST)
        return redirect("project", projectid)
    else:
        return render(
            request,
            'app/form.html',
            {
                'title':'New Form',
                'year':datetime.now().year,
            }
        )
Exemplo n.º 4
0
def new(projectid):
    carmewrapper.new(projectid)
    carmewrapper.setStatus(projectid, "State", "New")
    carmewrapper.setStatus(projectid, "IP", "NONE")
Exemplo n.º 5
0
def delete(projectid):
    carmewrapper.setStatus(projectid, "State", "Deleted")
    carmewrapper.cleanUp(projectid)
Exemplo n.º 6
0
def setup(projectid):
    carmewrapper.setStatus(projectid, "Cluster", "Creating")
    result = carmewrapper.createCluster(projectid)
    carmewrapper.setStatus(projectid, "Cluster", "Created")
    carmewrapper.setStatus(projectid, "Jupyter", "Installing")
    result += carmewrapper.installJupyter(projectid)
    carmewrapper.setStatus(projectid, "Jupyter", "Installed")
    carmewrapper.setStatus(projectid, "Task", "Idle")
    carmewrapper.setStatus(projectid, "State", "Started")
Exemplo n.º 7
0
def config(projectid, config, filename):
    carmewrapper.config(projectid, config, filename)
    carmewrapper.setStatus(projectid, "State", "Configured")
    carmewrapper.setStatus(projectid, "Task", "Idle")
Exemplo n.º 8
0
def configAll(projectid, config):
    carmewrapper.configAll(projectid, config)
    carmewrapper.setStatus(projectid, "State", "Configured")
    carmewrapper.setStatus(projectid, "Task", "Idle")
Exemplo n.º 9
0
def setup(request, projectid):
    carmewrapper.setStatus(projectid, "Task", "Setup")
    app.tasks.setup.delay(projectid)
    return JsonResponse(carmewrapper.getProjectDetails(projectid))