Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Rocky Linux 9 #93

Merged
merged 23 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
ffe36d0
Secure the connection with the elsticsearch
khaledk2 Jul 25, 2023
50cd783
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 26, 2023
6f6df0a
Fix pre commit checks
khaledk2 Jul 26, 2023
353deae
Merge branch 'secure_elasticsearch_onnection' of https://github.com/k…
khaledk2 Jul 26, 2023
a36a3a7
Update to elasticsearch 8.8.1
khaledk2 Jul 26, 2023
08f554b
FIx action
khaledk2 Jul 26, 2023
c0e37ee
Set elastic search username and password
khaledk2 Jul 26, 2023
13dabf7
Support Rocky 9
khaledk2 Sep 2, 2023
f7157d3
Use python from the base image, install pip and restore build psycopg…
khaledk2 Sep 4, 2023
9d5b6fe
remove unused requirements
khaledk2 Sep 5, 2023
048556e
use rocky linux 9 as base image
khaledk2 Sep 5, 2023
0643e02
add instruction to set ELASTIC_PASSWORD
khaledk2 Sep 5, 2023
4bb4498
Merge pull request #92 from khaledk2/secure_elasticsearch_onnection
khaledk2 Sep 25, 2023
7d5a837
add tag 0.5.3 to changelog
khaledk2 Sep 25, 2023
77c8c74
Update CHANGELOG.md
khaledk2 Sep 25, 2023
ce8501f
Merge pull request #95 from khaledk2/add_tag_0.5.3
khaledk2 Sep 25, 2023
41212c4
Support Rocky 9
khaledk2 Sep 2, 2023
28a2d3b
Use python from the base image, install pip and restore build psycopg…
khaledk2 Sep 4, 2023
5c9938c
remove unused requirements
khaledk2 Sep 5, 2023
ec0a0b7
use rocky linux 9 as base image
khaledk2 Sep 5, 2023
c7dc12d
clean up start searchengine script
khaledk2 Jan 25, 2024
c7ad3b6
fix conflict
khaledk2 Jan 25, 2024
c4f030e
Add empty line by the end of the file
khaledk2 Jan 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions deployment/docker/rockylinux/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Dockerfile
.git
.gitignore
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need an extra line

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I am not sure what you mean

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you add an empty line at the end of the file?

28 changes: 28 additions & 0 deletions deployment/docker/rockylinux/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#docker build . -t searchengine
# docker build . -f deployment/docker/rockylinux/Dockerfile -t searchengine
FROM rockylinux/rockylinux:9.0
USER root
RUN dnf update -y
RUN dnf install epel-release -y
RUN dnf install bzip2-devel -y
RUN dnf install wget -y
RUN dnf groupinstall "Development Tools" -y
RUN dnf install openssl-devel -y
RUN dnf install libffi-devel -y
RUN dnf install libpq-devel -y
RUN dnf install python3-pip -y
RUN dnf install -y python3-devel.x86_64
RUN dnf clean all && rm -rf /var/cache/yum
RUN mkdir /searchengine
ADD deployment/docker/rockylinux/start_gunicorn_serch_engine.sh /searchengine
ADD deployment/docker/rockylinux/run_app.sh /searchengine
ADD . /searchengine
RUN cd /searchengine
RUN mkdir /etc/searchengine
RUN mkdir /etc/searchengine/chachedata
RUN mkdir /etc/searchengine/logs
WORKDIR /searchengine
RUN pip3 install -r requirements.txt
RUN pip3 install gunicorn
EXPOSE 5577
ENTRYPOINT ["bash", "run_app.sh"]
18 changes: 18 additions & 0 deletions deployment/docker/rockylinux/run_app.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
echo "$@"

#test if the configuration file exists, if not it will copy it from the app configuration folder
test -f /etc/searchengine/.app_config.yml || cp /searchengine/configurations/app_config.yml /etc/searchengine/.app_config.yml

#Check the script input
if [[ $@ == run_app* ]] ; then
url_perfix=${@/run_app/}
echo using prefix: $url_perfix
bash start_gunicorn_serch_engine.sh $url_perfix
elif [ -z "$@" ] || [ "$@" = "run_app" ]; then
echo "Starting the app"
bash start_gunicorn_serch_engine.sh
else
echo "$@"
python3 manage.py "$@"
fi
29 changes: 29 additions & 0 deletions deployment/docker/rockylinux/start_gunicorn_serch_engine.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/sh
NAME="omero_search_engine"
USER root
PYTHONPATH=~/.pyenv/versions/searchengine/bin/
jburel marked this conversation as resolved.
Show resolved Hide resolved
APPPATH=/searchengine
SOCKFILE=/etc/searchengine/sock3 #change this to project_dir/sock (new file will be created)
echo "Starting $NAME as `whoami`"
export PATH="$PYTHONPATH:$PATH"
export PATH="$APPPATH:$PATH"
echo "staring the app"
# Create the run directory if it doesn't exist
RUNDIR=$(dirname $SOCKFILE)
echo "$RUNDIR"
test -d $RUNDIR || mkdir -p $RUNDIR
LOGS=/etc/searchengine/logs
LOGSDIR=$(dirname $LOGS)
test -d $LOGSDIR || mkdir -p $LOGSDIR
user=$USER
echo "Start Gunicorn ...."
#exec ls -l ~/.pyenv/versions/searchengine/bin/
echo "$HOME"
echo pwd
cd $APPPATH
if [ -z "$@" ]; then
exec gunicorn "omero_search_engine:create_app('production')" -b 0.0.0.0:5577 --timeout 0 --name "$NAME" --bind=unix:$SOCKFILE --log-file=$LOGSDIR/logs/engine_gunilog.log --access-logfile=$LOGSDIR/logs/engine_access.log -error-logfile=$LOGSDIR/logs/engine_logs/engine_error.log --workers 4
else
echo Run with SCRIPT_NAME=$@
SCRIPT_NAME=/"$@"/ exec gunicorn "omero_search_engine:create_app('production')" -b 0.0.0.0:5577 --timeout 0 --name "$NAME" --bind=unix:$SOCKFILE --log-file=$LOGSDIR/logs/engine_gunilog.log --access-logfile=$LOGSDIR/logs/engine_access.log -error-logfile=$LOGSDIR/logs/engine_logs/engine_error.log --workers 4
fi