The Scheduler is an automated tool for the Gemini Observatory, designed to generate and optimize observation schedules as part of the GPP project. It uses the lucupy library for modeling and supports both standalone and service modes, as well as a Jupyter-based UI for experimentation.
- Automated scheduling of observations
- GraphQL API for integration with Gemini Program Platform
- Jupyter notebooks for interactive exploration
- Docker support for easy deployment
Before running the scheduler, set the following environment variables:
PYTHONPATH: Should include the project base path.REDISCLOUD_URL: Redis connection string (contact project staff for credentials).APP_VERSION: Application version (e.g.,dev).
Example:
export PYTHONPATH=$PYTHONPATH:/path/to/scheduler
export REDISCLOUD_URL=redis://<USER>:<PASSWORD>@redisserver.ec2.cloud.redislabs.com:12345
export APP_VERSION=devUsing uv:
# Install uv if you haven't already
curl -LsSf https://astral.sh/uv/install.sh | sh
# Create virtual environment and install dependencies
uv syncuv run python scheduler/main.pyAfter the scheduler service is started, it will instantiate a web server in the port 8000 by default. The service is meant to be used through the web UI https://github.com/gemini-hlsw/schedule
The standalone script should be able to run a single plan request directly in the terminal and print the output
uv run python scheduler/scripts/run.pyNote:
To ensure GitHub Actions secrets (such asREDISCLOUD_URL) are available for testing and CI, all contributions should be made from branches within the main repository, not from forks.
-
Clone the main repository:
git clone https://github.com/gemini-hlsw/scheduler.git cd scheduler -
Create a new feature branch:
git checkout -b your-feature-branch
-
Work on your changes and commit as usual.
-
Sync dependencies Make sure you packages are updated
uv sync
Commit uv.lock file changes
-
Rebase your branch with the latest main branch before pushing:
git fetch origin git rebase origin/main
-
Push your branch to the main repository:
git push origin your-feature-branch
-
Open a Pull Request from your feature branch to
mainin the main repository.
Do not use the GitHub fork workflow.
Opening pull requests from forks will not have access to required repository secrets, and CI/CD workflows may fail.
Build and run the container:
docker build -t scheduler .
docker run -dp 8000:8000 schedulerAccess the GraphQL console at http://localhost:8000/graphql.
To update your local repository and dependencies:
git pull
pip install -U lucupyIf you encounter issues, ensure you have the latest version of lucupy and all dependencies.
For help, contact the project maintainers