[GitHub] GJL commented on a change in pull request #6496: [FLINK-10063][tests] Use runit to supervise mesos processes.

2018-08-08 Thread GitBox
GJL commented on a change in pull request #6496: [FLINK-10063][tests] Use runit 
to supervise mesos processes.
URL: https://github.com/apache/flink/pull/6496#discussion_r208608118
 
 

 ##
 File path: flink-jepsen/docker/Dockerfile-db
 ##
 @@ -35,5 +35,12 @@ RUN mkdir -p /root/.ssh/ && \
 chmod 600 /root/.ssh/authorized_keys && \
 cat /root/id_rsa.pub >> /root/.ssh/authorized_keys
 
+COPY sshd-run /etc/sv/service/sshd/run
+RUN chmod +x /etc/sv/service/sshd/run && \
+ln -sf /etc/sv/service/sshd /etc/service
+
 EXPOSE 22
-CMD exec /usr/sbin/sshd -D
+
+# Start runit process supervisor which will bring up sshd.
+# In our tests we can use runit to supervise more processes, e.g., Mesos.
+CMD runsvdir -P /etc/service /dev/null > /dev/null
 
 Review comment:
   Yes is needed. It only redirects std err:
   
   >>> If the log argument is given to runsvdir, all output to standard error 
is redirected to this log


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] GJL commented on a change in pull request #6496: [FLINK-10063][tests] Use runit to supervise mesos processes.

2018-08-08 Thread GitBox
GJL commented on a change in pull request #6496: [FLINK-10063][tests] Use runit 
to supervise mesos processes.
URL: https://github.com/apache/flink/pull/6496#discussion_r208608118
 
 

 ##
 File path: flink-jepsen/docker/Dockerfile-db
 ##
 @@ -35,5 +35,12 @@ RUN mkdir -p /root/.ssh/ && \
 chmod 600 /root/.ssh/authorized_keys && \
 cat /root/id_rsa.pub >> /root/.ssh/authorized_keys
 
+COPY sshd-run /etc/sv/service/sshd/run
+RUN chmod +x /etc/sv/service/sshd/run && \
+ln -sf /etc/sv/service/sshd /etc/service
+
 EXPOSE 22
-CMD exec /usr/sbin/sshd -D
+
+# Start runit process supervisor which will bring up sshd.
+# In our tests we can use runit to supervise more processes, e.g., Mesos.
+CMD runsvdir -P /etc/service /dev/null > /dev/null
 
 Review comment:
   Yes is needed. It only redirects std err:
   
   > If the log argument is given to runsvdir, all output to standard error is 
redirected to this log


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] GJL commented on a change in pull request #6496: [FLINK-10063][tests] Use runit to supervise mesos processes.

2018-08-08 Thread GitBox
GJL commented on a change in pull request #6496: [FLINK-10063][tests] Use runit 
to supervise mesos processes.
URL: https://github.com/apache/flink/pull/6496#discussion_r208471471
 
 

 ##
 File path: flink-jepsen/src/jepsen/flink/mesos.clj
 ##
 @@ -24,11 +24,35 @@
 [jepsen.os.debian :as debian]
 [jepsen.flink.zookeeper :refer [zookeeper-uri]]))
 
+;;; runit process supervisor (http://smarden.org/runit/)
+;;;
+;;; We use runit to supervise Mesos processes because Mesos uses a "fail-fast" 
approach to
+;;; error handling, e.g., the Mesos master will exit when it discovers it has 
been partitioned away
+;;; from the Zookeeper quorum.
+
+(def runit-version "2.1.2-3")
+
+(defn create-supervised-service!
+  "Registers a service with the process supervisor and starts it."
+  [service-name cmd]
+  (let [service-dir (str "/etc/sv/" service-name)
+run-script (str service-dir "/run")]
+(c/su
+  (c/exec :mkdir :-p service-dir)
+  (c/exec :echo (clojure.string/join "\n" ["#!/bin/sh" cmd]) :> run-script)
 
 Review comment:
   I'll fix this.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services