Skip to content

Latest commit

 

History

History
46 lines (39 loc) · 1.3 KB

File metadata and controls

46 lines (39 loc) · 1.3 KB

Frontend API

This frontend API is meant to provide endpoints that are not covered in the ophyd-api (ophyd as a service, ophyd websocket, etc).

Examples include a pyfai endpoint that will perform qspace analysis on an image with provided parameters, or a future endpoint for transforming images before sending them to the client.

If the endpoint is directly Bluesky related it may go into ophyd-api instead.

Installation

Optionally set up a conda environment

conda create -n frontend-api python=3.12
conda activate frontend-api

Install requirements

#/frontend-api
pip install -r requirements.txt

Starting the server

Start the server

#/frontend-api
python main.py

Starting in a container

To start the Python server in a container:

#/frontend-api
docker build -t python-server .
docker run -dp 8080:8080 python-server

For testing Bluesky in Python directly, use the following commands to run Jupyter Notebook from within a container:

#/frontend-api
docker build -t python-jupyter .
docker run -it -p 8888:8888 python-jupyter /bin/bash
#in the Container Terminal
jupyter lab --ip='0.0.0.0' --port=8888 --allow-root --no-browser --ServerApp.token='' --ServerApp.password=''

Now in a browser you can navigate to localhost:8888/lab