Skip to content

Commit

Permalink
feat: add DSpot-web v2 in Perl (#913)
Browse files Browse the repository at this point in the history
  • Loading branch information
borisbaldassari authored and monperrus committed Jan 28, 2020
1 parent c8988a2 commit d67cd85
Show file tree
Hide file tree
Showing 57 changed files with 6,820 additions and 0 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
23 changes: 23 additions & 0 deletions dspot-web/v2-mojo/README-developers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

# Development

## Directories

Projects being analysed by the DSpot Web UI are cloned and analysed in a dedicated directory, configured in section `work_dir` of the main configuration file of the application: `d_spot_web.conf`.

In this directory each directory is a project, with all required files and information for the project stored inside. A typical architecture looks as follows:

* `work_dir`
- `project_a`
- `src` is the git extract (clone) of the repository.
- `output` is the hierarchy generated during the dspot execution.
- `results.zip` is the compressed file of the results.
- `logs` contains the logs of all major actions:
- `dspot.log` is the log of the dspot execution.
- `git_clone.log` is the log of the `git clone` command.
- `git_pull.log` is the log of the last `git pull` command, if relevant.




qsfd
40 changes: 40 additions & 0 deletions dspot-web/v2-mojo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@

# DSpot Web UI

## About

This directory contains everything needed to run a demonstration web server for DSpot.


## Installation

This application uses the [Mojolicious web framework](https://mojolicious.org/) and relies on a Postgres DB to store the task management system. Results are stored on disk.

You will need to install Perl and Mojolicious, plus a few other plugins. It is good practice to use [perlbrew](https://perlbrew.pl/) to manage one's perl installation, although it is not required. Then requirements can be installed with:

```
$ cpanm Mojolicious
$ cpanm Mojolicious::Plugin::Minion Mojolicious::Plugin::Minion::Admin Mojolicious::Plugin::Mail
$ cpanm Mojo::Pg
$ cpanm Archive::Zip File::Copy::Recursive DateTime
```

### Initialising the application

Setup a PostgreSQL DB for Minion:

```
postgres=# CREATE USER dspot_minion WITH PASSWORD 'pass4minion';
CREATE ROLE
postgres=# CREATE DATABASE dspot_minion OWNER dspot_minion;
CREATE DATABASE
```


## Run the application

```
$ hypnotoad script/dspot_web
```

The application is served on http://localhost:3000.
21 changes: 21 additions & 0 deletions dspot-web/v2-mojo/d_spot_web.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
'secrets' => ['abc7qzverq3rcqevq0d178qzabvftq96evfab563'],

# See README.md for Posgres configuration. Only used for job management.
'conf_pg_minion' => 'postgresql://dspot_minion:pass4minion@/dspot_minion',

# URL of the host (used for emails).
'hostname' => 'http://ci4.castalia.camp:3000',

# MAVEN_HOME.
'mvn_home' => '~/Applis/apache-maven-3.6.0/',

# Command to run when invoking mvn.
'mvn_cmd' => 'mvn clean install -DskipTests',

# Command to run when invoking dspot-maven.
'dspot_cmd' => 'mvn eu.stamp-project:dspot-maven:3.1.0:amplify-unit-tests -Doutput-path=../output/dspot/',

# Places where all repos will be cloned (and analysed).
'workspace' => '/data/dspot_workspace/',
}
Loading

0 comments on commit d67cd85

Please sign in to comment.