├── .dockerignore ├── .flake8 ├── .gitignore ├── .pre-commit-config.yaml ├── .pylintrc ├── CONTRIBUTING.md ├── Dockerfile ├── Dockerfile.base ├── Jenkinsfile.dcos-commons ├── Jenkinsfile.dcos-commons-base_ ├── LICENSE ├── README.md ├── TESTING.md ├── UPDATING-FRAMEWORKS.md ├── __init__.py ├── build.gradle ├── build.sh ├── changelog.md ├── cli ├── README.md ├── client │ ├── cosmos.go │ ├── cosmos_test.go │ ├── dcoscli.go │ ├── dcoscli_test.go │ ├── http.go │ ├── print.go │ ├── response.go │ └── testdata │ │ ├── cliconfig │ │ ├── both │ │ │ ├── clusters │ │ │ │ ├── 12345678-1234-1234-1234-123456789012 │ │ │ │ │ ├── dcos.toml │ │ │ │ │ └── subcommands │ │ │ │ │ │ └── .empty_dir │ │ │ │ └── e266cd62-5b75-4b17-87a6-7b29d8ec0df4 │ │ │ │ │ ├── attached │ │ │ │ │ ├── dcos.toml │ │ │ │ │ └── subcommands │ │ │ │ │ └── .empty_dir │ │ │ └── dcos.toml │ │ ├── new │ │ │ └── clusters │ │ │ │ ├── 12345678-1234-1234-1234-123456789012 │ │ │ │ ├── dcos.toml │ │ │ │ └── subcommands │ │ │ │ │ └── .empty_dir │ │ │ │ └── e266cd62-5b75-4b17-87a6-7b29d8ec0df4 │ │ │ │ ├── attached │ │ │ │ ├── dcos.toml │ │ │ │ └── subcommands │ │ │ │ └── .empty_dir │ │ ├── old │ │ │ └── dcos.toml │ │ └── two-attached │ │ │ └── clusters │ │ │ ├── 12345678-1234-1234-1234-123456789012 │ │ │ ├── attached │ │ │ ├── dcos.toml │ │ │ └── subcommands │ │ │ │ └── .empty_dir │ │ │ └── e266cd62-5b75-4b17-87a6-7b29d8ec0df4 │ │ │ ├── attached │ │ │ ├── dcos.toml │ │ │ └── subcommands │ │ │ └── .empty_dir │ │ └── responses │ │ └── cosmos │ │ └── 1.10 │ │ └── enterprise │ │ ├── bad-app-id.json │ │ ├── bad-json.json │ │ ├── bad-name.json │ │ ├── bad-version-no-versions.json │ │ ├── bad-version.json │ │ ├── generic-error.json │ │ └── marathon-error.json ├── commands.go ├── commands │ ├── config.go │ ├── debug.go │ ├── endpoints.go │ ├── plan.go │ ├── pod.go │ ├── state.go │ └── update.go ├── config │ └── config.go └── queries │ ├── config.go │ ├── endpoints.go │ ├── package.go │ ├── package_test.go │ ├── plan.go │ ├── plan_test.go │ ├── pod.go │ ├── pod_test.go │ ├── state.go │ └── testdata │ ├── input │ ├── config.json │ ├── empty.json │ └── malformed.json │ ├── requests │ ├── update-configuration-replace.json │ ├── update-configuration.json │ ├── update-package-version.json │ └── update.json │ └── responses │ ├── cosmos │ └── 1.10 │ │ ├── enterprise │ │ ├── describe-no-package-versions.json │ │ ├── describe.json │ │ └── update.json │ │ └── open │ │ └── describe.json │ └── scheduler │ ├── already-reported.txt │ ├── continue.json │ ├── force-complete.json │ ├── interrupt.json │ ├── not-found.txt │ ├── plan-status.json │ ├── plans-no-update.json │ ├── plans.json │ └── restart.json ├── conftest.py ├── dep-snapshots └── dcos ├── dind-wrapper.sh ├── docs ├── .gitignore ├── README.md ├── generate.sh ├── pages │ ├── _config.yml │ ├── _layouts │ │ ├── layout.html │ │ └── redirect.html │ ├── developer-guide.md │ ├── faq.md │ ├── glossary.md │ ├── img │ │ ├── data-store-tutorial-architecture.png │ │ ├── dev-guide-configuration-values-across-files.png │ │ ├── dev-guide-deployment-steps.png │ │ ├── dev-guide-plans-and-the-offer-cycle.png │ │ ├── dev-guide-plans-vs-services.png │ │ ├── multi-service-multi.png │ │ └── multi-service-single.png │ ├── index.md │ ├── multi-service.md │ ├── operations-guide.md │ ├── plans.md │ ├── style │ │ ├── Dropdown.css │ │ ├── Dropdown.js │ │ ├── layout.css │ │ └── yaml-reference.css │ ├── tutorials │ │ └── secrets-tutorial.md │ └── yaml-reference.md └── reference │ └── swagger-api │ ├── swagger-config.json │ └── swagger-spec.yaml ├── frameworks ├── cassandra │ ├── .gitignore │ ├── README.md │ ├── build-openssl.sh │ ├── build-python.sh │ ├── build.gradle │ ├── build.sh │ ├── lib │ │ ├── metrics-statsd-common-4.1.2-SNAPSHOT.jar │ │ ├── metrics3-statsd-4.1.2-SNAPSHOT.jar │ │ ├── reporter-config-base-3.0.3.jar │ │ └── reporter-config3-3.0.3.jar │ ├── modify-cassandra-distribution.sh │ ├── src │ │ ├── main │ │ │ ├── dist │ │ │ │ ├── cassandra-rackdc.properties │ │ │ │ ├── cassandra.yaml │ │ │ │ ├── cqlshrc │ │ │ │ ├── jmx-ssl-setup.sh │ │ │ │ ├── jvm_CMS.options │ │ │ │ ├── jvm_G1.options │ │ │ │ ├── metrics-reporter-config.yaml │ │ │ │ └── svc.yml │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── mesosphere │ │ │ │ │ └── sdk │ │ │ │ │ └── cassandra │ │ │ │ │ ├── api │ │ │ │ │ ├── Seeds.java │ │ │ │ │ └── SeedsResource.java │ │ │ │ │ └── scheduler │ │ │ │ │ ├── CassandraRecoveryPlanOverrider.java │ │ │ │ │ ├── CassandraRecoveryPlanOverriderFactory.java │ │ │ │ │ ├── CassandraSeedUtils.java │ │ │ │ │ ├── CassandraZoneValidator.java │ │ │ │ │ └── Main.java │ │ │ └── resources │ │ │ │ ├── cassandra-rackdc.properties │ │ │ │ ├── cassandra.yaml │ │ │ │ ├── jvm_CMS.options │ │ │ │ ├── jvm_G1.options │ │ │ │ └── svc.yml │ │ └── test │ │ │ ├── java │ │ │ └── com │ │ │ │ └── mesosphere │ │ │ │ └── sdk │ │ │ │ └── cassandra │ │ │ │ └── scheduler │ │ │ │ ├── CassandraRecoveryPlanOverriderTest.java │ │ │ │ └── ServiceTest.java │ │ │ └── resources │ │ │ └── mockito-extensions │ │ │ └── org.mockito.plugins.MockMaker │ ├── tests │ │ ├── __init__.py │ │ ├── config.py │ │ ├── conftest.py │ │ ├── nodetool.py │ │ ├── test_auth.py │ │ ├── test_backup_and_restore.py │ │ ├── test_custom_domain.py │ │ ├── test_external_volumes.py │ │ ├── test_jmx.py │ │ ├── test_nodetool.py │ │ ├── test_overlay.py │ │ ├── test_racks.py │ │ ├── test_sanity.py │ │ ├── test_tls.py │ │ ├── test_toggle_tls.py │ │ └── test_zzzrecovery.py │ └── universe │ │ ├── config.json │ │ ├── marathon.json.mustache │ │ ├── package.json │ │ └── resource.json ├── hdfs │ ├── README.md │ ├── build.gradle │ ├── build.sh │ ├── cli │ │ ├── build.sh │ │ ├── main.go │ │ ├── main_test.go │ │ └── vendor │ ├── keytab-fix │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── mesosphere │ │ │ └── keytabfix │ │ │ ├── KerberosUtil.java │ │ │ ├── Keytab.java │ │ │ ├── KeytabEntry.java │ │ │ ├── KeytabFix.java │ │ │ ├── KeytabInputStream.java │ │ │ ├── KeytabOutputStream.java │ │ │ ├── KrbInputStream.java │ │ │ └── KrbKeytab.java │ ├── src │ │ ├── main │ │ │ ├── dist │ │ │ │ ├── core-site.xml │ │ │ │ ├── data-hadoop-metrics2.properties │ │ │ │ ├── hdfs-site.xml │ │ │ │ ├── journal-hadoop-metrics2.properties │ │ │ │ ├── krb5.conf │ │ │ │ ├── name-hadoop-metrics2.properties │ │ │ │ ├── ssl-client.xml │ │ │ │ ├── ssl-server.xml │ │ │ │ └── svc.yml │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── mesosphere │ │ │ │ │ └── sdk │ │ │ │ │ └── hdfs │ │ │ │ │ └── scheduler │ │ │ │ │ ├── HDFSAuthEnvContainer.java │ │ │ │ │ ├── HDFSUserAuthMapperBuilder.java │ │ │ │ │ ├── HDFSZoneValidator.java │ │ │ │ │ ├── HdfsRecoveryPlanOverrider.java │ │ │ │ │ ├── HdfsRecoveryPlanOverriderFactory.java │ │ │ │ │ └── Main.java │ │ │ └── resources │ │ │ │ ├── core-site.xml │ │ │ │ ├── data-hadoop-metrics2.properties │ │ │ │ ├── hdfs-site.xml │ │ │ │ ├── journal-hadoop-metrics2.properties │ │ │ │ ├── name-hadoop-metrics2.properties │ │ │ │ └── svc.yml │ │ └── test │ │ │ ├── java │ │ │ └── com │ │ │ │ └── mesosphere │ │ │ │ └── sdk │ │ │ │ └── hdfs │ │ │ │ └── scheduler │ │ │ │ ├── HDFSUserAuthMapperBuilderTest.java │ │ │ │ └── ServiceTest.java │ │ │ └── resources │ │ │ └── mockito-extensions │ │ │ └── org.mockito.plugins.MockMaker │ ├── tests │ │ ├── __init__.py │ │ ├── auth.py │ │ ├── config.py │ │ ├── conftest.py │ │ ├── test_active_directory_auth.py │ │ ├── test_cli.py │ │ ├── test_default_kerberos_setup.py │ │ ├── test_hdfs_kerberos_upgrade.py │ │ ├── test_kerberos_auth.py │ │ ├── test_overlay.py │ │ ├── test_racks.py │ │ ├── test_sanity.py │ │ ├── test_ssl_kerberos_auth.py │ │ ├── test_ssl_kerberos_custom_domain_auth.py │ │ ├── test_tls.py │ │ └── test_upgrade.py │ ├── tools │ │ └── zone-resolver.sh │ └── universe │ │ ├── config.json │ │ ├── marathon.json.mustache │ │ ├── package.json │ │ └── resource.json └── helloworld │ ├── README.md │ ├── build.gradle │ ├── build.sh │ ├── src │ ├── main │ │ ├── dist │ │ │ ├── canary.yml │ │ │ ├── crash-loop.yml │ │ │ ├── custom_steps.yml │ │ │ ├── custom_tld.yml │ │ │ ├── discovery.yml │ │ │ ├── enable-disable.yml │ │ │ ├── executor_volume.yml │ │ │ ├── external-volumes.yml │ │ │ ├── finish_state.yml │ │ │ ├── foobar_service_name.yml │ │ │ ├── gpu_resource.yml │ │ │ ├── graceful-shutdown.yml │ │ │ ├── host-volume.yml │ │ │ ├── marathon_constraint.yml │ │ │ ├── multiport.yml │ │ │ ├── multistep_plan.yml │ │ │ ├── non_recoverable_state.yml │ │ │ ├── nonessential_tasks.yml │ │ │ ├── overlay.yml │ │ │ ├── pause.yml │ │ │ ├── plan.yml │ │ │ ├── pod-mount-volume.yml │ │ │ ├── pod-profile-mount-volume.yml │ │ │ ├── pre-reserved-sidecar.yml │ │ │ ├── pre-reserved.yml │ │ │ ├── profile-mount-volume.yml │ │ │ ├── resource_limits.yml │ │ │ ├── seccomp.yml │ │ │ ├── secrets.yml │ │ │ ├── share_pid_namespace.yml │ │ │ ├── shm.yml │ │ │ ├── sidecar.yml │ │ │ ├── simple.yml │ │ │ ├── svc.yml │ │ │ ├── taskcfg.yml │ │ │ ├── tls.yml │ │ │ ├── update_plan.yml │ │ │ ├── uri.yml │ │ │ └── web-url.yml │ │ └── java │ │ │ └── com │ │ │ └── mesosphere │ │ │ └── sdk │ │ │ └── helloworld │ │ │ └── scheduler │ │ │ ├── DecommissionCustomizer.java │ │ │ ├── ExampleMultiServiceResource.java │ │ │ ├── Main.java │ │ │ ├── ReversePhasesCustomizer.java │ │ │ └── Scenario.java │ └── test │ │ ├── java │ │ └── com │ │ │ └── mesosphere │ │ │ └── sdk │ │ │ └── helloworld │ │ │ └── scheduler │ │ │ ├── CustomStepsTest.java │ │ │ ├── SchedulerRestartServiceTest.java │ │ │ └── ServiceTest.java │ │ └── resources │ │ └── mockito-extensions │ │ └── org.mockito.plugins.MockMaker │ ├── tests │ ├── __init__.py │ ├── config.py │ ├── conftest.py │ ├── scale │ │ ├── test_scale.py │ │ └── threading_utils.py │ ├── test_backoff.py │ ├── test_canary_strategy.py │ ├── test_custom_plan.py │ ├── test_custom_service_tld.py │ ├── test_decommission.py │ ├── test_discovery.py │ ├── test_enable_disable.py │ ├── test_executor_volumes.py │ ├── test_external_volumes.py │ ├── test_fast_failure.py │ ├── test_goal_states.py │ ├── test_host_volumes.py │ ├── test_mono_to_multi_migrate.py │ ├── test_mount_volumes.py │ ├── test_multiple_ports.py │ ├── test_multiservice_dynamic.py │ ├── test_multistep_plan.py │ ├── test_nonessential_tasks.py │ ├── test_overlay.py │ ├── test_parallel_plans.py │ ├── test_placement.py │ ├── test_pre_reserved_sidecar.py │ ├── test_profile_mount_volumes.py │ ├── test_quota_deployment.py │ ├── test_quota_downgrade.py │ ├── test_quota_upgrade.py │ ├── test_region_awareness.py │ ├── test_resource_limits.py │ ├── test_resource_refinement.py │ ├── test_sanity.py │ ├── test_seccomp.py │ ├── test_secrets.py │ ├── test_share_pid_namespace.py │ ├── test_shm.py │ ├── test_sidecar.py │ ├── test_taskcfg.py │ ├── test_tls.py │ ├── test_uninstall.py │ ├── test_web_url.py │ ├── test_zzzrecovery.py │ └── tls │ │ └── keystore │ │ ├── README.md │ │ ├── build.gradle │ │ ├── config │ │ ├── integration-test.yml │ │ └── local.yml │ │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── mesosphere │ │ └── sdk │ │ └── testing │ │ └── tls │ │ └── keystore │ │ ├── KeystoreApplication.java │ │ ├── KeystoreConfiguration.java │ │ ├── api │ │ └── Saying.java │ │ ├── cli │ │ └── TLSTruststoreTestCommand.java │ │ ├── core │ │ └── Template.java │ │ └── resources │ │ └── HelloWorldResource.java │ └── universe │ ├── config.json │ ├── marathon.json.mustache │ ├── package.json │ └── resource.json ├── frozen_requirements.txt ├── govendor ├── README.md ├── github.com │ ├── BurntSushi │ │ └── toml │ │ │ ├── COMPATIBLE │ │ │ ├── COPYING │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── decode.go │ │ │ ├── decode_meta.go │ │ │ ├── doc.go │ │ │ ├── encode.go │ │ │ ├── encoding_types.go │ │ │ ├── encoding_types_1.1.go │ │ │ ├── lex.go │ │ │ ├── parse.go │ │ │ ├── session.vim │ │ │ ├── type_check.go │ │ │ └── type_fields.go │ ├── alecthomas │ │ ├── template │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── doc.go │ │ │ ├── exec.go │ │ │ ├── funcs.go │ │ │ ├── helper.go │ │ │ ├── parse │ │ │ │ ├── lex.go │ │ │ │ ├── node.go │ │ │ │ └── parse.go │ │ │ └── template.go │ │ └── units │ │ │ ├── COPYING │ │ │ ├── README.md │ │ │ ├── bytes.go │ │ │ ├── doc.go │ │ │ ├── si.go │ │ │ └── util.go │ ├── aryann │ │ └── difflib │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ └── difflib.go │ ├── cbroglie │ │ └── mustache │ │ │ ├── LICENSE │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── mustache.go │ │ │ └── partials.go │ ├── containernetworking │ │ └── cni │ │ │ ├── LICENSE │ │ │ └── pkg │ │ │ ├── invoke │ │ │ ├── args.go │ │ │ ├── delegate.go │ │ │ ├── exec.go │ │ │ ├── find.go │ │ │ ├── os_unix.go │ │ │ ├── os_windows.go │ │ │ └── raw_exec.go │ │ │ ├── skel │ │ │ └── skel.go │ │ │ ├── types │ │ │ ├── 020 │ │ │ │ └── types.go │ │ │ ├── args.go │ │ │ ├── current │ │ │ │ └── types.go │ │ │ └── types.go │ │ │ └── version │ │ │ ├── conf.go │ │ │ ├── plugin.go │ │ │ ├── reconcile.go │ │ │ └── version.go │ ├── davecgh │ │ └── go-spew │ │ │ ├── LICENSE │ │ │ └── spew │ │ │ ├── bypass.go │ │ │ ├── bypasssafe.go │ │ │ ├── common.go │ │ │ ├── config.go │ │ │ ├── doc.go │ │ │ ├── dump.go │ │ │ ├── format.go │ │ │ └── spew.go │ ├── dcos │ │ └── dcos-cni │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── cmd │ │ │ └── l4lb │ │ │ │ ├── README.md │ │ │ │ └── l4lb.go │ │ │ ├── glide.lock │ │ │ ├── glide.yaml │ │ │ └── pkg │ │ │ ├── l4lb │ │ │ └── config.go │ │ │ ├── mesos │ │ │ └── ip.go │ │ │ ├── minuteman │ │ │ ├── config.go │ │ │ └── plugin.go │ │ │ └── spartan │ │ │ ├── config.go │ │ │ └── plugin.go │ ├── mesosphere │ │ └── dcos-commons │ │ │ └── cli │ ├── nicksnyder │ │ └── go-i18n │ │ │ ├── LICENSE │ │ │ └── i18n │ │ │ ├── bundle │ │ │ └── bundle.go │ │ │ ├── i18n.go │ │ │ ├── language │ │ │ ├── language.go │ │ │ ├── operands.go │ │ │ ├── plural.go │ │ │ ├── pluralspec.go │ │ │ └── pluralspec_gen.go │ │ │ └── translation │ │ │ ├── plural_translation.go │ │ │ ├── single_translation.go │ │ │ ├── template.go │ │ │ └── translation.go │ ├── pelletier │ │ └── go-toml │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── benchmark.json │ │ │ ├── benchmark.sh │ │ │ ├── benchmark.toml │ │ │ ├── benchmark.yml │ │ │ ├── doc.go │ │ │ ├── example-crlf.toml │ │ │ ├── example.toml │ │ │ ├── keysparsing.go │ │ │ ├── lexer.go │ │ │ ├── marshal.go │ │ │ ├── marshal_test.toml │ │ │ ├── parser.go │ │ │ ├── position.go │ │ │ ├── test.sh │ │ │ ├── token.go │ │ │ ├── toml.go │ │ │ ├── tomltree_create.go │ │ │ └── tomltree_write.go │ ├── pmezard │ │ └── go-difflib │ │ │ ├── LICENSE │ │ │ └── difflib │ │ │ └── difflib.go │ ├── stretchr │ │ └── testify │ │ │ ├── LICENSE │ │ │ ├── assert │ │ │ ├── assertion_format.go │ │ │ ├── assertion_format.go.tmpl │ │ │ ├── assertion_forward.go │ │ │ ├── assertion_forward.go.tmpl │ │ │ ├── assertions.go │ │ │ ├── doc.go │ │ │ ├── errors.go │ │ │ ├── forward_assertions.go │ │ │ └── http_assertions.go │ │ │ ├── require │ │ │ ├── doc.go │ │ │ ├── forward_requirements.go │ │ │ ├── require.go │ │ │ ├── require.go.tmpl │ │ │ ├── require_forward.go │ │ │ ├── require_forward.go.tmpl │ │ │ └── requirements.go │ │ │ └── suite │ │ │ ├── doc.go │ │ │ ├── interfaces.go │ │ │ └── suite.go │ └── vishvananda │ │ ├── netlink │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── README.md │ │ ├── addr.go │ │ ├── addr_linux.go │ │ ├── bpf_linux.go │ │ ├── bridge_linux.go │ │ ├── class.go │ │ ├── class_linux.go │ │ ├── conntrack_linux.go │ │ ├── conntrack_unspecified.go │ │ ├── filter.go │ │ ├── filter_linux.go │ │ ├── genetlink_linux.go │ │ ├── genetlink_unspecified.go │ │ ├── gtp_linux.go │ │ ├── handle_linux.go │ │ ├── handle_unspecified.go │ │ ├── link.go │ │ ├── link_linux.go │ │ ├── link_tuntap_linux.go │ │ ├── neigh.go │ │ ├── neigh_linux.go │ │ ├── netlink.go │ │ ├── netlink_linux.go │ │ ├── netlink_unspecified.go │ │ ├── nl │ │ │ ├── addr_linux.go │ │ │ ├── bridge_linux.go │ │ │ ├── conntrack_linux.go │ │ │ ├── genetlink_linux.go │ │ │ ├── link_linux.go │ │ │ ├── mpls_linux.go │ │ │ ├── nl_linux.go │ │ │ ├── nl_unspecified.go │ │ │ ├── route_linux.go │ │ │ ├── syscall.go │ │ │ ├── tc_linux.go │ │ │ ├── xfrm_linux.go │ │ │ ├── xfrm_monitor_linux.go │ │ │ ├── xfrm_policy_linux.go │ │ │ └── xfrm_state_linux.go │ │ ├── order.go │ │ ├── protinfo.go │ │ ├── protinfo_linux.go │ │ ├── qdisc.go │ │ ├── qdisc_linux.go │ │ ├── route.go │ │ ├── route_linux.go │ │ ├── route_unspecified.go │ │ ├── rule.go │ │ ├── rule_linux.go │ │ ├── socket.go │ │ ├── socket_linux.go │ │ ├── xfrm.go │ │ ├── xfrm_monitor_linux.go │ │ ├── xfrm_policy.go │ │ ├── xfrm_policy_linux.go │ │ ├── xfrm_state.go │ │ └── xfrm_state_linux.go │ │ └── netns │ │ ├── LICENSE │ │ ├── README.md │ │ ├── netns.go │ │ ├── netns_linux.go │ │ └── netns_unspecified.go ├── gopkg.in │ ├── alecthomas │ │ └── kingpin.v3-unstable │ │ │ ├── COPYING │ │ │ ├── README.md │ │ │ ├── actions.go │ │ │ ├── app.go │ │ │ ├── args.go │ │ │ ├── camelcase.go │ │ │ ├── clause.go │ │ │ ├── cmd.go │ │ │ ├── completions.go │ │ │ ├── doc.go │ │ │ ├── flags.go │ │ │ ├── global.go │ │ │ ├── guesswidth.go │ │ │ ├── guesswidth_unix.go │ │ │ ├── i18n_en_AU.go │ │ │ ├── i18n_fr.go │ │ │ ├── i18n_init.go │ │ │ ├── model.go │ │ │ ├── parser.go │ │ │ ├── struct.go │ │ │ ├── templates.go │ │ │ ├── usage.go │ │ │ ├── values.go │ │ │ ├── values.json │ │ │ └── values_generated.go │ └── yaml.v2 │ │ ├── LICENSE │ │ ├── LICENSE.libyaml │ │ ├── README.md │ │ ├── apic.go │ │ ├── decode.go │ │ ├── emitterc.go │ │ ├── encode.go │ │ ├── parserc.go │ │ ├── readerc.go │ │ ├── resolve.go │ │ ├── scannerc.go │ │ ├── sorter.go │ │ ├── writerc.go │ │ ├── yaml.go │ │ ├── yamlh.go │ │ └── yamlprivateh.go └── vendor.json ├── gradle.properties ├── gradle ├── checkstyle │ ├── README.md │ ├── checkstyle.xml │ └── suppressions.xml ├── findbugs │ └── excludeFilter.xml ├── quality.gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── hooks └── post_push ├── mypy.ini ├── pyproject.toml ├── release.sh ├── renovate.json ├── run_container.sh ├── sdk ├── README.md ├── bootstrap │ ├── .gitignore │ ├── build.sh │ ├── main.go │ ├── main_test.go │ └── vendor ├── cli │ ├── .gitignore │ ├── build.sh │ ├── main.go │ └── vendor ├── scheduler │ ├── build.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── mesosphere │ │ │ │ └── sdk │ │ │ │ ├── config │ │ │ │ ├── Configuration.java │ │ │ │ ├── ConfigurationComparator.java │ │ │ │ ├── ConfigurationFactory.java │ │ │ │ ├── ConfigurationUpdater.java │ │ │ │ ├── DefaultConfigurationUpdater.java │ │ │ │ ├── RecoveryConfiguration.java │ │ │ │ ├── SerializationUtils.java │ │ │ │ ├── StringConfiguration.java │ │ │ │ ├── TaskEnvRouter.java │ │ │ │ ├── YAMLConfigurationLoader.java │ │ │ │ └── validate │ │ │ │ │ ├── ConfigValidationError.java │ │ │ │ │ ├── ConfigValidator.java │ │ │ │ │ ├── DefaultConfigValidators.java │ │ │ │ │ ├── DomainCapabilityValidator.java │ │ │ │ │ ├── PlacementRuleIsValid.java │ │ │ │ │ ├── PodSpecsCannotChangeNetworkRegime.java │ │ │ │ │ ├── PodSpecsCannotShrink.java │ │ │ │ │ ├── PodSpecsCannotUseUnsupportedFeatures.java │ │ │ │ │ ├── PreReservationCannotChange.java │ │ │ │ │ ├── RegionCannotChange.java │ │ │ │ │ ├── ResourceLimitsMustExceedRequestedResources.java │ │ │ │ │ ├── ServiceNameCannotBreakDNS.java │ │ │ │ │ ├── ServiceNameCannotContainDoubleUnderscores.java │ │ │ │ │ ├── ServiceRoleCannotChangeOnIncompleteDeployment.java │ │ │ │ │ ├── TLSRequiresServiceAccount.java │ │ │ │ │ ├── TaskEnvCannotChange.java │ │ │ │ │ ├── TaskSpecsCannotUseUnsupportedFeatures.java │ │ │ │ │ ├── TaskVolumesCannotChange.java │ │ │ │ │ ├── UserCannotChange.java │ │ │ │ │ └── ZoneValidator.java │ │ │ │ ├── curator │ │ │ │ ├── CuratorLocker.java │ │ │ │ ├── CuratorPersister.java │ │ │ │ └── CuratorUtils.java │ │ │ │ ├── dcos │ │ │ │ ├── Capabilities.java │ │ │ │ ├── DcosConstants.java │ │ │ │ ├── DcosHttpClientBuilder.java │ │ │ │ ├── DcosHttpExecutor.java │ │ │ │ ├── DcosVersion.java │ │ │ │ ├── auth │ │ │ │ │ ├── CachedTokenProvider.java │ │ │ │ │ ├── ConstantTokenProvider.java │ │ │ │ │ └── TokenProvider.java │ │ │ │ └── clients │ │ │ │ │ ├── CertificateAuthorityClient.java │ │ │ │ │ ├── DcosVersionClient.java │ │ │ │ │ ├── SecretsClient.java │ │ │ │ │ └── ServiceAccountIAMTokenClient.java │ │ │ │ ├── debug │ │ │ │ ├── DebugEndpoint.java │ │ │ │ ├── OfferOutcomeTrackerV2.java │ │ │ │ ├── PlansTracker.java │ │ │ │ ├── TaskReservationsTracker.java │ │ │ │ └── TaskStatusesTracker.java │ │ │ │ ├── framework │ │ │ │ ├── ApiServer.java │ │ │ │ ├── Driver.java │ │ │ │ ├── EnvStore.java │ │ │ │ ├── FrameworkConfig.java │ │ │ │ ├── FrameworkRunner.java │ │ │ │ ├── FrameworkScheduler.java │ │ │ │ ├── ImplicitReconciler.java │ │ │ │ ├── OfferProcessor.java │ │ │ │ ├── OfferQueue.java │ │ │ │ ├── ProcessExit.java │ │ │ │ ├── ReviveManager.java │ │ │ │ ├── SchedulerDriverFactory.java │ │ │ │ ├── TaskKiller.java │ │ │ │ └── TokenBucket.java │ │ │ │ ├── http │ │ │ │ ├── EndpointUtils.java │ │ │ │ ├── RequestUtils.java │ │ │ │ ├── ResponseUtils.java │ │ │ │ ├── endpoints │ │ │ │ │ ├── ArtifactResource.java │ │ │ │ │ ├── ConfigResource.java │ │ │ │ │ ├── DebugOffersResource.java │ │ │ │ │ ├── DeprecatedPlanResource.java │ │ │ │ │ ├── EndpointsResource.java │ │ │ │ │ ├── HealthResource.java │ │ │ │ │ ├── MultiArtifactResource.java │ │ │ │ │ ├── MultiConfigResource.java │ │ │ │ │ ├── MultiEndpointsResource.java │ │ │ │ │ ├── MultiHealthResource.java │ │ │ │ │ ├── MultiPlansResource.java │ │ │ │ │ ├── MultiPodResource.java │ │ │ │ │ ├── MultiStateResource.java │ │ │ │ │ ├── PlansDebugResource.java │ │ │ │ │ ├── PlansResource.java │ │ │ │ │ ├── PodResource.java │ │ │ │ │ ├── StateResource.java │ │ │ │ │ ├── TaskReservationsResource.java │ │ │ │ │ ├── TaskStatusesResource.java │ │ │ │ │ └── ThreadsResource.java │ │ │ │ ├── queries │ │ │ │ │ ├── ArtifactQueries.java │ │ │ │ │ ├── ConfigQueries.java │ │ │ │ │ ├── EndpointsQueries.java │ │ │ │ │ ├── PlansQueries.java │ │ │ │ │ ├── PodQueries.java │ │ │ │ │ └── StateQueries.java │ │ │ │ └── types │ │ │ │ │ ├── EndpointProducer.java │ │ │ │ │ ├── GroupedTasks.java │ │ │ │ │ ├── PhaseInfo.java │ │ │ │ │ ├── PlanInfo.java │ │ │ │ │ ├── PrettyJsonResource.java │ │ │ │ │ ├── PropertyDeserializer.java │ │ │ │ │ ├── StepInfo.java │ │ │ │ │ ├── StringPropertyDeserializer.java │ │ │ │ │ └── TaskInfoAndStatus.java │ │ │ │ ├── metrics │ │ │ │ ├── Metrics.java │ │ │ │ └── PlanReporter.java │ │ │ │ ├── offer │ │ │ │ ├── CommonIdUtils.java │ │ │ │ ├── Constants.java │ │ │ │ ├── CreateOfferRecommendation.java │ │ │ │ ├── DestroyOfferRecommendation.java │ │ │ │ ├── InvalidRequirementException.java │ │ │ │ ├── LaunchOfferRecommendation.java │ │ │ │ ├── LoggingUtils.java │ │ │ │ ├── MesosResource.java │ │ │ │ ├── MesosResourcePool.java │ │ │ │ ├── OfferAccepter.java │ │ │ │ ├── OfferRecommendation.java │ │ │ │ ├── OfferUtils.java │ │ │ │ ├── RangeUtils.java │ │ │ │ ├── ReserveOfferRecommendation.java │ │ │ │ ├── ResourceBuilder.java │ │ │ │ ├── ResourceUtils.java │ │ │ │ ├── StoreTaskInfoRecommendation.java │ │ │ │ ├── TaskException.java │ │ │ │ ├── TaskUtils.java │ │ │ │ ├── UninstallRecommendation.java │ │ │ │ ├── UnreserveOfferRecommendation.java │ │ │ │ ├── ValueUtils.java │ │ │ │ ├── evaluate │ │ │ │ │ ├── DestroyEvaluationStage.java │ │ │ │ │ ├── EvaluationOutcome.java │ │ │ │ │ ├── ExecutorEvaluationStage.java │ │ │ │ │ ├── ExecutorResourceMapper.java │ │ │ │ │ ├── ExternalVolumeProvider.java │ │ │ │ │ ├── ExternalVolumeProviderFactory.java │ │ │ │ │ ├── GenericDockerVolumeProvider.java │ │ │ │ │ ├── LaunchEvaluationStage.java │ │ │ │ │ ├── NamedVIPEvaluationStage.java │ │ │ │ │ ├── OfferEvaluationStage.java │ │ │ │ │ ├── OfferEvaluationUtils.java │ │ │ │ │ ├── OfferEvaluator.java │ │ │ │ │ ├── PlacementRuleEvaluationStage.java │ │ │ │ │ ├── PodInfoBuilder.java │ │ │ │ │ ├── PortEvaluationStage.java │ │ │ │ │ ├── PortworxVolumeProvider.java │ │ │ │ │ ├── ResourceEvaluationStage.java │ │ │ │ │ ├── ResourceLabels.java │ │ │ │ │ ├── ResourceMapperUtils.java │ │ │ │ │ ├── TLSEvaluationStage.java │ │ │ │ │ ├── TaskPortLookup.java │ │ │ │ │ ├── TaskResourceMapper.java │ │ │ │ │ ├── UnreserveEvaluationStage.java │ │ │ │ │ ├── VolumeEvaluationStage.java │ │ │ │ │ ├── placement │ │ │ │ │ │ ├── AbstractRoundRobinRule.java │ │ │ │ │ │ ├── AgentRule.java │ │ │ │ │ │ ├── AndRule.java │ │ │ │ │ │ ├── AnyMatcher.java │ │ │ │ │ │ ├── AttributeRule.java │ │ │ │ │ │ ├── AttributeRuleFactory.java │ │ │ │ │ │ ├── ExactMatcher.java │ │ │ │ │ │ ├── HostnameRule.java │ │ │ │ │ │ ├── HostnameRuleFactory.java │ │ │ │ │ │ ├── InvalidPlacementRule.java │ │ │ │ │ │ ├── InvertedExactMatcher.java │ │ │ │ │ │ ├── IsLocalRegionRule.java │ │ │ │ │ │ ├── MarathonConstraintParser.java │ │ │ │ │ │ ├── MaxPerAttributeRule.java │ │ │ │ │ │ ├── MaxPerHostnameRule.java │ │ │ │ │ │ ├── MaxPerRegionRule.java │ │ │ │ │ │ ├── MaxPerRule.java │ │ │ │ │ │ ├── MaxPerZoneRule.java │ │ │ │ │ │ ├── NotRule.java │ │ │ │ │ │ ├── OrRule.java │ │ │ │ │ │ ├── PassthroughRule.java │ │ │ │ │ │ ├── PlacementField.java │ │ │ │ │ │ ├── PlacementRule.java │ │ │ │ │ │ ├── PlacementUtils.java │ │ │ │ │ │ ├── RegexMatcher.java │ │ │ │ │ │ ├── RegionRule.java │ │ │ │ │ │ ├── RegionRuleFactory.java │ │ │ │ │ │ ├── RoundRobinByAttributeRule.java │ │ │ │ │ │ ├── RoundRobinByHostnameRule.java │ │ │ │ │ │ ├── RoundRobinByRegionRule.java │ │ │ │ │ │ ├── RoundRobinByZoneRule.java │ │ │ │ │ │ ├── RuleFactory.java │ │ │ │ │ │ ├── StringMatcher.java │ │ │ │ │ │ ├── StringMatcherRule.java │ │ │ │ │ │ ├── TaskTypeConverter.java │ │ │ │ │ │ ├── TaskTypeLabelConverter.java │ │ │ │ │ │ ├── TaskTypeRule.java │ │ │ │ │ │ ├── ZoneRule.java │ │ │ │ │ │ └── ZoneRuleFactory.java │ │ │ │ │ └── security │ │ │ │ │ │ ├── CertificateNamesGenerator.java │ │ │ │ │ │ ├── PEMUtils.java │ │ │ │ │ │ ├── TLSArtifact.java │ │ │ │ │ │ ├── TLSArtifactPaths.java │ │ │ │ │ │ ├── TLSArtifactsGenerator.java │ │ │ │ │ │ └── TLSArtifactsUpdater.java │ │ │ │ ├── history │ │ │ │ │ └── OfferOutcome.java │ │ │ │ └── taskdata │ │ │ │ │ ├── AttributeStringUtils.java │ │ │ │ │ ├── AuxLabelAccess.java │ │ │ │ │ ├── EnvConstants.java │ │ │ │ │ ├── EnvUtils.java │ │ │ │ │ ├── LabelConstants.java │ │ │ │ │ ├── LabelReader.java │ │ │ │ │ ├── LabelUtils.java │ │ │ │ │ ├── LabelWriter.java │ │ │ │ │ ├── TaskLabelReader.java │ │ │ │ │ └── TaskLabelWriter.java │ │ │ │ ├── scheduler │ │ │ │ ├── AbstractScheduler.java │ │ │ │ ├── DefaultScheduler.java │ │ │ │ ├── ExplicitReconciler.java │ │ │ │ ├── MesosEventClient.java │ │ │ │ ├── OfferResources.java │ │ │ │ ├── SchedulerBuilder.java │ │ │ │ ├── SchedulerConfig.java │ │ │ │ ├── SchedulerRunner.java │ │ │ │ ├── SchedulerUtils.java │ │ │ │ ├── WorkSetTracker.java │ │ │ │ ├── decommission │ │ │ │ │ ├── DecommissionPlanFactory.java │ │ │ │ │ ├── EraseTaskStateStep.java │ │ │ │ │ └── TriggerDecommissionStep.java │ │ │ │ ├── multi │ │ │ │ │ ├── AllDiscipline.java │ │ │ │ │ ├── DisciplineSelectionStore.java │ │ │ │ │ ├── MultiServiceEventClient.java │ │ │ │ │ ├── MultiServiceManager.java │ │ │ │ │ ├── MultiServiceRunner.java │ │ │ │ │ ├── OfferDiscipline.java │ │ │ │ │ ├── ParallelFootprintDiscipline.java │ │ │ │ │ ├── ServiceFactory.java │ │ │ │ │ └── ServiceStore.java │ │ │ │ ├── plan │ │ │ │ │ ├── AbstractStep.java │ │ │ │ │ ├── DecommissionPlanManager.java │ │ │ │ │ ├── DefaultPhase.java │ │ │ │ │ ├── DefaultPhaseFactory.java │ │ │ │ │ ├── DefaultPlan.java │ │ │ │ │ ├── DefaultPlanCoordinator.java │ │ │ │ │ ├── DefaultPlanManager.java │ │ │ │ │ ├── DefaultPodInstance.java │ │ │ │ │ ├── DefaultStepFactory.java │ │ │ │ │ ├── DeployPlanFactory.java │ │ │ │ │ ├── DeploymentStep.java │ │ │ │ │ ├── Element.java │ │ │ │ │ ├── Interruptible.java │ │ │ │ │ ├── ParentElement.java │ │ │ │ │ ├── Phase.java │ │ │ │ │ ├── PhaseFactory.java │ │ │ │ │ ├── Plan.java │ │ │ │ │ ├── PlanCoordinator.java │ │ │ │ │ ├── PlanCustomizer.java │ │ │ │ │ ├── PlanFactory.java │ │ │ │ │ ├── PlanManager.java │ │ │ │ │ ├── PlanScheduler.java │ │ │ │ │ ├── PlanUtils.java │ │ │ │ │ ├── PodInstanceRequirement.java │ │ │ │ │ ├── StageBuilder.java │ │ │ │ │ ├── Status.java │ │ │ │ │ ├── Step.java │ │ │ │ │ ├── StepFactory.java │ │ │ │ │ ├── backoff │ │ │ │ │ │ ├── Backoff.java │ │ │ │ │ │ ├── DisabledBackoff.java │ │ │ │ │ │ └── ExponentialBackoff.java │ │ │ │ │ └── strategy │ │ │ │ │ │ ├── CanaryStrategy.java │ │ │ │ │ │ ├── DependencyStrategy.java │ │ │ │ │ │ ├── DependencyStrategyHelper.java │ │ │ │ │ │ ├── InterruptibleStrategy.java │ │ │ │ │ │ ├── ParallelStrategy.java │ │ │ │ │ │ ├── RandomStrategy.java │ │ │ │ │ │ ├── SerialStrategy.java │ │ │ │ │ │ ├── Strategy.java │ │ │ │ │ │ └── StrategyGenerator.java │ │ │ │ ├── recovery │ │ │ │ │ ├── DefaultRecoveryPlanManager.java │ │ │ │ │ ├── FailureUtils.java │ │ │ │ │ ├── RecoveryPlanOverrider.java │ │ │ │ │ ├── RecoveryPlanOverriderFactory.java │ │ │ │ │ ├── RecoveryStep.java │ │ │ │ │ ├── RecoveryType.java │ │ │ │ │ └── monitor │ │ │ │ │ │ ├── DefaultFailureMonitor.java │ │ │ │ │ │ ├── FailureMonitor.java │ │ │ │ │ │ ├── NeverFailureMonitor.java │ │ │ │ │ │ ├── TestingFailureMonitor.java │ │ │ │ │ │ └── TimedFailureMonitor.java │ │ │ │ └── uninstall │ │ │ │ │ ├── DeregisterStep.java │ │ │ │ │ ├── ResourceCleanupStep.java │ │ │ │ │ ├── TLSCleanupStep.java │ │ │ │ │ ├── TaskKillStep.java │ │ │ │ │ ├── UninstallPlanFactory.java │ │ │ │ │ ├── UninstallRecorder.java │ │ │ │ │ ├── UninstallScheduler.java │ │ │ │ │ └── UninstallStep.java │ │ │ │ ├── specification │ │ │ │ ├── CommandSpec.java │ │ │ │ ├── ConfigFileSpec.java │ │ │ │ ├── DefaultCommandSpec.java │ │ │ │ ├── DefaultConfigFileSpec.java │ │ │ │ ├── DefaultDiscoverySpec.java │ │ │ │ ├── DefaultHealthCheckSpec.java │ │ │ │ ├── DefaultHostVolumeSpec.java │ │ │ │ ├── DefaultNetworkSpec.java │ │ │ │ ├── DefaultPodSpec.java │ │ │ │ ├── DefaultReadinessCheckSpec.java │ │ │ │ ├── DefaultResourceLimits.java │ │ │ │ ├── DefaultResourceSet.java │ │ │ │ ├── DefaultResourceSpec.java │ │ │ │ ├── DefaultSecretSpec.java │ │ │ │ ├── DefaultServiceSpec.java │ │ │ │ ├── DefaultTaskSpec.java │ │ │ │ ├── DefaultTransportEncryptionSpec.java │ │ │ │ ├── DefaultVipSpec.java │ │ │ │ ├── DefaultVolumeSpec.java │ │ │ │ ├── DiscoverySpec.java │ │ │ │ ├── DockerVolumeSpec.java │ │ │ │ ├── ExternalVolumeSpec.java │ │ │ │ ├── GoalState.java │ │ │ │ ├── HealthCheckSpec.java │ │ │ │ ├── HostVolumeSpec.java │ │ │ │ ├── InvalidTaskSpecException.java │ │ │ │ ├── NamedVIPSpec.java │ │ │ │ ├── NetworkSpec.java │ │ │ │ ├── PlanGenerator.java │ │ │ │ ├── PodInstance.java │ │ │ │ ├── PodSpec.java │ │ │ │ ├── PortSpec.java │ │ │ │ ├── PortworxVolumeSpec.java │ │ │ │ ├── RLimitSpec.java │ │ │ │ ├── RangeSpec.java │ │ │ │ ├── ReadinessCheckSpec.java │ │ │ │ ├── ReplacementFailurePolicy.java │ │ │ │ ├── ResourceLimits.java │ │ │ │ ├── ResourceSet.java │ │ │ │ ├── ResourceSpec.java │ │ │ │ ├── SecretSpec.java │ │ │ │ ├── ServiceSpec.java │ │ │ │ ├── TaskSpec.java │ │ │ │ ├── TransportEncryptionSpec.java │ │ │ │ ├── ValidationUtils.java │ │ │ │ ├── VipSpec.java │ │ │ │ ├── VolumeSpec.java │ │ │ │ └── yaml │ │ │ │ │ ├── RawConfig.java │ │ │ │ │ ├── RawDiscovery.java │ │ │ │ │ ├── RawExternalVolume.java │ │ │ │ │ ├── RawHealthCheck.java │ │ │ │ │ ├── RawHostVolume.java │ │ │ │ │ ├── RawNetwork.java │ │ │ │ │ ├── RawPhase.java │ │ │ │ │ ├── RawPlan.java │ │ │ │ │ ├── RawPod.java │ │ │ │ │ ├── RawPort.java │ │ │ │ │ ├── RawRLimit.java │ │ │ │ │ ├── RawRange.java │ │ │ │ │ ├── RawReadinessCheck.java │ │ │ │ │ ├── RawResource.java │ │ │ │ │ ├── RawResourceLimits.java │ │ │ │ │ ├── RawResourceSet.java │ │ │ │ │ ├── RawScheduler.java │ │ │ │ │ ├── RawSecret.java │ │ │ │ │ ├── RawServiceSpec.java │ │ │ │ │ ├── RawTask.java │ │ │ │ │ ├── RawTransportEncryption.java │ │ │ │ │ ├── RawVip.java │ │ │ │ │ ├── RawVolume.java │ │ │ │ │ ├── TemplateUtils.java │ │ │ │ │ ├── WriteOnceLinkedHashMap.java │ │ │ │ │ └── YAMLToInternalMappers.java │ │ │ │ ├── state │ │ │ │ ├── ConfigStore.java │ │ │ │ ├── ConfigStoreException.java │ │ │ │ ├── ConfigTargetStore.java │ │ │ │ ├── CycleDetectingLockUtils.java │ │ │ │ ├── FrameworkStore.java │ │ │ │ ├── GoalStateOverride.java │ │ │ │ ├── JsonSerializer.java │ │ │ │ ├── PersistentLaunchRecorder.java │ │ │ │ ├── SchemaVersionStore.java │ │ │ │ ├── Serializer.java │ │ │ │ ├── StateStore.java │ │ │ │ ├── StateStoreException.java │ │ │ │ └── StateStoreUtils.java │ │ │ │ └── storage │ │ │ │ ├── MemPersister.java │ │ │ │ ├── Persister.java │ │ │ │ ├── PersisterCache.java │ │ │ │ ├── PersisterException.java │ │ │ │ ├── PersisterUtils.java │ │ │ │ └── StorageError.java │ │ └── resources │ │ │ └── log4j2.xml │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── mesosphere │ │ │ └── sdk │ │ │ ├── config │ │ │ ├── ConfigurationUpdaterTest.java │ │ │ ├── DefaultTaskEnvRouterTest.java │ │ │ ├── YAMLConfigurationLoaderTest.java │ │ │ └── validate │ │ │ │ ├── DomainCapabilityValidatorTest.java │ │ │ │ ├── PlacementRuleIsValidTest.java │ │ │ │ ├── PodSpecsCannotChangeNetworkRegimeTest.java │ │ │ │ ├── PodSpecsCannotShrinkTest.java │ │ │ │ ├── PodSpecsCannotUseUnsupportedFeaturesTest.java │ │ │ │ ├── PreReservationCannotChangeTest.java │ │ │ │ ├── RegionCannotChangeTest.java │ │ │ │ ├── ServiceNameCannotBreakDNSTest.java │ │ │ │ ├── ServiceNameCannotContainDoubleUnderscoresTest.java │ │ │ │ ├── TLSRequiresServiceAccountTest.java │ │ │ │ ├── TaskEnvCannotChangeTest.java │ │ │ │ ├── TaskSpecsCannotUseUnsupportedFeaturesTest.java │ │ │ │ ├── TaskVolumesCannotChangeTest.java │ │ │ │ ├── UserCannotChangeTest.java │ │ │ │ ├── VerifyHostVolumePathTest.java │ │ │ │ └── VerifySecretFilePathTest.java │ │ │ ├── curator │ │ │ ├── CuratorLockerTest.java │ │ │ ├── CuratorPersisterTest.java │ │ │ ├── CuratorTestUtils.java │ │ │ └── CuratorUtilsTest.java │ │ │ ├── dcos │ │ │ ├── CapabilitiesTest.java │ │ │ ├── DcosVersionTest.java │ │ │ ├── ResourceRefinementCapabilityContext.java │ │ │ ├── auth │ │ │ │ ├── CachedTokenProviderTest.java │ │ │ │ └── ConstantTokenProviderTest.java │ │ │ └── clients │ │ │ │ ├── CertificateAuthorityClientTest.java │ │ │ │ ├── DcosVersionClientTest.java │ │ │ │ └── SecretsClientTest.java │ │ │ ├── debug │ │ │ ├── OfferOutcomeTrackerV2Test.java │ │ │ ├── PlansTrackerTest.java │ │ │ ├── TaskReservationsTrackerTest.java │ │ │ └── TaskStatusesTrackerTest.java │ │ │ ├── framework │ │ │ ├── ApiServerTest.java │ │ │ ├── FrameworkRunnerTest.java │ │ │ ├── FrameworkSchedulerTest.java │ │ │ ├── ImplicitReconcilerTest.java │ │ │ ├── OfferProcessorTest.java │ │ │ ├── OfferQueueTest.java │ │ │ ├── ReviveManagerTest.java │ │ │ ├── SchedulerDriverFactoryTest.java │ │ │ ├── TaskKillerTest.java │ │ │ └── TokenBucketTest.java │ │ │ ├── http │ │ │ ├── EndpointUtilsTest.java │ │ │ ├── RequestUtilsTest.java │ │ │ ├── ResponseUtilsTest.java │ │ │ ├── endpoints │ │ │ │ ├── ArtifactResourceTest.java │ │ │ │ ├── HealthResourceTest.java │ │ │ │ ├── MultiArtifactResourceTest.java │ │ │ │ └── MultiHealthResourceTest.java │ │ │ ├── queries │ │ │ │ ├── ArtifactQueriesTest.java │ │ │ │ ├── ConfigQueriesTest.java │ │ │ │ ├── EndpointsQueriesTest.java │ │ │ │ ├── PlansQueriesTest.java │ │ │ │ ├── PodQueriesTest.java │ │ │ │ └── StateQueriesTest.java │ │ │ └── types │ │ │ │ ├── PlanInfoTest.java │ │ │ │ └── StringPropertyDeserializerTest.java │ │ │ ├── metrics │ │ │ ├── MetricsTest.java │ │ │ └── PlanReporterTest.java │ │ │ ├── offer │ │ │ ├── CommonIdUtilsTest.java │ │ │ ├── DefaultOfferRequirementProviderTest.java │ │ │ ├── MesosResourcePoolTest.java │ │ │ ├── OfferAccepterTest.java │ │ │ ├── OfferUtilsTest.java │ │ │ ├── RangeUtilsTest.java │ │ │ ├── ResourceBuilderTest.java │ │ │ ├── ResourceUtilsTest.java │ │ │ ├── TaskUtilsTest.java │ │ │ ├── UnreserveOfferRecommendationTest.java │ │ │ ├── evaluate │ │ │ │ ├── ExecutorEvaluationStageTest.java │ │ │ │ ├── LaunchEvaluationStageTest.java │ │ │ │ ├── MultiEvaluationStageTest.java │ │ │ │ ├── NamedVIPEvaluationStageTest.java │ │ │ │ ├── OfferEvaluationUtilsTest.java │ │ │ │ ├── OfferEvaluatorPlacementTest.java │ │ │ │ ├── OfferEvaluatorPortsTest.java │ │ │ │ ├── OfferEvaluatorTest.java │ │ │ │ ├── OfferEvaluatorTestBase.java │ │ │ │ ├── OfferEvaluatorVolumesTest.java │ │ │ │ ├── PlacementRuleEvaluationStageTest.java │ │ │ │ ├── PortEvaluationStageTest.java │ │ │ │ ├── TLSEvaluationStageTest.java │ │ │ │ ├── TaskPortLookupTest.java │ │ │ │ ├── VolumeEvaluationStageTest.java │ │ │ │ ├── placement │ │ │ │ │ ├── AbstractRoundRobinRuleTest.java │ │ │ │ │ ├── AgentRuleTest.java │ │ │ │ │ ├── AndRuleTest.java │ │ │ │ │ ├── AttributeRuleTest.java │ │ │ │ │ ├── ExactMatcherTest.java │ │ │ │ │ ├── HostnameRuleTest.java │ │ │ │ │ ├── InvalidPlacementRuleTest.java │ │ │ │ │ ├── IsLocalRegionRuleTest.java │ │ │ │ │ ├── MarathonConstraintParserTest.java │ │ │ │ │ ├── MaxPerAttributeRuleTest.java │ │ │ │ │ ├── MaxPerHostnameRuleTest.java │ │ │ │ │ ├── MaxPerRegionRuleTest.java │ │ │ │ │ ├── MaxPerTest.java │ │ │ │ │ ├── MaxPerZoneRuleTest.java │ │ │ │ │ ├── NotRuleTest.java │ │ │ │ │ ├── OrRuleTest.java │ │ │ │ │ ├── PassthroughRuleTest.java │ │ │ │ │ ├── PlacementUtilsTest.java │ │ │ │ │ ├── RegionRuleTest.java │ │ │ │ │ ├── RoundRobinByAttributeRuleTest.java │ │ │ │ │ ├── RoundRobinByHostnameRuleTest.java │ │ │ │ │ ├── RoundRobinByRegionRuleTest.java │ │ │ │ │ ├── RoundRobinByZoneRuleTest.java │ │ │ │ │ ├── TaskTypeRuleTest.java │ │ │ │ │ ├── TestPlacementUtils.java │ │ │ │ │ └── ZoneRuleTest.java │ │ │ │ └── security │ │ │ │ │ ├── CertificateNamesGeneratorTest.java │ │ │ │ │ ├── TLSArtifactPathsTest.java │ │ │ │ │ ├── TLSArtifactsGeneratorTest.java │ │ │ │ │ └── TLSArtifactsUpdaterTest.java │ │ │ └── taskdata │ │ │ │ ├── AttributeStringUtilsTest.java │ │ │ │ ├── AuxLabelAccessTest.java │ │ │ │ ├── EnvUtilsTest.java │ │ │ │ └── TaskLabelReaderWriterTest.java │ │ │ ├── scheduler │ │ │ ├── AbstractSchedulerTest.java │ │ │ ├── DefaultSchedulerTest.java │ │ │ ├── ExplicitReconcilerTest.java │ │ │ ├── SchedulerBuilderTest.java │ │ │ ├── SchedulerConfigTest.java │ │ │ ├── SchedulerRunnerTest.java │ │ │ ├── WorkSetTrackerTest.java │ │ │ ├── decommission │ │ │ │ └── DecommissionPlanFactoryTest.java │ │ │ ├── multi │ │ │ │ ├── DisciplineSelectionStoreTest.java │ │ │ │ ├── MultiServiceEventClientTest.java │ │ │ │ ├── MultiServiceManagerTest.java │ │ │ │ ├── MultiServiceRunnerTest.java │ │ │ │ ├── ParallelFootprintDisciplineTest.java │ │ │ │ └── ServiceStoreTest.java │ │ │ ├── plan │ │ │ │ ├── DefaultPhaseTest.java │ │ │ │ ├── DefaultPlanCoordinatorTest.java │ │ │ │ ├── DefaultPlanManagerTest.java │ │ │ │ ├── DefaultStepFactoryTest.java │ │ │ │ ├── DeploymentStepTest.java │ │ │ │ ├── PlanSchedulerTest.java │ │ │ │ ├── PlanUtilsTest.java │ │ │ │ ├── PodInstanceRequirementTestUtils.java │ │ │ │ ├── RandomRecoveryStrategyTest.java │ │ │ │ ├── TestStep.java │ │ │ │ ├── backoff │ │ │ │ │ └── ExponentialBackoffTest.java │ │ │ │ └── strategy │ │ │ │ │ ├── CanaryStrategyTest.java │ │ │ │ │ ├── ParallelStrategyTest.java │ │ │ │ │ └── SerialStrategyTest.java │ │ │ ├── recovery │ │ │ │ └── DefaultRecoveryPlanManagerTest.java │ │ │ └── uninstall │ │ │ │ ├── ResourceCleanupStepTest.java │ │ │ │ ├── TLSCleanupStepTest.java │ │ │ │ ├── TaskKillStepTest.java │ │ │ │ ├── UninstallRecorderTest.java │ │ │ │ └── UninstallSchedulerTest.java │ │ │ ├── specification │ │ │ ├── DefaultHealthCheckSpecTest.java │ │ │ ├── DefaultPodSpecTest.java │ │ │ ├── DefaultServiceSpecTest.java │ │ │ ├── DefaultTaskSpecTest.java │ │ │ ├── DefaultVipSpecTest.java │ │ │ ├── DefaultVolumeSpecTest.java │ │ │ ├── PlanGeneratorTest.java │ │ │ ├── RLimitSpecTest.java │ │ │ ├── ReplacementFailurePolicyTest.java │ │ │ ├── validation │ │ │ │ └── ZoneValidatorTest.java │ │ │ └── yaml │ │ │ │ ├── TemplateUtilsTest.java │ │ │ │ ├── WriteOnceLinkedHashMapTest.java │ │ │ │ └── YAMLServiceSpecFactoryTest.java │ │ │ ├── state │ │ │ ├── ConfigStoreTest.java │ │ │ ├── FrameworkStoreTest.java │ │ │ ├── JsonSerializerTest.java │ │ │ ├── PersistentLaunchRecorderTest.java │ │ │ ├── SchemaVersionStoreTest.java │ │ │ ├── StateStoreTest.java │ │ │ └── StateStoreUtilsTest.java │ │ │ ├── storage │ │ │ ├── MemPersisterTest.java │ │ │ ├── PersisterCacheTest.java │ │ │ └── PersisterUtilsTest.java │ │ │ └── testutils │ │ │ ├── DefaultCapabilitiesTestSuite.java │ │ │ ├── OfferTestUtils.java │ │ │ ├── PodTestUtils.java │ │ │ ├── ResourceTestUtils.java │ │ │ ├── SchedulerConfigTestUtils.java │ │ │ ├── TaskTestUtils.java │ │ │ ├── TestConstants.java │ │ │ └── TestPodFactory.java │ │ └── resources │ │ ├── custom-phases.yml │ │ ├── invalid-config-file.yml │ │ ├── invalid-duplicate-container-definition.yml │ │ ├── invalid-duplicate-count.yml │ │ ├── invalid-duplicate-port-names.yml │ │ ├── invalid-duplicate-ports.yml │ │ ├── invalid-image-null.yml │ │ ├── invalid-network-labels-blank.yml │ │ ├── invalid-network-labels-format.yml │ │ ├── invalid-network.yml │ │ ├── invalid-plan-steps.yml │ │ ├── invalid-pod-name.yml │ │ ├── invalid-resource-limits-in-resource-set.yml │ │ ├── invalid-resource-set-name.yml │ │ ├── invalid-rlimit-name.yml │ │ ├── invalid-scalar-cpu-resource.yml │ │ ├── invalid-scalar-disk-resource.yml │ │ ├── invalid-scalar-mem-resource.yml │ │ ├── invalid-seccomp-info.yml │ │ ├── invalid-share-parent-pod.yml │ │ ├── invalid-share-parent-shm-size.yml │ │ ├── invalid-task-dns.yml │ │ ├── invalid-task-kill-grace-period-seconds.yml │ │ ├── invalid-task-labels-blank.yml │ │ ├── invalid-task-labels-format.yml │ │ ├── invalid-task-name.yml │ │ ├── invalid-task-resources.yml │ │ ├── invalid-vip-port-name-collision.yml │ │ ├── invalid-volume-and-volumes.yml │ │ ├── invalid.yml.mustache │ │ ├── log4j2.xml │ │ ├── mockito-extensions │ │ └── org.mockito.plugins.MockMaker │ │ ├── ranges.yml │ │ ├── readiness-check.yml │ │ ├── recovery-plan-manager-test.yml │ │ ├── resource-refinement.yml │ │ ├── resource-set-seq.yml │ │ ├── response-ca-bundle-valid.json │ │ ├── response-ca-bundle-with-error.json │ │ ├── response-ca-sign-valid.json │ │ ├── response-ca-sign-with-error.json │ │ ├── rsa-private-key.pem │ │ ├── rsa-public-key.pem │ │ ├── seccomp-profile-name.yml │ │ ├── seccomp-unconfined.yml │ │ ├── shared-resource-set.yml │ │ ├── static-port.yml │ │ ├── test-render-inverted.yml │ │ ├── test-render.yml │ │ ├── test.yml │ │ ├── valid-automatic-cni-port-forwarding.yml │ │ ├── valid-customzk.yml │ │ ├── valid-envkey-ports.yml │ │ ├── valid-exhaustive.yml │ │ ├── valid-external-volume.yml │ │ ├── valid-finished.yml │ │ ├── valid-gpu-resource.yml │ │ ├── valid-gpu-resourceset.yml │ │ ├── valid-host-volume.yml │ │ ├── valid-image.yml │ │ ├── valid-minimal-health-configfile.yml │ │ ├── valid-minimal-networks-docker.yml │ │ ├── valid-minimal-overlay-vip.yml │ │ ├── valid-minimal-overlay.yml │ │ ├── valid-minimal-ports.yml │ │ ├── valid-minimal-volume.yml │ │ ├── valid-minimal.yml │ │ ├── valid-multiple-ports.yml │ │ ├── valid-network.yml │ │ ├── valid-networks-port-mapping.yml │ │ ├── valid-port-healthcheck-overlay.yml │ │ ├── valid-port-healthcheck.yml │ │ ├── valid-port-readinesscheck-overlay.yml │ │ ├── valid-port-readinesscheck.yml │ │ ├── valid-profile-mount-volume.yml │ │ ├── valid-resource-limits-empty.yml │ │ ├── valid-resource-limits-in-resource-set.yml │ │ ├── valid-resource-limits-in-task.yml │ │ ├── valid-seccomp-info.yml │ │ ├── valid-secrets-env.yml │ │ ├── valid-secrets.yml │ │ ├── valid-shared-memory-pod.yml │ │ ├── valid-shm-spec.yml │ │ ├── valid-simple.yml │ │ ├── valid-task-kill-grace-period-seconds.yml │ │ └── valid-task-labels.yml └── testing │ ├── build.gradle │ └── src │ └── main │ └── java │ └── com │ └── mesosphere │ └── sdk │ └── testing │ ├── AcceptEntry.java │ ├── ClusterState.java │ ├── ConfigValidatorUtils.java │ ├── CosmosRenderer.java │ ├── Expect.java │ ├── LaunchedTask.java │ ├── Send.java │ ├── SendOffer.java │ ├── SendTaskStatus.java │ ├── ServiceTestResult.java │ ├── ServiceTestRunner.java │ └── SimulationTick.java ├── settings.gradle ├── test.sh ├── test_requirements.txt ├── testing ├── README.md ├── sdk_agents.py ├── sdk_auth.py ├── sdk_cmd.py ├── sdk_diag.py ├── sdk_external_volumes.py ├── sdk_fault_domain.py ├── sdk_hosts.py ├── sdk_install.py ├── sdk_jobs.py ├── sdk_marathon.py ├── sdk_metrics.py ├── sdk_networks.py ├── sdk_package_registry.py ├── sdk_plan.py ├── sdk_recovery.py ├── sdk_repository.py ├── sdk_security.py ├── sdk_service.py ├── sdk_tasks.py ├── sdk_upgrade.py ├── sdk_utils.py └── security │ ├── __init__.py │ ├── cipher_suites.py │ ├── kerberos.py │ ├── keytab-validator │ ├── .gitignore │ ├── README.MD │ ├── keytab-validator.jar │ ├── known_bad.keytab │ ├── known_good.keytab │ └── src │ │ ├── META-INF │ │ └── MANIFEST.MF │ │ └── Main.java │ └── transport_encryption.py ├── tools-internal ├── README.md └── kdc-api-server │ ├── Dockerfile.heimdal-alpine │ ├── Dockerfile.heimdal-centos7 │ ├── Dockerfile.mit-alpine │ ├── Dockerfile.mit-centos7 │ ├── README.md │ ├── docker │ ├── kdc.conf │ ├── krb5.conf │ └── supervisord.conf │ ├── kdc.conf │ └── server │ ├── dcos.go │ ├── kadmin.go │ ├── main.go │ ├── server.go │ └── util.go └── tools ├── Dockerfile ├── README.md ├── airgap_linter.py ├── build_go_exe.sh ├── build_package.sh ├── ci ├── checks │ ├── get_applicable_changes.py │ ├── get_base_branch.sh │ └── run_pre_commit.sh ├── launch_cluster.sh ├── steps │ ├── check_json_files.py │ └── check_python_files.sh └── test_runner.sh ├── container ├── README.md └── venvs │ └── wrap.sh ├── create_service_account.sh ├── create_testing_volumes.py ├── dcos_login.py ├── distribution ├── UPDATING.md └── copy-files ├── kdc ├── README.md ├── kdc.json └── kdc.py ├── pip ├── .gitignore ├── README.md ├── build-whl.sh ├── cmd_wrapper │ └── __init__.py └── setup.py ├── print_package_tag.py ├── publish_aws.py ├── publish_azure.py ├── publish_dcos_file.py ├── publish_http.py ├── release_builder.py ├── save_properties.py ├── standardize_config_json.py ├── universe ├── __init__.py ├── azure_uploader.py ├── package.py ├── package_builder.py ├── package_manager.py ├── package_publisher.py └── s3_uploader.py └── validate_pip_freeze.py /.dockerignore: -------------------------------------------------------------------------------- 1 | # Ignore all folders when building the Docker image. 2 | /**/build 3 | /**/__pycache__ 4 | *.pyc 5 | .* 6 | /service-diagnostic-bundles 7 | /logs 8 | 9 | !test_requirements.txt 10 | !frozen_requirements.txt 11 | !test_runner.sh 12 | !/tools/ci 13 | !test.sh 14 | !TESTING.md 15 | !/tools/**/*.py 16 | !.pre-commit-config.yaml 17 | -------------------------------------------------------------------------------- /.flake8: -------------------------------------------------------------------------------- 1 | [flake8] 2 | # The following are ignored to work better with "black": 3 | # E203 whitespace before ':' (https://github.com/ambv/black#slices) 4 | # E501 line too long (https://github.com/ambv/black#line-length) 5 | # W503 line break before binary operator (https://github.com/ambv/black#line-breaks--binary-operators) 6 | ignore = E203, E501, W503 7 | max-line-length = 100 8 | max-complexity = 18 9 | # The default for Flake8 is: C,E,F,W (Critical, Error, Fatal, Warning) 10 | # Add B : (https://github.com/PyCQA/flake8-bugbear) 11 | # Add T : (https://github.com/ambv/flake8-mypy) 12 | select = B,C,E,F,W,T4,B9 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | *.pyc 3 | .cache/ 4 | .gopath/ 5 | .*/ 6 | 7 | # dcos-docker artifacts 8 | dcos-docker/ 9 | ignore/ 10 | genconf/ 11 | *.box 12 | 13 | # leftovers from running tests/tools directly 14 | tools/env/ 15 | tools/cluster-*.properties 16 | tools/*.pem 17 | tools/dcostests_env/ 18 | tools/shakedown_env/ 19 | tools/*/shakedown_env/ 20 | tools/cassandra 21 | tools/hdfs 22 | tools/helloworld 23 | tools/template 24 | /test_*.json 25 | /logs/ 26 | *.log 27 | *.pem 28 | .pytest_cache/ 29 | __pycache__ 30 | 31 | # idea 32 | *.i?? 33 | .idea/ 34 | out/ 35 | classes/ 36 | 37 | # eclipse 38 | .classpath 39 | .project 40 | .settings/ 41 | bin/ 42 | 43 | # vscode 44 | .vscode 45 | 46 | # gradle 47 | .gradle 48 | build/ 49 | 50 | # gradle subprojects 51 | sdk/core/build 52 | sdk/executor/build 53 | frameworks/*/build 54 | frameworks/*/dcos-commons-tools/ 55 | frameworks/*/*-universe-url* 56 | 57 | # vim swap files 58 | *.swp 59 | 60 | # OS X 61 | .DS_Store 62 | 63 | # service diagnostics 64 | /service-diagnostic-bundles 65 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | repos: 2 | - repo: https://github.com/python/black 3 | rev: stable 4 | hooks: 5 | - id: black 6 | args: [--diff, --check] 7 | language_version: python3.6 8 | - repo: https://gitlab.com/pycqa/flake8 9 | rev: 3.7.7 10 | hooks: 11 | - id: flake8 12 | - repo: local 13 | hooks: 14 | - id: pylint 15 | name: pylint 16 | entry: pylint 17 | args: [-E, -j4, --disable=invalid-sequence-index, --disable=no-member, --disable=no-name-in-module] 18 | language: system 19 | types: [python] 20 | -------------------------------------------------------------------------------- /__init__.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import os.path 3 | 4 | # Add /testing/ to PYTHONPATH: 5 | this_file_dir = os.path.dirname(os.path.abspath(__file__)) 6 | sys.path.append(os.path.normpath(os.path.join(this_file_dir, "testing"))) 7 | -------------------------------------------------------------------------------- /cli/client/testdata/cliconfig/both/clusters/12345678-1234-1234-1234-123456789012/dcos.toml: -------------------------------------------------------------------------------- 1 | [core] 2 | ssl_verify = "/path/to/.dcos/clusters/12345678-1234-1234-1234-123456789012/dcos_ca.crt" 3 | dcos_url = "http://cluster-2.com/" 4 | dcos_acs_token = "cluster-2-token" 5 | [package] 6 | cosmos_url = "https://cluster-2-cosmos" 7 | [cluster] 8 | name = "cluster-2" 9 | -------------------------------------------------------------------------------- /cli/client/testdata/cliconfig/both/clusters/12345678-1234-1234-1234-123456789012/subcommands/.empty_dir: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/d2iq-archive/dcos-commons/69824783f664407b88179e6461e42b611673d053/cli/client/testdata/cliconfig/both/clusters/12345678-1234-1234-1234-123456789012/subcommands/.empty_dir -------------------------------------------------------------------------------- /cli/client/testdata/cliconfig/both/clusters/e266cd62-5b75-4b17-87a6-7b29d8ec0df4/attached: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/d2iq-archive/dcos-commons/69824783f664407b88179e6461e42b611673d053/cli/client/testdata/cliconfig/both/clusters/e266cd62-5b75-4b17-87a6-7b29d8ec0df4/attached -------------------------------------------------------------------------------- /cli/client/testdata/cliconfig/both/clusters/e266cd62-5b75-4b17-87a6-7b29d8ec0df4/dcos.toml: -------------------------------------------------------------------------------- 1 | [core] 2 | ssl_verify = "/path/to/.dcos/clusters/e266cd62-5b75-4b17-87a6-7b29d8ec0df4/dcos_ca.crt" 3 | dcos_url = "http://cluster-1.com/" 4 | dcos_acs_token = "cluster-1-token" 5 | [package] 6 | cosmos_url = "https://cluster-1-cosmos" 7 | [cluster] 8 | name = "cluster-1" 9 | -------------------------------------------------------------------------------- /cli/client/testdata/cliconfig/both/clusters/e266cd62-5b75-4b17-87a6-7b29d8ec0df4/subcommands/.empty_dir: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/d2iq-archive/dcos-commons/69824783f664407b88179e6461e42b611673d053/cli/client/testdata/cliconfig/both/clusters/e266cd62-5b75-4b17-87a6-7b29d8ec0df4/subcommands/.empty_dir -------------------------------------------------------------------------------- /cli/client/testdata/cliconfig/both/dcos.toml: -------------------------------------------------------------------------------- 1 | [core] 2 | ssl_verify = "false" 3 | dcos_url = "http://old-cluster.com/" 4 | dcos_acs_token = "old-cluster-token" 5 | [package] 6 | cosmos_url = "https://old-cluster-cosmos" 7 | -------------------------------------------------------------------------------- /cli/client/testdata/cliconfig/new/clusters/12345678-1234-1234-1234-123456789012/dcos.toml: -------------------------------------------------------------------------------- 1 | [core] 2 | ssl_verify = "/path/to/.dcos/clusters/12345678-1234-1234-1234-123456789012/dcos_ca.crt" 3 | dcos_url = "http://cluster-2.com/" 4 | dcos_acs_token = "cluster-2-token" 5 | [package] 6 | cosmos_url = "https://cluster-2-cosmos" 7 | [cluster] 8 | name = "cluster-2" 9 | -------------------------------------------------------------------------------- /cli/client/testdata/cliconfig/new/clusters/12345678-1234-1234-1234-123456789012/subcommands/.empty_dir: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/d2iq-archive/dcos-commons/69824783f664407b88179e6461e42b611673d053/cli/client/testdata/cliconfig/new/clusters/12345678-1234-1234-1234-123456789012/subcommands/.empty_dir -------------------------------------------------------------------------------- /cli/client/testdata/cliconfig/new/clusters/e266cd62-5b75-4b17-87a6-7b29d8ec0df4/attached: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/d2iq-archive/dcos-commons/69824783f664407b88179e6461e42b611673d053/cli/client/testdata/cliconfig/new/clusters/e266cd62-5b75-4b17-87a6-7b29d8ec0df4/attached -------------------------------------------------------------------------------- /cli/client/testdata/cliconfig/new/clusters/e266cd62-5b75-4b17-87a6-7b29d8ec0df4/dcos.toml: -------------------------------------------------------------------------------- 1 | [core] 2 | ssl_verify = "/path/to/.dcos/clusters/e266cd62-5b75-4b17-87a6-7b29d8ec0df4/dcos_ca.crt" 3 | dcos_url = "http://cluster-1.com/" 4 | dcos_acs_token = "cluster-1-token" 5 | [package] 6 | cosmos_url = "https://cluster-1-cosmos" 7 | [cluster] 8 | name = "cluster-1" 9 | -------------------------------------------------------------------------------- /cli/client/testdata/cliconfig/new/clusters/e266cd62-5b75-4b17-87a6-7b29d8ec0df4/subcommands/.empty_dir: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/d2iq-archive/dcos-commons/69824783f664407b88179e6461e42b611673d053/cli/client/testdata/cliconfig/new/clusters/e266cd62-5b75-4b17-87a6-7b29d8ec0df4/subcommands/.empty_dir -------------------------------------------------------------------------------- /cli/client/testdata/cliconfig/old/dcos.toml: -------------------------------------------------------------------------------- 1 | [core] 2 | ssl_verify = "false" 3 | dcos_url = "http://old-cluster.com/" 4 | dcos_acs_token = "old-cluster-token" 5 | [package] 6 | cosmos_url = "https://old-cluster-cosmos" 7 | -------------------------------------------------------------------------------- /cli/client/testdata/cliconfig/two-attached/clusters/12345678-1234-1234-1234-123456789012/attached: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/d2iq-archive/dcos-commons/69824783f664407b88179e6461e42b611673d053/cli/client/testdata/cliconfig/two-attached/clusters/12345678-1234-1234-1234-123456789012/attached -------------------------------------------------------------------------------- /cli/client/testdata/cliconfig/two-attached/clusters/12345678-1234-1234-1234-123456789012/dcos.toml: -------------------------------------------------------------------------------- 1 | [core] 2 | ssl_verify = "/path/to/.dcos/clusters/12345678-1234-1234-1234-123456789012/dcos_ca.crt" 3 | dcos_url = "http://cluster-2.com/" 4 | dcos_acs_token = "cluster-2-token" 5 | [package] 6 | cosmos_url = "https://cluster-2-cosmos" 7 | [cluster] 8 | name = "cluster-2" 9 | -------------------------------------------------------------------------------- /cli/client/testdata/cliconfig/two-attached/clusters/12345678-1234-1234-1234-123456789012/subcommands/.empty_dir: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/d2iq-archive/dcos-commons/69824783f664407b88179e6461e42b611673d053/cli/client/testdata/cliconfig/two-attached/clusters/12345678-1234-1234-1234-123456789012/subcommands/.empty_dir -------------------------------------------------------------------------------- /cli/client/testdata/cliconfig/two-attached/clusters/e266cd62-5b75-4b17-87a6-7b29d8ec0df4/attached: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/d2iq-archive/dcos-commons/69824783f664407b88179e6461e42b611673d053/cli/client/testdata/cliconfig/two-attached/clusters/e266cd62-5b75-4b17-87a6-7b29d8ec0df4/attached -------------------------------------------------------------------------------- /cli/client/testdata/cliconfig/two-attached/clusters/e266cd62-5b75-4b17-87a6-7b29d8ec0df4/dcos.toml: -------------------------------------------------------------------------------- 1 | [core] 2 | ssl_verify = "/path/to/.dcos/clusters/e266cd62-5b75-4b17-87a6-7b29d8ec0df4/dcos_ca.crt" 3 | dcos_url = "http://cluster-1.com/" 4 | dcos_acs_token = "cluster-1-token" 5 | [package] 6 | cosmos_url = "https://cluster-1-cosmos" 7 | [cluster] 8 | name = "cluster-1" 9 | -------------------------------------------------------------------------------- /cli/client/testdata/cliconfig/two-attached/clusters/e266cd62-5b75-4b17-87a6-7b29d8ec0df4/subcommands/.empty_dir: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/d2iq-archive/dcos-commons/69824783f664407b88179e6461e42b611673d053/cli/client/testdata/cliconfig/two-attached/clusters/e266cd62-5b75-4b17-87a6-7b29d8ec0df4/subcommands/.empty_dir -------------------------------------------------------------------------------- /cli/client/testdata/responses/cosmos/1.10/enterprise/bad-app-id.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "AppIdChanged", 3 | "message": "The new appId /hello-world must be equal to the old appId /hello-world2", 4 | "data": { 5 | "newAppId": "/hello-world", 6 | "oldAppId": "/hello-world2" 7 | } 8 | } -------------------------------------------------------------------------------- /cli/client/testdata/responses/cosmos/1.10/enterprise/bad-name.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": { 3 | "appId": "/hello-world-1" 4 | }, 5 | "message": "Unable to locate service with marathon appId: '/hello-world-1'", 6 | "type": "MarathonAppNotFound" 7 | } -------------------------------------------------------------------------------- /cli/client/testdata/responses/cosmos/1.10/enterprise/bad-version-no-versions.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": { 3 | "currentVersion": "stub-universe", 4 | "updateVersion": "not-a-valid", 5 | "validVersions": [] 6 | }, 7 | "message": "The service of version stub-universe cannot update to the requested version not-a-valid", 8 | "type": "BadVersionUpdate" 9 | } -------------------------------------------------------------------------------- /cli/client/testdata/responses/cosmos/1.10/enterprise/bad-version.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": { 3 | "currentVersion": "stub-universe", 4 | "updateVersion": "not-a-valid", 5 | "validVersions": [ "v0.8", "v0.9", "v1.1", "v2.0" ] 6 | }, 7 | "message": "The service of version stub-universe cannot update to the requested version not-a-valid", 8 | "type": "BadVersionUpdate" 9 | } -------------------------------------------------------------------------------- /cli/client/testdata/responses/cosmos/1.10/enterprise/generic-error.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": { 3 | }, 4 | "message": "This an example of a generic Cosmos error response.", 5 | "type": "GenericErrorType" 6 | } -------------------------------------------------------------------------------- /cli/client/testdata/responses/cosmos/1.10/enterprise/marathon-error.json: -------------------------------------------------------------------------------- 1 | {"type":"unhandled_exception","message":"java.lang.Error: {\"message\":\"App is locked by one or more deployments. Override with the option '?force=true'. View details at '/v2/deployments/'.\",\"deployments\":[{\"id\":\"839314dd-f223-4d55-9d74-a556119e84be\"}]}"} 2 | -------------------------------------------------------------------------------- /cli/queries/endpoints.go: -------------------------------------------------------------------------------- 1 | package queries 2 | 3 | import ( 4 | "github.com/mesosphere/dcos-commons/cli/client" 5 | ) 6 | 7 | type Endpoints struct { 8 | PrefixCb func() string 9 | } 10 | 11 | func NewEndpoints() *Endpoints { 12 | return &Endpoints{ 13 | PrefixCb: func() string { return "v1/" }, 14 | } 15 | } 16 | 17 | func (q *Endpoints) Show(endpointName string) error { 18 | responseBytes, err := client.HTTPServiceGet(q.PrefixCb() + "endpoints/" + endpointName) 19 | if err != nil { 20 | return err 21 | } 22 | // Endpoint details may be of any format, so just print the raw text 23 | client.PrintResponseText(responseBytes) 24 | return nil 25 | } 26 | 27 | func (q *Endpoints) List() error { 28 | responseBytes, err := client.HTTPServiceGet(q.PrefixCb() + "endpoints") 29 | if err != nil { 30 | return err 31 | } 32 | client.PrintJSONBytes(responseBytes) 33 | return nil 34 | } 35 | -------------------------------------------------------------------------------- /cli/queries/testdata/input/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "hello": { 3 | "count": 1, 4 | "cpus": 0.1, 5 | "disk": 25, 6 | "gpus": 1, 7 | "mem": 252, 8 | "placement": "hostname:UNIQUE" 9 | }, 10 | "service": { 11 | "mesos_api_version": "V1", 12 | "name": "hello-world", 13 | "service_account": "", 14 | "service_account_secret": "", 15 | "sleep": 1000, 16 | "spec_file": "svc.yml", 17 | "user": "root" 18 | }, 19 | "world": { 20 | "count": 2, 21 | "cpus": 0.2, 22 | "disk": 50, 23 | "mem": 512, 24 | "placement": "hostname:UNIQUE" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /cli/queries/testdata/input/empty.json: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cli/queries/testdata/input/malformed.json: -------------------------------------------------------------------------------- 1 | { 2 | "hello": { 3 | "count": 1, 4 | "cpus": 0.1, 5 | "disk": 25, 6 | "gpus": 1, 7 | "mem": 252, 8 | "placement": "hostname:UNIQUE" 9 | }, 10 | "service": { 11 | "mesos_api_version": "V1", 12 | "name": "hello-world", 13 | "service_account": "", 14 | "service_account_secret": "", 15 | "sleep": 1000, 16 | "spec_file": "svc.yml", 17 | "user": "root" 18 | }, 19 | -------------------------------------------------------------------------------- /cli/queries/testdata/requests/update-configuration-replace.json: -------------------------------------------------------------------------------- 1 | { 2 | "appId": "hello-world", 3 | "options": { 4 | "hello": { 5 | "count": 1, 6 | "cpus": 0.1, 7 | "disk": 25, 8 | "gpus": 1, 9 | "mem": 252, 10 | "placement": "hostname:UNIQUE" 11 | }, 12 | "service": { 13 | "mesos_api_version": "V1", 14 | "name": "hello-world", 15 | "service_account": "", 16 | "service_account_secret": "", 17 | "sleep": 1000, 18 | "spec_file": "svc.yml", 19 | "user": "root" 20 | }, 21 | "world": { 22 | "count": 2, 23 | "cpus": 0.2, 24 | "disk": 50, 25 | "mem": 512, 26 | "placement": "hostname:UNIQUE" 27 | } 28 | }, 29 | "replace" : true 30 | } 31 | -------------------------------------------------------------------------------- /cli/queries/testdata/requests/update-configuration.json: -------------------------------------------------------------------------------- 1 | { 2 | "appId": "hello-world", 3 | "options": { 4 | "hello": { 5 | "count": 1, 6 | "cpus": 0.1, 7 | "disk": 25, 8 | "gpus": 1, 9 | "mem": 252, 10 | "placement": "hostname:UNIQUE" 11 | }, 12 | "service": { 13 | "mesos_api_version": "V1", 14 | "name": "hello-world", 15 | "service_account": "", 16 | "service_account_secret": "", 17 | "sleep": 1000, 18 | "spec_file": "svc.yml", 19 | "user": "root" 20 | }, 21 | "world": { 22 | "count": 2, 23 | "cpus": 0.2, 24 | "disk": 50, 25 | "mem": 512, 26 | "placement": "hostname:UNIQUE" 27 | } 28 | }, 29 | "replace" : false 30 | } 31 | -------------------------------------------------------------------------------- /cli/queries/testdata/requests/update-package-version.json: -------------------------------------------------------------------------------- 1 | { 2 | "appId": "hello-world", 3 | "packageVersion" : "stub-universe", 4 | "replace": false 5 | } -------------------------------------------------------------------------------- /cli/queries/testdata/requests/update.json: -------------------------------------------------------------------------------- 1 | { 2 | "appId": "hello-world", 3 | "options": { 4 | "hello": { 5 | "count": 1, 6 | "cpus": 0.1, 7 | "disk": 25, 8 | "gpus": 1, 9 | "mem": 252, 10 | "placement": "hostname:UNIQUE" 11 | }, 12 | "service": { 13 | "mesos_api_version": "V1", 14 | "name": "hello-world", 15 | "service_account": "", 16 | "service_account_secret": "", 17 | "sleep": 1000, 18 | "spec_file": "svc.yml", 19 | "user": "root" 20 | }, 21 | "world": { 22 | "count": 2, 23 | "cpus": 0.2, 24 | "disk": 50, 25 | "mem": 512, 26 | "placement": "hostname:UNIQUE" 27 | } 28 | }, 29 | "packageVersion" : "stub-universe", 30 | "replace": false 31 | } 32 | -------------------------------------------------------------------------------- /cli/queries/testdata/responses/scheduler/already-reported.txt: -------------------------------------------------------------------------------- 1 | Command has already been reported or completed -------------------------------------------------------------------------------- /cli/queries/testdata/responses/scheduler/continue.json: -------------------------------------------------------------------------------- 1 | { 2 | "message": "Received cmd: continue" 3 | } -------------------------------------------------------------------------------- /cli/queries/testdata/responses/scheduler/force-complete.json: -------------------------------------------------------------------------------- 1 | { 2 | "message": "Received cmd: forceComplete" 3 | } -------------------------------------------------------------------------------- /cli/queries/testdata/responses/scheduler/interrupt.json: -------------------------------------------------------------------------------- 1 | { 2 | "message": "Received cmd: interrupt" 3 | } -------------------------------------------------------------------------------- /cli/queries/testdata/responses/scheduler/not-found.txt: -------------------------------------------------------------------------------- 1 | Element not found -------------------------------------------------------------------------------- /cli/queries/testdata/responses/scheduler/plans-no-update.json: -------------------------------------------------------------------------------- 1 | [ 2 | "deploy", 3 | "recovery" 4 | ] -------------------------------------------------------------------------------- /cli/queries/testdata/responses/scheduler/plans.json: -------------------------------------------------------------------------------- 1 | [ 2 | "backup", 3 | "deploy", 4 | "recovery", 5 | "update" 6 | ] -------------------------------------------------------------------------------- /cli/queries/testdata/responses/scheduler/restart.json: -------------------------------------------------------------------------------- 1 | { 2 | "message": "Received cmd: restart" 3 | } -------------------------------------------------------------------------------- /dep-snapshots/dcos: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/d2iq-archive/dcos-commons/69824783f664407b88179e6461e42b611673d053/dep-snapshots/dcos -------------------------------------------------------------------------------- /dind-wrapper.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | echo "==> Launching the Docker daemon..." 5 | if docker info > /dev/null 2>&1; then 6 | echo "=== Docker already running"; 7 | else 8 | /usr/local/bin/dind dockerd $DIND_DOCKER_ARGS > /var/log/docker.log 2>&1 & 9 | for i in `seq 300`; do 10 | echo "=== waiting for docker to start..."; 11 | if docker info > /dev/null 2>&1; then 12 | break; 13 | fi; 14 | sleep 1; 15 | done; 16 | if docker info > /dev/null 2>&1; then 17 | echo "=== Docker started!"; 18 | else 19 | echo "=== Docker failed to start"; 20 | exit 1; 21 | fi; 22 | fi 23 | 24 | exec $@ 25 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | dcos-commons-gh-pages/ 2 | # TODO: specifically exclude from ignoring (not ignore) the documentation files 3 | # that are known/expected to be manually created. 4 | # 5 | # the vast majority of documentation w/i pages/services are auto-generated, BUT 6 | # some files are manually created, i.e. limitations.md. 7 | pages/services/ 8 | swagger-codegen-cli-*.jar 9 | -------------------------------------------------------------------------------- /docs/pages/_config.yml: -------------------------------------------------------------------------------- 1 | defaults: 2 | - 3 | scope: 4 | path: "" 5 | values: 6 | layout: "layout" 7 | stylesheet: "layout.css" 8 | menuWeight: 999 9 | plugins: 10 | - jekyll-redirect-from 11 | - jekyll-toc 12 | sass: 13 | sass_dir: _sass 14 | style: :compressed 15 | highlighter: rouge 16 | lsi: false 17 | markdown: kramdown 18 | kramdown: 19 | input: GFM 20 | hard_wrap: false 21 | extensions: [tables] 22 | source: . 23 | baseurl: /dcos-commons 24 | # Render pages in directories, to avoid .html file endings. 25 | # This matches docs.mesosphere.com's layout. 26 | permalink: pretty 27 | -------------------------------------------------------------------------------- /docs/pages/_layouts/redirect.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Redirecting... 5 | 6 | 7 |

