Skip to main content

Virtual Machine Dashboard

Virtual Machine Dashboard provides overview over all the projects running on Virtual Machine.

Access​

You can access Virtual Machine Dashboard here:

https://dashboard.local.datastat.si/

Projects Overview ​

Virtual Machine Dashboard provides overview over all projects running on Virtual Machine. You can see their status, current branch they are running on and commit time of the latest commit, project is currently running.

Status of a service is determined by creating "http request" on a services base url and observing "http status" of its response. This means that if service has bug where base url does not return 200 response code, Dashboard will list this service as "stopped" even though it is technically running.

Inside Dashboard, you can manage projects in a following way:

  • Restart Project - Clicking on a Restart button will trigger restart action of a service, using its down command to stop the service and up command to start it again. In cases where only 1 command is needed (for example: "pm2 restart PortalApp") only "up command" is set and used.
    Note:

    Sometimes after restarting the service its status can be marked as stopped even if in reallty it was started successully. Please refresh the page a couple of times, to ensure service is really stopped

  • Change Branch - Clicking on Change Branch button will open modal window, showing last 10 active branches of a project. Branches listed are both local and remote (remote ones will have "origin/" in its name). Clicking on a branch will checkout cliked branch inside this projects work directory.
    Note:

    The branches listed here are only those that the project currently knows about. In order to update the list, pull current branch first.

  • Pull Current Branch - Available inside Change Branch Modal. Clicking on this will trigger "git pull" inside projects working directory. In case of uncommited work this will of course not work and manual handling will be required.

Managing Projects ​

In order to add, remove or modify projects inside Datastat Dashboard, you need to modify configuration inside:

~/code/repo/dashboard/data/projects_config.json

All Projects are placed inside one of the groups (currently: Ijf and Judomanager). Each project should have the following attributes:

  • id: Unique number across all projects
  • title: Title of the project. Will be displayed on the dashboard
  • url: Base url of the project. This will be used to link user to the project and to determine the status of the project
  • icon_url: Url to the icon of a project
  • path: Working directory of a project. This will be used to run all commands connected to the projects (such as "git pull", "docker-compose up", ...)
  • down_command: Command that one should run to stop the project. In case only one command is enough to restart the project, leave this null
  • down_command: Command that one should run to start the project
Adding .Net projects

If added project is run via service xxx start command on virtual machine, be sure to add "up" and "down" commands also to sudoers (sudo visudo -f /etc/sudoers.d/dashboard)

Source Code​

Source code for Datastat Dashboard is available on github: https://github.com/datastat/datastat-dashboard