Skip to content

PrankWeb deploy for development

Lukas Polak edited this page Oct 24, 2024 · 3 revisions

This page describe how you can run PrankWeb locally, we recommend using this only for developers. We recommend using Docker based deployment instead.

PrankWeb consists of several components, some or all of the components must be deployed. In fact the recommended approach is to use Docker to run all components. On the developer machine we suggest to prepare data/command to run particular component in isolation. In rest of this page, we describe how to deploy selected components in a standalone mode and how multiple components can be connected. Please keep in mind, that this setup requires manual modification of some files in the repository.

API Gateway

You need to run Nginx with the configuration from this component. As this acts only as API gate, you may not need this component.

Frontend

This component has configuration in frontend/server/configuration.js. Besides the port the two other properties can be used to set data source, this can be local directory or remote server.

Serving content from local directory allow you to run Frontend locally without the need to run any other component. The proxy-directory directory should contains folder database with subdirectories for given task definitions. For example v1, v1-conservation, etc.. The content is the same as for \data\prankweb\task\database inside the Docker image. Content of frontend/server/configuration.js:

module.exports = {
  "port": 8075,
  "proxy-directory": "../../data/database/",
}

Alternatively you can proxy all requests to a server, like prankweb instance. You can use this to run Frontned with full API behind it. Content of frontend/server/configuration.js:

module.exports = {
  "port": 8075,
  "proxy-service": "https://prankweb.cz",
}

Once the configuration is ready:

  • Navigate into the frontend directory
  • Install dependencies using
    npm ci
  • Run Frontend in development mode using:
    npm run dev

You can now open your browser on localhost and port from the configuration (default: http://localhost:8075) and you should see PrankWeb homepage.

Also, note that instead of the prankweb.cz instance, you might run the Docker in background and proxy all requests to the running Docker containers by setting the following:

module.exports = {
  "port": 8075,
  "proxy-service": "http://localhost:8020",
}

Java-tools

This component is used by other scripts, you can run it from the command line. See output_prankweb.py for more information on how use this component.

Executor-p2rank

The entry point for running predictions. See run_p2rank.py or run_p2rank_task.py. Using the entry points you can execute this component without any other component.

If you want to run in the same way it runs in Docker image, you need to connect it to message broker using Celery, see celery_p2rank.py.

Conservation pipelines

Both conservations pipelines are implemented in Python. Yet they require several external tools, see executor-p2rank/Dockerfile for more details.

Web server

You can run this component as a Python application, just install libraries. Yet you man need to modify/remove connection to Celery broker in order to run it without celery.

Celery

It seems like Celery requires some additional configuration to run using Windows. Thus we recommend running all Celery related components using Docker. This should not be necessary to develop the components, as the Celery is used only to start a task (call a Python function).