Redirecting...

8 | Click here if you are not redirected. 9 | 10 | 11 | -------------------------------------------------------------------------------- /docs/pages/img/data-store-tutorial-architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/d2iq-archive/dcos-commons/69824783f664407b88179e6461e42b611673d053/docs/pages/img/data-store-tutorial-architecture.png -------------------------------------------------------------------------------- /docs/pages/img/dev-guide-configuration-values-across-files.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/d2iq-archive/dcos-commons/69824783f664407b88179e6461e42b611673d053/docs/pages/img/dev-guide-configuration-values-across-files.png -------------------------------------------------------------------------------- /docs/pages/img/dev-guide-deployment-steps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/d2iq-archive/dcos-commons/69824783f664407b88179e6461e42b611673d053/docs/pages/img/dev-guide-deployment-steps.png -------------------------------------------------------------------------------- /docs/pages/img/dev-guide-plans-and-the-offer-cycle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/d2iq-archive/dcos-commons/69824783f664407b88179e6461e42b611673d053/docs/pages/img/dev-guide-plans-and-the-offer-cycle.png -------------------------------------------------------------------------------- /docs/pages/img/dev-guide-plans-vs-services.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/d2iq-archive/dcos-commons/69824783f664407b88179e6461e42b611673d053/docs/pages/img/dev-guide-plans-vs-services.png -------------------------------------------------------------------------------- /docs/pages/img/multi-service-multi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/d2iq-archive/dcos-commons/69824783f664407b88179e6461e42b611673d053/docs/pages/img/multi-service-multi.png -------------------------------------------------------------------------------- /docs/pages/img/multi-service-single.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/d2iq-archive/dcos-commons/69824783f664407b88179e6461e42b611673d053/docs/pages/img/multi-service-single.png -------------------------------------------------------------------------------- /docs/pages/operations-guide.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: SDK Operations Guide 3 | menu: false 4 | redirect_from: /operations-guide.html 5 | --- 6 | 7 | The content from the Operations Guide has been merged into individual service guides for DC/OS services that make use of the DC/OS SDK. 8 | 9 | Please visit the [DC/OS Service Docs page](https://docs.mesosphere.com/services/) to find the documentation for the service you are using. 10 | -------------------------------------------------------------------------------- /docs/pages/style/yaml-reference.css: -------------------------------------------------------------------------------- 1 | @import url('layout.css'); 2 | 3 | /* root list gets no margins, no border: */ 4 | #content ul { margin-left: 0; padding-left: 0 } 5 | /* nested lists get a left border and some left margins: */ 6 | #content li>ul { border-left: 2px dotted #BF97F0; margin-left: 1em; padding-left: 1em } 7 | /* styling for list elements: */ 8 | #content li { list-style-type: none; margin: 0; padding: 0 } 9 | 10 | /* allow escaping above custom list behavior with custom
*/ 11 | .noyaml ul { padding-left: 30px !important } 12 | .noyaml li>ul { border-left: none !important } 13 | .noyaml li { list-style-type: square !important } -------------------------------------------------------------------------------- /docs/reference/swagger-api/swagger-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "appName": "DC/OS SDK API Reference", 3 | "infoUrl": "https://github.com/mesosphere/dcos-commons/", 4 | "infoEmail": "https://dcos-community.slack.com/messages/data-services-dev/", 5 | "licenseInfo": "Apache License V2", 6 | "licenseUrl": "https://github.com/mesosphere/dcos-commons/blob/master/LICENSE" 7 | } 8 | -------------------------------------------------------------------------------- /frameworks/cassandra/.gitignore: -------------------------------------------------------------------------------- 1 | Python-*/ 2 | Python-*.tgz 3 | openssl-*/ 4 | openssl-*.tar.gz 5 | -------------------------------------------------------------------------------- /frameworks/cassandra/README.md: -------------------------------------------------------------------------------- 1 | # DC/OS Apache Cassandra Service Documentation 2 | 3 | User documentation may be found at the [DC/OS Docs site](https://docs.mesosphere.com/services/cassandra/). 4 | -------------------------------------------------------------------------------- /frameworks/cassandra/build.gradle: -------------------------------------------------------------------------------- 1 | group 'com.mesosphere.sdk' 2 | version '1.1-SNAPSHOT' 3 | 4 | apply plugin: 'application' 5 | 6 | dependencies { 7 | compile project(":scheduler") 8 | testCompile project(":testing") 9 | } 10 | 11 | distributions { 12 | main { 13 | baseName = 'cassandra-scheduler' 14 | version = '' 15 | } 16 | } 17 | 18 | mainClassName = 'com.mesosphere.sdk.cassandra.scheduler.Main' 19 | -------------------------------------------------------------------------------- /frameworks/cassandra/lib/metrics-statsd-common-4.1.2-SNAPSHOT.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/d2iq-archive/dcos-commons/69824783f664407b88179e6461e42b611673d053/frameworks/cassandra/lib/metrics-statsd-common-4.1.2-SNAPSHOT.jar -------------------------------------------------------------------------------- /frameworks/cassandra/lib/metrics3-statsd-4.1.2-SNAPSHOT.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/d2iq-archive/dcos-commons/69824783f664407b88179e6461e42b611673d053/frameworks/cassandra/lib/metrics3-statsd-4.1.2-SNAPSHOT.jar -------------------------------------------------------------------------------- /frameworks/cassandra/lib/reporter-config-base-3.0.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/d2iq-archive/dcos-commons/69824783f664407b88179e6461e42b611673d053/frameworks/cassandra/lib/reporter-config-base-3.0.3.jar -------------------------------------------------------------------------------- /frameworks/cassandra/lib/reporter-config3-3.0.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/d2iq-archive/dcos-commons/69824783f664407b88179e6461e42b611673d053/frameworks/cassandra/lib/reporter-config3-3.0.3.jar -------------------------------------------------------------------------------- /frameworks/cassandra/src/main/dist/cassandra-rackdc.properties: -------------------------------------------------------------------------------- 1 | dc={{CASSANDRA_LOCATION_DATA_CENTER}} 2 | {{#PLACEMENT_REFERENCED_ZONE}} 3 | rack={{ZONE}} 4 | {{/PLACEMENT_REFERENCED_ZONE}} 5 | {{^PLACEMENT_REFERENCED_ZONE}} 6 | rack={{CASSANDRA_LOCATION_RACK}} 7 | {{/PLACEMENT_REFERENCED_ZONE}} 8 | -------------------------------------------------------------------------------- /frameworks/cassandra/src/main/dist/cqlshrc: -------------------------------------------------------------------------------- 1 | [connection] 2 | factory = cqlshlib.ssl.ssl_transport_factory 3 | 4 | [ssl] 5 | ; certfile = /root/.cassandra/certificate 6 | ; Note: If validate = true then the certificate name must match the machine's hostname 7 | validate = true 8 | ; If using client authentication (require_client_auth = true in cassandra.yaml) you'll also need to point to your uesrkey and usercert. 9 | ; SSL client authentication is only supported via cqlsh on C* 2.1 and greater. 10 | ; This is disabled by default on all Instaclustr-managed clusters. 11 | ; userkey = /path/to/userkey.pem 12 | ; usercert = /path/to/usercert.pem 13 | -------------------------------------------------------------------------------- /frameworks/cassandra/src/main/dist/jvm_CMS.options: -------------------------------------------------------------------------------- 1 | -Xms{{CASSANDRA_HEAP_SIZE_MB}}M 2 | -Xmx{{CASSANDRA_HEAP_SIZE_MB}}M 3 | -Xmn{{CASSANDRA_HEAP_NEW_MB}}M 4 | 5 | -XX:+UseParNewGC 6 | -XX:+UseConcMarkSweepGC 7 | -XX:+CMSParallelRemarkEnabled 8 | -XX:SurvivorRatio=8 9 | -XX:MaxTenuringThreshold=1 10 | -XX:CMSInitiatingOccupancyFraction=75 11 | -XX:+UseCMSInitiatingOccupancyOnly 12 | -XX:CMSWaitDuration=10000 13 | -XX:+CMSParallelInitialMarkEnabled 14 | -XX:+CMSEdenChunksRecordAlways 15 | -XX:+CMSClassUnloadingEnabled 16 | 17 | -XX:+PrintGCDetails 18 | -XX:+PrintGCDateStamps 19 | -XX:+PrintHeapAtGC 20 | -XX:+PrintTenuringDistribution 21 | -XX:+PrintGCApplicationStoppedTime 22 | -XX:+PrintPromotionFailure 23 | #-XX:PrintFLSStatistics=1 24 | -Xloggc:{{MESOS_SANDBOX}}/gc.log 25 | -XX:+UseGCLogFileRotation 26 | -XX:NumberOfGCLogFiles=10 27 | -XX:GCLogFileSize=10M 28 | -------------------------------------------------------------------------------- /frameworks/cassandra/src/main/dist/jvm_G1.options: -------------------------------------------------------------------------------- 1 | -Xms{{CASSANDRA_HEAP_SIZE_MB}}M 2 | -Xmx{{CASSANDRA_HEAP_SIZE_MB}}M 3 | 4 | -XX:+UseG1GC 5 | 6 | -XX:+PrintGCDetails 7 | -XX:+PrintGCDateStamps 8 | -XX:+PrintHeapAtGC 9 | -XX:+PrintTenuringDistribution 10 | -XX:+PrintGCApplicationStoppedTime 11 | -XX:+PrintPromotionFailure 12 | #-XX:PrintFLSStatistics=1 13 | -Xloggc:{{MESOS_SANDBOX}}/gc.log 14 | -XX:+UseGCLogFileRotation 15 | -XX:NumberOfGCLogFiles=10 16 | -XX:GCLogFileSize=10M 17 | -------------------------------------------------------------------------------- /frameworks/cassandra/src/main/dist/metrics-reporter-config.yaml: -------------------------------------------------------------------------------- 1 | statsd: 2 | - period: {{METRICS_PERIOD_MIN}} 3 | timeunit: 'MINUTES' 4 | hosts: 5 | - host: {{STATSD_UDP_HOST}} 6 | port: {{STATSD_UDP_PORT}} 7 | -------------------------------------------------------------------------------- /frameworks/cassandra/src/main/java/com/mesosphere/sdk/cassandra/api/Seeds.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.cassandra.api; 2 | 3 | import com.fasterxml.jackson.annotation.JsonCreator; 4 | import com.fasterxml.jackson.annotation.JsonIgnore; 5 | import com.fasterxml.jackson.annotation.JsonProperty; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * A class representing the seeds for a Cassandra cluster and whether the requester should consider 11 | * itself a seed. 12 | */ 13 | public class Seeds { 14 | @JsonProperty("seeds") 15 | private final List seeds; 16 | 17 | @JsonCreator 18 | public Seeds(@JsonProperty("seeds") List seeds) { 19 | this.seeds = seeds; 20 | } 21 | 22 | @JsonIgnore 23 | public List getSeeds() { 24 | return seeds; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /frameworks/cassandra/src/main/resources/cassandra-rackdc.properties: -------------------------------------------------------------------------------- 1 | ../dist/cassandra-rackdc.properties -------------------------------------------------------------------------------- /frameworks/cassandra/src/main/resources/cassandra.yaml: -------------------------------------------------------------------------------- 1 | ../dist/cassandra.yaml -------------------------------------------------------------------------------- /frameworks/cassandra/src/main/resources/jvm_CMS.options: -------------------------------------------------------------------------------- 1 | ../dist/jvm_CMS.options -------------------------------------------------------------------------------- /frameworks/cassandra/src/main/resources/jvm_G1.options: -------------------------------------------------------------------------------- 1 | ../dist/jvm_G1.options -------------------------------------------------------------------------------- /frameworks/cassandra/src/main/resources/svc.yml: -------------------------------------------------------------------------------- 1 | ../dist/svc.yml -------------------------------------------------------------------------------- /frameworks/cassandra/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker: -------------------------------------------------------------------------------- 1 | mock-maker-inline 2 | -------------------------------------------------------------------------------- /frameworks/cassandra/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/d2iq-archive/dcos-commons/69824783f664407b88179e6461e42b611673d053/frameworks/cassandra/tests/__init__.py -------------------------------------------------------------------------------- /frameworks/cassandra/tests/conftest.py: -------------------------------------------------------------------------------- 1 | from typing import Iterator 2 | 3 | import pytest 4 | import sdk_external_volumes 5 | import sdk_security 6 | from tests import config 7 | 8 | 9 | @pytest.fixture(scope="session") 10 | def configure_security(configure_universe: None) -> Iterator[None]: 11 | yield from sdk_security.security_session(config.SERVICE_NAME) 12 | 13 | 14 | @pytest.fixture(scope="session") 15 | def configure_external_volumes(): 16 | # Handle creation of external volumes. 17 | yield from sdk_external_volumes.external_volumes_session() 18 | -------------------------------------------------------------------------------- /frameworks/hdfs/README.md: -------------------------------------------------------------------------------- 1 | # DC/OS Apache HDFS Service 2 | 3 | User documentation may be found at the [DC/OS Docs site](https://docs.mesosphere.com/services/hdfs/). 4 | -------------------------------------------------------------------------------- /frameworks/hdfs/build.gradle: -------------------------------------------------------------------------------- 1 | group 'com.mesosphere.sdk.hdfs' 2 | version '1.0-SNAPSHOT' 3 | 4 | apply plugin: 'application' 5 | 6 | dependencies { 7 | compile project(":scheduler") 8 | testCompile project(":testing") 9 | } 10 | 11 | distributions { 12 | main { 13 | baseName = 'hdfs-scheduler' 14 | version = '' 15 | } 16 | } 17 | 18 | mainClassName = 'com.mesosphere.sdk.hdfs.scheduler.Main' 19 | -------------------------------------------------------------------------------- /frameworks/hdfs/cli/build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | 4 | # Builds the custom CLI used by the Kafka service. 5 | # Produces 3 artifacts: dcos-service-cli[-linux|-darwin|.exe] 6 | 7 | CUR_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 8 | cd $CUR_DIR 9 | 10 | # required env: 11 | export REPO_ROOT_DIR=$(dirname $(dirname $(dirname $CUR_DIR))) 12 | export REPO_NAME=$(basename $REPO_ROOT_DIR) 13 | $REPO_ROOT_DIR/tools/build_go_exe.sh frameworks/hdfs/cli/ dcos-service-cli linux darwin windows 14 | -------------------------------------------------------------------------------- /frameworks/hdfs/cli/main_test.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "testing" 4 | import "github.com/stretchr/testify/assert" 5 | 6 | func TestFirstArgumentIndex(t *testing.T) { 7 | 8 | assert.Equal(t, firstArgumentIndex("hdfs", []string{"hdfs", "--flag"}), 0) 9 | assert.Equal(t, firstArgumentIndex("hdfs", []string{"--flag", "hdfs"}), 1) 10 | assert.Equal(t, firstArgumentIndex("hdfs", []string{"-f", "hdfs"}), 1) 11 | assert.Equal(t, firstArgumentIndex("hdfs", []string{"--flag", "argument", "hdfs"}), -1) 12 | assert.Equal(t, firstArgumentIndex("hdfs", []string{"--flag", "hdfs", "argument"}), 1) 13 | assert.Equal(t, firstArgumentIndex("hdfs", []string{}), -1) 14 | } 15 | -------------------------------------------------------------------------------- /frameworks/hdfs/cli/vendor: -------------------------------------------------------------------------------- 1 | ../../../sdk/cli/vendor -------------------------------------------------------------------------------- /frameworks/hdfs/keytab-fix/src/main/java/com/mesosphere/keytabfix/KeytabFix.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.keytabfix; 2 | 3 | import java.io.File; 4 | import java.io.IOException; 5 | 6 | public class KeytabFix { 7 | public static void main(String[] args) throws IOException { 8 | String keytabPath = ""; 9 | if(args.length > 0) { 10 | keytabPath = args[0]; 11 | } else { 12 | System.err.println("Keytab File is not specified!\nUsage: KeytabFix file.keytab"); 13 | System.exit(1); 14 | } 15 | File keytabFile = new File(keytabPath); 16 | if(!keytabFile.exists()){ 17 | System.err.println("Keytab File does not exists: " + keytabPath); 18 | System.exit(1); 19 | } 20 | System.out.println("Fixing KeyTab File..."+keytabPath); 21 | String keytabOut = "hdfs.keytab"; 22 | Keytab keytab = Keytab.loadKeytab(keytabFile); 23 | 24 | keytab.store(new File(keytabOut)); 25 | System.out.println("Fixed KeyTab File is: "+keytabOut); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /frameworks/hdfs/src/main/dist/data-hadoop-metrics2.properties: -------------------------------------------------------------------------------- 1 | # Autogenerated by the Mesos Framework, DO NOT EDIT 2 | *.sink.statsd.class=org.apache.hadoop.metrics2.sink.StatsDSink 3 | datanode.sink.statsd.period=10 4 | datanode.sink.statsd.server.host={{STATSD_UDP_HOST}} 5 | datanode.sink.statsd.server.port={{STATSD_UDP_PORT}} 6 | datanode.sink.statsd.skip.hostname=false -------------------------------------------------------------------------------- /frameworks/hdfs/src/main/dist/journal-hadoop-metrics2.properties: -------------------------------------------------------------------------------- 1 | # Autogenerated by the Mesos Framework, DO NOT EDIT 2 | *.sink.statsd.class=org.apache.hadoop.metrics2.sink.StatsDSink 3 | journalnode.sink.statsd.period=10 4 | journalnode.sink.statsd.server.host={{STATSD_UDP_HOST}} 5 | journalnode.sink.statsd.server.port={{STATSD_UDP_PORT}} 6 | journalnode.sink.statsd.skip.hostname=false -------------------------------------------------------------------------------- /frameworks/hdfs/src/main/dist/krb5.conf: -------------------------------------------------------------------------------- 1 | [libdefaults] 2 | default_realm = {{SECURITY_KERBEROS_REALM}} 3 | 4 | [realms] 5 | {{SECURITY_KERBEROS_REALM}} = { 6 | kdc = {{SECURITY_KERBEROS_KDC_HOSTNAME}}:{{SECURITY_KERBEROS_KDC_PORT}} 7 | } 8 | -------------------------------------------------------------------------------- /frameworks/hdfs/src/main/dist/name-hadoop-metrics2.properties: -------------------------------------------------------------------------------- 1 | # Autogenerated by the Mesos Framework, DO NOT EDIT 2 | *.sink.statsd.class=org.apache.hadoop.metrics2.sink.StatsDSink 3 | namenode.sink.statsd.period=10 4 | namenode.sink.statsd.server.host={{STATSD_UDP_HOST}} 5 | namenode.sink.statsd.server.port={{STATSD_UDP_PORT}} 6 | namenode.sink.statsd.skip.hostname=false -------------------------------------------------------------------------------- /frameworks/hdfs/src/main/dist/ssl-client.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ssl.client.truststore.password 7 | notsecure 8 | 9 | 10 | ssl.client.truststore.type 11 | jks 12 | 13 | 14 | ssl.client.truststore.location 15 | {{MESOS_SANDBOX}}/node.truststore 16 | 17 | 18 | -------------------------------------------------------------------------------- /frameworks/hdfs/src/main/resources/core-site.xml: -------------------------------------------------------------------------------- 1 | ../dist/core-site.xml -------------------------------------------------------------------------------- /frameworks/hdfs/src/main/resources/data-hadoop-metrics2.properties: -------------------------------------------------------------------------------- 1 | ../dist/data-hadoop-metrics2.properties -------------------------------------------------------------------------------- /frameworks/hdfs/src/main/resources/hdfs-site.xml: -------------------------------------------------------------------------------- 1 | ../dist/hdfs-site.xml -------------------------------------------------------------------------------- /frameworks/hdfs/src/main/resources/journal-hadoop-metrics2.properties: -------------------------------------------------------------------------------- 1 | ../dist/journal-hadoop-metrics2.properties -------------------------------------------------------------------------------- /frameworks/hdfs/src/main/resources/name-hadoop-metrics2.properties: -------------------------------------------------------------------------------- 1 | ../dist/name-hadoop-metrics2.properties -------------------------------------------------------------------------------- /frameworks/hdfs/src/main/resources/svc.yml: -------------------------------------------------------------------------------- 1 | ../dist/svc.yml -------------------------------------------------------------------------------- /frameworks/hdfs/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker: -------------------------------------------------------------------------------- 1 | mock-maker-inline 2 | -------------------------------------------------------------------------------- /frameworks/hdfs/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/d2iq-archive/dcos-commons/69824783f664407b88179e6461e42b611673d053/frameworks/hdfs/tests/__init__.py -------------------------------------------------------------------------------- /frameworks/hdfs/tests/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | import sdk_security 3 | from tests import config 4 | 5 | 6 | @pytest.fixture(scope="session") 7 | def configure_security(configure_universe): 8 | yield from sdk_security.security_session(config.SERVICE_NAME) 9 | -------------------------------------------------------------------------------- /frameworks/hdfs/tests/test_upgrade.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | import pytest 4 | import sdk_install 5 | import sdk_upgrade 6 | 7 | from tests import config 8 | 9 | log = logging.getLogger(__name__) 10 | 11 | foldered_name = config.FOLDERED_SERVICE_NAME 12 | 13 | 14 | @pytest.mark.sanity 15 | def test_hdfs_upgrade(): 16 | try: 17 | sdk_install.uninstall(config.PACKAGE_NAME, foldered_name) 18 | 19 | sdk_upgrade.test_upgrade( 20 | config.PACKAGE_NAME, 21 | foldered_name, 22 | config.DEFAULT_TASK_COUNT, 23 | from_options={"service": {"name": foldered_name}}, 24 | timeout_seconds=30 * 60, 25 | ) 26 | 27 | finally: 28 | sdk_install.uninstall(config.PACKAGE_NAME, foldered_name) 29 | -------------------------------------------------------------------------------- /frameworks/hdfs/tools/zone-resolver.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # For rack-awareness, HDFS expects a class or a script to resolve IP addresses 4 | # of data nodes to rack information. This script provides that resolution. 5 | # The first and only argument this script expects ($1) is the IP address 6 | # of the data node trying to register with the name node. 7 | export DATA_NODE_ZONE=$(curl ${SCHEDULER_API_HOSTNAME}:${SCHEDULER_API_PORT}/v1/state/zone/data/$1) 8 | echo "/$DATA_NODE_ZONE" 9 | -------------------------------------------------------------------------------- /frameworks/helloworld/build.gradle: -------------------------------------------------------------------------------- 1 | group 'com.mesosphere.sdk' 2 | version '1.1.1-SNAPSHOT' 3 | 4 | apply plugin: 'application' 5 | 6 | dependencies { 7 | compile project(":scheduler") 8 | testCompile project(":testing") 9 | } 10 | 11 | task copyKeystoreApp(type: Copy) { 12 | from('src/../tests/tls/keystore/build/distributions/') { 13 | include 'keystore-app.zip' 14 | } 15 | into('build/distributions') 16 | } 17 | 18 | distZip.dependsOn ":keystore-app:integrationTestZip" 19 | distZip.finalizedBy copyKeystoreApp 20 | 21 | distributions { 22 | main { 23 | baseName = 'hello-world-scheduler' 24 | version = '' 25 | } 26 | } 27 | 28 | mainClassName = 'com.mesosphere.sdk.helloworld.scheduler.Main' 29 | -------------------------------------------------------------------------------- /frameworks/helloworld/src/main/dist/crash-loop.yml: -------------------------------------------------------------------------------- 1 | # This service generates endlessly crashing tasks which do NOT complete their Steps 2 | name: {{FRAMEWORK_NAME}} 3 | scheduler: 4 | principal: {{FRAMEWORK_PRINCIPAL}} 5 | user: {{FRAMEWORK_USER}} 6 | pods: 7 | hello: 8 | count: {{HELLO_COUNT}} 9 | placement: '{{{HELLO_PLACEMENT}}}' 10 | tasks: 11 | server: 12 | goal: RUNNING 13 | cmd: "echo crash-loop && sleep $SLEEP_DURATION && exit 1" 14 | cpus: {{HELLO_CPUS}} 15 | memory: {{HELLO_MEM}} 16 | env: 17 | SLEEP_DURATION: {{SLEEP_DURATION}} 18 | readiness-check: 19 | cmd: exit 1 20 | interval: 5 21 | delay: 0 22 | timeout: 10 23 | plans: 24 | deploy: 25 | phases: 26 | crash: 27 | strategy: parallel 28 | pod: hello 29 | -------------------------------------------------------------------------------- /frameworks/helloworld/src/main/dist/custom_steps.yml: -------------------------------------------------------------------------------- 1 | name: {{FRAMEWORK_NAME}} 2 | pods: 3 | hello: 4 | count: 2 5 | tasks: 6 | first: 7 | goal: RUNNING 8 | cmd: echo hello1 >> output 9 | cpus: {{HELLO_CPUS}} 10 | memory: {{HELLO_MEM}} 11 | second: 12 | goal: RUNNING 13 | cmd: echo hello2 >> output 14 | cpus: {{HELLO_CPUS}} 15 | memory: {{HELLO_MEM}} 16 | third: 17 | goal: RUNNING 18 | cmd: echo hello3 >> output 19 | cpus: {{HELLO_CPUS}} 20 | memory: {{HELLO_MEM}} 21 | plans: 22 | deploy: 23 | strategy: serial 24 | phases: 25 | deploy: 26 | strategy: {{DEPLOY_STRATEGY}} 27 | pod: hello 28 | steps: 29 | - default: {{DEPLOY_STEPS}} 30 | -------------------------------------------------------------------------------- /frameworks/helloworld/src/main/dist/custom_tld.yml: -------------------------------------------------------------------------------- 1 | name: {{FRAMEWORK_NAME}} 2 | scheduler: 3 | principal: {{FRAMEWORK_PRINCIPAL}} 4 | user: {{FRAMEWORK_USER}} 5 | pods: 6 | hello: 7 | count: 1 8 | uris: 9 | - {{BOOTSTRAP_URI}} 10 | resource-sets: 11 | hello-resources: 12 | cpus: {{HELLO_CPUS}} 13 | memory: 256 14 | ports: 15 | test: 16 | port: 0 17 | advertise: true 18 | tasks: 19 | resolution: 20 | goal: RUNNING 21 | resource-set: hello-resources 22 | cmd: | 23 | set -e 24 | 25 | # Test DNS resolution and then sleep so endpoints 26 | # can be checked 27 | ./bootstrap && sleep 1000000 28 | -------------------------------------------------------------------------------- /frameworks/helloworld/src/main/dist/foobar_service_name.yml: -------------------------------------------------------------------------------- 1 | name: foobar 2 | scheduler: 3 | principal: {{FRAMEWORK_PRINCIPAL}} 4 | user: {{FRAMEWORK_USER}} 5 | pods: 6 | foo: 7 | count: {{HELLO_COUNT}} 8 | tasks: 9 | bar: 10 | goal: RUNNING 11 | cmd: "echo world && sleep $SLEEP_DURATION" 12 | cpus: {{HELLO_CPUS}} 13 | memory: {{HELLO_MEM}} 14 | env: 15 | SLEEP_DURATION: {{SLEEP_DURATION}} 16 | -------------------------------------------------------------------------------- /frameworks/helloworld/src/main/dist/graceful-shutdown.yml: -------------------------------------------------------------------------------- 1 | name: {{FRAMEWORK_NAME}} 2 | scheduler: 3 | principal: {{FRAMEWORK_PRINCIPAL}} 4 | pods: 5 | hello: 6 | count: 1 7 | user: {{FRAMEWORK_USER}} 8 | tasks: 9 | server: 10 | goal: RUNNING 11 | cmd: | 12 | # for graceful shutdown 13 | # trap SIGTERM and mock a cleanup timeframe 14 | terminated () { 15 | echo "$(date) received SIGTERM, zzz for 3 ..." 16 | sleep 3 17 | echo "$(date) ... all clean, peace out" 18 | exit 0 19 | } 20 | trap terminated SIGTERM 21 | echo "$(date) trapping SIGTERM, watch here for the signal..." 22 | 23 | while true; do 24 | sleep 0.1 25 | done 26 | cpus: {{HELLO_CPUS}} 27 | memory: {{HELLO_MEM}} 28 | kill-grace-period: {{HELLO_KILL_GRACE_PERIOD}} 29 | -------------------------------------------------------------------------------- /frameworks/helloworld/src/main/dist/non_recoverable_state.yml: -------------------------------------------------------------------------------- 1 | name: {{FRAMEWORK_NAME}} 2 | scheduler: 3 | principal: {{FRAMEWORK_PRINCIPAL}} 4 | user: {{FRAMEWORK_USER}} 5 | pods: 6 | hello: 7 | count: 1 8 | tasks: 9 | server: 10 | goal: FINISH 11 | cmd: "exit 1" 12 | cpus: 0.1 13 | memory: 256 14 | -------------------------------------------------------------------------------- /frameworks/helloworld/src/main/dist/profile-mount-volume.yml: -------------------------------------------------------------------------------- 1 | name: {{FRAMEWORK_NAME}} 2 | scheduler: 3 | principal: {{FRAMEWORK_PRINCIPAL}} 4 | user: {{FRAMEWORK_USER}} 5 | pods: 6 | hello: 7 | count: {{HELLO_COUNT}} 8 | tasks: 9 | profile: 10 | goal: RUNNING 11 | cmd: | 12 | set -e -x 13 | if [ -n "{{{TEST_PROFILE_VOLUME_COMMAND}}}" ]; then 14 | {{{TEST_PROFILE_VOLUME_COMMAND}}} profile-container-path 15 | fi 16 | echo profile >> profile-container-path/output 17 | sleep $SLEEP_DURATION 18 | cpus: {{HELLO_CPUS}} 19 | memory: {{HELLO_MEM}} 20 | env: 21 | SLEEP_DURATION: {{SLEEP_DURATION}} 22 | VOLUME_PROFILE: {{HELLO_VOLUME_PROFILE}} 23 | volume: 24 | path: profile-container-path 25 | profiles: [{{HELLO_VOLUME_PROFILE}}] 26 | type: MOUNT 27 | size: {{HELLO_DISK}} 28 | -------------------------------------------------------------------------------- /frameworks/helloworld/src/main/dist/resource_limits.yml: -------------------------------------------------------------------------------- 1 | name: {{FRAMEWORK_NAME}} 2 | scheduler: 3 | principal: {{FRAMEWORK_PRINCIPAL}} 4 | user: {{FRAMEWORK_USER}} 5 | pods: 6 | hello: 7 | count: {{HELLO_COUNT}} 8 | tasks: 9 | unlimited: 10 | goal: RUNNING 11 | # We can't easily assert that resource limits are set properly since: 12 | # 1) In DC/OS, even root tasks cannot read their cgroups info (seccomp profile enforced?) 13 | # 2) In EE, we cannot easily query the Mesos master to see the task info 14 | # 15 | # Therefore, we just sleep and check that the task launches properly. That this launches properly can be 16 | # verified manually. 17 | cmd: | 18 | sleep 3600 19 | 20 | cpus: {{HELLO_CPUS}} 21 | memory: {{HELLO_MEM}} 22 | resource-limits: 23 | cpus: "unlimited" 24 | memory: "unlimited" 25 | env: 26 | SLEEP_DURATION: {{SLEEP_DURATION}} 27 | -------------------------------------------------------------------------------- /frameworks/helloworld/src/main/dist/seccomp.yml: -------------------------------------------------------------------------------- 1 | name: {{FRAMEWORK_NAME}} 2 | scheduler: 3 | principal: {{FRAMEWORK_PRINCIPAL}} 4 | user: {{FRAMEWORK_USER}} 5 | pods: 6 | hello: 7 | seccomp-unconfined: {{HELLO_SECCOMP_UNCONFINED}} 8 | {{#HELLO_SECCOMP_PROFILE_NAME}} 9 | seccomp-profile-name: {{HELLO_SECCOMP_PROFILE_NAME}} 10 | {{/HELLO_SECCOMP_PROFILE_NAME}} 11 | count: {{HELLO_COUNT}} 12 | tasks: 13 | server: 14 | goal: RUNNING 15 | cmd: "uname && sleep $SLEEP_DURATION" 16 | cpus: {{HELLO_CPUS}} 17 | memory: {{HELLO_MEM}} 18 | env: 19 | SLEEP_DURATION: {{SLEEP_DURATION}} 20 | -------------------------------------------------------------------------------- /frameworks/helloworld/src/main/dist/shm.yml: -------------------------------------------------------------------------------- 1 | name: {{FRAMEWORK_NAME}} 2 | scheduler: 3 | principal: {{FRAMEWORK_PRINCIPAL}} 4 | user: {{FRAMEWORK_USER}} 5 | pods: 6 | hello: 7 | count: {{HELLO_COUNT}} 8 | ipc-mode: PRIVATE 9 | shm-size: 128 10 | tasks: 11 | server: 12 | ipc-mode: SHARE_PARENT 13 | goal: RUNNING 14 | cmd: | 15 | df -m /dev/shm | grep -w 128 && 16 | stat -Lc %i /proc/self/ns/ipc > /dev/shm/child1 && 17 | sleep $SLEEP_DURATION 18 | cpus: {{HELLO_CPUS}} 19 | memory: {{HELLO_MEM}} 20 | env: 21 | SLEEP_DURATION: {{SLEEP_DURATION}} -------------------------------------------------------------------------------- /frameworks/helloworld/src/main/dist/simple.yml: -------------------------------------------------------------------------------- 1 | name: {{FRAMEWORK_NAME}} 2 | scheduler: 3 | principal: {{FRAMEWORK_PRINCIPAL}} 4 | user: {{FRAMEWORK_USER}} 5 | pods: 6 | hello: 7 | count: {{HELLO_COUNT}} 8 | tasks: 9 | server: 10 | goal: RUNNING 11 | cmd: "echo hello >> output && sleep $SLEEP_DURATION" 12 | cpus: {{HELLO_CPUS}} 13 | memory: {{HELLO_MEM}} 14 | env: 15 | SLEEP_DURATION: {{SLEEP_DURATION}} 16 | -------------------------------------------------------------------------------- /frameworks/helloworld/src/main/dist/update_plan.yml: -------------------------------------------------------------------------------- 1 | name: {{FRAMEWORK_NAME}} 2 | scheduler: 3 | principal: {{FRAMEWORK_PRINCIPAL}} 4 | user: {{FRAMEWORK_USER}} 5 | pods: 6 | hello: 7 | count: {{HELLO_COUNT}} 8 | tasks: 9 | server: 10 | goal: RUNNING 11 | cmd: "echo hello >> output && sleep $SLEEP_DURATION" 12 | cpus: {{HELLO_CPUS}} 13 | memory: {{HELLO_MEM}} 14 | env: 15 | SLEEP_DURATION: {{SLEEP_DURATION}} 16 | plans: 17 | deploy: 18 | strategy: parallel 19 | phases: 20 | hello-deploy: 21 | strategy: parallel 22 | pod: hello 23 | update: 24 | strategy: serial 25 | phases: 26 | hello-update: 27 | strategy: serial 28 | pod: hello 29 | -------------------------------------------------------------------------------- /frameworks/helloworld/src/main/dist/web-url.yml: -------------------------------------------------------------------------------- 1 | name: {{FRAMEWORK_NAME}} 2 | scheduler: 3 | principal: {{FRAMEWORK_PRINCIPAL}} 4 | user: {{FRAMEWORK_USER}} 5 | web-url: http://hello-world.marathon.mesos:{{PORT_API}} 6 | pods: 7 | hello: 8 | count: {{HELLO_COUNT}} 9 | tasks: 10 | server: 11 | goal: RUNNING 12 | cmd: "echo hello >> output && sleep $SLEEP_DURATION" 13 | cpus: {{HELLO_CPUS}} 14 | memory: {{HELLO_MEM}} 15 | env: 16 | SLEEP_DURATION: {{SLEEP_DURATION}} 17 | -------------------------------------------------------------------------------- /frameworks/helloworld/src/main/java/com/mesosphere/sdk/helloworld/scheduler/ReversePhasesCustomizer.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.helloworld.scheduler; 2 | 3 | import com.mesosphere.sdk.offer.Constants; 4 | import com.mesosphere.sdk.scheduler.plan.Plan; 5 | import com.mesosphere.sdk.scheduler.plan.PlanCustomizer; 6 | 7 | import java.util.Collections; 8 | 9 | /** 10 | * This customizer illustrates an example of modifying a plan at runtime to execute the steps in deployment phases 11 | * in reverse order. 12 | */ 13 | public class ReversePhasesCustomizer implements PlanCustomizer { 14 | @Override 15 | public Plan updatePlan(Plan plan) { 16 | if (plan.getName().equals(Constants.DEPLOY_PLAN_NAME)) { 17 | plan.getChildren().forEach(phase -> Collections.reverse(phase.getChildren())); 18 | } 19 | return plan; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /frameworks/helloworld/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker: -------------------------------------------------------------------------------- 1 | mock-maker-inline 2 | -------------------------------------------------------------------------------- /frameworks/helloworld/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/d2iq-archive/dcos-commons/69824783f664407b88179e6461e42b611673d053/frameworks/helloworld/tests/__init__.py -------------------------------------------------------------------------------- /frameworks/helloworld/tests/test_multiple_ports.py: -------------------------------------------------------------------------------- 1 | import logging 2 | import pytest 3 | 4 | import sdk_install 5 | import sdk_tasks 6 | 7 | from tests import config 8 | 9 | log = logging.getLogger(__name__) 10 | 11 | 12 | @pytest.fixture(scope="module", autouse=True) 13 | def configure_package(configure_security): 14 | try: 15 | sdk_install.uninstall(config.PACKAGE_NAME, config.SERVICE_NAME) 16 | yield # let the test session execute 17 | finally: 18 | sdk_install.uninstall(config.PACKAGE_NAME, config.SERVICE_NAME) 19 | 20 | 21 | @pytest.mark.sanity 22 | def test_launch_task_with_multiple_ports(): 23 | sdk_install.install( 24 | config.PACKAGE_NAME, 25 | config.SERVICE_NAME, 26 | 0, 27 | additional_options={"service": {"yaml": "multiport"}}, 28 | ) 29 | assert sdk_tasks.get_summary(with_completed=True, task_name="multiport-0-server"), "Unable to find matching completed task" 30 | -------------------------------------------------------------------------------- /frameworks/helloworld/tests/test_resource_limits.py: -------------------------------------------------------------------------------- 1 | import logging 2 | import pytest 3 | 4 | import sdk_install 5 | import sdk_plan 6 | 7 | 8 | from tests import config 9 | 10 | log = logging.getLogger(__name__) 11 | 12 | 13 | @pytest.fixture(scope="module", autouse=True) 14 | def configure_package(configure_security): 15 | try: 16 | sdk_install.uninstall(config.PACKAGE_NAME, config.SERVICE_NAME) 17 | options = {"service": {"user": "root", "yaml": "resource_limits"}} 18 | 19 | sdk_install.install( 20 | config.PACKAGE_NAME, 21 | config.SERVICE_NAME, 22 | expected_running_tasks=1, 23 | additional_options=options, 24 | ) 25 | 26 | yield # let the test session execute 27 | finally: 28 | sdk_install.uninstall(config.PACKAGE_NAME, config.SERVICE_NAME) 29 | 30 | 31 | @pytest.mark.dcos_min_version("2.1") 32 | @pytest.mark.sanity 33 | def test_resource_limits(): 34 | sdk_plan.wait_for_completed_deployment(config.SERVICE_NAME) 35 | -------------------------------------------------------------------------------- /frameworks/helloworld/tests/tls/keystore/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id "com.github.johnrengelman.shadow" version "4.0.2" 3 | id 'application' 4 | } 5 | 6 | group 'com.mesosphere.sdk' 7 | version '0.1-SNAPSHOT' 8 | 9 | ext { 10 | dropwizardVer = '1.3.9' 11 | } 12 | 13 | dependencies { 14 | compile "io.dropwizard:dropwizard-core:${dropwizardVer}" 15 | compile "io.dropwizard:dropwizard-client:${dropwizardVer}" 16 | compile "io.dropwizard:dropwizard-jackson:${dropwizardVer}" 17 | compile "io.dropwizard:dropwizard-hibernate:${dropwizardVer}" 18 | } 19 | 20 | mainClassName = 'com.mesosphere.sdk.testing.tls.keystore.KeystoreApplication' 21 | 22 | shadowJar { 23 | setArchiveName(project.name.toLowerCase() + "-" + version + "-all.jar") 24 | mergeServiceFiles() 25 | } 26 | 27 | task integrationTestZip(type: Zip, dependsOn: 'shadowJar') { 28 | setArchiveName("keystore-app.zip") 29 | from shadowJar.archivePath 30 | from('config/integration-test.yml') 31 | } 32 | -------------------------------------------------------------------------------- /frameworks/helloworld/tests/tls/keystore/src/main/java/com/mesosphere/sdk/testing/tls/keystore/core/Template.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.testing.tls.keystore.core; 2 | 3 | import java.util.Optional; 4 | 5 | import static java.lang.String.format; 6 | 7 | /** 8 | * An example of rendering response with Template. 9 | */ 10 | public class Template { 11 | private final String content; 12 | private final String defaultName; 13 | 14 | public Template(String content, String defaultName) { 15 | this.content = content; 16 | this.defaultName = defaultName; 17 | } 18 | 19 | public String render(Optional name) { 20 | return format(content, name.orElse(defaultName)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /govendor/README.md: -------------------------------------------------------------------------------- 1 | # Go vendor hack 2 | 3 | This directory contains the dependencies for service CLIs and for the `bootstrap` utility. 4 | 5 | This is a workaround for the Go tooling being confused by e.g. `github.com/mesosphere/dcos-commons/frameworks/myframework/cli/` pointing into `github.com/mesosphere/dcos-commons/cli/` when using vendoring. 6 | 7 | Frameworks in `dcos-commons/frameworks/` should create a `vendor` symlink which points to here. In other words, a symlink at `frameworks/yoursvc/cli/dcos-yoursvc/vendor` should point to `govendor/`. 8 | 9 | This workaround only applies to frameworks which are collocated in the `dcos-commons` repository. External projects shouldn't have to do this, and can instead have a regular `vendor` directory structure with a copy of `github.com/mesosphere/dcos-commons/cli`. 10 | -------------------------------------------------------------------------------- /govendor/github.com/BurntSushi/toml/COMPATIBLE: -------------------------------------------------------------------------------- 1 | Compatible with TOML version 2 | [v0.4.0](https://github.com/toml-lang/toml/blob/v0.4.0/versions/en/toml-v0.4.0.md) 3 | 4 | -------------------------------------------------------------------------------- /govendor/github.com/BurntSushi/toml/Makefile: -------------------------------------------------------------------------------- 1 | install: 2 | go install ./... 3 | 4 | test: install 5 | go test -v 6 | toml-test toml-test-decoder 7 | toml-test -encoder toml-test-encoder 8 | 9 | fmt: 10 | gofmt -w *.go */*.go 11 | colcheck *.go */*.go 12 | 13 | tags: 14 | find ./ -name '*.go' -print0 | xargs -0 gotags > TAGS 15 | 16 | push: 17 | git push origin master 18 | git push github master 19 | 20 | -------------------------------------------------------------------------------- /govendor/github.com/BurntSushi/toml/encoding_types.go: -------------------------------------------------------------------------------- 1 | // +build go1.2 2 | 3 | package toml 4 | 5 | // In order to support Go 1.1, we define our own TextMarshaler and 6 | // TextUnmarshaler types. For Go 1.2+, we just alias them with the 7 | // standard library interfaces. 8 | 9 | import ( 10 | "encoding" 11 | ) 12 | 13 | // TextMarshaler is a synonym for encoding.TextMarshaler. It is defined here 14 | // so that Go 1.1 can be supported. 15 | type TextMarshaler encoding.TextMarshaler 16 | 17 | // TextUnmarshaler is a synonym for encoding.TextUnmarshaler. It is defined 18 | // here so that Go 1.1 can be supported. 19 | type TextUnmarshaler encoding.TextUnmarshaler 20 | -------------------------------------------------------------------------------- /govendor/github.com/BurntSushi/toml/encoding_types_1.1.go: -------------------------------------------------------------------------------- 1 | // +build !go1.2 2 | 3 | package toml 4 | 5 | // These interfaces were introduced in Go 1.2, so we add them manually when 6 | // compiling for Go 1.1. 7 | 8 | // TextMarshaler is a synonym for encoding.TextMarshaler. It is defined here 9 | // so that Go 1.1 can be supported. 10 | type TextMarshaler interface { 11 | MarshalText() (text []byte, err error) 12 | } 13 | 14 | // TextUnmarshaler is a synonym for encoding.TextUnmarshaler. It is defined 15 | // here so that Go 1.1 can be supported. 16 | type TextUnmarshaler interface { 17 | UnmarshalText(text []byte) error 18 | } 19 | -------------------------------------------------------------------------------- /govendor/github.com/BurntSushi/toml/session.vim: -------------------------------------------------------------------------------- 1 | au BufWritePost *.go silent!make tags > /dev/null 2>&1 2 | -------------------------------------------------------------------------------- /govendor/github.com/alecthomas/template/README.md: -------------------------------------------------------------------------------- 1 | # Go's `text/template` package with newline elision 2 | 3 | This is a fork of Go 1.4's [text/template](http://golang.org/pkg/text/template/) package with one addition: a backslash immediately after a closing delimiter will delete all subsequent newlines until a non-newline. 4 | 5 | eg. 6 | 7 | ``` 8 | {{if true}}\ 9 | hello 10 | {{end}}\ 11 | ``` 12 | 13 | Will result in: 14 | 15 | ``` 16 | hello\n 17 | ``` 18 | 19 | Rather than: 20 | 21 | ``` 22 | \n 23 | hello\n 24 | \n 25 | ``` 26 | -------------------------------------------------------------------------------- /govendor/github.com/alecthomas/units/README.md: -------------------------------------------------------------------------------- 1 | # Units - Helpful unit multipliers and functions for Go 2 | 3 | The goal of this package is to have functionality similar to the [time](http://golang.org/pkg/time/) package. 4 | 5 | It allows for code like this: 6 | 7 | ```go 8 | n, err := ParseBase2Bytes("1KB") 9 | // n == 1024 10 | n = units.Mebibyte * 512 11 | ``` 12 | -------------------------------------------------------------------------------- /govendor/github.com/alecthomas/units/doc.go: -------------------------------------------------------------------------------- 1 | // Package units provides helpful unit multipliers and functions for Go. 2 | // 3 | // The goal of this package is to have functionality similar to the time [1] package. 4 | // 5 | // 6 | // [1] http://golang.org/pkg/time/ 7 | // 8 | // It allows for code like this: 9 | // 10 | // n, err := ParseBase2Bytes("1KB") 11 | // // n == 1024 12 | // n = units.Mebibyte * 512 13 | package units 14 | -------------------------------------------------------------------------------- /govendor/github.com/alecthomas/units/si.go: -------------------------------------------------------------------------------- 1 | package units 2 | 3 | // SI units. 4 | type SI int64 5 | 6 | // SI unit multiples. 7 | const ( 8 | Kilo SI = 1000 9 | Mega = Kilo * 1000 10 | Giga = Mega * 1000 11 | Tera = Giga * 1000 12 | Peta = Tera * 1000 13 | Exa = Peta * 1000 14 | ) 15 | 16 | func MakeUnitMap(suffix, shortSuffix string, scale int64) map[string]float64 { 17 | return map[string]float64{ 18 | shortSuffix: 1, 19 | "K" + suffix: float64(scale), 20 | "M" + suffix: float64(scale * scale), 21 | "G" + suffix: float64(scale * scale * scale), 22 | "T" + suffix: float64(scale * scale * scale * scale), 23 | "P" + suffix: float64(scale * scale * scale * scale * scale), 24 | "E" + suffix: float64(scale * scale * scale * scale * scale * scale), 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /govendor/github.com/cbroglie/mustache/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: all 2 | all: fmt vet lint test 3 | 4 | .PHONY: 5 | get-deps: 6 | go get github.com/golang/lint/golint 7 | 8 | .PHONY: test 9 | test: 10 | go test -cover ./... 11 | 12 | .PHONY: fmt 13 | fmt: 14 | go fmt ./... 15 | 16 | .PHONY: vet 17 | vet: 18 | go vet ./... 19 | 20 | .PHONY: lint 21 | lint: 22 | golint ./... 23 | 24 | .PHONY: ci 25 | ci: fmt vet test 26 | -------------------------------------------------------------------------------- /govendor/github.com/containernetworking/cni/pkg/invoke/os_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 CNI authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // +build darwin dragonfly freebsd linux netbsd opensbd solaris 16 | 17 | package invoke 18 | 19 | // Valid file extensions for plugin executables. 20 | var ExecutableFileExtensions = []string{""} 21 | -------------------------------------------------------------------------------- /govendor/github.com/containernetworking/cni/pkg/invoke/os_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 CNI authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package invoke 16 | 17 | // Valid file extensions for plugin executables. 18 | var ExecutableFileExtensions = []string{".exe", ""} 19 | -------------------------------------------------------------------------------- /govendor/github.com/davecgh/go-spew/LICENSE: -------------------------------------------------------------------------------- 1 | ISC License 2 | 3 | Copyright (c) 2012-2016 Dave Collins 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /govendor/github.com/dcos/dcos-cni/README.md: -------------------------------------------------------------------------------- 1 | # Purpose 2 | This repo hosts the CNI plugins specific to DC/OS. A brief description 3 | of each of the plugins is given below: 4 | 5 | * [plugins/l4lb](plugins/l4lb/README.md): A CNI plugin which allows containers in isolated virtual networks to use services provided by [Minuteman](https://github.com/dcos/minuteman) and [Spartan](https://github.com/dcos/spartan). 6 | 7 | # Pre-requisites 8 | * GoLang 1.6+ 9 | * [Glide](https://github.com/Masterminds/glide) 10 | 11 | # Build instructions 12 | The project uses `glide` to capture all the golang dependencies into the vendor folder. In order to build the project just do 13 | ``` 14 | make 15 | ``` 16 | To do a clean build run: 17 | ``` 18 | make clean 19 | ``` 20 | The build installs the plugins in the `bin` folder. 21 | 22 | -------------------------------------------------------------------------------- /govendor/github.com/dcos/dcos-cni/pkg/minuteman/config.go: -------------------------------------------------------------------------------- 1 | package minuteman 2 | 3 | type NetConf struct { 4 | Enable bool `json:"enable", omitempty"` 5 | Path string `json:"path, omitempty"` 6 | } 7 | -------------------------------------------------------------------------------- /govendor/github.com/mesosphere/dcos-commons/cli: -------------------------------------------------------------------------------- 1 | ../../../../cli/ -------------------------------------------------------------------------------- /govendor/github.com/pelletier/go-toml/doc.go: -------------------------------------------------------------------------------- 1 | // Package toml is a TOML parser and manipulation library. 2 | // 3 | // This version supports the specification as described in 4 | // https://github.com/toml-lang/toml/blob/master/versions/en/toml-v0.4.0.md 5 | // 6 | // Marshaling 7 | // 8 | // Go-toml can marshal and unmarshal TOML documents from and to data 9 | // structures. 10 | // 11 | // TOML document as a tree 12 | // 13 | // Go-toml can operate on a TOML document as a tree. Use one of the Load* 14 | // functions to parse TOML data and obtain a Tree instance, then one of its 15 | // methods to manipulate the tree. 16 | // 17 | // JSONPath-like queries 18 | // 19 | // The package github.com/pelletier/go-toml/query implements a system 20 | // similar to JSONPath to quickly retrive elements of a TOML document using a 21 | // single expression. See the package documentation for more information. 22 | // 23 | package toml 24 | -------------------------------------------------------------------------------- /govendor/github.com/pelletier/go-toml/example-crlf.toml: -------------------------------------------------------------------------------- 1 | # This is a TOML document. Boom. 2 | 3 | title = "TOML Example" 4 | 5 | [owner] 6 | name = "Tom Preston-Werner" 7 | organization = "GitHub" 8 | bio = "GitHub Cofounder & CEO\nLikes tater tots and beer." 9 | dob = 1979-05-27T07:32:00Z # First class dates? Why not? 10 | 11 | [database] 12 | server = "192.168.1.1" 13 | ports = [ 8001, 8001, 8002 ] 14 | connection_max = 5000 15 | enabled = true 16 | 17 | [servers] 18 | 19 | # You can indent as you please. Tabs or spaces. TOML don't care. 20 | [servers.alpha] 21 | ip = "10.0.0.1" 22 | dc = "eqdc10" 23 | 24 | [servers.beta] 25 | ip = "10.0.0.2" 26 | dc = "eqdc10" 27 | 28 | [clients] 29 | data = [ ["gamma", "delta"], [1, 2] ] # just an update to make sure parsers support it 30 | -------------------------------------------------------------------------------- /govendor/github.com/pelletier/go-toml/example.toml: -------------------------------------------------------------------------------- 1 | # This is a TOML document. Boom. 2 | 3 | title = "TOML Example" 4 | 5 | [owner] 6 | name = "Tom Preston-Werner" 7 | organization = "GitHub" 8 | bio = "GitHub Cofounder & CEO\nLikes tater tots and beer." 9 | dob = 1979-05-27T07:32:00Z # First class dates? Why not? 10 | 11 | [database] 12 | server = "192.168.1.1" 13 | ports = [ 8001, 8001, 8002 ] 14 | connection_max = 5000 15 | enabled = true 16 | 17 | [servers] 18 | 19 | # You can indent as you please. Tabs or spaces. TOML don't care. 20 | [servers.alpha] 21 | ip = "10.0.0.1" 22 | dc = "eqdc10" 23 | 24 | [servers.beta] 25 | ip = "10.0.0.2" 26 | dc = "eqdc10" 27 | 28 | [clients] 29 | data = [ ["gamma", "delta"], [1, 2] ] # just an update to make sure parsers support it 30 | -------------------------------------------------------------------------------- /govendor/github.com/pelletier/go-toml/marshal_test.toml: -------------------------------------------------------------------------------- 1 | title = "TOML Marshal Testing" 2 | 3 | [basic] 4 | bool = true 5 | date = 1979-05-27T07:32:00Z 6 | float = 123.4 7 | int = 5000 8 | string = "Bite me" 9 | uint = 5001 10 | 11 | [basic_lists] 12 | bools = [true,false,true] 13 | dates = [1979-05-27T07:32:00Z,1980-05-27T07:32:00Z] 14 | floats = [12.3,45.6,78.9] 15 | ints = [8001,8001,8002] 16 | strings = ["One","Two","Three"] 17 | uints = [5002,5003] 18 | 19 | [basic_map] 20 | one = "one" 21 | two = "two" 22 | 23 | [subdoc] 24 | 25 | [subdoc.first] 26 | name = "First" 27 | 28 | [subdoc.second] 29 | name = "Second" 30 | 31 | [[subdoclist]] 32 | name = "List.First" 33 | 34 | [[subdoclist]] 35 | name = "List.Second" 36 | 37 | [[subdocptrs]] 38 | name = "Second" 39 | -------------------------------------------------------------------------------- /govendor/github.com/pelletier/go-toml/position.go: -------------------------------------------------------------------------------- 1 | // Position support for go-toml 2 | 3 | package toml 4 | 5 | import ( 6 | "fmt" 7 | ) 8 | 9 | // Position of a document element within a TOML document. 10 | // 11 | // Line and Col are both 1-indexed positions for the element's line number and 12 | // column number, respectively. Values of zero or less will cause Invalid(), 13 | // to return true. 14 | type Position struct { 15 | Line int // line within the document 16 | Col int // column within the line 17 | } 18 | 19 | // String representation of the position. 20 | // Displays 1-indexed line and column numbers. 21 | func (p Position) String() string { 22 | return fmt.Sprintf("(%d, %d)", p.Line, p.Col) 23 | } 24 | 25 | // Invalid returns whether or not the position is valid (i.e. with negative or 26 | // null values) 27 | func (p Position) Invalid() bool { 28 | return p.Line <= 0 || p.Col <= 0 29 | } 30 | -------------------------------------------------------------------------------- /govendor/github.com/stretchr/testify/assert/assertion_format.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.CommentFormat}} 2 | func {{.DocInfo.Name}}f(t TestingT, {{.ParamsFormat}}) bool { 3 | return {{.DocInfo.Name}}(t, {{.ForwardedParamsFormat}}) 4 | } 5 | -------------------------------------------------------------------------------- /govendor/github.com/stretchr/testify/assert/assertion_forward.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.CommentWithoutT "a"}} 2 | func (a *Assertions) {{.DocInfo.Name}}({{.Params}}) bool { 3 | return {{.DocInfo.Name}}(a.t, {{.ForwardedParams}}) 4 | } 5 | -------------------------------------------------------------------------------- /govendor/github.com/stretchr/testify/assert/errors.go: -------------------------------------------------------------------------------- 1 | package assert 2 | 3 | import ( 4 | "errors" 5 | ) 6 | 7 | // AnError is an error instance useful for testing. If the code does not care 8 | // about error specifics, and only needs to return the error for example, this 9 | // error should be used to make the test code more readable. 10 | var AnError = errors.New("assert.AnError general error for testing") 11 | -------------------------------------------------------------------------------- /govendor/github.com/stretchr/testify/assert/forward_assertions.go: -------------------------------------------------------------------------------- 1 | package assert 2 | 3 | // Assertions provides assertion methods around the 4 | // TestingT interface. 5 | type Assertions struct { 6 | t TestingT 7 | } 8 | 9 | // New makes a new Assertions object for the specified TestingT. 10 | func New(t TestingT) *Assertions { 11 | return &Assertions{ 12 | t: t, 13 | } 14 | } 15 | 16 | //go:generate go run ../_codegen/main.go -output-package=assert -template=assertion_forward.go.tmpl -include-format-funcs 17 | -------------------------------------------------------------------------------- /govendor/github.com/stretchr/testify/require/doc.go: -------------------------------------------------------------------------------- 1 | // Package require implements the same assertions as the `assert` package but 2 | // stops test execution when a test fails. 3 | // 4 | // Example Usage 5 | // 6 | // The following is a complete example using require in a standard test function: 7 | // import ( 8 | // "testing" 9 | // "github.com/stretchr/testify/require" 10 | // ) 11 | // 12 | // func TestSomething(t *testing.T) { 13 | // 14 | // var a string = "Hello" 15 | // var b string = "Hello" 16 | // 17 | // require.Equal(t, a, b, "The two words should be the same.") 18 | // 19 | // } 20 | // 21 | // Assertions 22 | // 23 | // The `require` package have same global functions as in the `assert` package, 24 | // but instead of returning a boolean result they call `t.FailNow()`. 25 | // 26 | // Every assertion function also takes an optional string message as the final argument, 27 | // allowing custom error messages to be appended to the message the assertion method outputs. 28 | package require 29 | -------------------------------------------------------------------------------- /govendor/github.com/stretchr/testify/require/forward_requirements.go: -------------------------------------------------------------------------------- 1 | package require 2 | 3 | // Assertions provides assertion methods around the 4 | // TestingT interface. 5 | type Assertions struct { 6 | t TestingT 7 | } 8 | 9 | // New makes a new Assertions object for the specified TestingT. 10 | func New(t TestingT) *Assertions { 11 | return &Assertions{ 12 | t: t, 13 | } 14 | } 15 | 16 | //go:generate go run ../_codegen/main.go -output-package=require -template=require_forward.go.tmpl -include-format-funcs 17 | -------------------------------------------------------------------------------- /govendor/github.com/stretchr/testify/require/require.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.Comment}} 2 | func {{.DocInfo.Name}}(t TestingT, {{.Params}}) { 3 | if !assert.{{.DocInfo.Name}}(t, {{.ForwardedParams}}) { 4 | t.FailNow() 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /govendor/github.com/stretchr/testify/require/require_forward.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.CommentWithoutT "a"}} 2 | func (a *Assertions) {{.DocInfo.Name}}({{.Params}}) { 3 | {{.DocInfo.Name}}(a.t, {{.ForwardedParams}}) 4 | } 5 | -------------------------------------------------------------------------------- /govendor/github.com/stretchr/testify/require/requirements.go: -------------------------------------------------------------------------------- 1 | package require 2 | 3 | // TestingT is an interface wrapper around *testing.T 4 | type TestingT interface { 5 | Errorf(format string, args ...interface{}) 6 | FailNow() 7 | } 8 | 9 | //go:generate go run ../_codegen/main.go -output-package=require -template=require.go.tmpl -include-format-funcs 10 | -------------------------------------------------------------------------------- /govendor/github.com/vishvananda/netlink/Makefile: -------------------------------------------------------------------------------- 1 | DIRS := \ 2 | . \ 3 | nl 4 | 5 | DEPS = \ 6 | github.com/vishvananda/netns 7 | 8 | uniq = $(if $1,$(firstword $1) $(call uniq,$(filter-out $(firstword $1),$1))) 9 | testdirs = $(call uniq,$(foreach d,$(1),$(dir $(wildcard $(d)/*_test.go)))) 10 | goroot = $(addprefix ../../../,$(1)) 11 | unroot = $(subst ../../../,,$(1)) 12 | fmt = $(addprefix fmt-,$(1)) 13 | 14 | all: test 15 | 16 | $(call goroot,$(DEPS)): 17 | go get $(call unroot,$@) 18 | 19 | .PHONY: $(call testdirs,$(DIRS)) 20 | $(call testdirs,$(DIRS)): 21 | sudo -E go test -test.parallel 4 -timeout 60s -v github.com/vishvananda/netlink/$@ 22 | 23 | $(call fmt,$(call testdirs,$(DIRS))): 24 | ! gofmt -l $(subst fmt-,,$@)/*.go | grep -q . 25 | 26 | .PHONY: fmt 27 | fmt: $(call fmt,$(call testdirs,$(DIRS))) 28 | 29 | test: fmt $(call goroot,$(DEPS)) $(call testdirs,$(DIRS)) 30 | -------------------------------------------------------------------------------- /govendor/github.com/vishvananda/netlink/genetlink_unspecified.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | package netlink 4 | 5 | type GenlOp struct{} 6 | 7 | type GenlMulticastGroup struct{} 8 | 9 | type GenlFamily struct{} 10 | 11 | func (h *Handle) GenlFamilyList() ([]*GenlFamily, error) { 12 | return nil, ErrNotImplemented 13 | } 14 | 15 | func GenlFamilyList() ([]*GenlFamily, error) { 16 | return nil, ErrNotImplemented 17 | } 18 | 19 | func (h *Handle) GenlFamilyGet(name string) (*GenlFamily, error) { 20 | return nil, ErrNotImplemented 21 | } 22 | 23 | func GenlFamilyGet(name string) (*GenlFamily, error) { 24 | return nil, ErrNotImplemented 25 | } 26 | -------------------------------------------------------------------------------- /govendor/github.com/vishvananda/netlink/link_tuntap_linux.go: -------------------------------------------------------------------------------- 1 | package netlink 2 | 3 | // ideally golang.org/x/sys/unix would define IfReq but it only has 4 | // IFNAMSIZ, hence this minimalistic implementation 5 | const ( 6 | SizeOfIfReq = 40 7 | IFNAMSIZ = 16 8 | ) 9 | 10 | type ifReq struct { 11 | Name [IFNAMSIZ]byte 12 | Flags uint16 13 | pad [SizeOfIfReq - IFNAMSIZ - 2]byte 14 | } 15 | -------------------------------------------------------------------------------- /govendor/github.com/vishvananda/netlink/neigh.go: -------------------------------------------------------------------------------- 1 | package netlink 2 | 3 | import ( 4 | "fmt" 5 | "net" 6 | ) 7 | 8 | // Neigh represents a link layer neighbor from netlink. 9 | type Neigh struct { 10 | LinkIndex int 11 | Family int 12 | State int 13 | Type int 14 | Flags int 15 | IP net.IP 16 | HardwareAddr net.HardwareAddr 17 | LLIPAddr net.IP //Used in the case of NHRP 18 | } 19 | 20 | // String returns $ip/$hwaddr $label 21 | func (neigh *Neigh) String() string { 22 | return fmt.Sprintf("%s %s", neigh.IP, neigh.HardwareAddr) 23 | } 24 | -------------------------------------------------------------------------------- /govendor/github.com/vishvananda/netlink/netlink_linux.go: -------------------------------------------------------------------------------- 1 | package netlink 2 | 3 | import "github.com/vishvananda/netlink/nl" 4 | 5 | // Family type definitions 6 | const ( 7 | FAMILY_ALL = nl.FAMILY_ALL 8 | FAMILY_V4 = nl.FAMILY_V4 9 | FAMILY_V6 = nl.FAMILY_V6 10 | FAMILY_MPLS = nl.FAMILY_MPLS 11 | ) 12 | -------------------------------------------------------------------------------- /govendor/github.com/vishvananda/netlink/nl/mpls_linux.go: -------------------------------------------------------------------------------- 1 | package nl 2 | 3 | import "encoding/binary" 4 | 5 | const ( 6 | MPLS_LS_LABEL_SHIFT = 12 7 | MPLS_LS_S_SHIFT = 8 8 | ) 9 | 10 | func EncodeMPLSStack(labels ...int) []byte { 11 | b := make([]byte, 4*len(labels)) 12 | for idx, label := range labels { 13 | l := label << MPLS_LS_LABEL_SHIFT 14 | if idx == len(labels)-1 { 15 | l |= 1 << MPLS_LS_S_SHIFT 16 | } 17 | binary.BigEndian.PutUint32(b[idx*4:], uint32(l)) 18 | } 19 | return b 20 | } 21 | 22 | func DecodeMPLSStack(buf []byte) []int { 23 | if len(buf)%4 != 0 { 24 | return nil 25 | } 26 | stack := make([]int, 0, len(buf)/4) 27 | for len(buf) > 0 { 28 | l := binary.BigEndian.Uint32(buf[:4]) 29 | buf = buf[4:] 30 | stack = append(stack, int(l)>>MPLS_LS_LABEL_SHIFT) 31 | if (l>>MPLS_LS_S_SHIFT)&1 > 0 { 32 | break 33 | } 34 | } 35 | return stack 36 | } 37 | -------------------------------------------------------------------------------- /govendor/github.com/vishvananda/netlink/nl/nl_unspecified.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | package nl 4 | 5 | import "encoding/binary" 6 | 7 | var SupportedNlFamilies = []int{} 8 | 9 | func NativeEndian() binary.ByteOrder { 10 | return nil 11 | } 12 | -------------------------------------------------------------------------------- /govendor/github.com/vishvananda/netlink/nl/xfrm_monitor_linux.go: -------------------------------------------------------------------------------- 1 | package nl 2 | 3 | import ( 4 | "unsafe" 5 | ) 6 | 7 | const ( 8 | SizeofXfrmUserExpire = 0xe8 9 | ) 10 | 11 | // struct xfrm_user_expire { 12 | // struct xfrm_usersa_info state; 13 | // __u8 hard; 14 | // }; 15 | 16 | type XfrmUserExpire struct { 17 | XfrmUsersaInfo XfrmUsersaInfo 18 | Hard uint8 19 | Pad [7]byte 20 | } 21 | 22 | func (msg *XfrmUserExpire) Len() int { 23 | return SizeofXfrmUserExpire 24 | } 25 | 26 | func DeserializeXfrmUserExpire(b []byte) *XfrmUserExpire { 27 | return (*XfrmUserExpire)(unsafe.Pointer(&b[0:SizeofXfrmUserExpire][0])) 28 | } 29 | 30 | func (msg *XfrmUserExpire) Serialize() []byte { 31 | return (*(*[SizeofXfrmUserExpire]byte)(unsafe.Pointer(msg)))[:] 32 | } 33 | -------------------------------------------------------------------------------- /govendor/github.com/vishvananda/netlink/order.go: -------------------------------------------------------------------------------- 1 | package netlink 2 | 3 | import ( 4 | "encoding/binary" 5 | 6 | "github.com/vishvananda/netlink/nl" 7 | ) 8 | 9 | var ( 10 | native = nl.NativeEndian() 11 | networkOrder = binary.BigEndian 12 | ) 13 | 14 | func htonl(val uint32) []byte { 15 | bytes := make([]byte, 4) 16 | binary.BigEndian.PutUint32(bytes, val) 17 | return bytes 18 | } 19 | 20 | func htons(val uint16) []byte { 21 | bytes := make([]byte, 2) 22 | binary.BigEndian.PutUint16(bytes, val) 23 | return bytes 24 | } 25 | 26 | func ntohl(buf []byte) uint32 { 27 | return binary.BigEndian.Uint32(buf) 28 | } 29 | 30 | func ntohs(buf []byte) uint16 { 31 | return binary.BigEndian.Uint16(buf) 32 | } 33 | -------------------------------------------------------------------------------- /govendor/github.com/vishvananda/netlink/route_unspecified.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | package netlink 4 | 5 | func (r *Route) ListFlags() []string { 6 | return []string{} 7 | } 8 | 9 | func (n *NexthopInfo) ListFlags() []string { 10 | return []string{} 11 | } 12 | -------------------------------------------------------------------------------- /govendor/github.com/vishvananda/netlink/rule.go: -------------------------------------------------------------------------------- 1 | package netlink 2 | 3 | import ( 4 | "fmt" 5 | "net" 6 | ) 7 | 8 | // Rule represents a netlink rule. 9 | type Rule struct { 10 | Priority int 11 | Family int 12 | Table int 13 | Mark int 14 | Mask int 15 | TunID uint 16 | Goto int 17 | Src *net.IPNet 18 | Dst *net.IPNet 19 | Flow int 20 | IifName string 21 | OifName string 22 | SuppressIfgroup int 23 | SuppressPrefixlen int 24 | } 25 | 26 | func (r Rule) String() string { 27 | return fmt.Sprintf("ip rule %d: from %s table %d", r.Priority, r.Src, r.Table) 28 | } 29 | 30 | // NewRule return empty rules. 31 | func NewRule() *Rule { 32 | return &Rule{ 33 | SuppressIfgroup: -1, 34 | SuppressPrefixlen: -1, 35 | Priority: -1, 36 | Mark: -1, 37 | Mask: -1, 38 | Goto: -1, 39 | Flow: -1, 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /govendor/github.com/vishvananda/netlink/socket.go: -------------------------------------------------------------------------------- 1 | package netlink 2 | 3 | import "net" 4 | 5 | // SocketID identifies a single socket. 6 | type SocketID struct { 7 | SourcePort uint16 8 | DestinationPort uint16 9 | Source net.IP 10 | Destination net.IP 11 | Interface uint32 12 | Cookie [2]uint32 13 | } 14 | 15 | // Socket represents a netlink socket. 16 | type Socket struct { 17 | Family uint8 18 | State uint8 19 | Timer uint8 20 | Retrans uint8 21 | ID SocketID 22 | Expires uint32 23 | RQueue uint32 24 | WQueue uint32 25 | UID uint32 26 | INode uint32 27 | } 28 | -------------------------------------------------------------------------------- /govendor/github.com/vishvananda/netns/netns_unspecified.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | package netns 4 | 5 | import ( 6 | "errors" 7 | ) 8 | 9 | var ( 10 | ErrNotImplemented = errors.New("not implemented") 11 | ) 12 | 13 | func Set(ns NsHandle) (err error) { 14 | return ErrNotImplemented 15 | } 16 | 17 | func New() (ns NsHandle, err error) { 18 | return -1, ErrNotImplemented 19 | } 20 | 21 | func Get() (NsHandle, error) { 22 | return -1, ErrNotImplemented 23 | } 24 | 25 | func GetFromPath(path string) (NsHandle, error) { 26 | return -1, ErrNotImplemented 27 | } 28 | 29 | func GetFromName(name string) (NsHandle, error) { 30 | return -1, ErrNotImplemented 31 | } 32 | 33 | func GetFromPid(pid int) (NsHandle, error) { 34 | return -1, ErrNotImplemented 35 | } 36 | 37 | func GetFromThread(pid, tid int) (NsHandle, error) { 38 | return -1, ErrNotImplemented 39 | } 40 | 41 | func GetFromDocker(id string) (NsHandle, error) { 42 | return -1, ErrNotImplemented 43 | } 44 | -------------------------------------------------------------------------------- /govendor/gopkg.in/alecthomas/kingpin.v3-unstable/guesswidth.go: -------------------------------------------------------------------------------- 1 | // +build appengine !linux,!freebsd,!darwin,!dragonfly,!netbsd,!openbsd 2 | 3 | package kingpin 4 | 5 | import "io" 6 | 7 | func guessWidth(w io.Writer) int { 8 | return 80 9 | } 10 | -------------------------------------------------------------------------------- /govendor/gopkg.in/alecthomas/kingpin.v3-unstable/guesswidth_unix.go: -------------------------------------------------------------------------------- 1 | // +build !appengine,linux freebsd darwin dragonfly netbsd openbsd 2 | 3 | package kingpin 4 | 5 | import ( 6 | "io" 7 | "os" 8 | "strconv" 9 | "syscall" 10 | "unsafe" 11 | ) 12 | 13 | func guessWidth(w io.Writer) int { 14 | // check if COLUMNS env is set to comply with 15 | // http://pubs.opengroup.org/onlinepubs/009604499/basedefs/xbd_chap08.html 16 | colsStr := os.Getenv("COLUMNS") 17 | if colsStr != "" { 18 | if cols, err := strconv.Atoi(colsStr); err == nil { 19 | return cols 20 | } 21 | } 22 | 23 | if t, ok := w.(*os.File); ok { 24 | fd := t.Fd() 25 | var dimensions [4]uint16 26 | 27 | if _, _, err := syscall.Syscall6( 28 | syscall.SYS_IOCTL, 29 | uintptr(fd), 30 | uintptr(syscall.TIOCGWINSZ), 31 | uintptr(unsafe.Pointer(&dimensions)), 32 | 0, 0, 0, 33 | ); err == 0 { 34 | return int(dimensions[1]) 35 | } 36 | } 37 | return 80 38 | } 39 | -------------------------------------------------------------------------------- /govendor/gopkg.in/alecthomas/kingpin.v3-unstable/i18n_fr.go: -------------------------------------------------------------------------------- 1 | package kingpin 2 | 3 | var i18n_fr = []byte("\x1f\x8b\b\x00\x00\x00\x00\x00\x02\xff\x94\xd1A\xaa\x830\x10\x06\xe0}N1d\xf36\xea\x01\xdc\xc9{\xbc\v\xb8,]L㨁\x98H&i\x85һ\x17\xd1nJ\a\xe9\xfa\xcf\xf7\a\xe6?)\x80\xbb\x02\x00ж\xd35\xe8v\f70\xc1'ZR\xc9\xe4\xd9&{%\x18\xc9͕.\xb6\x97)\xa2g\x87\xc9\x06\xbf\x92\xa6\xef\xad\x19)\x82\xfbA\xdb\xd1Kgr\x8e*\xad\x00\x1e\xc5\xfb/\x99q\xa0Z\xe8\xdbÏ\xf0\xdf\xe1\xc0\x12\xfc\x8b8\x13\xe6E\xb0M\x94i\x13\x87<\x91O,\xd8\xdf0M\xe8;\xd1\xef9I\xbe\xcd\x17sPц̥9\xeaY\xe7\xf9b\x8c\xed\xfe\uab1e\x01\x00\x00\xff\xff\x1esa\xbf\xe9\x01\x00\x00") 4 | -------------------------------------------------------------------------------- /govendor/gopkg.in/yaml.v2/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2011-2016 Canonical Ltd. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.daemon=true 2 | org.gradle.parallel=true 3 | org.gradle.caching=true 4 | -------------------------------------------------------------------------------- /gradle/findbugs/excludeFilter.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /gradle/quality.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'checkstyle' 2 | apply plugin: 'pmd' 3 | 4 | checkstyle { 5 | configDir = file("$rootProject.projectDir/gradle/checkstyle") 6 | } 7 | 8 | tasks.withType(Checkstyle) { 9 | // disable style checks on java unit tests 10 | exclude("**/src/test/**") 11 | // disable style checks on non essential projects 12 | exclude("**/tests/**", "**/sdk/testing/**") 13 | } 14 | 15 | pmd { 16 | ignoreFailures = true 17 | ruleSets = [ 18 | 'category/java/bestpractices.xml', 19 | 'category/java/codestyle.xml', 20 | 'category/java/errorprone.xml', 21 | 'category/java/multithreading.xml' 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/d2iq-archive/dcos-commons/69824783f664407b88179e6461e42b611673d053/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /hooks/post_push: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | DATE_STAMP="$(date +%Y%m%d)" 6 | SOURCE_COMMIT=${SOURCE_COMMIT:-$(git rev-parse HEAD)} 7 | 8 | additional_tags=("${SOURCE_COMMIT}" "${DATE_STAMP}-${SOURCE_COMMIT}") 9 | 10 | for tag in ${additional_tags[@]}; do 11 | target="${DOCKER_REPO}:${tag}" 12 | docker tag ${IMAGE_NAME} ${target} 13 | docker push ${target} 14 | done 15 | -------------------------------------------------------------------------------- /mypy.ini: -------------------------------------------------------------------------------- 1 | [mypy] 2 | disallow_incomplete_defs = True 3 | disallow_subclassing_any = True 4 | disallow_untyped_calls = True 5 | disallow_untyped_decorators = False 6 | disallow_untyped_defs = True 7 | follow_imports = 'normal' 8 | ignore_missing_imports = True 9 | no_implicit_optional = True 10 | strict_optional = True 11 | warn_no_return = True 12 | warn_redundant_casts = True 13 | warn_return_any = True 14 | warn_unused_configs = True 15 | warn_unused_ignores = True 16 | 17 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.black] 2 | line-length = 100 3 | target-version = ["py36"] 4 | -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "config:base" 4 | ], 5 | "dockerfile": { 6 | "fileMatch": ["(^|/)Dockerfile[^/]*$"] 7 | }, 8 | "ignoreDeps": [ 9 | "azure-mgmt-network", 10 | "azure-mgmt-resource", 11 | "azure-monitor", 12 | "azure-storage", 13 | "keyring", 14 | "msrestazure", 15 | "oauth2client", 16 | "PyInstaller" 17 | ], 18 | "ignorePaths": [ 19 | "frameworks/*/universe*/package.json" 20 | ], 21 | "rebaseStalePrs": false, 22 | "renovateFork": true, 23 | "reviewers": [ 24 | "mediapills", 25 | "farhan5900", 26 | "rishabh96b", 27 | "alexeygorobets", 28 | "timcharper", 29 | "kaiwalyajoshi" 30 | ], 31 | "schedule": [ 32 | "after 10pm on the first day of the month" 33 | ], 34 | "updateNotScheduled" : false 35 | } 36 | -------------------------------------------------------------------------------- /run_container.sh: -------------------------------------------------------------------------------- 1 | test.sh -------------------------------------------------------------------------------- /sdk/bootstrap/.gitignore: -------------------------------------------------------------------------------- 1 | bootstrap* 2 | native-* 3 | .native-* 4 | -------------------------------------------------------------------------------- /sdk/bootstrap/build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | 4 | # Builds the "bootstrap" tool for use with common tasks in container environments. 5 | # Produces 1 artifact: bootstrap.zip (containing a linux build of "bootstrap") 6 | 7 | CUR_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 8 | EXE_FILENAME=$(basename $CUR_DIR) 9 | PKG_FILENAME=${EXE_FILENAME}.zip 10 | 11 | cd $CUR_DIR 12 | 13 | # required env: 14 | export REPO_ROOT_DIR=$(dirname $(dirname $CUR_DIR)) 15 | export REPO_NAME=$(basename $REPO_ROOT_DIR) 16 | $REPO_ROOT_DIR/tools/build_go_exe.sh sdk/bootstrap/ $EXE_FILENAME linux 17 | 18 | rm -f $PKG_FILENAME 19 | zip -q $PKG_FILENAME $EXE_FILENAME 20 | -------------------------------------------------------------------------------- /sdk/bootstrap/vendor: -------------------------------------------------------------------------------- 1 | ../../govendor/ -------------------------------------------------------------------------------- /sdk/cli/.gitignore: -------------------------------------------------------------------------------- 1 | dcos-* 2 | *.whl 3 | native-* 4 | .native-* 5 | -------------------------------------------------------------------------------- /sdk/cli/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "github.com/mesosphere/dcos-commons/cli" 5 | "gopkg.in/alecthomas/kingpin.v3-unstable" 6 | ) 7 | 8 | func main() { 9 | app := cli.New() 10 | cli.HandleDefaultSections(app) 11 | kingpin.MustParse(app.Parse(cli.GetArguments())) 12 | } 13 | -------------------------------------------------------------------------------- /sdk/cli/vendor: -------------------------------------------------------------------------------- 1 | ../../govendor -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/config/ConfigurationComparator.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.config; 2 | 3 | /** 4 | * This interface defines a way to compare two {@link Configuration} objects for equality. This 5 | * interface is intentionally separate from {@link Object#equals(Object)} in order to have very 6 | * explicit requirements around equality checks when they're needed. 7 | * 8 | * @param The {@code Configuration} type that will be parsed. 9 | */ 10 | public interface ConfigurationComparator { 11 | /** 12 | * Returns whether the provided configuration objects are equal. 13 | */ 14 | boolean equals(T first, T second); 15 | } 16 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/config/ConfigurationFactory.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.config; 2 | 3 | import com.mesosphere.sdk.state.ConfigStoreException; 4 | 5 | /** 6 | * This interface defines a way for previously stored Configuration objects to be reconstructed from 7 | * a byte array. 8 | * 9 | * @param The {@code Configuration} type that will be parsed. 10 | */ 11 | public interface ConfigurationFactory { 12 | /** 13 | * Parses the provided {@code bytes} and returns a configuration object. 14 | * 15 | * @throws ConfigStoreException if parsing fails 16 | */ 17 | T parse(byte[] bytes) throws ConfigStoreException; 18 | } 19 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/dcos/auth/ConstantTokenProvider.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.dcos.auth; 2 | 3 | import com.auth0.jwt.JWT; 4 | import com.auth0.jwt.interfaces.DecodedJWT; 5 | 6 | /** 7 | * Constant Token Provider always returns single pre-configured auth token. It can be used for 8 | * testing and for known life of configured token. 9 | */ 10 | public class ConstantTokenProvider implements TokenProvider { 11 | 12 | private final DecodedJWT token; 13 | 14 | public ConstantTokenProvider(String token) { 15 | this.token = JWT.decode(token); 16 | } 17 | 18 | @Override 19 | public DecodedJWT getToken() { 20 | return this.token; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/dcos/auth/TokenProvider.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.dcos.auth; 2 | 3 | import com.auth0.jwt.interfaces.DecodedJWT; 4 | 5 | import java.io.IOException; 6 | 7 | /** 8 | * TokenProvider describes an interface that provides valid DC/OS auth token. 9 | */ 10 | public interface TokenProvider { 11 | 12 | DecodedJWT getToken() throws IOException; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/debug/DebugEndpoint.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.debug; 2 | 3 | import javax.ws.rs.QueryParam; 4 | import javax.ws.rs.core.Response; 5 | 6 | /** 7 | * Interface for all debug endpoints. 8 | */ 9 | 10 | public interface DebugEndpoint { 11 | /** 12 | * Called to retun JSON response of requested endpoint. 13 | * @param plan (optional) Plan to drill down on. 14 | * @param phase (optional) Phase to drill down on. 15 | * @param step (optional) Step to drill down on. 16 | * @param sync (optional) Poll backend State-Stores. 17 | * @return JSON response of the requested debug endpoint. 18 | */ 19 | public Response getJson( 20 | @QueryParam("plan") String plan, 21 | @QueryParam("phase") String phase, 22 | @QueryParam("step") String step, 23 | @QueryParam("sync") boolean sync); 24 | } 25 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/http/types/EndpointProducer.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.http.types; 2 | 3 | /** 4 | * Interface for an object which returns the String content of an endpoint when requested. 5 | */ 6 | public interface EndpointProducer { 7 | 8 | /** 9 | * Creates and returns an {@link EndpointProducer} which only produces the provided constant value. 10 | */ 11 | static EndpointProducer constant(final String value) { 12 | return () -> value; 13 | } 14 | 15 | /** 16 | * Returns some endpoint content to be sent in response to an 'endpoints' lookup request. This 17 | * could be a URL, or the content of a file, etc. 18 | */ 19 | String getEndpoint(); 20 | } 21 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/http/types/PropertyDeserializer.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.http.types; 2 | 3 | import com.mesosphere.sdk.state.StateStoreException; 4 | 5 | /** 6 | * Interface which handles deserializing StateStore Property data for viewing by users. 7 | * 8 | * @see com.googlecode.protobuf.format.JsonFormat for turning protobufs into JSON 9 | */ 10 | public interface PropertyDeserializer { 11 | /** 12 | * Returns a valid JSON representation for the data in {@code value} for display to an end user. 13 | * {@code key} is provided to support datatypes which vary on a per-key basis. 14 | * 15 | * @throws StateStoreException if the provided data failed to be deserialized to JSON 16 | */ 17 | String toJsonString(String key, byte[] value) throws StateStoreException; 18 | } 19 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/http/types/StringPropertyDeserializer.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.http.types; 2 | 3 | import com.mesosphere.sdk.state.StateStoreException; 4 | 5 | import java.nio.charset.Charset; 6 | import java.nio.charset.StandardCharsets; 7 | 8 | /** 9 | * Implementation of {@link PropertyDeserializer} which converts UTF-8 JSON byte arrays to Strings. 10 | */ 11 | public class StringPropertyDeserializer implements PropertyDeserializer { 12 | private static final Charset DEFAULT_CHAR_SET = StandardCharsets.UTF_8; 13 | 14 | private final Charset charset; 15 | 16 | public StringPropertyDeserializer() { 17 | this(DEFAULT_CHAR_SET); 18 | } 19 | 20 | public StringPropertyDeserializer(Charset charset) { 21 | this.charset = charset; 22 | } 23 | 24 | @Override 25 | public String toJsonString(String key, byte[] value) throws StateStoreException { 26 | return new String(value, charset); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/offer/InvalidRequirementException.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.offer; 2 | 3 | /** 4 | * An exception which describes an error in a provided set of Offer Requirements. 5 | */ 6 | public class InvalidRequirementException extends Exception { 7 | public InvalidRequirementException(Throwable ex) { 8 | super(ex); 9 | } 10 | 11 | public InvalidRequirementException(String msg) { 12 | super(msg); 13 | } 14 | 15 | public InvalidRequirementException(String msg, Throwable cause) { 16 | super(msg, cause); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/offer/TaskException.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.offer; 2 | 3 | /** 4 | * This class encapsulates Exceptions associated with Tasks. 5 | */ 6 | public class TaskException extends Exception { 7 | public TaskException(Throwable cause) { 8 | super(cause); 9 | } 10 | 11 | public TaskException(String message) { 12 | super(message); 13 | } 14 | 15 | public TaskException(String message, Throwable cause) { 16 | super(message, cause); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/offer/UninstallRecommendation.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.offer; 2 | 3 | import org.apache.mesos.Protos; 4 | 5 | /** 6 | * This interface encapsulates a Mesos resource which is to be unreserved or destroyed. 7 | */ 8 | public interface UninstallRecommendation extends OfferRecommendation { 9 | /** 10 | * Returns the Mesos resource to be unreserved or destroyed. 11 | */ 12 | Protos.Resource getResource(); 13 | } 14 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/offer/evaluate/ExternalVolumeProvider.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.offer.evaluate; 2 | 3 | import java.util.Map; 4 | 5 | interface ExternalVolumeProvider { 6 | String getVolumeName(); 7 | 8 | Map getDriverOptions(); 9 | } 10 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/offer/evaluate/OfferEvaluationStage.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.offer.evaluate; 2 | 3 | import com.mesosphere.sdk.offer.MesosResourcePool; 4 | 5 | /** 6 | * Classes implementing this interface evaluate a pod against an offer and its resources for suitability to run. 7 | */ 8 | public interface OfferEvaluationStage { 9 | 10 | /** 11 | * Evaluate the given offer (in the form of a {@link MesosResourcePool}, modifying the 12 | * deducting used resources from the pool, and creating the appropriate {@link EvaluationOutcome}. 13 | * 14 | * @param mesosResourcePool the available resources left available for this stage to consume 15 | * @param podInfoBuilder the grouping of all task and executor builders for the pod 16 | * @return an {@link EvaluationOutcome} describing whether this evaluation stage succeeded or failed, and why 17 | */ 18 | EvaluationOutcome evaluate(MesosResourcePool mesosResourcePool, PodInfoBuilder podInfoBuilder); 19 | } 20 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/offer/evaluate/placement/AttributeRuleFactory.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.offer.evaluate.placement; 2 | 3 | /** 4 | * This class generates {@link AttributeRule}s. 5 | */ 6 | public final class AttributeRuleFactory implements RuleFactory { 7 | private static final AttributeRuleFactory factory = new AttributeRuleFactory(); 8 | 9 | private AttributeRuleFactory() { 10 | // Do not instantiate this class 11 | } 12 | 13 | public static AttributeRuleFactory getInstance() { 14 | return factory; 15 | } 16 | 17 | @Override 18 | public PlacementRule require(StringMatcher matcher) { 19 | return new AttributeRule(matcher); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/offer/evaluate/placement/HostnameRuleFactory.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.offer.evaluate.placement; 2 | 3 | /** 4 | * This class generates {@link HostnameRule}s. 5 | */ 6 | public final class HostnameRuleFactory implements RuleFactory { 7 | private static final HostnameRuleFactory factory = new HostnameRuleFactory(); 8 | 9 | private HostnameRuleFactory() { 10 | // Do not instantiate this class 11 | } 12 | 13 | public static HostnameRuleFactory getInstance() { 14 | return factory; 15 | } 16 | 17 | @Override 18 | public PlacementRule require(StringMatcher matcher) { 19 | return new HostnameRule(matcher); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/offer/evaluate/placement/PlacementField.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.offer.evaluate.placement; 2 | 3 | /** 4 | * This enum differentiates between the different classes of placement keys. 5 | */ 6 | public enum PlacementField { 7 | ATTRIBUTE, 8 | HOSTNAME, 9 | ZONE, 10 | REGION 11 | } 12 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/offer/evaluate/placement/RegionRuleFactory.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.offer.evaluate.placement; 2 | 3 | /** 4 | * This class generates {@link RegionRule}s. 5 | */ 6 | public final class RegionRuleFactory implements RuleFactory { 7 | private static final RegionRuleFactory factory = new RegionRuleFactory(); 8 | 9 | private RegionRuleFactory() { 10 | // Do not instantiate this class 11 | } 12 | 13 | public static RegionRuleFactory getInstance() { 14 | return factory; 15 | } 16 | 17 | @Override 18 | public PlacementRule require(StringMatcher matcher) { 19 | return new RegionRule(matcher); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/offer/evaluate/placement/StringMatcher.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.offer.evaluate.placement; 2 | 3 | import com.fasterxml.jackson.annotation.JsonTypeInfo; 4 | 5 | /** 6 | * Implements a check against a provided string, determining whether it matches some criteria. 7 | * This may be used for checks against e.g. attributes or hostnames. 8 | */ 9 | @JsonTypeInfo(use = JsonTypeInfo.Id.NAME) 10 | public interface StringMatcher { 11 | 12 | /** 13 | * Returns whether the provided string matches some internal criteria. 14 | */ 15 | boolean matches(String value); 16 | } 17 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/offer/evaluate/placement/TaskTypeConverter.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.offer.evaluate.placement; 2 | 3 | import com.fasterxml.jackson.annotation.JsonTypeInfo; 4 | import org.apache.mesos.Protos.TaskInfo; 5 | 6 | /** 7 | * Given a {@link TaskInfo}, returns a type string for that task. This must be implemented by the 8 | * developer, or see {@link TaskTypeLabelConverter} for a sample implementation which expects a 9 | * {@link TaskInfo} Label which contains the task type. 10 | */ 11 | @JsonTypeInfo(use = JsonTypeInfo.Id.NAME) 12 | public interface TaskTypeConverter { 13 | String getTaskType(TaskInfo taskInfo); 14 | } 15 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/offer/evaluate/placement/ZoneRuleFactory.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.offer.evaluate.placement; 2 | 3 | /** 4 | * This class generates {@link ZoneRule}s. 5 | */ 6 | public final class ZoneRuleFactory implements RuleFactory { 7 | private static final ZoneRuleFactory factory = new ZoneRuleFactory(); 8 | 9 | private ZoneRuleFactory() { 10 | } 11 | 12 | public static ZoneRuleFactory getInstance() { 13 | return factory; 14 | } 15 | 16 | @Override 17 | public PlacementRule require(StringMatcher matcher) { 18 | return new ZoneRule(matcher); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/scheduler/plan/Phase.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.scheduler.plan; 2 | 3 | /** 4 | * Defines the interface for one {@link Phase} within a {@link Plan}. A Phase is an ordered list of 5 | * one or more {@link Step}s, which each describe a single unit of work. 6 | *

