concourse / concourse-bosh-deployment

A toolchain for deploying Concourse with BOSH.
Apache License 2.0
86 stars 155 forks source link

Cannot install v4.0.0 with github-based auth #79

Closed siennathesane closed 6 years ago

siennathesane commented 6 years ago

Using these versions:

✗ bosh -e home env
Using environment '10.0.4.6' as client 'admin'

Name      bosh
UUID      7d43a2ce-cacb-4ebb-a253-b34428503771
Version   266.4.0 (00000000)
CPI       vsphere_cpi
Features  compiled_package_cache: disabled
          config_server: enabled
          dns: disabled
          snapshots: disabled
User      admin

✗ git status
HEAD detached at v4.0.0

With this command:

✗ BOSH_LOG_LEVEL=debug BOSH_LOG_PATH=concourse.log bosh -e home interpolate -d concourse concourse.yml \
  -l ../versions.yml \
  --vars-store cluster-creds.yml \
  -o operations/static-web.yml \
  -o operations/github-auth.yml \
  --var github_client.username=… \
  --var github_client.password=… \
  --var main_team.github.orgs='["<org>"]' \
  --var main_team.github.teams='["<org>:all"]' \
  --var main_team.github.users='["mxplusb"]' \
  --var web_ip=10.0.4.20 \
  --var external_url=https://<public-url> \
  --var network_name=default \
  --var web_vm_type=small \
  --var db_vm_type=medium \
  --var db_persistent_disk_type=10GB \
  --var worker_vm_type=worker \
  --var deployment_name=concourse

Fails with one of:

Finding variable 'main_team.github.users':
  Expected to find a map key 'users' for path '/github/users' (found map keys: 'teams')
# or
Finding variable 'main_team.github.teams':
  Expected to find a map key 'teams' for path '/github/teams' (found map keys: 'orgs')
# or
Finding variable 'main_team.github.orgs':
  Expected to find a map key 'orgs' for path '/github/orgs' (found map keys: 'teams')

The error I receive depends on the order of the main_team.github.x variables within the command but it is always one of those 3. Looking at the BOSH documentation for the ATC, I am passing properly formatted strings as variables.

siennathesane commented 6 years ago

To further the mysterious plot of this issue, this command returns no errors:

BOSH_LOG_LEVEL=debug BOSH_LOG_PATH=concourse.log bosh -e home interpolate -d concourse concourse.yml \
  -l ../versions.yml \
  --vars-store cluster-creds.yml \
  -o operations/static-web.yml \
  -o operations/github-auth.yml \
  --var github_client.username=... \
  --var github_client.password=... \
  --var atc.properties.main_team.github.orgs='[<org>]' \
  --var atc.properties.main_team.github.teams='["<org>:all"]' \
  --var atc.properties.main_team.github.users='[mxplusb]' \
  --var web_ip=10.0.4.20 \
  --var external_url=https://<public-url> \
  --var network_name=default \
  --var web_vm_type=small \
  --var db_vm_type=medium \
  --var db_persistent_disk_type=10GB \
  --var worker_vm_type=worker \
  --var deployment_name=concourse

However, it doesn't properly resolve the variables:

instance_groups:
- azs:
  - z1
  instances: 1
  jobs:
  - name: atc
    properties:
      external_url: https://<public-url>
      github_auth:
        client_id: ...
        client_secret: ...
      log_level: debug
      main_team:
        auth:
          github:
            orgs: ((main_team.github.orgs))
            teams: ((main_team.github.teams))
            users: ((main_team.github.users))

Which is a bit strange. @lurraca also ran into this issue and reported it here.

making commented 6 years ago
Finding variable 'main_team.github.users':
  Expected to find a map key 'users' for path '/github/users' (found map keys: 'teams')

I think github.users seem to be regarded as a variable type that has orgs, teams an users.

  --var atc.properties.main_team.github.orgs='[<org>]' \
  --var atc.properties.main_team.github.teams='["<org>:all"]' \
  --var atc.properties.main_team.github.users='[mxplusb]' \

These are simply ignored.

The following ops-file works for me

- type: replace
  path: /instance_groups/name=web/jobs/name=atc/properties/main_team?/auth/github/users
  value: ((main_team.github_users))

- type: replace
  path: /instance_groups/name=web/jobs/name=atc/properties/main_team?/auth/github/orgs
  value: ((main_team.github_orgs))

- type: replace
  path: /instance_groups/name=web/jobs/name=atc/properties/main_team?/auth/github/teams
  value: ((main_team.github_teams))

and

  --var main_team.github_orgs='["<org>"]' \
  --var main_team.github_teams='["<org>:all"]' \
  --var main_team.github_users='["mxplusb"]' \
siennathesane commented 6 years ago

Thanks @making for taking a look! I changed it, and now everything interpolates properly. It also deploys correctly.

Samze commented 6 years ago

This issue is blocking us upgrading to 4.0.0 too. Would love to see the PR merged 👍

siennathesane commented 6 years ago

@Samze if you could comment on the PR with your blocker, that could help the team when it comes to priority.

// cc @jama-pivotal

jama22 commented 6 years ago

oh hey! sorry to hear about the blocker! @vito is master of PRs and community, and we manage our incoming PRs across all repos using this meta view: https://project.concourse-ci.org/pull-requests

Samze commented 6 years ago

Thanks both of you, I've commented on the PR.