This is the code of the Executor component of the project Progressor - The Programming Professor.
These instructions are written for Ubuntu 16.04 LTS.
The goal is to install the Executor in /opt/Executor/
and run it as a Docker container.
- Install Docker by executing
curl -sSL https://get.docker.com/ | sh
- Install OpenJDK and Supervisor by executing
sudo apt-get install -y openjdk-8-jre-headless supervisor
- You may use any other Java Runtime Environment instead.
- Configure Supervisor to start the Executor automatically:
-
Set up Supervisor web admin interface with the username/password of your choice:
sudo nano /etc/supervisor/supervisord.conf
[inet_http_server] port = 9001 username = your-supervisor-username password = your-supervisor-password
-
With
sudo nano /etc/supervisor/conf.d/progressor-executor.conf
, create a supervisor service configuration, with the following content:[program:executor] command=java -jar /opt/Executor/ProgressorExecutor.jar autostart=true autorestart=true environment=KOTLIN_HOME="/kotlinc"
- If you need to override the default settings, please refer to the detailed configuration information.
-
Make Supervisor start when the server boots:
sudo systemctl enable supervisor
-
Start the service by executing
sudo service supervisor start
-
Reload Supervisor configuration by running
sudo supervisorctl reread
-
and
sudo supervisorctl update
-
- If you built the Executor JAR from this repo, rename it to
ProgressorExecutor.jar
and upload it to your server in/opt/Executor/
, otherwise download the pre-compiled one:cd /opt/Executor/
wget https://github.com/Progressor/ProgressorMeteor/raw/master/bin/ProgressorExecutor.jar
- If you modified the Dockerfile, upload it to your server in
/opt/Executor/
, otherwise download the pre-compiled one:cd /opt/Executor
wget https://raw.githubusercontent.com/Progressor/ProgressorExecutor/master/src/main/docker/Dockerfile
- On the server, still in
/opt/Executor
, build the Docker image used by the Executor by runningdocker build -t progressor/executor .
The Executor will use this image to create one container per request. After the request has been processed, the container is stopped and immediately deleted.
That way we make sure the different requests never interfere with each other.
This repository contains a Maven project created using IntelliJ IDEA.
Maven can easily be downloaded and installed on any platform. But it is also included in many IDEs like IntelliJ IDEA, NetBeans and others.
The dependencies are outlined in a separate document.
You can build the project by executing mvn clean package -Dmaven.test.skip=true
which will create the executable target/ProgressorExecutor-1.0-jar-with-dependencies.jar
.
This statement will do the following:
- It will clean the workspace and remove any files left over from previous builds.
- It will generate Java-specific Apache Thrift code based on the language-independent interface definition in
src/main/thrift/executor.thrift
. - It will skip the tests as you may not have properly set up your development machine to test all supported programming languages.
- It will build the application.
- It will generate two JAR files: one slim version (without the dependencies included) and one with all the dependencies included which you can then copy and use wherever you like.
The Executor is a Java application that receives requests from the Progressor web application using Apache Thrift.
The actual application logic is completely separated from the Apache Thrift layer and has its own public API that can be used to extend the Executor.
Additionally, the project contains two abstract classes that can be reused to easily implement a new programming language.