Panel Server Setup Examples#

This notebook guides users how to setup panel servers on EC2.

Setting Up the Panel Server#

Prerequisite Environment#

To begin, you’ll need to configure your EC2 environment. If you haven’t done so already, please follow the steps outlined in this guide.

Next, you should install either Anaconda or, as the recommended choice, Mamba, and create Jupyter files. Here are some resources to help you with the installation:

Creating the Panel#

Before proceeding, ensure that you’ve configured the accessible ports in the EC2 console.

To set up the server in the terminal:

panel serve <your_file_name.py> --address 0.0.0.0 --port <port_number> --allow-websocket-origin="*"

For a continuously running server in the terminal:

nohup panel serve <your_file_name.py> --address 0.0.0.0 --port <port_number> --allow-websocket-origin="*" &

To terminate processes based on port numbers:

sudo lsof -i :<port_number>
sudo kill <PID>

For further information on configuring a Panel server, please refer to this link.

Admin Panel#

The /admin panel offers a comprehensive view of the current application, equipped with essential tools for debugging and profiling purposes. You can activate it by including the --admin argument when executing the panel serve command.

To initiate the server, please enter the following command in either the Command Prompt or Anaconda Prompt:

panel serve --admin --profiler=snakeviz <your_file_name.py>

Ensure that you include both the --admin and --profiler command-line options. It’s crucial not to overlook specifying the profiler.

After enabling the server, you can access the procedure page and the admin page by entering the following URLs in your web browser:

http://localhost:your_port_number/your_file_name
http://localhost:your_port_number/admin

The overview page furnishes essential information about currently active sessions, running versions, and, if the ‘psutil’ library is installed, resource utilization details.

The launch profiler is designed to meticulously scrutinize the execution time of a specific application’s initialization process. You can activate it by specifying a profiler using the –profiler command-line option. There are several available profilers.

Once you’ve enabled the launch profiler, it will independently profile each application and provide you with the profiler output generated by your selected profiling engine.

For further information on configuring a Panel server, please refer to this link.