Skip to content

gemini-hlsw/scheduler

Repository files navigation

Scheduler

Python version build tests codecov

This is the automated Scheduler for Gemini Observatory, part of the GPP project.

For the list of dependencies check: requirements.txt.

How to Install (Local Development)

Note: These instructions assume you are using Mac OS X or Linux.

Download the project source:

Fork the project and then clone into your desired directory.

You may wish to also fork and clone the lucupy repository, which is the package that contains the model for this project.

Create the project environment:

Using virtualenv:

Make sure you have an active Python 3.10 or 3.11 distribution installed on your machine.

virtualenv can be installed using pip:

$ pip install virtualenv

Then in the project directory, execute:

$ virtualenv --python=/path/to/python_executable venv
$ source venv/bin/activate
$ pip install -r requirements.txt

Using conda or Anaconda:

In the project directory, execute:

$ conda env create -f environment.yml
$ conda activate scheduler

Executing the Scheduler

Standalone script

To run the scheduler as a standalone script, execute:

$ python scheduler/scripts/run_greedymax.py

If you have performed the installation correctly, you should see logging messages, and an output of a plan, followed by the message DONE.

Service

To run the scheduler as a service, execute:

$ python scheduler/main.py

Jupyter notebooks

We offer Jupyter notebooks using a Mercury user interface to test the scheduler. This can be launched on localhost:8000 as follows:

$ cd demo
$ mercury run

This should open a tab in your active browser and show the notebooks.

If the startup complains about a missing allauth package, install this with:

$ pip install django-allauth

How to Install (Docker)

  1. Run Docker-compose. If is the first time running the script, it will take some time to build the images.
$ docker build -t scheduler .  
$ docker run -dp 8000:8000 scheduler
  1. You can access http://localhost:8000/graphql to interact with the GraphQL console.

Troubleshooting

The most likely cause of issues during execution is that changes have been made to the lucupy project and an update of the package is necessary. This can be done with:

$ pip install -U lucupy