This repository contains an interactive tutorial showing how to use Scyros to mine GitHub repositories and extract functions from real-world code. In the tutorial, we build a small end-to-end pipeline to extract functions with integer types in C and Java repositories mined from GitHub.
The tutorial itself runs inside a Streamlit web application. The purpose of this README is only to help you set up and launch the tutorial environment. Once the application is running, open it in your browser and follow the step-by-step instructions provided in the interface.
First clone the repository to your local machine:
git clone git@github.com:fxpl/scyros-tutorial.git
cd scyros-tutorialAfter cloning the repository, choose one of the installation methods below.
To build the Docker image, please follow the steps below:
-
Ensure Docker is installed: https://www.docker.com/get-started.
-
Open a terminal and navigate to the directory containing this
README.mdfile and theDockerfile. -
Build the Docker image using the following command:
docker build -t scyros-tutorial . -
After completion, verify that the image has been created successfully by running:
docker images
You should see
scyros-tutoriallisted. -
Start the container. This should not take more than a minute.
docker run --rm -p 8501:8501 scyros-tutorial:latest
-
Click on the link displayed in the terminal (
http://localhost:8501) or, alternatively, open http://localhost:8501 in your browser. -
While the container is running, you can open a terminal inside the container to run commands and inspect the file system. Fetch first the container by ID running
docker psin a new terminal on your host, and then:docker exec -it <container-id> /bin/bash
- Make sure you have scyros installed on your machine. In most cases, you can install it using the following command:
For more information on available releases and installation options, please refer to the release page of the Scyros repository.
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/fxpl/scyros/releases/latest/download/scyros-installer.sh | sh
- Make sure you have uv installed on your machine. You can install it using the following command:
curl -LsSf https://astral.sh/uv/install.sh | sh - uv installs to ~/.local/bin by default; make sure to add this directory to your PATH environment variable if it's not already included.
- Run the following commands to set up the virtual environment and install the dependencies (you may need to run these commands as a superuser):
uv python install uv venv source .venv/bin/activate uv sync - Start the Streamlit application:
uv run streamlit run Scyros_Tutorial.py
To remove the Docker image and free up disk space, you can run the following command in the host terminal:
docker rmi scyros-tutorial:latestRemember to revoke your GitHub personal access token in your GitHub account settings.
- If
docker runfails with an error similar to the one below, it means that port 8501 is already in use on your machine.To solve this, you can either stop the process using that port, or run the container mapping to a different port (e.g., 8502):docker: Error response from daemon: ports are not available: exposing port TCP 0.0.0.0:8501 -> 127.0.0.1:0: listen tcp 0.0.0.0:8501: bind: address already in use.The application will be accessible at: http://localhost:8502docker run --rm -p 8502:8501 scyros-tutorial:latest