Sign inSign up

nemosupremo/faustian

By nemosupremo

Updated about 7 years ago

Image
0

1.0K

nemosupremo/faustian repository overview

Faustian

Faustian is an Apache Mesos framework for launching and managing Faust workers. This service was envisioned to provide a tighter integration between Mesos, Faust, monitoring and our cloud infrastructure.

Considerations

The functionality currently provided by this framework may be better achieved by using Marathon + Pods and moving the autoscaling & monitoring portions to a separate service. However, we continued developing this framework as Marathon does not yet support multiple Mesos roles, which mean we would have to run another marathon cluster as we wanted to keep our data processing and our general purpose Mesos resources separate.

Configuration

Faustian can be configure from the command line or using environment variables.

CLI FlagEnvironment VariableDefaultDescription
--listen-addrLISTEN_ADDR:1424The listen address for the Faustian HTTP API.
--hostnameHOSTNAMEOS HostnameThe hostname that Faustian will use to advertise itself.
--mesos-masterMESOS_MASTERn/aEither a comma seperated list of hostnames leading to the mesos master, or Zookeeper URI to discover the mesos masters from zookeeper.
--mesos-userMESOS_USERrootThe OS User that the Mesos Executor will use to launch tasks.
--zookeeperZOOKEEPERn/aA Zookeeper URI specifiying the hosts and path of the zookeeper cluster to store our configuration data.
--rolesROLES*A list of mesos roles that this framework should receive offers from.
--autoscaling-providerAUTOSCALING_PROVIDERn/aThe cloud service this framework should use for autoscaling. Only aws is supported.
--autoscaling-default-roleAUTOSCALING_DEFAULT_ROLEn/aIf a pipeline does not specify a role, for the purpose of autoscaling, it will be assumed the pipeline is under this role.
--vault-addrVAULT_ADDRn/aVault address
--vault-tokenVAULT_TOKENn/aVault token
--gatekeeper-addrGATEKEEPER_ADDRn/aGatekeeper address
--aws-access-key-idAWS_ACCESS_KEY_IDn/aAWS Access Key ID for authentication to AWS services.
--aws-secret-access-keyAWS_SECRET_ACCESS_KEYn/aAWS Secret Key for authentication to AWS services.
--aws-asg-mapAWS_ASG_MAPn/aA list of key/value pairs (seperated by :) of mesos roles to autoscaling group names. Faustian will use this map to ensure each role has appropriate resources in AWS.

Pipeline Definition

Faustian treats your consumer group of worker processes as a pipeline. Each worker in a pipeline is expected to be a docker image with an ENTRYPOINT directly into the faust worker. This means your dockerfile must have an ENTRYPOINT of either ENTRYPOINT ["faust", "-A", "application"] or if your python application calls app.main() ENTRYPOINT ["python", "app.py"]

{
  "id": "string", // must be unique per pipeline
  "container": {
    "image": "string", // Docker image if your faust worker
    "network": "HOST" // Networking type. Either HOST or BRIDGE. If using BRIDGE, Faustian uses the `mesos-bridge` network
  },
  "environment": {
  }, // environment variables applied to all processes
  "processes": { // Faustian uses TASK_GROUPS (aka pods in marathon) to run a group of workers at the same time. This is useful if you want to run multiple agents in different processes.
    "parse": {
      "id": "parse", // id for this worker, must match the key name
      "arguments": ["worker", "-l", "info"], // command line arguments for this worker
      "environment": {
      }, // environment variables for just this work
      "resources": {
        "cpu": 0.29,
        "mem": 512
      }, // resources for this task
      "port_mappings": [{
        "host_port": 0,
        "container_port": 6066,
        "protocol": "tcp"
      }], // Port mappings, like in Marathon. This only applies when the network mode is BRIDGE.
      "kill_grace_period": 30 // kill grace period, this is how long we will wait for the application to quit before sending a KILL
    }
  },
  "executor_resources": {
    "cpu": 0.01,
    "mem": 32,
    "disk": 1
  }, // executor resourcess
  "instances": 5 // number of worker instances
}

HTTP API

POST /pipelines

Create a new pipeline. Returns a 204 on success.

PATCH /pipelines/{pipeline-id}

Update a pipeline. If only the number of instances are changed, then new workers will be added/removed. If anything else changes all the old workers are killed and relaunched.

License

MIT

Tag summary

Content type

Image

Digest

Size

8 MB

Last updated

over 7 years ago

docker pull nemosupremo/faustian