7 | * For example, a Step might represent a cluster task that needs to be updated, while the Phase is 8 | * a list of all of those cluster tasks. 9 | *

10 | * See {@link Plan} docs for more background. 11 | */ 12 | public interface Phase extends ParentElement { 13 | } 14 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/scheduler/plan/PhaseFactory.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.scheduler.plan; 2 | 3 | import com.mesosphere.sdk.scheduler.plan.strategy.Strategy; 4 | import com.mesosphere.sdk.specification.PodSpec; 5 | 6 | /** 7 | * A PhaseFactory transforms {@link PodSpec}s into {@link Phase}s. 8 | */ 9 | public interface PhaseFactory { 10 | Phase getPhase(PodSpec podSpec); 11 | 12 | Phase getPhase(PodSpec podSpec, Strategy strategy); 13 | } 14 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/scheduler/plan/PlanCoordinator.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.scheduler.plan; 2 | 3 | import java.util.Collection; 4 | import java.util.List; 5 | 6 | /** 7 | * PlanCoordinator's job is to coordinate offers among configured {@link PlanManager}s. 8 | */ 9 | public interface PlanCoordinator { 10 | 11 | /** 12 | * @return The {@link Step}s which are eligible for processing. 13 | */ 14 | List getCandidates(); 15 | 16 | /** 17 | * @return The {@link PlanManager}s which the PlanCoordinator coordinates. 18 | */ 19 | Collection getPlanManagers(); 20 | } 21 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/scheduler/plan/PlanCustomizer.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.scheduler.plan; 2 | 3 | /** 4 | * This interface allows an opportunity for plans to be modified before execution. 5 | */ 6 | public interface PlanCustomizer { 7 | 8 | /** 9 | * Takes a reference to a plan, returning a reference to a modified plan derived from the original. 10 | *

11 | * By default, it returns the plan unmodified. 12 | * 13 | * @param plan 14 | * @return 15 | */ 16 | default Plan updatePlan(Plan plan) { 17 | return plan; 18 | } 19 | 20 | /** 21 | * Takes a reference to the uninstall plan, returning a reference to a modified plan derived from the original. 22 | *

23 | * By default, it returns the plan unmodified. 24 | * 25 | * @param uninstallPlan 26 | * @return 27 | */ 28 | default Plan updateUninstallPlan(Plan uninstallPlan) { 29 | return uninstallPlan; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/scheduler/plan/PlanFactory.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.scheduler.plan; 2 | 3 | import com.mesosphere.sdk.specification.ServiceSpec; 4 | 5 | /** 6 | * This interface defines the required elements for transforming {@link ServiceSpec}s into {@link Plan}s. 7 | */ 8 | public interface PlanFactory { 9 | Plan getPlan(ServiceSpec serviceSpec); 10 | } 11 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/scheduler/plan/StageBuilder.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.scheduler.plan; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * Interface for objects that build Plans. 7 | */ 8 | public interface StageBuilder { 9 | 10 | void addPhase(Phase phase); 11 | 12 | void setPhases(List phases); 13 | } 14 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/scheduler/plan/StepFactory.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.scheduler.plan; 2 | 3 | import com.mesosphere.sdk.specification.PodInstance; 4 | import com.mesosphere.sdk.specification.TaskSpec; 5 | 6 | import java.util.Collection; 7 | 8 | /** 9 | * An implementation of this interface should provide {@link Step}s based on {@link TaskSpec}s. This should 10 | * include logic detecting that a previously launched Task's specification has changed and so a relaunch of the Task is 11 | * needed. 12 | */ 13 | public interface StepFactory { 14 | Step getStep(PodInstance podInstance, Collection tasksToLaunch); 15 | } 16 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/scheduler/plan/backoff/DisabledBackoff.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.scheduler.plan.backoff; 2 | 3 | import org.apache.mesos.Protos; 4 | 5 | import java.time.Duration; 6 | import java.util.Optional; 7 | 8 | /** 9 | * Implementation of {@link Backoff} with zero backoff. 10 | */ 11 | public class DisabledBackoff extends Backoff { 12 | 13 | @Override 14 | public void addDelay(String taskInstanceName) {} 15 | 16 | @Override 17 | public void addDelay(Protos.TaskID taskID) {} 18 | 19 | @Override 20 | public Optional getDelay(String taskInstanceName) { 21 | return Optional.empty(); 22 | } 23 | 24 | @Override 25 | public boolean clearDelay(String taskInstanceName) { 26 | return false; 27 | } 28 | 29 | @Override 30 | public boolean clearDelay(Protos.TaskID taskID) { 31 | return false; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/scheduler/plan/strategy/InterruptibleStrategy.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.scheduler.plan.strategy; 2 | 3 | import com.mesosphere.sdk.scheduler.plan.Element; 4 | 5 | import java.util.concurrent.atomic.AtomicBoolean; 6 | 7 | /** 8 | * This class provides an encapsulation of common implementations for the methods associated with 9 | * pausing and resuming strategies. 10 | * 11 | * @param is the type of {@link Element}s to which the Strategy applies. 12 | */ 13 | public abstract class InterruptibleStrategy implements Strategy { 14 | private AtomicBoolean interrupted = new AtomicBoolean(false); 15 | 16 | @Override 17 | public void interrupt() { 18 | interrupted.set(true); 19 | } 20 | 21 | @Override 22 | public void proceed() { 23 | interrupted.set(false); 24 | } 25 | 26 | @Override 27 | public boolean isInterrupted() { 28 | return interrupted.get(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/scheduler/plan/strategy/StrategyGenerator.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.scheduler.plan.strategy; 2 | 3 | import com.mesosphere.sdk.scheduler.plan.Element; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * A StrategyGenerator generates {@link Strategy} objects of the appropriate type. 9 | * 10 | * @param is the type of {@link Element}s to which the Strategy applies. 11 | */ 12 | public interface StrategyGenerator { 13 | Strategy generate(List elements); 14 | } 15 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/scheduler/recovery/RecoveryPlanOverrider.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.scheduler.recovery; 2 | 3 | import com.mesosphere.sdk.scheduler.plan.Phase; 4 | import com.mesosphere.sdk.scheduler.plan.PodInstanceRequirement; 5 | 6 | import java.util.Optional; 7 | 8 | /** 9 | * This interface allows for the specification of custom recovery logic when presented with a stopped pod encapsulated 10 | * by the PodInstanceRequirement. 11 | */ 12 | public interface RecoveryPlanOverrider { 13 | 14 | /** 15 | * Returns a phase to be used when recovering the pod as described in the provided {@link PodInstanceRequirement}, 16 | * or an empty Optional if a default recovery phase should be used instead. 17 | * 18 | * @param podInstanceRequirement specifies the pod to be recovered, and the type of recovery 19 | */ 20 | Optional override(PodInstanceRequirement podInstanceRequirement); 21 | } 22 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/scheduler/recovery/RecoveryPlanOverriderFactory.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.scheduler.recovery; 2 | 3 | import com.mesosphere.sdk.scheduler.plan.Plan; 4 | import com.mesosphere.sdk.state.StateStore; 5 | 6 | import java.util.Collection; 7 | 8 | /** 9 | * Implementations of this interface allow the overriding of behavior in the {@link DefaultRecoveryPlanManager} 10 | * with a custom implementation that addresses applicaiton specific failure recovery mechanisms. 11 | */ 12 | public interface RecoveryPlanOverriderFactory { 13 | 14 | /** 15 | * Returns a new {@link RecoveryPlanOverrider} which will be queried for custom overridden phases when task recovery 16 | * occurs. 17 | * 18 | * @param stateStore the state store being used by the service 19 | * @param plans all plans being used by the service, as of the time that the service is being initialized 20 | */ 21 | RecoveryPlanOverrider create(StateStore stateStore, Collection plans); 22 | } 23 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/scheduler/recovery/RecoveryType.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.scheduler.recovery; 2 | 3 | /** 4 | * This indicates the type of recovery taking place. Transient indicates an in place recovery with no possibility of 5 | * data-loss. A permanent recovery is destructive and implies loss of data associated with a Pod. 6 | */ 7 | public enum RecoveryType { 8 | 9 | /** 10 | * No action is needed. No-op. 11 | */ 12 | NONE, 13 | 14 | /** 15 | * Transient failure (e.g. exited when goal=RUNNING, or exited non-zero when goal=ONCE or FINISH, or 16 | * 'pod restart' cmd), relaunch the task in-place without modifying its persistent volumes. 17 | */ 18 | TRANSIENT, 19 | 20 | /** 21 | * Permanent failure (e.g. bad machine or 'pod replace' cmd), destroy the current task's state and relaunch it 22 | * elsewhere from scratch. 23 | */ 24 | PERMANENT 25 | } 26 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/scheduler/recovery/monitor/DefaultFailureMonitor.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.scheduler.recovery.monitor; 2 | 3 | import com.mesosphere.sdk.scheduler.recovery.FailureUtils; 4 | 5 | import org.apache.mesos.Protos; 6 | 7 | /** 8 | * The DefaultFailureMonitor reports that tasks have Failed permanently when they are so labeled. 9 | */ 10 | public class DefaultFailureMonitor implements FailureMonitor { 11 | @Override 12 | public boolean hasFailed(Protos.TaskInfo task) { 13 | return FailureUtils.isPermanentlyFailed(task); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/scheduler/recovery/monitor/FailureMonitor.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.scheduler.recovery.monitor; 2 | 3 | import org.apache.mesos.Protos.TaskInfo; 4 | 5 | /** 6 | * Instances of this class are used to determine when a stopped task has failed and should be restarted elsewhere. 7 | */ 8 | public interface FailureMonitor { 9 | /** 10 | * Determines whether the given {@link TaskInfo}has failed forever or not. This hook will be first called with a 11 | * given {@link TaskInfo} the first time that {@link TaskInfo} stops running. It may be called additional times 12 | * after that. 13 | * 14 | * @param task The {@link TaskInfo} that is no longer running 15 | * @return true if the {@link TaskInfo} should be considered permanently lost & restarted elsewhere, false if it's 16 | * machine might still come back 17 | */ 18 | boolean hasFailed(TaskInfo task); 19 | } 20 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/scheduler/recovery/monitor/NeverFailureMonitor.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.scheduler.recovery.monitor; 2 | 3 | import org.apache.mesos.Protos; 4 | 5 | /** 6 | * A special {@link FailureMonitor} that never fails tasks. 7 | *

8 | * This is equivalent to disabling the failure detection feature. 9 | */ 10 | public class NeverFailureMonitor implements FailureMonitor { 11 | 12 | @Override 13 | public boolean hasFailed(Protos.TaskInfo task) { 14 | return false; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/scheduler/recovery/monitor/TestingFailureMonitor.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.scheduler.recovery.monitor; 2 | 3 | import org.apache.mesos.Protos.TaskInfo; 4 | 5 | import java.util.Arrays; 6 | import java.util.List; 7 | 8 | /** 9 | * Simple API to enable testing of failure conditions in frameworks. 10 | *

11 | * Allows you to specify which {@link TaskInfo}s will be treated as having failed. Any non-specified {@link TaskInfo}s 12 | * will be treated as stopped. 13 | */ 14 | public class TestingFailureMonitor implements FailureMonitor { 15 | private List failedList; 16 | 17 | public TestingFailureMonitor(TaskInfo... failed) { 18 | this.failedList = Arrays.asList(failed); 19 | } 20 | 21 | public void setFailedList(TaskInfo... failed) { 22 | this.failedList = Arrays.asList(failed); 23 | } 24 | 25 | @Override 26 | public boolean hasFailed(TaskInfo task) { 27 | return failedList.stream().anyMatch(task::equals); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/scheduler/uninstall/TaskKillStep.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.scheduler.uninstall; 2 | 3 | import com.mesosphere.sdk.framework.TaskKiller; 4 | import com.mesosphere.sdk.scheduler.plan.Status; 5 | 6 | import org.apache.mesos.Protos; 7 | 8 | import java.util.Optional; 9 | 10 | /** 11 | * Step which issues a kill command for a given task. 12 | */ 13 | public class TaskKillStep extends UninstallStep { 14 | 15 | private final Protos.TaskID taskID; 16 | 17 | public TaskKillStep(Protos.TaskID taskID, Optional namespace) { 18 | super("kill-task-" + taskID.getValue(), namespace); 19 | this.taskID = taskID; 20 | } 21 | 22 | @Override 23 | public void start() { 24 | setStatus(Status.IN_PROGRESS); 25 | TaskKiller.killTask(taskID); 26 | setStatus(Status.COMPLETE); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/specification/CommandSpec.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.specification; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.fasterxml.jackson.databind.annotation.JsonDeserialize; 5 | 6 | import java.util.Map; 7 | 8 | /** 9 | * Specification for defining a command. 10 | */ 11 | @JsonDeserialize(as = DefaultCommandSpec.class) 12 | public interface CommandSpec { 13 | @JsonProperty("value") 14 | String getValue(); 15 | 16 | @JsonProperty("environment") 17 | Map getEnvironment(); 18 | } 19 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/specification/DiscoverySpec.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.specification; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.fasterxml.jackson.databind.annotation.JsonDeserialize; 5 | import org.apache.mesos.Protos; 6 | 7 | import java.util.Optional; 8 | 9 | /** 10 | * Specification for a task's discovery info, including Mesos-DNS name prefix. 11 | */ 12 | @JsonDeserialize(as = DefaultDiscoverySpec.class) 13 | public interface DiscoverySpec { 14 | @JsonProperty("prefix") 15 | Optional getPrefix(); 16 | 17 | @JsonProperty("visibility") 18 | Optional getVisibility(); 19 | } 20 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/specification/ExternalVolumeSpec.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.specification; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.fasterxml.jackson.databind.annotation.JsonDeserialize; 5 | 6 | /** 7 | * Specification object for external volumes. 8 | */ 9 | @JsonDeserialize(as = PortworxVolumeSpec.class) 10 | public interface ExternalVolumeSpec { 11 | 12 | // The type of external-volume. Currently only DOCKER is supported. 13 | @JsonProperty("type") 14 | Type getType(); 15 | 16 | // Path where the external volume is surfaced in the launched container. 17 | @JsonProperty("container-path") 18 | String getContainerPath(); 19 | 20 | /** 21 | * Types of external volumes. 22 | */ 23 | enum Type { 24 | DOCKER 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/specification/GoalState.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.specification; 2 | 3 | /** 4 | * The allowed goal states for a Task. These are treated as the desired outcome for executing a given task. 5 | */ 6 | public enum GoalState { 7 | /** 8 | * ERROR. 9 | */ 10 | UNKNOWN, 11 | 12 | /** 13 | * Running continuously. Should be restarted if it exits. 14 | */ 15 | RUNNING, 16 | 17 | /** 18 | * Running and then exiting successfully once for a given configuration. Should not be restarted upon a successful 19 | * exit, but may be run again if there's a config change. 20 | */ 21 | FINISH, 22 | 23 | /** 24 | * Running only once over the lifetime of a service. Should not be run again for the duration of this install, 25 | * regardless of any config changes. 26 | */ 27 | ONCE 28 | } 29 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/specification/HealthCheckSpec.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.specification; 2 | 3 | import com.fasterxml.jackson.databind.annotation.JsonDeserialize; 4 | 5 | /** 6 | * HealthCheck specification. 7 | */ 8 | @JsonDeserialize(as = DefaultHealthCheckSpec.class) 9 | public interface HealthCheckSpec extends ReadinessCheckSpec { 10 | Integer getGracePeriod(); 11 | 12 | Integer getMaxConsecutiveFailures(); 13 | } 14 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/specification/HostVolumeSpec.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.specification; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.fasterxml.jackson.databind.annotation.JsonDeserialize; 5 | import org.apache.mesos.Protos; 6 | 7 | import java.util.Optional; 8 | 9 | /** 10 | * A HostVolumeSpec defines the features of a HostVolume. 11 | */ 12 | @JsonDeserialize(as = DefaultHostVolumeSpec.class) 13 | public interface HostVolumeSpec { 14 | 15 | @JsonProperty("host-path") 16 | String getHostPath(); 17 | 18 | @JsonProperty("container-path") 19 | String getContainerPath(); 20 | 21 | @JsonProperty("mode") 22 | Optional getMode(); 23 | } 24 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/specification/InvalidTaskSpecException.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.specification; 2 | 3 | /** 4 | * This class is an Exception to be used when unexpected errors are encountered in the handling of 5 | * TaskSpecifications and TaskTypeSpecifications. 6 | */ 7 | public class InvalidTaskSpecException extends Exception { 8 | public InvalidTaskSpecException(String errMsg) { 9 | super(errMsg); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/specification/NetworkSpec.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.specification; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.fasterxml.jackson.databind.annotation.JsonDeserialize; 5 | 6 | import java.util.Map; 7 | 8 | /** 9 | * Spec for defining a container's network membership. 10 | */ 11 | @JsonDeserialize(as = DefaultNetworkSpec.class) 12 | public interface NetworkSpec { 13 | @JsonProperty("network-name") 14 | String getName(); 15 | 16 | @JsonProperty("port-mappings") 17 | Map getPortMappings(); 18 | 19 | @JsonProperty("network-labels") 20 | Map getLabels(); 21 | } 22 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/specification/ReadinessCheckSpec.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.specification; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.fasterxml.jackson.databind.annotation.JsonDeserialize; 5 | 6 | /** 7 | * ReadinessCheck specification. 8 | */ 9 | @JsonDeserialize(as = DefaultReadinessCheckSpec.class) 10 | public interface ReadinessCheckSpec { 11 | @JsonProperty("command") 12 | String getCommand(); 13 | 14 | @JsonProperty("delay") 15 | Integer getDelay(); 16 | 17 | @JsonProperty("interval") 18 | Integer getInterval(); 19 | 20 | @JsonProperty("timeout") 21 | Integer getTimeout(); 22 | } 23 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/specification/ResourceSet.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.specification; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.fasterxml.jackson.databind.annotation.JsonDeserialize; 5 | 6 | import java.util.Collection; 7 | 8 | /** 9 | * Represents a named group of resources. 10 | */ 11 | @JsonDeserialize(as = DefaultResourceSet.class) 12 | public interface ResourceSet { 13 | @JsonProperty("id") 14 | String getId(); 15 | 16 | @JsonProperty("resource-specifications") 17 | Collection getResources(); 18 | 19 | @JsonProperty("volume-specifications") 20 | Collection getVolumes(); 21 | 22 | @JsonProperty("resource-limits") 23 | ResourceLimits getResourceLimits(); 24 | } 25 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/specification/ResourceSpec.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.specification; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.fasterxml.jackson.annotation.JsonTypeInfo; 5 | import org.apache.mesos.Protos; 6 | 7 | /** 8 | * A ResourceSpec encapsulates a Mesos Resource that may be used by a Task and therefore specified in a 9 | * TaskSpecification. 10 | */ 11 | @JsonTypeInfo(use = JsonTypeInfo.Id.NAME) 12 | public interface ResourceSpec { 13 | 14 | @JsonProperty("value") 15 | Protos.Value getValue(); 16 | 17 | @JsonProperty("name") 18 | String getName(); 19 | 20 | @JsonProperty("role") 21 | String getRole(); 22 | 23 | @JsonProperty("pre-reserved-role") 24 | String getPreReservedRole(); 25 | 26 | @JsonProperty("principal") 27 | String getPrincipal(); 28 | } 29 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/specification/SecretSpec.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.specification; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.fasterxml.jackson.databind.annotation.JsonDeserialize; 5 | 6 | import java.util.Optional; 7 | 8 | /** 9 | * A SecretSpec defines the features of a Secret. 10 | */ 11 | @JsonDeserialize(as = DefaultSecretSpec.class) 12 | public interface SecretSpec { 13 | 14 | @JsonProperty("secret") 15 | String getSecretPath(); 16 | 17 | @JsonProperty("env-key") 18 | Optional getEnvKey(); 19 | 20 | @JsonProperty("file") 21 | Optional getFilePath(); 22 | 23 | } 24 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/specification/TransportEncryptionSpec.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.specification; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.fasterxml.jackson.databind.annotation.JsonDeserialize; 5 | 6 | /** 7 | * Spec for defining a TLS encryption support. 8 | */ 9 | @JsonDeserialize(as = DefaultTransportEncryptionSpec.class) 10 | public interface TransportEncryptionSpec { 11 | @JsonProperty("name") 12 | String getName(); 13 | 14 | @JsonProperty("type") 15 | Type getType(); 16 | 17 | /** 18 | * The allowed formats of TLS certificate format. 19 | */ 20 | enum Type { 21 | // TODO(mh): Rename to PEM ? 22 | TLS, 23 | KEYSTORE 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/specification/VipSpec.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.specification; 2 | 3 | /** 4 | * Specification object for software defined VIPs. 5 | */ 6 | public interface VipSpec { 7 | /** 8 | * @return Application Port to which connections from VIP's port will be routed. 9 | */ 10 | int getApplicationPort(); 11 | 12 | /** 13 | * @return VIP's hostname. 14 | */ 15 | String getVipName(); 16 | 17 | /** 18 | * @return VIP's Port which will route connections to application Port. 19 | */ 20 | int getVipPort(); 21 | } 22 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/specification/yaml/RawConfig.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.specification.yaml; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | 5 | /** 6 | * Raw YAML Configuration section. 7 | */ 8 | public final class RawConfig { 9 | 10 | private final String template; 11 | 12 | private final String dest; 13 | 14 | private RawConfig( 15 | @JsonProperty("template") String template, 16 | @JsonProperty("dest") String dest) 17 | { 18 | this.template = template; 19 | this.dest = dest; 20 | } 21 | 22 | public String getTemplate() { 23 | return template; 24 | } 25 | 26 | public String getDest() { 27 | return dest; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/specification/yaml/RawDiscovery.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.specification.yaml; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | 5 | /** 6 | * Raw YAML discovery info. 7 | */ 8 | public final class RawDiscovery { 9 | private final String prefix; 10 | 11 | private final String visibility; 12 | 13 | private RawDiscovery( 14 | @JsonProperty("prefix") String prefix, 15 | @JsonProperty("visibility") String visibility) 16 | { 17 | this.prefix = prefix; 18 | this.visibility = visibility; 19 | } 20 | 21 | public String getPrefix() { 22 | return prefix; 23 | } 24 | 25 | public String getVisibility() { 26 | return visibility; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/specification/yaml/RawHostVolume.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.specification.yaml; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | 5 | /** 6 | * RawHostVolume YAML spec. 7 | */ 8 | public final class RawHostVolume { 9 | private final String hostPath; 10 | 11 | private final String containerPath; 12 | 13 | private final String mode; 14 | 15 | private RawHostVolume( 16 | @JsonProperty("host-path") String hostPath, 17 | @JsonProperty("container-path") String containerPath, 18 | @JsonProperty("mode") String mode) 19 | { 20 | this.hostPath = hostPath; 21 | this.containerPath = containerPath; 22 | this.mode = mode; 23 | } 24 | 25 | public String getMode() { 26 | return mode; 27 | } 28 | 29 | public String getHostPath() { 30 | return hostPath; 31 | } 32 | 33 | public String getContainerPath() { 34 | return containerPath; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/specification/yaml/RawPlan.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.specification.yaml; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | 5 | /** 6 | * Raw YAML plan. 7 | */ 8 | public final class RawPlan { 9 | 10 | private final String strategy; 11 | 12 | private final WriteOnceLinkedHashMap phases; 13 | 14 | private RawPlan( 15 | @JsonProperty("strategy") String strategy, 16 | @JsonProperty("phases") WriteOnceLinkedHashMap phases) 17 | { 18 | this.strategy = strategy; 19 | this.phases = phases; 20 | } 21 | 22 | public String getStrategy() { 23 | return strategy; 24 | } 25 | 26 | public WriteOnceLinkedHashMap getPhases() { 27 | return phases; 28 | } 29 | } 30 | 31 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/specification/yaml/RawRLimit.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.specification.yaml; 2 | 3 | import com.fasterxml.jackson.annotation.JsonCreator; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | 6 | /** 7 | * Raw YAML individual rlimit specification. 8 | */ 9 | public final class RawRLimit { 10 | private final Long soft; 11 | 12 | private final Long hard; 13 | 14 | @JsonCreator 15 | private RawRLimit(@JsonProperty("soft") Long soft, @JsonProperty("hard") Long hard) { 16 | this.soft = soft; 17 | this.hard = hard; 18 | } 19 | 20 | public Long getSoft() { 21 | return soft; 22 | } 23 | 24 | public Long getHard() { 25 | return hard; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/specification/yaml/RawRange.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.specification.yaml; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | 5 | /** 6 | * Raw YAML range. 7 | */ 8 | public final class RawRange { 9 | 10 | private final int begin; 11 | 12 | private final int end; 13 | 14 | private RawRange( 15 | @JsonProperty("begin") int begin, 16 | @JsonProperty("end") int end) 17 | { 18 | this.begin = begin; 19 | this.end = end; 20 | } 21 | 22 | public int getBegin() { 23 | return begin; 24 | } 25 | 26 | public int getEnd() { 27 | return end; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/specification/yaml/RawResource.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.specification.yaml; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | 5 | /** 6 | * Raw YAML resource. 7 | */ 8 | public final class RawResource { 9 | 10 | private final String name; 11 | 12 | private final String value; 13 | 14 | private final String envKey; 15 | 16 | private RawResource( 17 | @JsonProperty("name") String name, 18 | @JsonProperty("value") String value, 19 | @JsonProperty("env-key") String envKey) 20 | { 21 | this.name = name; 22 | this.value = value; 23 | this.envKey = envKey; 24 | } 25 | 26 | public String getName() { 27 | return name; 28 | } 29 | 30 | public String getValue() { 31 | return value; 32 | } 33 | 34 | public String getEnvKey() { 35 | return envKey; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/specification/yaml/RawResourceLimits.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.specification.yaml; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | 5 | /** 6 | * Raw YAML ResourceLimits. 7 | */ 8 | public final class RawResourceLimits { 9 | private final String cpus; 10 | 11 | private final String memory; 12 | 13 | private RawResourceLimits( 14 | @JsonProperty("cpus") String cpus, 15 | @JsonProperty("memory") String memory) 16 | { 17 | this.cpus = cpus; 18 | this.memory = memory; 19 | } 20 | 21 | public String getCpus() { 22 | return cpus; 23 | } 24 | 25 | public String getMemory() { 26 | return memory; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/specification/yaml/RawScheduler.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.specification.yaml; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | 5 | /** 6 | * Raw Scheduler configuration. 7 | */ 8 | public final class RawScheduler { 9 | 10 | private final String principal; 11 | 12 | private final String zookeeper; 13 | 14 | private final String user; 15 | 16 | private RawScheduler( 17 | @JsonProperty("principal") String principal, 18 | @JsonProperty("zookeeper") String zookeeper, 19 | @JsonProperty("user") String user) 20 | { 21 | this.principal = principal; 22 | this.zookeeper = zookeeper; 23 | this.user = user; 24 | } 25 | 26 | public String getPrincipal() { 27 | return principal; 28 | } 29 | 30 | public String getZookeeper() { 31 | return zookeeper; 32 | } 33 | 34 | public String getUser() { 35 | return user; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/specification/yaml/RawSecret.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.specification.yaml; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | 5 | 6 | /** 7 | * Raw YAML secret. 8 | */ 9 | public final class RawSecret { 10 | 11 | private final String secretPath; 12 | 13 | private final String envKey; 14 | 15 | private final String filePath; 16 | 17 | private RawSecret( 18 | @JsonProperty("secret") String secretPath, 19 | @JsonProperty("env-key") String envKey, 20 | @JsonProperty("file") String filePath) 21 | { 22 | this.secretPath = secretPath; 23 | this.envKey = envKey; 24 | this.filePath = filePath; 25 | } 26 | 27 | public String getSecretPath() { 28 | return secretPath; 29 | } 30 | 31 | public String getEnvKey() { 32 | return envKey; 33 | } 34 | 35 | public String getFilePath() { 36 | return filePath; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/specification/yaml/RawTransportEncryption.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.specification.yaml; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | 5 | /** 6 | * Raw YAML transport encryption. 7 | */ 8 | public final class RawTransportEncryption { 9 | private final String name; 10 | 11 | private final String type; 12 | 13 | private RawTransportEncryption( 14 | @JsonProperty("name") String name, 15 | @JsonProperty("type") String type) 16 | { 17 | this.name = name; 18 | this.type = type; 19 | } 20 | 21 | public String getName() { 22 | 23 | return name; 24 | } 25 | 26 | public String getType() { 27 | return type; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/specification/yaml/RawVip.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.specification.yaml; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | 5 | /** 6 | * Raw YAML vip. 7 | */ 8 | public final class RawVip { 9 | 10 | private final int port; 11 | 12 | private final String prefix; 13 | 14 | private RawVip( 15 | @JsonProperty("port") int port, 16 | @JsonProperty("prefix") String prefix) 17 | { 18 | this.port = port; 19 | this.prefix = prefix; 20 | } 21 | 22 | public int getPort() { 23 | return port; 24 | } 25 | 26 | public String getPrefix() { 27 | return prefix; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/java/com/mesosphere/sdk/state/Serializer.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.state; 2 | 3 | import java.io.IOException; 4 | 5 | /** 6 | * Interface for serializing and deserializing objects to byte arrays using some serialization 7 | * format. 8 | */ 9 | public interface Serializer { 10 | byte[] serialize(T value) throws IOException; 11 | 12 | T deserialize(byte[] bytes, Class clazz) throws IOException; 13 | } 14 | -------------------------------------------------------------------------------- /sdk/scheduler/src/main/resources/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | %-5level %d [%t] %c:%M(%L): %m%n 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/java/com/mesosphere/sdk/http/types/StringPropertyDeserializerTest.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.http.types; 2 | 3 | import com.mesosphere.sdk.config.SerializationUtils; 4 | 5 | import org.junit.Before; 6 | import org.junit.Test; 7 | 8 | import static org.junit.Assert.assertEquals; 9 | 10 | import java.nio.charset.StandardCharsets; 11 | 12 | /** 13 | * Tests for {@link StringPropertyDeserializer}. 14 | */ 15 | public class StringPropertyDeserializerTest { 16 | private StringPropertyDeserializer deserializer; 17 | 18 | @Before 19 | public void before() { 20 | deserializer = new StringPropertyDeserializer(); 21 | } 22 | 23 | @Test 24 | public void testToJsonString() throws Exception { 25 | boolean b = false; 26 | byte[] barr = SerializationUtils.toJsonString(b).getBytes(StandardCharsets.UTF_8); 27 | String bjson = deserializer.toJsonString("key", barr); 28 | assertEquals(bjson, "false"); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/java/com/mesosphere/sdk/offer/DefaultOfferRequirementProviderTest.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/d2iq-archive/dcos-commons/69824783f664407b88179e6461e42b611673d053/sdk/scheduler/src/test/java/com/mesosphere/sdk/offer/DefaultOfferRequirementProviderTest.java -------------------------------------------------------------------------------- /sdk/scheduler/src/test/java/com/mesosphere/sdk/offer/evaluate/MultiEvaluationStageTest.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/d2iq-archive/dcos-commons/69824783f664407b88179e6461e42b611673d053/sdk/scheduler/src/test/java/com/mesosphere/sdk/offer/evaluate/MultiEvaluationStageTest.java -------------------------------------------------------------------------------- /sdk/scheduler/src/test/java/com/mesosphere/sdk/offer/evaluate/placement/InvalidPlacementRuleTest.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.offer.evaluate.placement; 2 | 3 | import com.mesosphere.sdk.config.SerializationUtils; 4 | import org.junit.Test; 5 | 6 | import java.io.IOException; 7 | 8 | import static org.junit.Assert.assertEquals; 9 | 10 | public class InvalidPlacementRuleTest { 11 | 12 | @Test 13 | public void testSerializeDeserialize() throws IOException { 14 | PlacementRule rule = new InvalidPlacementRule("constraint", "exception"); 15 | assertEquals(rule, SerializationUtils.fromString( 16 | SerializationUtils.toJsonString(rule), PlacementRule.class, TestPlacementUtils.OBJECT_MAPPER)); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/java/com/mesosphere/sdk/offer/evaluate/placement/PassthroughRuleTest.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.offer.evaluate.placement; 2 | 3 | import java.io.IOException; 4 | import com.mesosphere.sdk.config.SerializationUtils; 5 | 6 | import org.junit.Test; 7 | 8 | import static org.junit.Assert.assertEquals; 9 | 10 | /** 11 | * Tests for {@link PassthroughRule}. 12 | */ 13 | public class PassthroughRuleTest { 14 | 15 | @Test 16 | public void testSerializeDeserialize() throws IOException { 17 | PlacementRule rule = new PassthroughRule(); 18 | assertEquals(rule, SerializationUtils.fromString( 19 | SerializationUtils.toJsonString(rule), PlacementRule.class, TestPlacementUtils.OBJECT_MAPPER)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/java/com/mesosphere/sdk/specification/DefaultVipSpecTest.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.specification; 2 | 3 | import org.junit.Assert; 4 | import org.junit.Test; 5 | 6 | public class DefaultVipSpecTest { 7 | @Test 8 | public void valid() { 9 | DefaultVipSpec vip = DefaultVipSpec.newBuilder() 10 | .applicationPort(0) 11 | .vipName("mysvc.mesos") 12 | .vipPort(0) 13 | .build(); 14 | 15 | Assert.assertNotNull(vip); 16 | } 17 | 18 | @Test(expected = IllegalArgumentException.class) 19 | public void invalid() { 20 | DefaultVipSpec.newBuilder() 21 | .applicationPort(-1) 22 | .vipName("") 23 | .vipPort(-1) 24 | .build(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/java/com/mesosphere/sdk/specification/ReplacementFailurePolicyTest.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.specification; 2 | 3 | import org.junit.Assert; 4 | import org.junit.Test; 5 | 6 | public class ReplacementFailurePolicyTest { 7 | @Test 8 | public void valid() { 9 | ReplacementFailurePolicy object = ReplacementFailurePolicy.newBuilder() 10 | .minReplaceDelaySecs(0) 11 | .permanentFailureTimoutSecs(0) 12 | .build(); 13 | 14 | Assert.assertNotNull(object); 15 | } 16 | 17 | @Test(expected = IllegalArgumentException.class) 18 | public void invalid() { 19 | ReplacementFailurePolicy.newBuilder() 20 | .minReplaceDelaySecs(-1) 21 | .permanentFailureTimoutSecs(-1) 22 | .build(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/java/com/mesosphere/sdk/specification/yaml/WriteOnceLinkedHashMapTest.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.specification.yaml; 2 | 3 | import org.junit.Assert; 4 | import org.junit.Test; 5 | 6 | import javax.validation.ConstraintViolationException; 7 | 8 | /** 9 | * Test for {@link WriteOnceLinkedHashMap}. 10 | */ 11 | public class WriteOnceLinkedHashMapTest { 12 | @Test 13 | public void valid() { 14 | WriteOnceLinkedHashMap map = new WriteOnceLinkedHashMap<>(); 15 | map.put("a", "b"); 16 | map.put("c", "d"); 17 | Assert.assertEquals(2, map.entrySet().size()); 18 | } 19 | 20 | @Test(expected = ConstraintViolationException.class) 21 | public void inValid() { 22 | WriteOnceLinkedHashMap map = new WriteOnceLinkedHashMap<>(); 23 | map.put("a", "b"); 24 | map.put("a", "d"); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/invalid-config-file.yml: -------------------------------------------------------------------------------- 1 | name: "data-store" 2 | pods: 3 | pod-type: 4 | count: 1 5 | tasks: 6 | some-task: 7 | goal: RUNNING 8 | cmd: "./task-cmd" 9 | cpus: 0.1 10 | memory: 512 11 | configs: 12 | conf-doesnt-exist: 13 | template: file-doesnt-exist.conf.mustache 14 | dest: conf/file-doesnt-exist.conf 15 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/invalid-duplicate-container-definition.yml: -------------------------------------------------------------------------------- 1 | name: "invalid-duplicate-container-test" 2 | pods: 3 | server: 4 | count: 1 5 | networks: 6 | test: 7 | host-ports: [4040] 8 | container-ports: [4041] 9 | container: 10 | networks: 11 | test: 12 | host-ports: [4040] 13 | container-ports: [4040] 14 | tasks: 15 | server: 16 | goal: RUNNING 17 | cmd: "cmd" 18 | cpus: 1 19 | memory: 1024 -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/invalid-duplicate-count.yml: -------------------------------------------------------------------------------- 1 | name: "hello-world" 2 | pods: 3 | pod-type: 4 | count: 1 5 | tasks: 6 | meta-data-task: 7 | goal: RUNNING 8 | cmd: "./task-cmd" 9 | cpus: 0.1 10 | memory: 512 11 | count: 2 12 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/invalid-duplicate-ports.yml: -------------------------------------------------------------------------------- 1 | name: "data-store" 2 | pods: 3 | meta-data: 4 | count: 2 5 | tasks: 6 | meta-data-task: 7 | goal: RUNNING 8 | cmd: "echo $TASK_NAME >> $TASK_NAME$CONTAINER_PATH_SUFFIX/output && sleep $SLEEP_DURATION" 9 | cpus: 0.1 10 | memory: 512 11 | ports: 12 | http: 13 | port: 8080 14 | another: 15 | port: 8080 16 | volume: 17 | path: "meta-data-container-path" 18 | type: ROOT 19 | size: 5000 20 | env: 21 | TASK_NAME: "meta-data" 22 | CONTAINER_PATH_SUFFIX: "-container-path" 23 | SLEEP_DURATION: "1000" -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/invalid-image-null.yml: -------------------------------------------------------------------------------- 1 | name: "invalid-image-null-test" 2 | pods: 3 | server: 4 | count: 1 5 | image: "" 6 | tasks: 7 | server: 8 | goal: RUNNING 9 | cmd: "cmd" 10 | cpus: 1 11 | memory: 1024 12 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/invalid-network-labels-blank.yml: -------------------------------------------------------------------------------- 1 | name: "invalid-network-labels-blank-test" 2 | pods: 3 | server: 4 | count: 1 5 | networks: 6 | dcos: 7 | labels: " " 8 | tasks: 9 | server: 10 | goal: RUNNING 11 | cmd: "cmd" 12 | cpus: 1 13 | memory: 1024 14 | ports: 15 | test: 16 | port: 8080 17 | test-2: 18 | port: 8081 19 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/invalid-network-labels-format.yml: -------------------------------------------------------------------------------- 1 | name: "invalid-network-labels-format-test" 2 | pods: 3 | server: 4 | count: 1 5 | networks: 6 | dcos: 7 | labels: "key1,val1" 8 | tasks: 9 | server: 10 | goal: RUNNING 11 | cmd: "cmd" 12 | cpus: 1 13 | memory: 1024 14 | ports: 15 | test: 16 | port: 8080 17 | test-2: 18 | port: 8081 19 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/invalid-network.yml: -------------------------------------------------------------------------------- 1 | name: "invalid-network-definition" 2 | pods: 3 | server: 4 | count: 1 5 | networks: 6 | dcos: 7 | host-ports: [8080] 8 | container-ports: [4040] 9 | tasks: 10 | server: 11 | goal: RUNNING 12 | cmd: "cmd" 13 | cpus: 1 14 | memory: 1024 15 | ports: 16 | test: 17 | port: 8080 -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/invalid-resource-limits-in-resource-set.yml: -------------------------------------------------------------------------------- 1 | name: "hello-world" 2 | pods: 3 | pod-type: 4 | count: 1 5 | resource-sets: 6 | meta-data-task-resourceset: 7 | cpus: 1.0 8 | memory: 512 9 | resource-limits: 10 | cpus: 0.5 11 | tasks: 12 | meta-data-task: 13 | goal: RUNNING 14 | cmd: "./task-cmd" 15 | resource-set: meta-data-task-resourceset 16 | 17 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/invalid-rlimit-name.yml: -------------------------------------------------------------------------------- 1 | name: "invalid-rlimit-name-test" 2 | pods: 3 | meta-data: 4 | count: 2 5 | rlimits: 6 | # Invalid rlimit. See man setrlimit for valid values. 7 | RLIMIT_NONSENSE: 8 | soft: 5 9 | hard: 10 10 | tasks: 11 | server: 12 | goal: RUNNING 13 | cmd: "cmd" 14 | cpus: 1 15 | memory: 1024 -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/invalid-scalar-cpu-resource.yml: -------------------------------------------------------------------------------- 1 | name: "hello-world" 2 | pods: 3 | pod-type: 4 | count: 1 5 | tasks: 6 | meta-data-task: 7 | goal: RUNNING 8 | cmd: "./task-cmd" 9 | cpus: 0 10 | memory: 10 11 | volumes: 12 | index: 13 | path: "index-container-path" 14 | type: MOUNT 15 | size: 10 16 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/invalid-scalar-disk-resource.yml: -------------------------------------------------------------------------------- 1 | name: "hello-world" 2 | pods: 3 | pod-type: 4 | count: 1 5 | tasks: 6 | meta-data-task: 7 | goal: RUNNING 8 | cmd: "./task-cmd" 9 | cpus: 10 10 | memory: 10 11 | volumes: 12 | index: 13 | path: "index-container-path" 14 | type: MOUNT 15 | size: 0 16 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/invalid-scalar-mem-resource.yml: -------------------------------------------------------------------------------- 1 | name: "hello-world" 2 | pods: 3 | pod-type: 4 | count: 1 5 | tasks: 6 | meta-data-task: 7 | goal: RUNNING 8 | cmd: "./task-cmd" 9 | cpus: 10 10 | memory: 0 11 | volumes: 12 | index: 13 | path: "index-container-path" 14 | type: MOUNT 15 | size: 10 16 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/invalid-seccomp-info.yml: -------------------------------------------------------------------------------- 1 | name: "invalid-seccomp-info" 2 | pods: 3 | meta-data: 4 | seccomp-unconfined: true 5 | seccomp-profile-name: "foobar" 6 | count: 2 7 | tasks: 8 | some-task: 9 | goal: RUNNING 10 | cmd: "some command" 11 | cpus: 1 12 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/invalid-share-parent-pod.yml: -------------------------------------------------------------------------------- 1 | name: "invalid-share-parent-pod" 2 | pods: 3 | meta-data: 4 | ipc-mode: SHARE_PARENT 5 | shm-size: 1024 6 | count: 2 7 | tasks: 8 | some-task: 9 | goal: RUNNING 10 | cmd: "some command" 11 | cpus: 1 12 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/invalid-share-parent-shm-size.yml: -------------------------------------------------------------------------------- 1 | name: valid-shm-spec 2 | pods: 3 | hello: 4 | ipc-mode: PRIVATE 5 | shm-size: 1024 6 | count: 2 7 | tasks: 8 | foo: 9 | goal: RUNNING 10 | ipc-mode: PRIVATE 11 | shm-size: 256 12 | cpus: 0.1 13 | memory: 256 14 | cmd: "some command" 15 | bar: 16 | ipc-mode: SHARE_PARENT 17 | goal: RUNNING 18 | cpus: 0.1 19 | memory: 256 20 | cmd: "some command" 21 | baz: 22 | ipc-mode: SHARE_PARENT 23 | shm-size: 256 24 | goal: RUNNING 25 | cpus: 0.1 26 | memory: 256 27 | cmd: "some command" 28 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/invalid-task-dns.yml: -------------------------------------------------------------------------------- 1 | name: "hello-world" 2 | pods: 3 | pod-type: 4 | count: 1 5 | tasks: 6 | meta-data-task: 7 | goal: RUNNING 8 | cmd: "./task-cmd" 9 | cpus: 0.1 10 | memory: 512 11 | discovery: 12 | prefix: meta-data 13 | other-pod: 14 | count: 1 15 | tasks: 16 | other-task: 17 | goal: RUNNING 18 | cmd: "./task-cmd" 19 | cpus: 0.1 20 | memory: 512 21 | discovery: 22 | prefix: meta-data 23 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/invalid-task-kill-grace-period-seconds.yml: -------------------------------------------------------------------------------- 1 | name: "hello-world" 2 | pods: 3 | pod-type: 4 | count: 1 5 | tasks: 6 | meta-data-task: 7 | goal: RUNNING 8 | cmd: "./task-cmd" 9 | cpus: 0.1 10 | memory: 512 11 | kill-grace-period: -1 12 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/invalid-task-labels-blank.yml: -------------------------------------------------------------------------------- 1 | name: "invalid-task-labels-blank-test" 2 | pods: 3 | server: 4 | count: 1 5 | tasks: 6 | server: 7 | goal: RUNNING 8 | cmd: "cmd" 9 | cpus: 1 10 | memory: 1024 11 | labels: " " 12 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/invalid-task-labels-format.yml: -------------------------------------------------------------------------------- 1 | name: "invalid-task-labels-format-test" 2 | pods: 3 | server: 4 | count: 1 5 | tasks: 6 | server: 7 | goal: RUNNING 8 | cmd: "cmd" 9 | cpus: 1 10 | memory: 1024 11 | labels: "label1,label1-value" 12 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/invalid-task-name.yml: -------------------------------------------------------------------------------- 1 | name: data-store 2 | pods: 3 | meta-data: 4 | placement: '[["hostname", "UNIQUE"]]' 5 | count: 2 6 | resource-sets: 7 | meta-data-resources: 8 | cpus: 0.1 9 | memory: 512 10 | tasks: 11 | meta-data-task: 12 | goal: RUNNING 13 | cmd: "echo $TASK_NAME >> $TASK_NAME$CONTAINER_PATH_SUFFIX/output && sleep $SLEEP_DURATION" 14 | resource-set: meta-data-resources 15 | meta-data-task: 16 | goal: RUNNING 17 | cmd: "echo $TASK_NAME >> $TASK_NAME$CONTAINER_PATH_SUFFIX/output && sleep $SLEEP_DURATION" 18 | resource-set: meta-data-resources 19 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/invalid-task-resources.yml: -------------------------------------------------------------------------------- 1 | name: "data-store" 2 | pods: 3 | meta-data: 4 | placement: '[["hostname", "UNIQUE"]]' 5 | count: 2 6 | resource-sets: 7 | meta-data-resources: 8 | cpus: 0.1 9 | memory: 512 10 | ports: 11 | http: 12 | port: 8080 13 | volume: 14 | path: "meta-data-container-path" 15 | type: ROOT 16 | size: 5000 17 | tasks: 18 | meta-data-task: 19 | goal: RUNNING 20 | cmd: "echo $TASK_NAME >> $TASK_NAME$CONTAINER_PATH_SUFFIX/output && sleep $SLEEP_DURATION" 21 | env: 22 | TASK_NAME: "meta-data" 23 | CONTAINER_PATH_SUFFIX: "-container-path" 24 | SLEEP_DURATION: "1000" 25 | health-check: 26 | cmd: "stat $TASK_NAME$CONTAINER_PATH_SUFFIX/output" 27 | interval: 5 28 | grace-period: 30 29 | max-consecutive-failures: 3 30 | delay: 0 31 | timeout: 10 32 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/invalid-vip-port-name-collision.yml: -------------------------------------------------------------------------------- 1 | name: "data-store" 2 | pods: 3 | meta-data: 4 | count: 2 5 | resource-sets: 6 | meta-data-resources: 7 | cpus: 0.1 8 | memory: 512 9 | ports: 10 | http: 11 | port: 8080 12 | http-other: 13 | port: 8080 14 | vip: 15 | port: 80 16 | prefix: http 17 | tasks: 18 | meta-data-task: 19 | goal: RUNNING 20 | cmd: "echo hello" 21 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/invalid-volume-and-volumes.yml: -------------------------------------------------------------------------------- 1 | name: "hello-world" 2 | pods: 3 | pod-type: 4 | count: 1 5 | tasks: 6 | meta-data-task: 7 | goal: RUNNING 8 | cmd: "./task-cmd" 9 | cpus: 0.1 10 | memory: 512 11 | volume: 12 | path: "index-container-path" 13 | type: MOUNT 14 | size: 4321 15 | volumes: 16 | metadata: 17 | path: "meta-data-container-path" 18 | type: ROOT 19 | size: 5000 20 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | %-5level %d [%t] %c:%M(%L): %m%n 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker: -------------------------------------------------------------------------------- 1 | mock-maker-inline 2 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/ranges.yml: -------------------------------------------------------------------------------- 1 | name: "ranges" 2 | pods: 3 | meta-data: 4 | count: 2 5 | tasks: 6 | some-task: 7 | goal: RUNNING 8 | cmd: "some command" 9 | ports: 10 | name1: 11 | port: 0 12 | env-key: key1 13 | ranges: 14 | - begin: 1 15 | end: 21 16 | - begin: 2000 17 | end: 5050 18 | name2: 19 | port: 0 20 | ranges: 21 | - begin: 22 | end: 21 23 | - begin: 5000 24 | end: 25 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/readiness-check.yml: -------------------------------------------------------------------------------- 1 | name: "hello-world" 2 | pods: 3 | pod-type: 4 | count: 1 5 | tasks: 6 | meta-data-task: 7 | goal: RUNNING 8 | cmd: "./task-cmd" 9 | cpus: 0.1 10 | memory: 512 11 | readiness-check: 12 | cmd: "./readiness-check" 13 | interval: 5 14 | delay: 0 15 | timeout: 10 16 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/recovery-plan-manager-test.yml: -------------------------------------------------------------------------------- 1 | name: "hello-world" 2 | pods: 3 | test-task-type: 4 | count: 1 5 | tasks: 6 | test-task-name: 7 | goal: RUNNING 8 | cmd: "echo 'Hello World'" 9 | cpus: 1.0 10 | memory: 1000 11 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/resource-refinement.yml: -------------------------------------------------------------------------------- 1 | name: "hello-world" 2 | pods: 3 | pod-type: 4 | count: 1 5 | pre-reserved-role: base-role 6 | tasks: 7 | test-task: 8 | goal: RUNNING 9 | cmd: "./task-cmd" 10 | cpus: 1.0 11 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/rsa-public-key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN PUBLIC KEY----- 2 | MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1nXCmIeuW6sNsR8FnAw0 3 | WIaeFS2jtMYtZ6Yj0C05wPymJIDBp5SRjF37dPNT7ICqK/LA8kD9gv3OIhhflypU 4 | GD1R3d98X8rocR8uoeBI9aZlOIS3qkSrQN6rmlhoVxgAXb9g0Gk7QLly4z3k+qc2 5 | eAdxMc0Fu+m1lcjGKtfgDeiZ3smU+FR6SRywPmCUDhMACvm6nocH8zCbrKwx5Nob 6 | RTbdq3FfpUeBd8D1AyBD5RZaYJ8Odfla0klroJVVn1RiBnywSVIftN2SIq1INquR 7 | KBggajiQmM6CcKa03+pRGcuvqtmkFCLwagZbVurER+d8LHABxwRHAkzxnuDhvnJx 8 | vwIDAQAB 9 | -----END PUBLIC KEY----- 10 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/seccomp-profile-name.yml: -------------------------------------------------------------------------------- 1 | name: "seccomp-profile-name" 2 | pods: 3 | meta-data: 4 | seccomp-profile-name: "foobar" 5 | count: 2 6 | tasks: 7 | some-task: 8 | goal: RUNNING 9 | cmd: "some command" 10 | cpus: 1 11 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/seccomp-unconfined.yml: -------------------------------------------------------------------------------- 1 | name: "seccomp-unconfined" 2 | pods: 3 | meta-data: 4 | seccomp-unconfined: true 5 | count: 2 6 | tasks: 7 | some-task: 8 | goal: RUNNING 9 | cmd: "some command" 10 | cpus: 1 11 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/shared-resource-set.yml: -------------------------------------------------------------------------------- 1 | name: "test" 2 | pods: 3 | pod: 4 | count: 2 5 | resource-sets: 6 | shared-resources: 7 | cpus: 1.0 8 | tasks: 9 | init: 10 | goal: ONCE 11 | cmd: "./init" 12 | resource-set: shared-resources 13 | server: 14 | goal: RUNNING 15 | cmd: "./server" 16 | resource-set: shared-resources 17 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/static-port.yml: -------------------------------------------------------------------------------- 1 | name: "hello-world" 2 | pods: 3 | pod-type: 4 | count: 1 5 | tasks: 6 | test-task: 7 | goal: RUNNING 8 | cmd: "./task-cmd" 9 | ports: 10 | test-port-name: 11 | port: 555 12 | env: 13 | PORT_TEST_PORT_NAME: 555 14 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/test-render-inverted.yml: -------------------------------------------------------------------------------- 1 | name: test-render 2 | pods: 3 | hello: 4 | count: 1 5 | tasks: 6 | server: 7 | goal: RUNNING 8 | {{#ENABLED}} 9 | cmd: ./enabled {{ENABLED}} 10 | {{/ENABLED}} 11 | {{^ENABLED}} 12 | cmd: ./disabled {{ENABLED}} 13 | {{/ENABLED}} 14 | cpus: 1.0 15 | memory: 256 16 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/test-render.yml: -------------------------------------------------------------------------------- 1 | name: test-render 2 | pods: 3 | hello: 4 | count: 1 5 | tasks: 6 | server: 7 | goal: RUNNING 8 | cmd: ./test-render 9 | cpus: 1.0 10 | memory: 256 11 | volume: 12 | path: hello-container-path 13 | type: ROOT 14 | size: {{VOL_SIZE}} 15 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/test.yml: -------------------------------------------------------------------------------- 1 | name: DCOS 2 | count: 1 -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/valid-customzk.yml: -------------------------------------------------------------------------------- 1 | name: "hello-world" 2 | scheduler: 3 | zookeeper: custom.master.mesos:2181 4 | pods: 5 | pod-type: 6 | count: 1 7 | tasks: 8 | meta-data-task: 9 | goal: RUNNING 10 | cmd: "./task-cmd" 11 | cpus: 0.1 12 | memory: 512 13 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/valid-envkey-ports.yml: -------------------------------------------------------------------------------- 1 | name: "envkey-ports" 2 | pods: 3 | meta-data: 4 | count: 2 5 | tasks: 6 | some-task: 7 | goal: RUNNING 8 | cmd: "some command" 9 | ports: 10 | name1: 11 | port: 8080 12 | env-key: key1 13 | name2: 14 | port: 8088 15 | name3: 16 | port: 8089 17 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/valid-external-volume.yml: -------------------------------------------------------------------------------- 1 | name: "hello-world" 2 | pods: 3 | pod-type: 4 | count: 1 5 | external-volumes: 6 | first-volume: 7 | type: DOCKER 8 | container-path: external-volume-etc 9 | driver-name: pxd 10 | driver-options: shared=true;size=10; 11 | volume-name: external-volume-name 12 | volume-mode: RO 13 | tasks: 14 | meta-data-task: 15 | goal: RUNNING 16 | cmd: "./task-cmd" 17 | cpus: 0.1 18 | memory: 512 19 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/valid-finished.yml: -------------------------------------------------------------------------------- 1 | name: "hello-world" 2 | pods: 3 | pod-type: 4 | count: 1 5 | tasks: 6 | meta-data-task: 7 | goal: FINISHED 8 | cmd: "./task-cmd" 9 | cpus: 0.1 10 | memory: 512 11 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/valid-gpu-resource.yml: -------------------------------------------------------------------------------- 1 | name: "hello-world" 2 | pods: 3 | pod-type: 4 | count: 1 5 | tasks: 6 | meta-data-task: 7 | goal: RUNNING 8 | cmd: "./task-cmd" 9 | cpus: 0.1 10 | gpus: 1.0 11 | memory: 512 12 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/valid-gpu-resourceset.yml: -------------------------------------------------------------------------------- 1 | name: "hello-world" 2 | pods: 3 | pod-type: 4 | count: 1 5 | resource-sets: 6 | meta-data-task-resourceset: 7 | cpus: 0.1 8 | gpus: 1.0 9 | memory: 512 10 | tasks: 11 | meta-data-task: 12 | goal: RUNNING 13 | cmd: "./task-cmd" 14 | resource-set: meta-data-task-resourceset 15 | 16 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/valid-host-volume.yml: -------------------------------------------------------------------------------- 1 | name: "hello-world" 2 | pods: 3 | pod-type: 4 | count: 1 5 | host-volumes: 6 | opt-mesosphere: 7 | host-path: /etc 8 | container-path: host-volume-etc 9 | mode: RO 10 | tasks: 11 | meta-data-task: 12 | goal: RUNNING 13 | cmd: "./task-cmd" 14 | cpus: 0.1 15 | memory: 512 16 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/valid-image.yml: -------------------------------------------------------------------------------- 1 | name: "valid-container-image-test" 2 | pods: 3 | server: 4 | count: 1 5 | image: group/image 6 | tasks: 7 | server: 8 | goal: RUNNING 9 | cmd: "cmd" 10 | cpus: 1 11 | memory: 1024 12 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/valid-minimal-health-configfile.yml: -------------------------------------------------------------------------------- 1 | name: "hello-world" 2 | pods: 3 | pod-type: 4 | count: 1 5 | tasks: 6 | meta-data-task: 7 | goal: RUNNING 8 | cmd: "./task-cmd" 9 | cpus: 0.1 10 | memory: 512 11 | discovery: 12 | prefix: meta-data 13 | health-check: 14 | cmd: "./health-check" 15 | interval: 5 16 | grace-period: 30 17 | max-consecutive-failures: 3 18 | delay: 0 19 | timeout: 10 20 | configs: 21 | config-one: 22 | template: config-one.conf.mustache 23 | dest: conf/config-one.conf 24 | config-two: 25 | template: config-two.xml.mustache 26 | dest: ../other/conf/config-two.xml 27 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/valid-minimal-networks-docker.yml: -------------------------------------------------------------------------------- 1 | name: "hello-world" 2 | pods: 3 | pod-type: 4 | count: 1 5 | image: group/image 6 | networks: 7 | dcos: 8 | tasks: 9 | meta-data-task: 10 | goal: RUNNING 11 | cmd: "./task-cmd" 12 | cpus: 0.1 13 | memory: 512 14 | ports: 15 | test: 16 | port: 4040 17 | discovery: 18 | prefix: meta-data 19 | health-check: 20 | cmd: "./health-check" 21 | interval: 5 22 | grace-period: 30 23 | max-consecutive-failures: 3 24 | delay: 0 25 | timeout: 10 26 | configs: 27 | config-one: 28 | template: config-one.conf.mustache 29 | dest: conf/config-one.conf 30 | config-two: 31 | template: config-two.xml.mustache 32 | dest: ../other/conf/config-two.xml 33 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/valid-minimal-overlay-vip.yml: -------------------------------------------------------------------------------- 1 | name: "hello-world" 2 | pods: 3 | pod-type: 4 | count: 1 5 | networks: 6 | dcos: 7 | tasks: 8 | meta-data-task: 9 | goal: RUNNING 10 | cmd: "./task-cmd" 11 | cpus: 0.1 12 | ports: 13 | http: 14 | port: 8080 15 | vip: 16 | prefix: overlay-vip 17 | port: 80 18 | memory: 512 19 | discovery: 20 | prefix: meta-data 21 | health-check: 22 | cmd: "./health-check" 23 | interval: 5 24 | grace-period: 30 25 | max-consecutive-failures: 3 26 | delay: 0 27 | timeout: 10 28 | configs: 29 | config-one: 30 | template: config-one.conf.mustache 31 | dest: conf/config-one.conf 32 | config-two: 33 | template: config-two.xml.mustache 34 | dest: ../other/conf/config-two.xml 35 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/valid-minimal-overlay.yml: -------------------------------------------------------------------------------- 1 | name: "hello-world" 2 | pods: 3 | pod-type: 4 | count: 1 5 | networks: 6 | dcos: 7 | tasks: 8 | meta-data-task: 9 | goal: RUNNING 10 | cmd: "./task-cmd" 11 | cpus: 0.1 12 | ports: 13 | http: 14 | port: 8080 15 | memory: 512 16 | discovery: 17 | prefix: meta-data 18 | health-check: 19 | cmd: "./health-check" 20 | interval: 5 21 | grace-period: 30 22 | max-consecutive-failures: 3 23 | delay: 0 24 | timeout: 10 25 | configs: 26 | config-one: 27 | template: config-one.conf.mustache 28 | dest: conf/config-one.conf 29 | config-two: 30 | template: config-two.xml.mustache 31 | dest: ../other/conf/config-two.xml 32 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/valid-minimal-ports.yml: -------------------------------------------------------------------------------- 1 | name: "hello-world" 2 | pods: 3 | pod-type: 4 | count: 1 5 | tasks: 6 | meta-data-task: 7 | goal: RUNNING 8 | cmd: "./task-cmd" 9 | cpus: 0.1 10 | ports: 11 | http: 12 | port: 8080 13 | memory: 512 14 | discovery: 15 | prefix: meta-data 16 | health-check: 17 | cmd: "./health-check" 18 | interval: 5 19 | grace-period: 30 20 | max-consecutive-failures: 3 21 | delay: 0 22 | timeout: 10 23 | configs: 24 | config-one: 25 | template: config-one.conf.mustache 26 | dest: conf/config-one.conf 27 | config-two: 28 | template: config-two.xml.mustache 29 | dest: ../other/conf/config-two.xml 30 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/valid-minimal-volume.yml: -------------------------------------------------------------------------------- 1 | name: "hello-world" 2 | pods: 3 | pod-type: 4 | count: 1 5 | tasks: 6 | task-name: 7 | goal: RUNNING 8 | cmd: "./task-cmd" 9 | cpus: 1.0 10 | memory: 512 11 | volume: 12 | path: container-path 13 | size: 10 14 | type: ROOT 15 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/valid-minimal.yml: -------------------------------------------------------------------------------- 1 | name: "hello-world" 2 | pods: 3 | pod-type: 4 | count: 1 5 | tasks: 6 | meta-data-task: 7 | goal: RUNNING 8 | cmd: "./task-cmd" 9 | cpus: 0.1 10 | memory: 512 11 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/valid-multiple-ports.yml: -------------------------------------------------------------------------------- 1 | name: "data-store" 2 | pods: 3 | meta-data: 4 | count: 2 5 | tasks: 6 | meta-data-task: 7 | goal: RUNNING 8 | cmd: "echo $TASK_NAME >> $TASK_NAME$CONTAINER_PATH_SUFFIX/output && sleep $SLEEP_DURATION" 9 | cpus: 0.1 10 | memory: 512 11 | ports: 12 | http: 13 | port: 8080 14 | another: 15 | port: 8088 16 | volume: 17 | path: "meta-data-container-path" 18 | type: ROOT 19 | size: 5000 20 | env: 21 | TASK_NAME: "meta-data" 22 | CONTAINER_PATH_SUFFIX: "-container-path" 23 | SLEEP_DURATION: "1000" 24 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/valid-network.yml: -------------------------------------------------------------------------------- 1 | name: "valid-container-network-test" 2 | pods: 3 | server: 4 | count: 1 5 | networks: 6 | dcos: 7 | labels: "key1:val1,key2:val2a:val2b" 8 | tasks: 9 | server: 10 | goal: RUNNING 11 | cmd: "cmd" 12 | cpus: 1 13 | memory: 1024 14 | ports: 15 | test: 16 | port: 8080 17 | test-2: 18 | port: 8081 19 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/valid-networks-port-mapping.yml: -------------------------------------------------------------------------------- 1 | name: "hello-world" 2 | pods: 3 | pod-type: 4 | count: 1 5 | networks: 6 | mesos-bridge: 7 | host-ports: [4040] 8 | container-ports: [8080] 9 | tasks: 10 | meta-data-task: 11 | goal: RUNNING 12 | cmd: "./task-cmd" 13 | cpus: 0.1 14 | ports: 15 | test: 16 | port: 4040 17 | memory: 512 18 | discovery: 19 | prefix: meta-data 20 | health-check: 21 | cmd: "./health-check" 22 | interval: 5 23 | grace-period: 30 24 | max-consecutive-failures: 3 25 | delay: 0 26 | timeout: 10 27 | configs: 28 | config-one: 29 | template: config-one.conf.mustache 30 | dest: conf/config-one.conf 31 | config-two: 32 | template: config-two.xml.mustache 33 | dest: ../other/conf/config-two.xml 34 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/valid-port-healthcheck-overlay.yml: -------------------------------------------------------------------------------- 1 | name: "hello-world" 2 | pods: 3 | pod-type: 4 | count: 1 5 | networks: 6 | dcos: 7 | tasks: 8 | test-task-name: 9 | goal: RUNNING 10 | cmd: "./task-cmd" 11 | ports: 12 | test-port: 13 | port: 10000 14 | env-key: PORT_TEST_PORT 15 | health-check: 16 | cmd: "/bin/true" 17 | interval: 5 18 | grace-period: 30 19 | max-consecutive-failures: 3 20 | delay: 0 21 | timeout: 10 22 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/valid-port-healthcheck.yml: -------------------------------------------------------------------------------- 1 | name: "hello-world" 2 | pods: 3 | pod-type: 4 | count: 1 5 | tasks: 6 | test-task-name: 7 | goal: RUNNING 8 | cmd: "./task-cmd" 9 | ports: 10 | test-port: 11 | port: 10000 12 | env-key: PORT_TEST_PORT 13 | health-check: 14 | cmd: "/bin/true" 15 | interval: 5 16 | grace-period: 30 17 | max-consecutive-failures: 3 18 | delay: 0 19 | timeout: 10 20 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/valid-port-readinesscheck-overlay.yml: -------------------------------------------------------------------------------- 1 | name: "hello-world" 2 | pods: 3 | pod-type: 4 | count: 1 5 | networks: 6 | dcos: 7 | tasks: 8 | test-task-name: 9 | goal: RUNNING 10 | cmd: "./task-cmd" 11 | ports: 12 | test-port: 13 | port: 10000 14 | env-key: PORT_TEST_PORT 15 | readiness-check: 16 | cmd: "/bin/true" 17 | interval: 5 18 | delay: 0 19 | timeout: 10 20 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/valid-port-readinesscheck.yml: -------------------------------------------------------------------------------- 1 | name: "hello-world" 2 | pods: 3 | pod-type: 4 | count: 1 5 | tasks: 6 | test-task-name: 7 | goal: RUNNING 8 | cmd: "./task-cmd" 9 | ports: 10 | test-port: 11 | port: 10000 12 | env-key: PORT_TEST_PORT 13 | readiness-check: 14 | cmd: "/bin/true" 15 | interval: 5 16 | delay: 0 17 | timeout: 10 18 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/valid-profile-mount-volume.yml: -------------------------------------------------------------------------------- 1 | name: "hello-world" 2 | pods: 3 | pod-type: 4 | count: 1 5 | tasks: 6 | task-name: 7 | goal: RUNNING 8 | cmd: "./task-cmd" 9 | cpus: 1.0 10 | memory: 512 11 | volume: 12 | path: container-path 13 | size: 10 14 | type: MOUNT 15 | profiles: ["fast", "slow"] 16 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/valid-resource-limits-empty.yml: -------------------------------------------------------------------------------- 1 | name: "hello-world" 2 | pods: 3 | pod-type: 4 | count: 1 5 | tasks: 6 | meta-data-task: 7 | goal: RUNNING 8 | cmd: "./task-cmd" 9 | cpus: 0.1 10 | memory: 512 11 | resource-limits: 12 | cpus: 13 | memory: 14 | 15 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/valid-resource-limits-in-resource-set.yml: -------------------------------------------------------------------------------- 1 | name: "hello-world" 2 | pods: 3 | pod-type: 4 | count: 1 5 | resource-sets: 6 | meta-data-task-resourceset: 7 | cpus: 0.1 8 | memory: 512 9 | resource-limits: 10 | cpus: unlimited 11 | memory: 1024 12 | tasks: 13 | meta-data-task: 14 | goal: RUNNING 15 | cmd: "./task-cmd" 16 | resource-set: meta-data-task-resourceset 17 | 18 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/valid-resource-limits-in-task.yml: -------------------------------------------------------------------------------- 1 | name: "hello-world" 2 | pods: 3 | pod-type: 4 | count: 1 5 | tasks: 6 | meta-data-task: 7 | goal: RUNNING 8 | cmd: "./task-cmd" 9 | cpus: 0.1 10 | memory: 512 11 | resource-limits: 12 | cpus: unlimited 13 | memory: 1024 14 | 15 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/valid-seccomp-info.yml: -------------------------------------------------------------------------------- 1 | name: "valid-seccomp-info" 2 | pods: 3 | meta-data: 4 | seccomp-unconfined: false 5 | seccomp-profile-name: "foobar" 6 | count: 2 7 | tasks: 8 | some-task: 9 | goal: RUNNING 10 | cmd: "some command" 11 | cpus: 1 12 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/valid-secrets-env.yml: -------------------------------------------------------------------------------- 1 | name: "helo-world" 2 | pods: 3 | hello: 4 | count: 1 5 | secrets: 6 | secret1: 7 | secret: hello-world/hello/somePath/secret1 8 | env-key: HELLO_SECRET1_ENV 9 | tasks: 10 | secret-task: 11 | goal: RUNNING 12 | cmd: "./task-cmd" 13 | cpus: 0.1 14 | memory: 256 15 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/valid-secrets.yml: -------------------------------------------------------------------------------- 1 | name: "helo-world" 2 | pods: 3 | hello: 4 | count: 1 5 | secrets: 6 | secret1: 7 | secret: hello-world/hello/somePath/secret1 8 | env-key: HELLO_SECRET1_ENV 9 | file: HELLO_SECRET1_FILE 10 | secret2: 11 | secret: hello-world/hello/somePath/secret2 12 | file: HELLO_SECRET2_FILE 13 | tasks: 14 | hello-task: 15 | goal: RUNNING 16 | cmd: "./task-cmd" 17 | cpus: 0.1 18 | memory: 256 19 | world: 20 | count: 1 21 | secrets: 22 | secret1: 23 | secret: hello-world/world/somePath/secret1 24 | env-key: WORLD_SECRET1_ENV 25 | secret2: 26 | secret: hello-world/world/somePath/secret2 27 | file: WORLD_SECRET2_FILE 28 | secret3: 29 | secret: hello-world/world/somePath/secret3 30 | tasks: 31 | world-task: 32 | goal: RUNNING 33 | cmd: "./task-cmd" 34 | cpus: 0.1 35 | memory: 256 36 | 37 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/valid-shared-memory-pod.yml: -------------------------------------------------------------------------------- 1 | name: "valid-shared-memory-pod" 2 | pods: 3 | meta-data: 4 | ipc-mode: PRIVATE 5 | shm-size: 1024 6 | count: 2 7 | tasks: 8 | some-task: 9 | goal: RUNNING 10 | cmd: "some command" 11 | cpus: 1 12 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/valid-shm-spec.yml: -------------------------------------------------------------------------------- 1 | name: valid-shm-spec 2 | pods: 3 | hello: 4 | ipc-mode: PRIVATE 5 | shm-size: 1024 6 | count: 2 7 | tasks: 8 | foo: 9 | goal: RUNNING 10 | ipc-mode: PRIVATE 11 | shm-size: 256 12 | cpus: 0.1 13 | memory: 256 14 | cmd: "some command" 15 | bar: 16 | ipc-mode: SHARE_PARENT 17 | goal: RUNNING 18 | cpus: 0.1 19 | memory: 256 20 | cmd: "some command" 21 | baz: 22 | ipc-mode: SHARE_PARENT 23 | goal: RUNNING 24 | cpus: 0.1 25 | memory: 256 26 | cmd: "some command" 27 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/valid-simple.yml: -------------------------------------------------------------------------------- 1 | name: "data-store" 2 | pods: 3 | meta-data: 4 | count: 2 5 | tasks: 6 | meta-data-task: 7 | goal: RUNNING 8 | cmd: "echo $TASK_NAME >> $TASK_NAME$CONTAINER_PATH_SUFFIX/output && sleep $SLEEP_DURATION" 9 | cpus: 0.1 10 | memory: 512 11 | ports: 12 | http: 13 | port: 8080 14 | volume: 15 | path: "meta-data-container-path" 16 | type: ROOT 17 | size: 5000 18 | env: 19 | TASK_NAME: "meta-data" 20 | CONTAINER_PATH_SUFFIX: "-container-path" 21 | SLEEP_DURATION: "1000" 22 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/valid-task-kill-grace-period-seconds.yml: -------------------------------------------------------------------------------- 1 | name: "hello-world" 2 | pods: 3 | pod-type: 4 | count: 1 5 | tasks: 6 | meta-data-task: 7 | goal: RUNNING 8 | cmd: "./task-cmd" 9 | cpus: 0.1 10 | memory: 512 11 | kill-grace-period: 15 12 | -------------------------------------------------------------------------------- /sdk/scheduler/src/test/resources/valid-task-labels.yml: -------------------------------------------------------------------------------- 1 | name: "valid-task-labels-test" 2 | pods: 3 | server: 4 | count: 1 5 | tasks: 6 | server: 7 | goal: RUNNING 8 | cmd: "cmd" 9 | cpus: 1 10 | memory: 1024 11 | labels: "label1:label1-value,label2:path:/" 12 | -------------------------------------------------------------------------------- /sdk/testing/src/main/java/com/mesosphere/sdk/testing/LaunchedTask.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.testing; 2 | 3 | import com.google.protobuf.TextFormat; 4 | import org.apache.mesos.Protos; 5 | 6 | /** 7 | * Grouping of a launched task along with its associated executor. 8 | */ 9 | public class LaunchedTask { 10 | private final Protos.ExecutorInfo executorInfo; 11 | 12 | private final Protos.TaskInfo taskInfo; 13 | 14 | public LaunchedTask(Protos.ExecutorInfo executorInfo, Protos.TaskInfo taskInfo) { 15 | this.executorInfo = executorInfo; 16 | this.taskInfo = taskInfo; 17 | } 18 | 19 | public Protos.ExecutorInfo getExecutor() { 20 | return executorInfo; 21 | } 22 | 23 | public Protos.TaskInfo getTask() { 24 | return taskInfo; 25 | } 26 | 27 | @Override 28 | public String toString() { 29 | return String.format("Executor: %s%nTask: %s", 30 | TextFormat.shortDebugString(executorInfo), TextFormat.shortDebugString(taskInfo)); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /sdk/testing/src/main/java/com/mesosphere/sdk/testing/SimulationTick.java: -------------------------------------------------------------------------------- 1 | package com.mesosphere.sdk.testing; 2 | 3 | /** 4 | * A step in a cluster simulation. 5 | */ 6 | public interface SimulationTick { 7 | 8 | /** 9 | * Returns a description of this step for debugging by the user. 10 | */ 11 | public String getDescription(); 12 | } 13 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'dcos-commons' 2 | 3 | include 'frameworks/cassandra' 4 | project(':frameworks/cassandra').name = 'cassandra' 5 | 6 | include 'frameworks/hdfs' 7 | project(':frameworks/hdfs').name = 'hdfs' 8 | 9 | include 'frameworks/helloworld' 10 | project(':frameworks/helloworld').name = 'helloworld' 11 | 12 | include 'frameworks/helloworld/tests/tls/keystore' 13 | project(':frameworks/helloworld/tests/tls/keystore').name = 'keystore-app' 14 | 15 | include 'sdk/scheduler' 16 | project(':sdk/scheduler').name = 'scheduler' 17 | 18 | include 'sdk/testing' 19 | project(':sdk/testing').name = 'testing' 20 | -------------------------------------------------------------------------------- /testing/README.md: -------------------------------------------------------------------------------- 1 | # Testing utils 2 | 3 | Common python code used for integration testing of services in this repository. By convention the libraries in this directory tend to start with `sdk_`, making them a little easier to identify in individual tests. 4 | 5 | Each service has its own tests which use these common utilities. For example, see the [../frameworks/helloworld/tests/](hello-world service tests). 6 | -------------------------------------------------------------------------------- /testing/security/__init__.py: -------------------------------------------------------------------------------- 1 | from . import kerberos 2 | from . import transport_encryption 3 | 4 | 5 | __all__ = ['kerberos', 'transport_encryption'] 6 | -------------------------------------------------------------------------------- /testing/security/keytab-validator/.gitignore: -------------------------------------------------------------------------------- 1 | Main.class 2 | .DS_Store 3 | 4 | -------------------------------------------------------------------------------- /testing/security/keytab-validator/README.MD: -------------------------------------------------------------------------------- 1 | This is a simple keytab validator. 2 | 3 | The files known_good.keytab and known_bad.keytab can be used to test the validator if you need to make any changes. 4 | 5 | A copy of the validator is checked in at keytab-validator.jar in this directory. If you make changes, update this checked 6 | in file :). 7 | 8 | To build the validator: 9 | ``` 10 | # From /keytab-validator: 11 | javac -d . src/Main.java && jar -cvfe keytab-validator.jar Main Main.class 12 | ``` 13 | -------------------------------------------------------------------------------- /testing/security/keytab-validator/keytab-validator.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/d2iq-archive/dcos-commons/69824783f664407b88179e6461e42b611673d053/testing/security/keytab-validator/keytab-validator.jar -------------------------------------------------------------------------------- /testing/security/keytab-validator/known_bad.keytab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/d2iq-archive/dcos-commons/69824783f664407b88179e6461e42b611673d053/testing/security/keytab-validator/known_bad.keytab -------------------------------------------------------------------------------- /testing/security/keytab-validator/known_good.keytab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/d2iq-archive/dcos-commons/69824783f664407b88179e6461e42b611673d053/testing/security/keytab-validator/known_good.keytab -------------------------------------------------------------------------------- /testing/security/keytab-validator/src/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Main-Class: Main 3 | 4 | -------------------------------------------------------------------------------- /tools-internal/README.md: -------------------------------------------------------------------------------- 1 | # Tools and scripts that are *NOT* used directly by consumers of dcos-commons 2 | 3 | Unlike the `tools` directory, files in this directory are *NOT* to be used directly by consumers of the DC/OS SDK. Examples include: 4 | 5 | - `Docker` files and sources that are required in order to build docker containers used by this or other projects. 6 | -------------------------------------------------------------------------------- /tools-internal/kdc-api-server/Dockerfile.mit-alpine: -------------------------------------------------------------------------------- 1 | # Build the kdc-api-server in a separate container 2 | FROM golang:1.11 3 | WORKDIR /go/src/github.com/mesosphere/kdc-api-server 4 | RUN go get -d -v golang.org/x/net/html gopkg.in/jcmturner/gokrb5.v7/keytab 5 | COPY server/ /go/src/github.com/mesosphere/kdc-api-server 6 | RUN go get github.com/dcos/client-go/dcos 7 | RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -o api-server . 8 | 9 | # Build a KDC container 10 | FROM alpine:3.9 11 | WORKDIR /kdc 12 | COPY docker/* /kdc/ 13 | 14 | ENV KRB5_CONFIG=/kdc/krb5.conf \ 15 | KRB5_KDC_PROFILE=/kdc/kdc.conf \ 16 | KDC_BIN=/usr/sbin/krb5kdc \ 17 | KADMIN_BIN=/usr/sbin/kadmin.local 18 | 19 | RUN apk add --no-cache krb5 krb5-server krb5-libs supervisor && \ 20 | echo -e "\n\n" | kdb5_util create -r LOCAL -s 21 | 22 | COPY --from=0 /go/src/github.com/mesosphere/kdc-api-server/api-server /kdc 23 | 24 | CMD /usr/bin/supervisord -c /kdc/supervisord.conf 25 | -------------------------------------------------------------------------------- /tools-internal/kdc-api-server/docker/kdc.conf: -------------------------------------------------------------------------------- 1 | [kdcdefaults] 2 | kdc_ports = 2500 3 | 4 | [realms] 5 | LOCAL = { 6 | kadmind_port = 749 7 | max_life = 30d 0h 0m 0s 8 | max_renewable_life = 60d 0h 0m 0s 9 | master_key_type = des3-hmac-sha1 10 | supported_enctypes = des3-hmac-sha1:normal des-cbc-crc:normal des-cbc-crc:v4 11 | } 12 | 13 | [logging] 14 | kdc = FILE:/var/log/kdc.log 15 | admin_server = FILE=/var/log/kadm5.log 16 | -------------------------------------------------------------------------------- /tools-internal/kdc-api-server/docker/krb5.conf: -------------------------------------------------------------------------------- 1 | [libdefaults] 2 | default_realm = LOCAL 3 | default_tkt_enctypes = des3-hmac-sha1 des-cbc-crc 4 | default_tgs_enctypes = des3-hmac-sha1 des-cbc-crc 5 | dns_lookup_kdc = true 6 | dns_lookup_realm = false 7 | 8 | [realms] 9 | LOCAL = { 10 | kdc = kdc.marathon.autoip.dcos.thisdcos.directory 11 | admin_server = kdc.marathon.autoip.dcos.thisdcos.directory 12 | master_kdc = kdc.marathon.autoip.dcos.thisdcos.directory 13 | default_domain = dcos.directory 14 | } 15 | 16 | [domain_realm] 17 | .dcos.directory = LOCAL 18 | dcos.directory = LOCAL 19 | .dcos.thisdcos.directory = LOCAL 20 | dcos.thisdcos.directory = LOCAL 21 | 22 | [logging] 23 | kdc = FILE:/var/log/kdc.log 24 | admin_server = FILE=/var/log/kadm5.log 25 | -------------------------------------------------------------------------------- /tools-internal/kdc-api-server/docker/supervisord.conf: -------------------------------------------------------------------------------- 1 | [supervisord] 2 | logfile=/dev/stdout 3 | logfile_maxbytes=0 4 | loglevel=info 5 | pidfile=/var/run/supervisord.pid 6 | nodaemon=true 7 | minfds=102 8 | minprocs=200 9 | user=root 10 | 11 | [program:kdc] 12 | command=%(ENV_KDC_BIN) -r LOCAL -n 13 | stderr_logfile = /dev/stderr 14 | stderr_logfile_maxbytes = 0 15 | stdout_logfile = /dev/stdout 16 | stdout_logfile_maxbytes = 0 17 | 18 | [program:webapi] 19 | command=/kdc/api-server 20 | stderr_logfile = /dev/stderr 21 | stderr_logfile_maxbytes = 0 22 | stdout_logfile = /dev/stdout 23 | stdout_logfile_maxbytes = 0 24 | -------------------------------------------------------------------------------- /tools/Dockerfile: -------------------------------------------------------------------------------- 1 | # Dockerfile for the KDC image 2 | 3 | FROM nvaziri/kdc:dev_0 4 | 5 | CMD /run.sh 6 | -------------------------------------------------------------------------------- /tools/ci/steps/check_python_files.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # This script is used by the build system to check all Python files in the 4 | # repository. 5 | # 6 | # By default, the BASE_BRANCH is determined using the get_base_branch script, 7 | # but this can be overridden by setting the BASE_BRANCH environment variable 8 | # before invoking this script 9 | 10 | set -x 11 | 12 | TOOL_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}" )/../checks" && pwd)" 13 | 14 | # Determine the target branch for the diff calculation. 15 | BASE_BRANCH="${BASE_BRANCH:-$("${TOOL_DIR}/get_base_branch.sh")}" 16 | 17 | # Get the list of changed .py files relative to the base branch. 18 | CHANGESET="$("${TOOL_DIR}/get_applicable_changes.py" --extensions ".py" --from-git "${BASE_BRANCH}")" 19 | 20 | if [[ -n ${CHANGESET} ]]; then 21 | echo "Changeset:" 22 | echo "${CHANGESET}" 23 | 24 | exec "${TOOL_DIR}/run_pre_commit.sh" --files ${CHANGESET} 25 | 26 | exit $? 27 | else 28 | echo "No Python files in changeset." 29 | fi 30 | -------------------------------------------------------------------------------- /tools/container/README.md: -------------------------------------------------------------------------------- 1 | # Tools installed in the docker container 2 | 3 | Everything in this directory expects to be installed and run inside the 4 | `mesosphere/dcos-commons` docker container. 5 | -------------------------------------------------------------------------------- /tools/container/venvs/wrap.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # TODO: this is just a pass-through fow now, actual invocation of pipenv will 3 | # be added after TeamCity configs are updated to use this file. 4 | set -eu 5 | function usage() { 6 | echo "Usage: $0 [ ARGS ... ]" >&2 7 | echo "Where:" >&2 8 | echo " PIPENV_PROJECT is the name of a directory under /venvs" >&2 9 | echo " COMMAND and ARGS will be run with pipenv using the project" >&2 10 | } 11 | pipenv_project="$1" 12 | shift 13 | if [[ $# == 0 ]]; then 14 | usage 15 | fi 16 | exec "$@" 17 | -------------------------------------------------------------------------------- /tools/distribution/UPDATING.md: -------------------------------------------------------------------------------- 1 | # Updating this repository 2 | 3 | This framework is built using the [DC/OS Commons SDK](https://github.com/mesosphere/dcos-commons), and in order to make use of new features in the SDK or consume bugfixes it should be updated regularly. 4 | 5 | The parts of the SDK consumed consist of: 6 | * The SDK Java libraries including: 7 | * scheduler libraries 8 | * testing libraries 9 | * SDK artifacts including: 10 | * The `bootstrap` utility 11 | * CLI binaries for the three supported platforms 12 | * Build tooling 13 | * Testing utilities 14 | 15 | For more details on the current update procedure, please refer to the section on updating of 16 | the [DC/OS Commons SDK Git repository](https://github.com/mesosphere/dcos-commons) 17 | at the version you want to update _to_. 18 | -------------------------------------------------------------------------------- /tools/kdc/README.md: -------------------------------------------------------------------------------- 1 | This directory serves to contain all relevant config files and script to enable the deployment and teardown of a 2 | Kerberos Domain Controller (KDC) server. 3 | 4 | The `kdc.json` config is used by the `sdk_auth` testing module to configure a KDC in the integration test environment. 5 | 6 | The Dockerfile is used to maintain/build a docker image which serves the KDC. The `run.sh` and `kdc.conf` files facilitate the bootstrap for 7 | said server as they're copied into the image via the Dockerfile recipe. 8 | 9 | The `kdc.py` script is an ad-hoc tool to deploy/teardown a KDC instance outside of the testing environment. Its usage 10 | from the root of the repo would look something like: 11 | ``` 12 | PYTHONPATH=testing ./tools/kdc.py deploy principals.txt 13 | ``` 14 | 15 | where `principals.txt` is a file of new-line separated strings of principals. 16 | -------------------------------------------------------------------------------- /tools/kdc/kdc.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "/kdc", 3 | "instances": 1, 4 | "cpus": 0.5, 5 | "mem": 128, 6 | "container": { 7 | "type": "DOCKER", 8 | "docker": { 9 | "image": "mesosphere/kdc:mit-centos7" 10 | } 11 | }, 12 | "networks": [ 13 | { 14 | "mode": "host" 15 | } 16 | ], 17 | "portDefinitions": [ 18 | { 19 | "port": 2500, 20 | "name": "kdc" 21 | }, 22 | { 23 | "port": 2501, 24 | "name": "web" 25 | } 26 | ], 27 | "secrets": { 28 | "secret0": { 29 | "source": "kdc-admin" 30 | } 31 | }, 32 | "env": { 33 | "SERVICE_ACCOUNT_SECRET": { 34 | "secret": "secret0" 35 | } 36 | }, 37 | "labels": { 38 | "DCOS_SERVICE_NAME": "kdc", 39 | "DCOS_SERVICE_PORT_INDEX": "1", 40 | "DCOS_SERVICE_SCHEME": "http" 41 | }, 42 | "requirePorts": true 43 | } 44 | -------------------------------------------------------------------------------- /tools/pip/.gitignore: -------------------------------------------------------------------------------- 1 | *.egg-info/ 2 | *.pyc 3 | *.whl 4 | dist/ 5 | build/ 6 | venv/ 7 | -------------------------------------------------------------------------------- /tools/pip/README.md: -------------------------------------------------------------------------------- 1 | # .whl tooling 2 | 3 | Tooling to release the contents of `tools/` and `testing/` as `.whl` packages. These are uploaded in SDK releases from early 2018 onwards. 4 | 5 | To build, run `build-whl.sh `. The output will include two `.whl` packages with the provided version, containing the respective content of `tools/` and `testing/`. See output from `build.sh` for example usage of the built artifacts. 6 | -------------------------------------------------------------------------------- /tools/universe/__init__.py: -------------------------------------------------------------------------------- 1 | from .azure_uploader import AzureUploader 2 | from .s3_uploader import S3Uploader 3 | from .package import Package 4 | from .package_builder import UniversePackageBuilder 5 | from .package_manager import PackageManager 6 | from .package_publisher import UniversePackagePublisher 7 | 8 | __all__ = [ 9 | "AzureUploader", 10 | "S3Uploader", 11 | "Package", 12 | "PackageManager", 13 | "UniversePackageBuilder", 14 | "UniversePackagePublisher", 15 | "VersionResolver", 16 | ] 17 | --------------------------------------------------------------------------------