Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

demo: create build scripts for our countdash demo #7781

Merged
merged 1 commit into from May 7, 2020

Conversation

shoenig
Copy link
Member

@shoenig shoenig commented Apr 22, 2020

We use the education team's "countdash" demo in many places
to showcase Nomad's Consul Connect integration. This change
adds a Dockerfile for each of counter-dashboard and
counter-api that can be used to build artifacts to publish
to Nomad's Docker Hub organization.

The recent "0.0.3" release of the countdash demo includes
changes we want in order to demo task group service checks.

We use the education team's "countdash" demo in many places
to showcase Nomad's Consul Connect integration. This change
adds a Dockerfile for each of `counter-dashboard` and
`counter-api` that can be used to build artifacts to publish
to Nomad's Docker Hub organization.

The recent "0.0.3" release of the `countdash` demo includes
changes we want in order to demo task group service checks.
@shoenig
Copy link
Member Author

shoenig commented Apr 22, 2020

Goal is to get something like this job into e2e and some of the connect examples

job "cd" {
  datacenters = ["dc1"]

  group "api" {
    network {
      mode = "bridge"

      port "api_healthcheck" {
        to = -1
      }
    }

    service {
      name = "count-api"
      port = "9001"

      connect {
        sidecar_service {}
      }

      check {
        name     = "api-health"
        type     = "http"
        port     = "api_healthcheck"
        path     = "/health"
        interval = "10s"
        timeout  = "3s"
        expose   = true
      }
    }

    task "web" {
      driver = "docker"

      config {
        image = "hashicorpnomad/counter-api:test"
      }
    }
  }

  group "dashboard" {
    network {
      mode = "bridge"

      port "http" {
        static = 9002
        to     = 9002
      }

      port "dashboard_healthcheck" {
        to = -1
      }

      port "dashboard_upstream_healthcheck" {
        to = -1
      }
    }

    service {
      name = "count-dashboard"
      port = "9002"

      connect {
        sidecar_service {
          proxy {
            upstreams {
              destination_name = "count-api"
              local_bind_port  = 8080
            }
          }
        }
      }

      check {
        name     = "dashboard-health"
        type     = "http"
        port     = "dashboard_healthcheck"
        path     = "/health"
        interval = "10s"
        timeout  = "3s"
        expose   = true
      }

      check {
        name     = "dashboard-upstream-health"
        type     = "http"
        port     = "dashboard_upstream_healthcheck"
        path     = "/health/api"
        interval = "10s"
        timeout  = "3s"
        expose   = true
      }
    }

    task "dashboard" {
      driver = "docker"

      env {
        COUNTING_SERVICE_URL = "http://${NOMAD_UPSTREAM_ADDR_count_api}"
      }

      config {
        image = "hashicorpnomad/counter-dashboard:test"
      }
    }
  }
}

Copy link
Member

@schmichael schmichael left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I always forget where that demo is located 😬

@shoenig shoenig merged commit f421afc into master May 7, 2020
@shoenig shoenig deleted the demo-countdash-docker branch May 7, 2020 14:34
@github-actions
Copy link

github-actions bot commented Jan 7, 2023

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants