Giter Site home page Giter Site logo

tim-jyu / stack Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 52.09 MB

Fork of maths/moodle-qtype_stack system with support for Dockerized API server

License: GNU General Public License v3.0

JavaScript 24.16% PHP 74.07% HTML 0.15% TeX 0.31% Common Lisp 0.56% NewLisp 0.02% PEG.js 0.37% CSS 0.23% Gherkin 0.14%

stack's Introduction

STACK 4.3.7

This is a fork of maths/moodle-qtype_stack system with support for Dockerized API server.

STACK is an assessment system for mathematics, science and related disciplines. STACK is a question type for the Moodle learning management system, and also the ILIAS learning management system.

STACK was created by Chris Sangwin of the University of Edinburgh, and includes the work of many other contributors. A demonstration server is available at the University of Edinburgh: https://stack.maths.ed.ac.uk/.

STACK is based on continuing research and use at the University of Edinburgh, the Open University, Aalto, Loughborough University, the University of Birmingham and others.

Docker usage

This is a fork tailored to run Stack API server as a Docker container in TIM stack.

Please note the following when trying to use or setup your own container

Building images

To build an image, you can use normal docker build. You can also use the included buildimage.sh script as follows:

$ ./buildimage.sh prod

This will build the production image and tag it as stack-api:build. You can also use dev target to build development image. Check out the differences between the two targets in the next section.

Build targets

Currently Dockerfile contains two targets:

  • prod: Sets up PHP 7.4, gnuplot and stack server. Runs entrypoint_install_and_run.sh as its entrypoint.
  • dev: Same as prod but in addition starts sshd. Runs entrypoint_install_and_run.sh as its entrypoint (see docker-compose section below for more info).

Configuration and Maxima

Use api/config.php.docker file to edit Stack API config. It currently contains options relevant to TIM.

Currently the fork is pre-configured to run MaximaPool API using goemaxima server. As such, there is no local Maxima installation that you can access within the container.

Usage examples with docker-compose

These examples assume you built the images yourself with buildimage.sh script.
You can also use automatically built images from timimages/stack-api repository instead of building them yourself.

Run production API server and Maxima

version: "3.7"
services:
  maxima:
    image: timimages/goemaxima:2020113000-latest
  stack:
    image: stack-api:build
    depends_on:
      - maxima
    ports:
      - "49992:80"
    volumes:
      - ./plots:/var/data/api/stack/plots:rw
      - ./plots:/var/www/html/plots:rw
      - ./api/config.php.docker:/var/www/html/config.php:rw
      - ./entrypoint_install_and_run.sh:/var/www/html/entrypoint_install_and_run.sh

This will

  • Start MaximaPool server (accessible via http://maxima:8080/maxima/ endpoint)
  • Build and start Stack API server in production mode on port 80 and makes it accessible via localhost:49992

Debugging

To debug stack, you can use the included Docker Compose file that sets up a local development environment.

  1. Run docker-compose -f docker-compose.debug.yml up.

    This will build the latest image of stack API server and set up the following ports:

    • 48882 for stack API
    • 2222 for SSH (username root, password test)

    This wil also start the server in attached mode. Add -d flag to docker-compose to run in detached mode instead if you need to.

  2. Once the server starts, test that it works by going to localhost:48882/api/endpoint.html

  3. Set up xdebug remote debugging using IDE of your choice.

    The image uses port 3009 for xdebug and has automatic breaking enabled for each request. Edit entrypoint_install_and_run_debug.sh to edit breakpoint behaviour if needed.

Syncing changes with upstream

From time to time, this fork needs to be synced with upstream.
At this moment api4.3 is the fork on upstream that contains up-to-date API.

To pull changes from upstream to this fork, you can merge changes from upstream:

git pull https://github.com/maths/moodle-qtype_stack api4.3

This may require resolving merge conflicts.

Documentation

The documentation is here, including the installation instructions.

License

STACK is Licensed under the GNU General Public, License Version 3.

stack's People

Contributors

sangwinc avatar timhunt avatar aharjula avatar malthesporring avatar germanvaleroelizondo avatar dezhidki avatar alcarola avatar iandavidwild avatar ksimuk avatar vesal avatar georgekinnear avatar mloginov avatar christianp avatar birdanja avatar gustavdelius avatar vhuerta-droid avatar gitnovisat5 avatar whanrott avatar sgparry avatar inthewaves avatar jonathanwatkins avatar malthefogsporring avatar smibu avatar potslinux avatar smborio avatar mjosupei avatar dhilsen avatar t-schroeder avatar kabalin avatar perhov avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.