This service is meant to be run on the computer that is connected to the SRT telescope at Johns Hopkins University. In order for the user requests from the accompanying website to be fulfilled, this service must be running. The website will remain operational even if this service is not running, but the user requests will not be fulfilled and users, will be waiting for email with their results that will not come.
- Install Python 3.10 or higher
- Install pip
- Run the following command to create a venv:
python3 -m venv venv
- Activate the venv:
source venv/bin/activate
- Install the requirements:
pip install -r requirements.txt
- Create a
.env
file and copy the values from the.env.example
file. This a hidden file as it starts with a '.' so runls -a
to see it in the file tree. - Populate the
.env
file with the correct values - Test the service runs correctly:
python3 main.py
- Now that the service is running correctly we need to setup the service to run in the background. Please close the running service.
- Run the service in the background:
nohup python3 main.py &
NOTE: If the computer has been shut down or the service has been stopped and has been previously setup, then the following steps are all that is needed to run the service:
- Additionally, please make sure the the .env file for the repo is properly populated containing the the right values. This a hidden file as it starts with a '.' so run
ls -a
to see if it exists. - Activate the venv:
source venv/bin/activate
- Test the services still runs correctly:
python3 main.py
- Now that the service is running correctly we need to setup the service to run in the background. Please close the running service.
- Run the service in the background:
nohup python3 main.py &
- To stop the service you will need to run
ps aux | grep main.py
to get the pid of the process running - Then simply run
kill <pid you found>