titus-control-plane

Titus is the Netflix Container Management Platform that manages containers and provides integrations to the infrastructure ecosystem.

  • 所有者: Netflix/titus-control-plane
  • 平台:
  • 許可證: Apache License 2.0
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

Titus Control Plane

Build Status
Apache 2.0

Overview

Titus is the Netflix Container Management Platform that manages containers and provides integrations to the infrastructure
ecosystem. This repository contains the control plane components which are responsible for accepting job requests and
scheduling containers on agents.

Documentation & Getting Started

netflix.github.io/titus

Building and Testing

For reference, check some of the scripts commonly used by committers in the scripts/dev/ folder.

Building

./gradlew build

Run Tests

./gradlew test

Run All Tests (including integration)

./gradlew testAll

Extensions

There are several extensions in the titus-ext folder for integrations with various systems. In order to use
these extensions, a wrapper project that reconfigures the guice bindings is needed. A tutorial project for binding
the different implementations is coming soon.

Local testing with docker-compose

docker-compose together with docker-engine
can be used to stand up a local cluster with all components necessary to run titus containers. Each component
(titus-master, titus-gateway, mesos-master, zookeeper, titus-agent) will run as a separate docker container, and Titus
containers will be launched as nested containers (docker-in-docker) inside the agent container.

The last versions known to work:

  • docker-engine 18.06.0-ce
  • docker-compose 1.22.0

To build and launch all components:

docker-compose build
docker-compose up -d

Ports 7001 (http) and 7104 (grpc) from titus-gateway will be exposed locally:

curl localhost:7001/api/v2/status
curl localhost:7001/api/v2/leader

Logs can be inspected with docker-compose logs. For agent logs, journald can be
used in a shell inside the agent container:

docker-compose exec agent bash
(agent) $ journalctl

# Note: some warnings and errors are to be expected on those logs
# Not all systemd units will work when not on an EC2 VM

# list nested docker containers launched by Titus
(agent) $ docker ps

By default, all titus-agent containers will join a cluster named unknown-instanceGroup.
Before any tasks can be scheduled, that cluster needs to be activated. Note that
this is necessary every time the Titus master is restarted, since instanceGroup
state is not being persisted:

curl localhost:7001/api/v3/agent/instanceGroups/unknown-instanceGroup/lifecycle \
  -X PUT -H "Content-type: application/json" -d \
  '{"instanceGroupId": "unknown-instanceGroup", "lifecycleState": "Active"}'

If you get an error saying that unknown-instanceGroup does not exist, wait 10s and try again. Agents take some time to
get registered.

After that, jobs can be submitted normally. AWS integrations will not work in this mode:

curl localhost:7001/api/v3/jobs \
  -X POST -H "Content-type: application/json" -d \
  '{
    "applicationName": "localtest",
    "owner": {"teamEmail": "me@me.com"},
    "container": {
      "image": {"name": "alpine", "tag": "latest"},
      "entryPoint": ["/bin/sleep", "1h"],
      "securityProfile": {"iamRole": "test-role", "securityGroups": ["sg-test"]}
    },
    "batch": {
      "size": 1,
      "runtimeLimitSec": "3600",
      "retryPolicy":{"delayed": {"delayMs": "1000", "retries": 3}}
    }
  }'

The status of the new job, and its task (container) can be queried with:

curl localhost:7001/api/v3/jobs
curl localhost:7001/api/v3/tasks

# to delete a task or a job:
curl localhost:7001/api/v3/jobs/:id -X DELETE
curl localhost:7001/api/v3/tasks/:id -X DELETE

Components can also be built and deployed individually. E.g.:

# build and deploy an agent
docker-compose build agent
docker-compose up -d agent

# build and deploy titus-master
docker-compose build master
docker-compose up -d master

To add more agents to the cluster:

docker-compose up -d --scale agent=2

Note that it can take ~10s for a new titus-agent to be detected and registered with the default configuration.

After you are done:

# tear everything down
docker-compose down

# or only stop titus-master
docker-compose stop master

LICENSE

Copyright (c) 2018 Netflix, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

主要指標

概覽
名稱與所有者Netflix/titus-control-plane
主編程語言Java
編程語言Shell (語言數: 4)
平台
許可證Apache License 2.0
所有者活动
創建於2017-10-17 22:20:55
推送於2022-05-13 17:14:05
最后一次提交2022-05-13 10:13:51
發布數552
最新版本名稱v0.1.1-rc.522 (發布於 )
第一版名稱v0.0.1-rc.17 (發布於 )
用户参与
星數316
關注者數313
派生數67
提交數1.7k
已啟用問題?
問題數11
打開的問題數0
拉請求數1225
打開的拉請求數0
關閉的拉請求數42
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?