Skip to content

Instantly share code, notes, and snippets.

@kaoudis
Last active February 21, 2025 17:46
Show Gist options
  • Select an option

  • Save kaoudis/cf412abafea5ca4054c852f9e5905aab to your computer and use it in GitHub Desktop.

Select an option

Save kaoudis/cf412abafea5ca4054c852f9e5905aab to your computer and use it in GitHub Desktop.
polytracker ubuntu workspace
#!/usr/bin/env bash
set -eux
sudo apt-get -y update
sudo apt-get -y install build-essential ca-certificates containerd.io curl docker-buildx-plugin docker-ce docker-ce-cli docker-compose-plugin gdb git make pkg-config python3-pip python3-virtualenv ripgrep valgrind wget
curl -LO https://trunk.io/releases/trunk
git clone git@github.com:trailofbits/polytracker.git && cd polytracker
virtualenv -p /usr/bin/python3 polytracker-venv
source polytracker-venv/bin/activate
git submodule update --init --recursive
pip3 install -e ".[dev]"
docker build -t trailofbits/polytracker -f Dockerfile .
@kaoudis
Copy link
Copy Markdown
Author

kaoudis commented Feb 19, 2025

We've tagged the local Polytracker main Docker build with trailofbits/polytracker above. Then, to make a new local Polytracker container and pass through the working local polytracker Git repo directory into it for experimentation and analysis in an environment with our derivative compiler-rt (this is primarily useful for working on the Python part of Polytracker, which is mainly the "read side" TDAG analysis code), also:

# from the root of the polytracker gh repo directory
$ docker run -it -v "$(pwd)":/workdir trailofbits/polytracker

This works beautifully in a Linux on-demand VM provisioned with a lot of RAM, but may be slow on your local machine depending on your hardware.

@kaoudis
Copy link
Copy Markdown
Author

kaoudis commented Feb 19, 2025

also possibly not wanted by everyone but act is a nice tool for testing GH Actions changes locally:

curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/nektos/act/master/install.sh | sudo bash

cf https://nektosact.com/installation/index.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment