Skip to content

Deploy SeaTable Python Runner


The running of Python scripts contains multiple parts in SeaTable, such as SeaTable, Python Runner, SeaTable FAAS Scheduler. Their functions and relationships are as follows

  • SeaTable: create/save/modify scripts, send requests, etc.
  • SeaTable FAAS Scheduler: handle requests, schedule timed tasks, save and count the results of script running. Equivalent to a master node.
  • Python Runner: actually run the scripts. When Python Runner receives a request for running script, it will download the script content and start a docker container to run the script. After the script is complete, the container is automatically destroyed to ensure safety. Equivalent to a worker node.

Python Runner and SeaTable FAAS Scheduler can be deployed to the same machine. The structure diagram is as follows


If you need to run a large number of Python scripts, you can deploy more Python Runners and arrange a load balance component between them. The structure diagram is as follows


Deploy Python Runner

The default directory for Python Runner is /opt/seatable-python-runner. The directory structure is as follows

├── logs                     (log files)
├── conf                     (configuration files)
├──                  (init script)
├──                 (start script)
├──                  (stop script)
└── Other code files

Download package

Python Runner needs to run directly on the host, download the latest package, then unzip and enter the project directory:

unzip -d /opt && cd /opt/seatable-python-runner

Installation dependencies

sudo pip3 install -r server_requirements.txt

Download Python Runner image

docker pull seatable/python-runner:latest

You can find all versions of Python Runner images in Docker repository.

Initialize Python Runner

sudo ./

Modify the configuration file

vim conf/

Edit the configuration as follows

SCHEDULER_URL = ''  # The URL of seatable-faas-scheduler, if you use an IP address, please add http://

More configuration options

uwsgi configuration

Python runner uses uwsgi to run, please edit in a way that meets your work needs

vim conf/seatable_python_runner.ini

The default configuration as follows

http = :8080  # port
process = 4   # processes
threads = 2   # threads

Star Python Runner

sudo ./

The stop command is as follows

sudo ./

The start/stop script is a collection of a series of operations, you can edit it according to your needs.

Deploy SeaTable FAAS Scheduler by Docker

The default directory for Scheduler is /opt/seatable-faas-scheduler. Create the directory:

mkdir /opt/seatable-faas-scheduler

The directory structure is as follows

├── docker-compose.yml
├── shared
│   ├── seatable-faas-scheduler
│   │   ├── conf     (configuration files)
│   │   ├── scripts  (script files)
│   │   └── logs     (log files)
│   ├── nginx-logs   (Nginx logs)
│   └── ssl          (SSL certificate)
└── mysql-data       (MariaDB data)

Install Docker-compose

Scheduler uses docker-compose. Install the docker-compose package:

# for CentOS
yum install docker-compose -y

# for Ubuntu
apt-get install docker-compose -y

Download the Scheduler Image

docker pull seatable/seatable-faas-scheduler:latest

You can find all versions of SeaTable FAAS Scheduler images in the Docker repository.

Download and Modify docker-compose.yml

Download the docker-compose.yml sample file to /opt/seatable-faas-scheduler, and modify the file to fit your environment and settings. The following fields must be modified:

  • The password of MariaDB root (MYSQL_ROOT_PASSWORD and DB_ROOT_PASSWD)
  • The volume directory of MariaDB data (volumes)
  • The volume directory of Scheduler data (volumes)
  • The time zone (Optional)

Initialize Database

Initialize database with the following command:

docker-compose up

NOTE: You should run the above command in a directory with thedocker-compose.yml.

Wait for a while. When you see This is a idle script (infinite loop) to keep container running. in the output log, the database initialized successfully.

Press keyboard Control + C  to finish this step.

Modify the configuration file of Scheduler

vim /path to the volume directory of Scheduler/seatable-faas-scheduler/conf/

Edit the configuration as follows


FAAS_URL = ''  # Python Runner URL
# If the Python runner and the Scheduler are running on the same host, then it needs to be configured as 'http://host.docker.internal:8080'(Can not be 'http://localhost:8080'), or 'http://<intranet address>:port'

SEATABLE_FAAS_AUTH_TOKEN = '***'  # Only copy this item to modify the SeaTable configuration file

Modify the configuration file of SeaTable

vim /path to the volume directory of SeaTable/seatable/conf/

Edit the configuration as follows

SEATABLE_FAAS_URL = '***'  # Scheduler URL
SEATABLE_FAAS_AUTH_TOKEN = '***'  # same as the item in

Start Scheduler

docker-compose up -d

Restart SeaTable Server

docker exec -d seatable /shared/seatable/scripts/ restart

Now, you can test the Python Runner through the SeaTable web page.

More Configuration Options of Scheduler

Deploy the https

  • Let's encrypt SSL certificate

If you set SEATABLE_FAAS_SCHEDULER_SERVER_LETSENCRYPT to true in "docker-compose.yml", the container would request a letsencrypt-signed SSL certificate for you automatically.


    - "80:80"
    - "443:443"
    - SEATABLE_FAAS_SCHEDULER_SERVER_LETSENCRYPT=True  # Default is False. Whether to use let's encrypt certificate.
    -  # Specifies your host name if https is enabled

Note:Since the nginx configuration file is only generated automatically when you run the container for the first time, you'd better set SEATABLE_FAAS_SCHEDULER_SERVER_HOSTNAME=True before executing the docker-compose up -d command for the first time.

If you want to use your own SSL certificate, you can refer to the following steps.

  • Add your own SSL certificate
  • Upload the SSL certificate file to the Scheduler data directory : /Your Scheduler data volume/ssl/
  • Modify the nginx configuration file : /Your Scheduler data volume/seatable-faas-scheduler/conf/nginx.conf
  • Reload the Nginx configuration file:docker exec -it seatable-faas-scheduler /usr/sbin/nginx -s reload


server {
    if ($host = {
        return 301 https://$host$request_uri;
    listen 80;
    return 404;

server {

    listen 443 ssl;
    ssl_certificate /shared/ssl/<your-ssl.cer>;
    ssl_certificate_key /shared/ssl/<your-ssl.key>;

    proxy_set_header X-Forwarded-For $remote_addr;

Scheduler FAQ

If for some reasons, the installation failed, how to start from clean state again?

Just remove the directory /opt/seatable-faas-scheduler and start again.

LetsEncrypt SSL certificate is about to expire.

If the certificate is not renewed automatically, you can execute the command docker exec -it seatable-faas-scheduler /scripts/ to manually renew the certificate.