Skip to content
Titus Executor is the Mesos Executor implementation for Titus
Branch: master
Clone or download
sargun Merge pull request #281 from Netflix/add-hedging
Add hedging to AWS requests
Latest commit 4128a19 Jul 16, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.buildkite Continue parts of upgrading to go1.12 (tooling) Apr 25, 2019
.circleci Set the ingress queue count on the IFB device correctly Jun 19, 2019
api/netflix/titus IP Service Jun 8, 2019
cache Cache Describe VPC calls Apr 30, 2019
cmd Address PR comments Jul 16, 2019
config add information about the docker image to ENV Jun 26, 2019
ec2util Add API Protect Mar 12, 2019
executor Merge pull request #272 from Netflix/rename-darion Jul 5, 2019
filelogger Linting fixes to work with latest gometalinter version (and associate… Sep 26, 2018
filesystems Disable LogRotate test on Circle CI May 2, 2019
fslocker Fix doc error on fslocker May 31, 2018
hack IP Service Jun 8, 2019
inject Fix spelling mistake Feb 18, 2019
logger IP Service Jun 8, 2019
logsutil Remove Logging to Journald only under systemd May 7, 2019
logviewer Rename darion: fix up references in code Jul 3, 2019
metadataserver Metadata service: refresh Metatron certs every 5 minutes Jun 27, 2019
models Initial commit Oct 26, 2017
mount Make titus mount use new patchset Oct 16, 2018
nvidia System services should use the new runc path for newer container release Jul 4, 2019
properties Fxi handling of certain types of properties Jul 29, 2018
reaper Upgrade deps to go mod friendly versions Apr 22, 2019
root Merge pull request #272 from Netflix/rename-darion Jul 5, 2019
tag Do not rely on the existence of special environment variables Nov 3, 2017
test/docker-containers/_servicelog Initial commit Oct 26, 2017
tini @ ac32c23 Bump tini to most recent version Jun 6, 2018
tools Continue parts of upgrading to go1.12 (tooling) Apr 25, 2019
uploader Use gometalinter 2.0.11 binary release, lint changes for that version Sep 26, 2018
vendor Further improvements arround stability Jun 26, 2019
vk/backend Address PR comments Jul 16, 2019
vpc Add comment explaining the hedger Jul 16, 2019
.codecov.yml Add .codecov.yml May 1, 2018
.dockerignore Initial commit Oct 26, 2017
.gitignore Rename darion: fix up references in code Jul 3, 2019
.gitmodules Initial commit Oct 26, 2017
.golangci.yml Setup tracing and metrics for titus-vpc-service Jun 19, 2019
CHANGELOG.md Release 20180516.3 Jun 21, 2018
CONTRIBUTING.md add license and contributing files Apr 18, 2018
LICENSE add license and contributing files Apr 18, 2018
Makefile System services should use the new runc path for newer container release Jul 4, 2019
OSSMETADATA Add oss metadata Oct 31, 2017
PULL_REQUEST_TEMPLATE.md initial (very simple) PR template Jun 11, 2018
README.md Add instructions for running tests serially; fix test segfault Jun 6, 2019
dependencies.lock Add agent protobuf with disable launchguard Jan 22, 2018
go.mod Add entry point for running titus-executor from the VK Jul 15, 2019
go.sum Add entry point for running titus-executor from the VK Jul 15, 2019

README.md

Mesos executor for Titus

Currently runs titus containers using Docker.

Building

Prerequisites

You must have Docker 1.13+ installed on your system, and it must be running. The steps to install it can be found on the docker website. Once it is installed, you may have to run the following command, prior to logging out and back in again:

gpasswd -a $YOURUSER docker # Fill in $YOURUSER with your user name

You must have a Go 1.12 development environment set up. You can find more details on installing Go, on their website. You must also install the build-essential metapackage on Linux.

We recommend setting up a GOPATH, and checking out your code into that GOPATH. For example:

mkdir -p ${HOME}/go
## You add these lines to your .bashrc
export GOPATH=${HOME}/go
export PATH=${GOPATH}/bin:${PATH}
##

And then you can check out github.com/Netflix/titus-executor to ${GOPATH}/src/github.com/Netflix/titus-executor -- an easy way to do this is go run go get -u github.com/Netflix/titus-executor.

Initial setup steps

Ensure that your build environment (i.e. VM) has the following commands prior to building:

  • make
  • gcc

Building and testing

In order to build titus-executor, check out the project into your $GOPATH/src/github.com/Netflix, and run the following command:

sudo -E PATH=${PATH} make builder all

This will output a debian file at the path, which you can then install on your system: ./build/distributions/titus-executor_latest.deb

To only build the .deb, and not rebuild the builder image:

sudo -E PATH=${PATH} make build

Building without Docker

If you want to build a dpkg, without Docker, once the code is checked out, you can run the following:

make build-standalone

Linting

Linting is done via the golangci-lint package, which runs various linters.

To run lint checks:

# Lint all files:
make lint
# Run lint checks inside a docker container:
make validate-docker

Testing

Local Testing

You should be able to run "local" testing on your system. These are going to be tests that are primarily unit tests, and test for logical correctness, and not for correctness of interaction with system daemons:

make test-local

Tests will run locally, according to whatever platform you're on.

Standalone tests in a Docker container

Requires docker:

make test-standalone

# Disable running tests in parallel and change the test timeout (useful on slower systems):
TEST_FLAGS="-v -parallel 1" TEST_TIMEOUT=10m make test-standalone
# If you're iterating on tests and don't want to build a new executor .deb every time:
./hack/tests-with-dind.sh

Tests will run inside a Docker container and run a dedicated docker daemon as docker-in-docker.

AWS specific features (VPC integration, metadata service proxy, GPU, EFS, ...) are disabled during these tests.

Generated Code

There are places inside of the executor where we've checked in binaries, or prebuilt pieces of code. This may be considered harmful by some, but from the perspective of pragmatism, we have such code in:

In order to generate code you need go-bindata, which you can get via:

go get -u github.com/jteeuwen/go-bindata/...

vpc/bpf

There are two pieces of generated code:

  • vpc/bpf/filter.o: This is compiled from vpc/bpf/filter.c. We ship this precompiled because it changes infrequently, and it requires LLVM, and the full kernel headers
  • vpc/bpf/filter/filter.go: This is a go package generated using go-bindata based upon vpc/bpf/filter.o

In order to regenerate this data, if you edit vpc/bpf/filter.c, you can do so by running:

make -C vpc/bpf/

api/netflix/titus

If you update the dependency github.com/Netflix/titus-api-definitions/src/main/proto/netflix/titus, you will need to regenerate the Go proto definitions.

You must first install the protobuf toolchain, and the Go protobuf compiler. More documentation on that can be found in the protobuf repo.

Once you update, and sync the dependency, just run the following:

make clean-proto-defs protogen

Running

nvidia GPUs

To use with nvidia devices, you must have an OCI runtime installed that supports running OCI prestart hooks, so that the nvidia-container-runtime-hook can be run before container start. You'll need to add a container runtime as per the dockerd documentation. The executor looks for a runtime named oci-add-hooks by default, but the runtime can be configured via the titus.executor.nvidiaOciRuntime config option. You can use the nvidia-docker runtime, or the oci-add-hooks runtime if you're not comfortable running a patched version of runc.

LICENSE

Copyright (c) 2019 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.

You can’t perform that action at this time.