go-mesos-executor icon indicating copy to clipboard operation
go-mesos-executor copied to clipboard

Need example

Open brat002 opened this issue 8 years ago • 2 comments

Thank you much for such interesting project. Could you share simple guide how to attach your executor to Mesos agent? I've use next config:

debug: true # Enable debug mode (more logs)
agent_endpoint: xx11-x1-38-15.xx.xxx.xx:5051
hooks: # Enabled hooks
#  - acl
  - removeContainer
#  - insertIptables
#  - removeIptables
proc_path: /proc # Mount path of host proc folder
iptables:
  container_bridge_interface: docker0 # Brigde interface for container network
acl:
  default_allowed_cidr: # Set of default IP (with CIDR) to allow
    - 172.17.0.1/32 # You should add host IP here for framework-based health checks

Debug output

./go-mesos-executor --debug --docker_socket /var/run/docker.sock
{"level":"info","ts":1506511341.5039887,"caller":"go-mesos-executor/main.go:36","msg":"Initializing the executor","executorID":"","frameworkID":""}
{"level":"info","ts":1506511341.5041852,"caller":"go-mesos-executor/main.go:51","msg":"Creating hook manager","hooks":["removeContainer"]}
{"level":"debug","ts":1506511341.5042639,"caller":"hook/hook_manager.go:91","msg":"Disabling acl post-run hook"}
{"level":"debug","ts":1506511341.5043116,"caller":"hook/hook_manager.go:91","msg":"Disabling insertIptables post-run hook"}
{"level":"debug","ts":1506511341.504338,"caller":"hook/hook_manager.go:91","msg":"Disabling removeIptables pre-stop hook"}
{"level":"fatal","ts":1506511341.5157998,"caller":"go-mesos-executor/main.go:67","msg":"An error occured while running the executor","error":"malformed request"}

brat002 avatar Sep 27 '17 11:09 brat002

Thank you so much for this comment.

I'll add a guide to the README. Actually (when using docker-compose), executor binary is mounted at the same place as the default mesos docker executor (/usr/libexec/mesos/mesos-docker-executor), replacing it. So, it will use this binary instead of the default one in order to launch the task (and mesos doesn't know that it's using a custom executor).

Frameworks can specify a custom executor path to the mesos master (and then to the mesos agent) in case you'd like to keep both.

Please tell me if this helps or if you want more information.

Devatoria avatar Sep 27 '17 11:09 Devatoria

Thanks. I want to use go-executor as secondary executor in cluster. Just need bit more info about how to attach it to running mesos-agent. Seems I should define special executor_id value or something similar.

Also looks like we have a bug here

--- a/main.go
+++ b/main.go
@@ -102,6 +102,11 @@ func readConfig() {
        viper.SetConfigName("config")
        viper.AddConfigPath("/etc/mesos-executor")
        viper.AddConfigPath(".")
+       if err := viper.ReadInConfig(); err != nil {
+               logger.GetInstance().Fatal("An error occured while reading the configuration file",
+                       zap.Error(err),
+               )
+       }

        viper.BindEnv("agent_endpoint")
        agentEndpoint = viper.GetString("agent_endpoint")
@@ -112,11 +117,6 @@ func readConfig() {
        viper.BindEnv("framework_id")
        frameworkID = viper.GetString("framework_id")

-       if err := viper.ReadInConfig(); err != nil {
-               logger.GetInstance().Fatal("An error occured while reading the configuration file",
-                       zap.Error(err),
-               )
-       }
 }

brat002 avatar Sep 27 '17 13:09 brat002