-
Notifications
You must be signed in to change notification settings - Fork 4
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
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 50cd783
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 6f6df0a
Fix pre commit checks
khaledk2 353deae
Merge branch 'secure_elasticsearch_onnection' of https://github.com/k…
khaledk2 a36a3a7
Update to elasticsearch 8.8.1
khaledk2 08f554b
FIx action
khaledk2 c0e37ee
Set elastic search username and password
khaledk2 13dabf7
Support Rocky 9
khaledk2 f7157d3
Use python from the base image, install pip and restore build psycopg…
khaledk2 9d5b6fe
remove unused requirements
khaledk2 048556e
use rocky linux 9 as base image
khaledk2 0643e02
add instruction to set ELASTIC_PASSWORD
khaledk2 4bb4498
Merge pull request #92 from khaledk2/secure_elasticsearch_onnection
khaledk2 7d5a837
add tag 0.5.3 to changelog
khaledk2 77c8c74
Update CHANGELOG.md
khaledk2 ce8501f
Merge pull request #95 from khaledk2/add_tag_0.5.3
khaledk2 41212c4
Support Rocky 9
khaledk2 28a2d3b
Use python from the base image, install pip and restore build psycopg…
khaledk2 5c9938c
remove unused requirements
khaledk2 ec0a0b7
use rocky linux 9 as base image
khaledk2 c7dc12d
clean up start searchengine script
khaledk2 c7ad3b6
fix conflict
khaledk2 c4f030e
Add empty line by the end of the file
khaledk2 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Dockerfile | ||
.git | ||
.gitignore | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
29
deployment/docker/rockylinux/start_gunicorn_serch_engine.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need an extra line
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?