Ejemplo n.º 1
0
def test_private_repository_mesos_app():
    """ Test private docker registry with mesos containerizer using "config" container's image field."""

    requires_marathon_version("1.5")
    if not common.is_enterprise_cli_package_installed():
        common.install_enterprise_cli_package()

    username = os.environ['DOCKER_HUB_USERNAME']
    password = os.environ['DOCKER_HUB_PASSWORD']

    secret_name = "dockerPullConfig"
    secret_value_json = common.create_docker_pull_config_json(username, password)
    secret_value = json.dumps(secret_value_json)

    client = marathon.create_client()
    common.create_secret(secret_name, secret_value)

    try:
        app_def = common.private_mesos_container_app(secret_name)
        client.add_app(app_def)
        shakedown.deployment_wait()

        common.assert_app_tasks_running(client, app_def)
    finally:
        common.delete_secret(secret_name)
Ejemplo n.º 2
0
def test_private_repository_mesos_app():
    """ Test private docker registry with mesos containerizer using "config" container's image field."""

    # marathon version captured here will work for root and mom
    requires_marathon_version('1.5')

    username = os.environ['DOCKER_HUB_USERNAME']
    password = os.environ['DOCKER_HUB_PASSWORD']

    secret_name = "dockerPullConfig"
    secret_value_json = common.create_docker_pull_config_json(
        username, password)

    import json
    secret_value = json.dumps(secret_value_json)

    client = marathon.create_client()
    common.create_secret(secret_name, secret_value)

    try:
        app_def = common.private_mesos_container_app(secret_name)
        client.add_app(app_def)
        shakedown.deployment_wait()

        common.assert_app_tasks_running(client, app_def)
    finally:
        common.delete_secret(secret_name)
Ejemplo n.º 3
0
def test_private_repository_mesos_app():
    """ Test private docker registry with mesos containerizer using "credentials" container field.
        Note: Despite of what DC/OS docmentation states this feature is not yet implemented:
        https://issues.apache.org/jira/browse/MESOS-7088
    """

    client = marathon.create_client()
    assert 'DOCKER_HUB_USERNAME' in os.environ, "Couldn't find docker hub username. $DOCKER_HUB_USERNAME is not set"
    assert 'DOCKER_HUB_PASSWORD' in os.environ, "Couldn't find docker hub password. $DOCKER_HUB_PASSWORD is not set"

    principal = os.environ['DOCKER_HUB_USERNAME']
    secret = os.environ['DOCKER_HUB_PASSWORD']

    app_def = common.private_mesos_container_app(principal, secret)
    client.add_app(app_def)
    shakedown.deployment_wait()

    common.assert_app_tasks_running(client, app_def)
def test_private_repository_mesos_app():
    """ Test private docker registry with mesos containerizer using "config" container's image field."""

    username = os.environ['DOCKER_HUB_USERNAME']
    password = os.environ['DOCKER_HUB_PASSWORD']

    secret_name = "dockerPullConfig"
    secret_value_json = common.create_docker_pull_config_json(username, password)

    import json
    secret_value = json.dumps(secret_value_json)

    client = marathon.create_client()
    common.create_secret(secret_name, secret_value)

    try:
        app_def = common.private_mesos_container_app(secret_name)
        client.add_app(app_def)
        shakedown.deployment_wait()

        common.assert_app_tasks_running(client, app_def)
    finally:
        common.delete_secret(secret_name)