Skip to content
This repository has been archived by the owner on Dec 4, 2024. It is now read-only.

Commit

Permalink
[COPS-3550] Replace hardcoded VIP with service.name (#411) (#412)
Browse files Browse the repository at this point in the history
* [COPS-3550] Replace hardcoded VIP with service.name (#411)

Use {{service.name}} for dispatcher VIP endpoints instead of hardcoded `spark-dispatcher`.

* [DCOS-39751] Make vip endpoint more like SDK frameworks (#414)

Rearrange the VIP endpoint to have dispatcher in front of {{service.name}}. This is closer to how other services are currently handled.
  • Loading branch information
samvantran authored Sep 25, 2018
1 parent 9683991 commit 856019b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
24 changes: 24 additions & 0 deletions tests/test_spark.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
import shakedown

import sdk_cmd
import sdk_hosts
import sdk_install
import sdk_security
import sdk_tasks
import sdk_utils
Expand Down Expand Up @@ -332,3 +334,25 @@ def test_driver_executor_tls():
sdk_cmd.run_cli('security secrets delete /{}'.format(keystore_secret))
sdk_cmd.run_cli('security secrets delete /{}'.format(truststore_secret))
sdk_cmd.run_cli('security secrets delete /{}'.format(my_secret))


@pytest.mark.sanity
def test_unique_vips():
spark1_service_name = "test/groupa/spark"
spark2_service_name = "test/groupb/spark"
try:
utils.require_spark(spark1_service_name)
utils.require_spark(spark2_service_name)

dispatcher1_ui = sdk_hosts.vip_host("marathon", "dispatcher.{}".format(spark1_service_name), 4040)
dispatcher2_ui = sdk_hosts.vip_host("marathon", "dispatcher.{}".format(spark2_service_name), 4040)

# verify dispatcher-ui is reachable at VIP
ok, _ = sdk_cmd.master_ssh("curl {}".format(dispatcher1_ui))
assert ok

ok, _ = sdk_cmd.master_ssh("curl {}".format(dispatcher2_ui))
assert ok
finally:
sdk_install.uninstall(utils.SPARK_PACKAGE_NAME, spark1_service_name)
sdk_install.uninstall(utils.SPARK_PACKAGE_NAME, spark2_service_name)
6 changes: 3 additions & 3 deletions universe/marathon.json.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -60,23 +60,23 @@
"protocol": "tcp",
"name": "dispatcher",
"labels": {
"VIP_0": "spark-dispatcher:7077"
"VIP_0": "dispatcher.{{service.name}}:7077"
}
},
{
"port": 0,
"protocol": "tcp",
"name": "dispatcher-ui",
"labels": {
"VIP_1": "spark-dispatcher:4040"
"VIP_1": "dispatcher.{{service.name}}:4040"
}
},
{
"port": 0,
"protocol": "tcp",
"name": "dispatcher-proxy",
"labels": {
"VIP_2": "spark-dispatcher:80"
"VIP_2": "dispatcher.{{service.name}}:80"
}
}
],
Expand Down

0 comments on commit 856019b

Please sign in to comment.