Skip to content

Commit

Permalink
Merge pull request #37 from thecoolestguy/master
Browse files Browse the repository at this point in the history
Added per-minute processes for frontend/indexing and 2 yum packages
  • Loading branch information
jrjohnson authored May 19, 2020
2 parents 1bb6d2f + efbed46 commit 2919882
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 3 deletions.
10 changes: 9 additions & 1 deletion ssh-admin/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ MAINTAINER Ilios Project Team <[email protected]>
ENV GITHUB_ACCOUNT_SSH_USERS=''

RUN apt-get update && \
apt-get install -y wget openssh-server sudo netcat mysql-client && \
apt-get install -y wget openssh-server sudo netcat mysql-client vim telnet && \
rm -rf /var/lib/apt/lists/* && \
apt-get autoremove -y

Expand All @@ -22,8 +22,16 @@ RUN sed -i 's/#PermitUserEnvironment no/PermitUserEnvironment yes/' /etc/ssh/ssh
# allow users in the sudo group to do wo without a password
RUN /bin/echo "%sudo ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/no-password-group

# initialize the log files for the loop processes
RUN /bin/touch /tmp/ilios_frontend_updates.log
RUN /bin/touch /tmp/ilios_search_index_updates.log

# copy over the script files that will run the processess
COPY update_ilios_frontend_loop.sh /update_ilios_frontend_loop.sh
COPY update_ilios_search_index_loop.sh /update_ilios_search_index_loop.sh
COPY entrypoint.sh /entrypoint.sh

# expose the ssh port
EXPOSE 22
ENTRYPOINT /entrypoint.sh

Expand Down
10 changes: 8 additions & 2 deletions ssh-admin/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
set -euf -o pipefail
set -m -euf -o pipefail

# Export out ENV out so symfony can read them
/bin/echo 'Dumping ILIOS environmental variables for symfony'
Expand Down Expand Up @@ -31,5 +31,11 @@ if [[ $GITHUB_ACCOUNT_SSH_USERS ]]; then
fi

/bin/echo "Starting ssh server"
/usr/sbin/sshd -D &
/bin/echo "Starting frontend-update service..."
/update_ilios_frontend_loop.sh &
/bin/echo "Starting search-index services..."
/update_ilios_search_index_loop.sh &

/usr/sbin/sshd -D
/bin/echo "Moving sshd process back to foreground to accept SSH connections..."
fg %1
7 changes: 7 additions & 0 deletions ssh-admin/update_ilios_frontend_loop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

while sleep 60; do
echo -n `date +\%H:\%M:\ ` > /tmp/ilios_frontend_updates.log
cd /var/www/ilios;sudo bin/console ilios:maintenance:update-frontend >> /tmp/ilios_frontend_updates.log 2>&1
:
done
7 changes: 7 additions & 0 deletions ssh-admin/update_ilios_search_index_loop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

while sleep 60; do
echo -n `date +\%H:\%M:\ ` > /tmp/ilios_search_index_updates.log
cd /var/www/ilios;sudo /var/www/ilios/bin/console messenger:consume async --time-limit=60 >> /tmp/ilios_search_index_updates.log 2>&1
:
done

0 comments on commit 2919882

Please sign in to comment.