Skip to content
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

issue/99/dev-mesos-version: Update Meson Dev Mesos to a newer version #100

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 21 additions & 21 deletions dev-resources/src/meson/ops/mesos.clj
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
(ns meson.ops.mesos
(:require [clojure.pprint :refer [pprint]]
[meson.config :as config]
(:require [meson.config :as config]
[meson.util.shell :as util]
[taoensso.timbre :as log]
[trifl.docs :as docs]))
Expand All @@ -18,19 +17,20 @@
[]
(log/info "Starting local docker cluster ...")
(log/debugf "Using image '%s'" config/docker-image-name)
(util/shellf-silent "rm -f %s" config/docker-container-id-file)
(util/shellf-silent "rm -f %s" config/docker-container-name)
(util/shellf "docker pull %s" config/docker-image-name)
(util/shellf-silent "docker run -d --cidfile %s --publish %s %s"
config/docker-container-id-file
config/docker-port-mappings
(util/shellf-silent "docker run --detach --privileged --publish %s --publish %s --name %s %s"
config/docker-mesos-ports
config/docker-marathon-ports
config/docker-container-name
config/docker-image-name)
(log/info "Done."))

(defn stop-local-docker
""
[]
(log/info "Stoping local docker cluster ...")
(let [id (util/shellf-silent "cat %s" config/docker-container-id-file)]
(let [id config/docker-container-name]
(util/shellf-silent "docker stop %s" id))
(log/info "Done."))

Expand All @@ -45,11 +45,11 @@
[]
(log/warn "Note that clojure.java.shell doesn't directly support TTY"
"connections.")
(let [id (util/shellf-silent "cat %s" config/docker-container-id-file)]
(let [id config/docker-container-name]
(log/info
(format (str "To connect to the running docker container, execute the "
"following:\n\n docker exec -it %s bash\n")
id))))
(format (str "To connect to the running docker container, execute the "
"following:\n\n docker exec -it %s bash\n")
id))))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Dispatch Functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Expand Down Expand Up @@ -100,14 +100,14 @@
connect Get command to connect to running Docker container
```"
([]
(docs/print-docstring #'run))
(docs/print-docstring #'run))
([[subcmd & args]]
(log/trace "Got subcmd:" subcmd)
(log/trace "Got args:" args)
(case (keyword subcmd)
nil (docs/print-docstring #'run)
:start (start)
:stop (stop)
:restart (restart)
:connect (connect)
:help (docs/print-docstring #'run))))
(log/trace "Got subcmd:" subcmd)
(log/trace "Got args:" args)
(case (keyword subcmd)
nil (docs/print-docstring #'run)
:start (start)
:stop (stop)
:restart (restart)
:connect (connect)
:help (docs/print-docstring #'run))))
7 changes: 4 additions & 3 deletions project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@
:cluster-deployment :local
:cluster-type :docker
:docker {
:container-id-file "/tmp/meson-mesos-container-id"
:image-name "clojusc/mesos:1.0.1"
:container-name "meson-mesos"
:image-name "mesos/mesos-mini:1.9.x"
:master "localhost:5050"
:agent "localhost:5051"
:port-mappings "5050-5051:5050-5051"}}}
:mesos-ports "5050-5051:5050-5051"
:marathon-ports "8080:8080"}}}
:profiles {
:uberjar {
:aot :all}
Expand Down
9 changes: 5 additions & 4 deletions src/meson/config.clj
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
(ns meson.config
(:require [leiningen.core.project :as project]
[taoensso.timbre :as log])
(:require [leiningen.core.project :as project])
(:refer-clojure :exclude [name]))

(def all (project/read))
Expand All @@ -23,11 +22,13 @@

(def docker (:docker mesos))

(def docker-container-id-file (:container-id-file docker))
(def docker-container-name (:container-name docker))

(def docker-image-name (:image-name docker))

(def docker-port-mappings (:port-mappings docker))
(def docker-mesos-ports (:mesos-ports docker))

(def docker-marathon-ports (:marathon-ports docker))

(def docker-agent (:agent docker))

Expand Down