This is the docker based code verifier to verify SingPath problem.
The verifiers are simple docker images for verifier server. Each image verifies user solution for a runtime.
By default a verifier server container (using the default CMD
instruction)
should bind to port 5000 (for any host).
It should parse the JSON object request inside a jsonrequest
querystring
( GET request only) or a formdata parameter (POST request), or in the body
of a POST request.
In the case the Query string the jsonrequest may be url encoded or base64 encoded.
It should support JSONP and CORS AJAX request.
The JSON request must have a solution
attribute and may have a tests
attribute. If the tests are missing the verifier should simply check the
solution loads correctly.
- Python 3: tests python code against doctests.
- Angular JS: test a html document against a protractor scenario.
The webserver is a simple nginx proxy server (in charge as well of the health check).
It's currently ready for testing. See server/README.md
.
Always on. Start and stop a cluster.
Requirements:
- Docker (or boot2docker on OS X and windows);
- gcloud;
- bash and make (you will need to install cygwin on windows).
Note:
On Linux, you might have to run the commands running sudo.
See server's README.md.
scripts/deploy.sh
is a bash script used to setup and start a cluster:
$ ./scripts/deploy.sh help
usage: setup|start|stop|delete
setup Create the an image, an instance template and a load balancer.
start Manually start the cluster (an instance group and an autoscaler).
The cluster should already be setup.
stop Stop the instance group.
delete Delete the cluster (instance group, load balancer and image.)
The cluster shouldn't be running.
To setup a cluster that Singpath can start:
-
Bump the version in
./VERSION
. -
Publish the container images:
cd server make push-deploy-images cd ..
-
Setup the cluster:
./scripts/deploy.sh setup
-
Try the new cluster:
./scripts/deploy.sh start
-
Stop the cluster:
./scripts/deploy.sh stop
An instance template and a network load balancer should now be ready. You just to update Singpath verifier version. The next time Singpath starts the cluster it will use the new version.