From d4ba1bd16ff37eb1e73e4c6ce2df0f1ab8b4dcec Mon Sep 17 00:00:00 2001 From: zeus Date: Mon, 29 Nov 2021 20:12:48 +0200 Subject: [PATCH] ssh --- default.conf | 44 +++++++++++++++++++ .../usr/share/swarmlab.io/sec/sec_bootstrap | 20 +++++---- .../usr/share/swarmlab.io/sec/swarmlab-sec | 18 +++++--- 3 files changed, 68 insertions(+), 14 deletions(-) create mode 100644 default.conf diff --git a/default.conf b/default.conf new file mode 100644 index 0000000..1072e80 --- /dev/null +++ b/default.conf @@ -0,0 +1,44 @@ +server { + listen 80; + server_name localhost; + + #charset koi8-r; + #access_log /var/log/nginx/log/host.access.log main; + + location / { + root /data/www; + index index.html index.htm; + } + + #error_page 404 /404.html; + + # redirect server error pages to the static page /50x.html + # + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /data/www; + } + + # proxy the PHP scripts to Apache listening on 127.0.0.1:80 + # + #location ~ \.php$ { + # proxy_pass http://127.0.0.1; + #} + + # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 + # + #location ~ \.php$ { + # root html; + # fastcgi_pass 127.0.0.1:9000; + # fastcgi_index index.php; + # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; + # include fastcgi_params; + #} + + # deny access to .htaccess files, if Apache's document root + # concurs with nginx's one + # + #location ~ /\.ht { + # deny all; + #} +} diff --git a/install/usr/share/swarmlab.io/sec/sec_bootstrap b/install/usr/share/swarmlab.io/sec/sec_bootstrap index 1dd7c5a..e4ccb4d 100755 --- a/install/usr/share/swarmlab.io/sec/sec_bootstrap +++ b/install/usr/share/swarmlab.io/sec/sec_bootstrap @@ -46,26 +46,28 @@ case $ROLE in # Auto update default host file in background and dumb all output auto_update_hosts "${HOSTNAMES}" > /dev/null 2>&1 & + tail -f /dev/null + # Start ssh server - /usr/sbin/sshd -D + #/usr/sbin/sshd -D ;; "workerservice") # Start ssh server in background - /usr/sbin/sshd -D & + #/usr/sbin/sshd -D & # Keep trying to connect to master node and stay there indefinitely so that master node can see # the connected hosts that are ready for MPI work - while sleep 1 - do + #while sleep 1 + #do # shellcheck disable=SC2086 - ssh -T -o "StrictHostKeyChecking no" \ - -i "${USER_HOME}/.ssh/id_rsa" \ - ${USER}@${MPI_MASTER_SERVICE_NAME} \ - "tail -f /dev/null" - done + # ssh -T -o "StrictHostKeyChecking no" \ + # -i "${USER_HOME}/.ssh/id_rsa" \ + # ${USER}@${MPI_MASTER_SERVICE_NAME} \ + tail -f /dev/null + #done ;; *) echo 'role argument only accepts "masterservice" or "workerservice"' diff --git a/install/usr/share/swarmlab.io/sec/swarmlab-sec b/install/usr/share/swarmlab.io/sec/swarmlab-sec index 4fea48d..1870742 100755 --- a/install/usr/share/swarmlab.io/sec/swarmlab-sec +++ b/install/usr/share/swarmlab.io/sec/swarmlab-sec @@ -465,9 +465,17 @@ up_master () printf "\\n%s\\n" "$HEADER" echo "$ docker-compose up -d masterservice" printf "\\n" - docker-compose rm -f - docker-compose up --build -d masterservice + # docker-compose rm -f + # docker-compose up --build -d masterservice #docker-compose up --force-recreate -d masterservice + docker-compose rm -f -s -v + docker pull $IMAGE_NAME + docker-compose up --build --remove-orphans -d masterservice << ANSWERS +yes +yes +yes +ANSWERS + } @@ -646,7 +654,7 @@ if [ $COMMAND_UP -eq 1 ]; then generate_ssh_keys build_and_push_image # remove for microservices up_master - up_workers + #up_workers prompt_ready show_instruction @@ -667,7 +675,7 @@ elif [ $COMMAND_SCALE -eq 1 ]; then down_master down_workers up_master - up_workers + #up_workers prompt_ready show_instruction @@ -678,7 +686,7 @@ elif [ $COMMAND_RELOAD -eq 1 ]; then down_workers build_and_push_image up_master - up_workers + #up_workers prompt_ready show_instruction