Page MenuHomeSoftware Heritage

Define configuration per environment within hiera
AbandonedPublic

Authored by ardumont on Oct 5 2020, 8:17 PM.

Details

Summary

This allows to reuse the same configuration declaration (especially vagrant which uses
the "staging" environment).

And not having to declare one especially for the vagrant nodes.

Note: I considered renaming the location from "vagrant" to "local" as "local" sounds more like a location
than "vagrant" (which is more an implementation detail on how we implement local vms). But I did not
act on this, if we agree on that, i'll do it in other diffs (that impacts the Vagrantfile as well).

Related to D3989#inline-27284 discussion
Related to T2606

Test Plan

No impact on current staging or environment nodes (tested with octocatalog-diff, one node per environment/location: production/azure, production/sesi, staging/sesi) [2]:

$ bin/octocatalog-diff --octocatalog-diff-args --no-truncate-details --to staging deposit.internal.staging.swh.network --environment staging
Found host deposit.internal.staging.swh.network
Cloning into '/tmp/swh-ocd.zKhPzTa9/environments/production/data/private'...
done.
Cloning into '/tmp/swh-ocd.zKhPzTa9/environments/staging/data/private'...
done.
*** Running octocatalog-diff on host deposit.internal.staging.swh.network
I, [2020-10-05T21:13:32.628602 #1691]  INFO -- : Catalogs compiled for deposit.internal.staging.swh.network
I, [2020-10-05T21:13:34.013628 #1691]  INFO -- : Diffs computed for deposit.internal.staging.swh.network
I, [2020-10-05T21:13:34.013675 #1691]  INFO -- : No differences
*** End octocatalog-diff on deposit.internal.staging.swh.network

$ bin/octocatalog-diff --octocatalog-diff-args --no-truncate-details --to staging uffizi
Found host uffizi.softwareheritage.org
Cloning into '/tmp/swh-ocd.uNXp4Prw/environments/production/data/private'...
done.
Cloning into '/tmp/swh-ocd.uNXp4Prw/environments/staging/data/private'...
done.
*** Running octocatalog-diff on host uffizi.softwareheritage.org
I, [2020-10-05T21:21:07.437352 #8051]  INFO -- : Catalogs compiled for uffizi.softwareheritage.org
I, [2020-10-05T21:21:08.585806 #8051]  INFO -- : Diffs computed for uffizi.softwareheritage.org
I, [2020-10-05T21:21:08.585849 #8051]  INFO -- : No differences
*** End octocatalog-diff on uffizi.softwareheritage.org

$ bin/octocatalog-diff --octocatalog-diff-args --no-truncate-details --to staging worker01.euwest.azure --environment production
Found host worker01.euwest.azure.internal.softwareheritage.org
Cloning into '/tmp/swh-ocd.dC3bcIdf/environments/production/data/private'...
done.
Cloning into '/tmp/swh-ocd.dC3bcIdf/environments/staging/data/private'...
done.
*** Running octocatalog-diff on host worker01.euwest.azure.internal.softwareheritage.org
I, [2020-10-06T09:37:24.671548 #2774]  INFO -- : Catalogs compiled for worker01.euwest.azure.internal.softwareheritage.org
I, [2020-10-06T09:37:25.583898 #2774]  INFO -- : Diffs computed for worker01.euwest.azure.internal.softwareheritage.org
I, [2020-10-06T09:37:25.583937 #2774]  INFO -- : No differences
*** End octocatalog-diff on worker01.euwest.azure.internal.softwareheritage.org

Then provision a staging vm and check its configuration is now referring to the
actual staging nodes (without this diff, it's using production nodes for swh
services for example...) [1]:

$ vagrant up staging-webapp

Check /etc/softwareheritage/web/web.yml which now presents the
internal.staging.swh.network url for swh services and no longer the production
ones.

[1] providing we change the Vagrantfile to actually declare the use of the hiera.yaml ~> D4148

[2] providing we change octocatalog-diff so it provides the environment ~> D4149

Diff Detail

Repository
rSPSITE puppet-swh-site
Branch
staging
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 15906
Build 24481: arc lint + arc unit

Event Timeline

Now it comes back to me, I need to check something with octocatalog-diff.

ardumont edited the test plan for this revision. (Show Details)
ardumont retitled this revision from Define configuration per environment to Define configuration per environment within hiera.
ardumont edited the test plan for this revision. (Show Details)
ardumont edited the test plan for this revision. (Show Details)
olasd added a subscriber: olasd.

Looks good, thanks!

This revision is now accepted and ready to land.Oct 6 2020, 2:09 PM
olasd requested changes to this revision.Oct 6 2020, 2:35 PM

See comments in D4149. I'm not sure that we actually want to be doing this.

This revision now requires changes to proceed.Oct 6 2020, 2:35 PM

See comments in D4149. I'm not sure that we actually want to be doing this.

i think you forgot to submit the comments ;)

See comments in D4149. I'm not sure that we actually want to be doing this.

i think you forgot to submit the comments ;)

I didn't. I figured out an issue while writing them and I'm not done yet.