This is a small docker container (and automated build) to show using Perfetto in Docker, and with docker-compose.
There are no guarentees about this setup - use and customize at your own discretion!
To run a single container (development) setup, first build
$ docker build -t perfetto .
Then run as follows, opening to http://0.0.0.0:8000
$ docker run -it -p 8000:8000 perfetto --serve-host 0.0.0.0 --serve-port 8000 --serve
Note that the image will do some building of the frontend at run time, so give it a few minutes to start up. When the UI is ready you'll see a message about it in the terminal.
If you want to build perfetto, you can leave the docker-compose.yaml as is. However if you want to use the automated build we provide, replace "build" with "image"
services:
perfetto:
build: ./
# Uncomment this and comment build to use image
# image: ghcr.io/rse-ops/perfetto:latest
to
services:
perfetto:
image: ghcr.io/rse-ops/perfetto:latest
To run with docker-compose and nginx (and SSL certs) first generate some self signed certs!
$ openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout ./nginx/ssl/nginx-selfsigned.key -out ./nginx/ssl/nginx-selfsigned.crt
(it will ask you for questions - answer them!)
Create a strong Diffie-Hellman group for negotiating Perfect Forward Secrecy with clients:
$ openssl dhparam -out ./nginx/ssl/dhparam.pem 4096
Note that for the above you can also likely use certbot. This is just a straight forward way.
Build the container:
$ docker-compose build
Bring up the containers!
$ docker-compose up -d
You'll need to change permissions in the volume or the static assets won't work:
$ docker exec nginx chmod 775 /usr/share/nginx/html -R
Bring down the images and remove volumes.
$ docker-compose stop
$ docker-compose rm
$ docker volume rm perfetto_web-data
Need help? Let us know. E.g., for the HPC use case this could be modified to run with Singularity Compose. or plain Singularity.