Sunbeam will require the following dependencies for installation and use,
If you want to run Sunbeam locally (not through Docker), you'll need,
First, clone the repository from GitHub into a new directory, and enter into the new sunbeam/ directory.
git clone https://github.com/UBC-Solar/sunbeam.git
cd sunbeamThen, setup some folders for databases and build Docker containers,
make buildNOTE: If you are on Linux, you may need to do
sudo make build.
If you ever want to delete the database storage and created docker containers,
make cleanTo run Sunbeam, activate the Docker compose cluster, whilst in the sunbeam/ folder, run
docker compose upNOTE: If you are on Linux, you may need to do
sudo docker compose up. If you are onmacOS, you may need to runsudo ln -s "$HOME/.docker/run/docker.sock" /var/run/docker.sockif your Docker socket is not already located at/var/run/docker.sock.
Add -d if you don't want your terminal to be consumed. Feel free to use a window manager like tmux.
To stop Sunbeam, whilst in the sunbeam/ folder, run
docker compose downOnce everything has launched, navigate to localhost:4200 to access the Prefect Dashboard. Navigate to Worker Pools -> docker-work-pool and find the Edit button on the top right.
Find Environment Variables and fill in SOLCAST_API_KEY, INFLUX_ORG, and INFLUX_TOKEN.
To deploy a pipeline, navigate to the Sunbeam API at localhost:8080 and select Pipelines API -> Commission Pipeline and enter in the name of a GitHub branch you want to commission. If you want to build what you have locally, select Build Local.
After deploying a pipeline, it will automatically run a flow. You can view the flow by navigating to the Prefect Dashboard at localhost:4200.
You can navigate to Deployments -> your deployment -> click Run at the top right to run a flow manually, or create a schedule to automatically run flows.
Sunbeam uses uv for dependency management. Now, create a new virtual environment.
On MacOS/WSL/Linux,
python3 -m venv ./venv
source venv/bin/activatethen,
uv sync --lockedYou should be able to run the entrypoint,
uv run python3 pipeline/run.pyFinally, you'll need to add INFLUX_TOKEN and INFLUX_ORG in the .env file created at sunbeam/config/.env, it should look something like,
INFLUX_TOKEN=s4Z9_S6_O09jHy665FtrEdS9_ObY44vR4xMh-wYLSWBkypS0S0ZHQgBvEV2A5LgvQ1IKr8byHes2LA==
INFLUX_ORG=8a0b6Ok98Jh31e96
SOLCAST_API_KEY=s4Z9_S6_O09jHy665FtrEdS9_ObY44vR4xMhNo, those are not real API keys.
As Sunbeam uses branches functionally as deployable data pipelines, it is important to differentiate between branches that are intended to be deployed, and branches that are used for development. As such, branches used for development should be prefixed by dev- before continuing in snake case such as dev-fix_influxdb_ingress.