Skip to content

Commit

Permalink
update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
JulienPeloton committed Dec 4, 2024
1 parent e664cbb commit bf0510c
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 10 deletions.
45 changes: 35 additions & 10 deletions install/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,38 @@ Clone this repository, and install all python dependencies:
pip install -r requirements.txt
```

## Java installation

You need Java 11 or 17. Execute:

```bash
sudo dnf install java-11-openjdk java-11-openjdk-devel
```

and then update your `.bashrc` with:

```bash
# Java -- put your path
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-11.0.25.0.9-3.el9.x86_64/
```

Check you have it set:

```bash
source ~/.bashrc
java -version
# openjdk version "11.0.25" 2024-10-15 LTS
# OpenJDK Runtime Environment (Red_Hat-11.0.25.0.9-1) (build 11.0.25+9-LTS)
# OpenJDK 64-Bit Server VM (Red_Hat-11.0.25.0.9-1) (build 11.0.25+9-LTS, mixed mode, sharing)
```

## Hadoop installation

First Execute the script to install it under `/opt`:
First execute the script as sudo to install it under `/opt`:

```bash
cd install/
./install_hadoop.sh
sudo ./install_hadoop.sh
```

and then update your `.bashrc` with (careful with the version number):
Expand All @@ -32,29 +57,29 @@ export ARROW_LIBHDFS_DIR=$HADOOP_HOME/lib/native

## Systemctl and gunicorn

Install a new unit for systemd under `/etc/systemd/system/fink_cutout_api.service`:
Install a new unit (as sudo) for systemd under `/etc/systemd/system/fink_cutout_api.service`:

```bash
[Unit]
Description=gunicorn daemon for fink_cutout_api
After=network.target

[Service]
User=root
Group=root
WorkingDirectory=/home/centos/fink-cutout-api
User=almalinux
Group=almalinux
WorkingDirectory=/home/almalinux/fink-cutout-api

ExecStart=/bin/sh -c 'source /root/.bashrc; exec /root/miniconda/bin/gunicorn --log-file=/tmp/fink_cutout_api.log app:app -b localhost:PORT --workers=1 --threads=8 --timeout 180 --chdir /home/centos/fink-cutout-api --bind unix:/run/fink_cutout_api.sock 2>&1 >> /tmp/fink_cutout_api.out'
ExecStart=/bin/sh -c 'source /home/almalinux/.bashrc; exec /home/almalinux/fink-env/bin/gunicorn --log-file=/tmp/fink_cutout_api.log app:app -b localhost:PORT --workers=1 --threads=8 --timeout 180 --chdir /home/almalinux/fink-cutout-api --bind unix:/home/almalinux/fink_cutout_api.sock 2>&1 >> /tmp/fink_cutout_api.out'

[Install]
WantedBy=multi-user.target
```

Make sure you change `PORT` with your actual port. Reload units and launch the application:
Make sure you change `PORT` with your actual port. Finally update the `config.yml` with your parameters (put the same `PORT`!), reload units and launch the application:

```bash
systemctl daemon-reload
systemctl start fink_cutout_api
sudo systemctl daemon-reload
sudo systemctl start fink_cutout_api
```

You are ready to use the API!
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ pyarrow
pandas
requests
flask
gunicorn

0 comments on commit bf0510c

Please sign in to comment.