Skip to content

JaneliaSciComp/fileglancer-hub

Repository files navigation

fileglancer-hub

Scripts and configuration files for deploying Fileglancer in production at Janelia. This includes a fileglancer-central server and a JupyterHub instance customized with the fileglancer extension, as well as an Nginx reverse proxy server.

Development Deployment

Assumes you have a working Pixi installation.

  1. Clone this repository
git clone [email protected]:JaneliaSciComp/fileglancer-hub.git
cd fileglancer-hub
  1. Start the Fileglancer Central server
pixi run -e central start
  1. Start the Fileglancer Hub server
pixi run -e hub start

Production Deployment

When working with a shared server, make sure to set your umask so that everything is writeable by the group:

umask 002

Fileglancer Installation

In production the servers need to run as root in order to allow for setuid priviledge.

  1. Download and install Pixi into /usr/local/bin
curl -fsSL https://pixi.sh/install.sh | sh
sudo cp /groups/scicompsoft/home/$USER/.pixi/bin/pixi /usr/local/bin/
  1. Create the working directories
sudo install -d -m 2775 -o $USER -g $(id -gn) /opt/deploy /opt/data
mkdir -p /opt/deploy/fileglancer-hub
mkdir -p /opt/deploy/fileglancer-central
mkdir -p /opt/data/fileglancer-central
  1. Clone the repository into /opt/deploy/fileglancer-hub
cd /opt/deploy/
git clone [email protected]:JaneliaSciComp/fileglancer-hub.git
cd fileglancer-hub
  1. Create a file at /opt/deploy/fileglancer-hub/.env.central with the following content (modify the FGC_EXTERNAL_PROXY_URL to use the server hostname):
FGC_EXTERNAL_PROXY_URL=https://fileglancer-dev.int.janelia.org/fg/files
FGC_DB_URL=sqlite:////opt/data/fileglancer-central/sqlite.db

FGC_CONFLUENCE_URL=https://wikis.janelia.org
FGC_CONFLUENCE_TOKEN=<token here>

FGC_JIRA_URL=https://issues.hhmi.org/issues
FGC_JIRA_TOKEN=<token here>
  1. Create a file at /opt/deploy/fileglancer-hub/.env.hub with the following content:
OAUTH_CLIENT_ID=<client id from okta>
OAUTH_CLIENT_SECRET=<client secret from okta>
OAUTH_DOMAIN=<okta domain, e.g. hhmi.okta.com>
OAUTH_CALLBACK_DOMAIN=<the domain of the hub, e.g. fileglancer.int.janelia.org>
  1. Install the systemd service files
sudo cp fileglancer-central.service /etc/systemd/system/fileglancer-central.service
sudo cp fileglancer-hub.service /etc/systemd/system/fileglancer-hub.service
  1. Enable the services
sudo systemctl enable fileglancer-central
sudo systemctl enable fileglancer-hub
  1. Start the service
sudo systemctl start fileglancer-central
sudo systemctl start fileglancer-hub

NGINX Reverse Proxy Installation

  1. Install nginx
sudo yum install nginx
  1. Copy the nginx configuration file to /etc/nginx/conf.d/fileglancer.conf
sudo cp nginx.conf /etc/nginx/conf.d/fileglancer.conf
  1. Set up the static path for the Fileglancer assets
find /opt/deploy/fileglancer-hub/ -name "assets"

Use this path to replace the <path_to_fileglancer_assets> placeholder in the Nginx configuration file (/etc/nginx/conf.d/fileglancer.conf).

find /opt/deploy/fileglancer-hub/ -name "ui"

Use this path to replace the <path_to_fileglancer_ui_directory> placeholder in the Nginx configuration file (/etc/nginx/conf.d/fileglancer.conf).

  1. Disable the default server block
  • comment out the default server block in the main Nginx configuration file
sudo nano /etc/nginx/nginx.conf
  1. Obtain the SSL certificate for *.int.janelia.org and install it in /etc/nginx/certs/
sudo mkdir -p /etc/nginx/certs/
sudo cp cert.pem /etc/nginx/certs/default.crt
sudo cp key.pem /etc/nginx/certs/default.key
  • Make sure the permissions are correct
sudo chown root:root /etc/nginx/certs/default.crt
sudo chown root:root /etc/nginx/certs/default.key
sudo chmod 644 /etc/nginx/certs/default.crt
sudo chmod 600 /etc/nginx/certs/default.key
  1. Enable the service
sudo systemctl enable nginx
  1. Start the service
sudo systemctl start nginx

Administration

Updating to a new version

First, update to the version of Fileglancer you want to deploy:

cd /opt/deploy/fileglancer-hub
git pull

Then restart the services:

sudo systemctl restart fileglancer-central
sudo systemctl restart fileglancer-hub
sudo systemctl restart nginx

Make sure to check the logs and smoketest the service to ensure everything came up correctly.

Hub status checks

sudo systemctl status fileglancer-central
sudo systemctl status fileglancer-hub
sudo systemctl status nginx

Check the logs of the services

sudo journalctl -u fileglancer-central -f
sudo journalctl -u fileglancer-hub -f
sudo journalctl -u nginx -f

About

Jupyterhub launcher configuration for the fileglancer application

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •