diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index dea35fafcfb53bad8e7975ca97b1561fdd4c84f1..64bf7c8ea35a9be63089bbb7c3282966f343a7bc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -39,7 +39,7 @@ deploy_test: - docker ps -a -q | xargs -I{} docker rm {} || echo "No containers to remove" - docker images -q | xargs -I{} docker rmi {} || echo "No images to remove" - docker pull l1ll1/strudel2_backend:$CI_COMMIT_BRANCH - - docker run --mount type=bind,source=/messages,target=/messages --mount type=bind,source=/var/log/strudel2,target=/var/log/strudel2 --restart=always -d -p 8080:8080 -p 8090:8090 --name strudel2_backend l1ll1/strudel2_backend:$CI_COMMIT_BRANCH || echo "Unable to start image ... possibly the old wsgi process is still running?" + - docker run --mount type=bind,source=/messages,target=/messages --mount type=bind,source=/var/log/strudel2,target=/var/log/strudel2 --restart=always -v /home/ubuntu/telegraf.conf:/etc/telegraf/telegraf.conf:ro -d -p 8080:8080 -p 8090:8090 --name strudel2_backend l1ll1/strudel2_backend:$CI_COMMIT_BRANCH || echo "Unable to start image ... possibly the old wsgi process is still running?" dependencies: - build @@ -61,7 +61,7 @@ deploy_dev: - docker ps -a -q | xargs -I{} docker rm {} || echo "No containers to remove" - docker images -q | xargs -I{} docker rmi {} || echo "No images to remove" - docker pull l1ll1/strudel2_backend:$CI_COMMIT_BRANCH - - docker run --mount type=bind,source=/messages,target=/messages --mount type=bind,source=/var/log/strudel2,target=/var/log/strudel2 --restart=always -d -p 8080:8080 -p 8090:8090 --name strudel2_backend l1ll1/strudel2_backend:$CI_COMMIT_BRANCH || echo "Unable to start image ... possibly the old wsgi process is still running?" + - docker run --mount type=bind,source=/messages,target=/messages --mount type=bind,source=/var/log/strudel2,target=/var/log/strudel2 --restart=always -v /home/ubuntu/telegraf.conf:/etc/telegraf/telegraf.conf:ro -d -p 8080:8080 -p 8090:8090 --name strudel2_backend l1ll1/strudel2_backend:$CI_COMMIT_BRANCH || echo "Unable to start image ... possibly the old wsgi process is still running?" dependencies: - build diff --git a/Dockerfile b/Dockerfile index b724606844004d63a53c688a02d946641b6cbec5..4a6ccbff0c3b42ef03f8d1504d3d473b79f3de0d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM ubuntu WORKDIR /opt/strudel2/src COPY . /opt/strudel2/src -RUN apt update && apt install -y python3 gcc python3-pip openssh-client +RUN apt update && apt install -y python3 gcc python3-pip openssh-client telegraf RUN pip3 install -r requirements.txt && pip install . RUN mkdir -p /var/www/.ssh && chown www-data:www-data /var/www/.ssh && chmod 700 /var/www/.ssh EXPOSE 8080 8090 diff --git a/runscript b/runscript index 389df95231f0203e42e369c20c8be1b86fde252f..64994e2b6712702581cd133061c48df18ef45f22 100755 --- a/runscript +++ b/runscript @@ -7,6 +7,8 @@ uwsgi \ --protocol=http \ --uid=www-data \ --gid=www-data \ + --stats /tmp/statsock \ -w tes.tes_wsgi & +telegraf & twsproxy 8090 diff --git a/tes/sshwrapper/__init__.py b/tes/sshwrapper/__init__.py index b7c02ce3e81663177570d2f9d9f77964224af717..e0ec9ba73987d6870e7d88dcf64193cb977f8706 100644 --- a/tes/sshwrapper/__init__.py +++ b/tes/sshwrapper/__init__.py @@ -42,7 +42,7 @@ class Ssh: """ Ssh class can execute or create tunnelstat """ - TIMEOUT=60 + TIMEOUT=30 SSHOPTS = [ '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-o', 'IdentityFile=/dev/null',