launchpad-layers:main

Last commit made on 2024-03-14
Get this branch:
git clone -b main https://git.launchpad.net/launchpad-layers
Members of Canonical Launchpad Engineering can upload to this branch. Log in for directions.

Branch merges

Branch information

Name:
main
Repository:
lp:launchpad-layers

Recent commits

910dfb7... by Ines Almeida

launchpad-base: update git domain configuration values to use default value if not set

`domain_git` is generally used to determine if an environment has git code hosting enabled or not.
But in cases where we don't want git hosting to be enabled, we still want the domain values to build and display URLs.
Adding a default placeholder value will enable us to display these placeholder URLs.

Succeeded
[SUCCEEDED] lint:0 (build)
11 of 1 result
0fd0405... by Colin Watson

Add dependencies of lp:ubuntu-archive-publishing

Those hook scripts need a few dependencies, and there's nowhere else
sensible to declare them. This will have to do.

Succeeded
[SUCCEEDED] lint:0 (build)
11 of 1 result
Merged branch ~cjwatson/launchpad-layers:publisher-parts-dependencies
91defc3... by Colin Watson

launchpad-publisher-parts: Fix parts directory

`publisher_parts_dir()` was set as
`config.archivepublisher.run_parts_location`, and is
`/srv/launchpad/publisher-parts`. However, the code that uses this
looks like this:

    def find_run_parts_dir(distribution_name, parts):
        """Find the requested run-parts directory, if it exists."""
        run_parts_location = config.archivepublisher.run_parts_location
        if not run_parts_location:
            return None

        parts_dir = os.path.join(run_parts_location, distribution_name, parts)
        if file_exists(parts_dir):
            return parts_dir
        else:
            return None

This means that it's actually trying to look in
`/srv/launchpad/publisher-parts/ubuntu`, which didn't exist.

The layer's configuration is really a bit wrong for this, since strictly
we ought to support multiple distributions with independent
configuration for each. However, for now, hardcoding Ubuntu will do
well enough.

Succeeded
[SUCCEEDED] lint:0 (build)
11 of 1 result
Merged branch ~cjwatson/launchpad-layers:fix-publisher-parts-directory
58edb3e... by Guruprasad

Add a 'scripts_dir' well-known directory

This can be used for placing scripts that are not in
the Launchpad source tree.

Succeeded
[SUCCEEDED] lint:0 (build)
11 of 1 result
06169f9... by Colin Watson

upload-queue-processor: Turn fsroot into a property

The strategy of saving previous values in an instance attribute doesn't
work, because charm hooks are run in separate processes and those values
don't persist. Turn `fsroot` into a property instead so that it's
always retrieved from relation data when needed.

Succeeded
[SUCCEEDED] lint:0 (build)
11 of 1 result
Merged branch ~cjwatson/launchpad-layers:upload-queue-processor-fsroot-property
6ca1d67... by Colin Watson

Clear flags more carefully on upgrade-charm

According to
https://charmsreactive.readthedocs.io/en/latest/charms.reactive.bus.html#charms.reactive.bus.dispatch,
most reactive handlers are invoked in an undefined order. This means
that the following sequence is possible if you try to upgrade the (e.g.)
`launchpad-admin` charm and change its `build_label` at the same time:

  reactive/ols.py:upgrade_charm
    clears ols.service.installed, ols.configured, service.configured
  reactive/ols.py:install_service
    unpacks new payload; sets ols.service.installed
  reactive/ols.py:handle_config_changes
    clears ols.configured, service.configured
  reactive/ols.py:update_payload
    clears ols.service.installed, ols.configured, service.configured
  reactive/launchpad-admin.py:configure
    crashes because `production-configs/launchpad-db-lazr.conf` doesn't
    exist yet in the new unpacked payload

`update_payload` clearing `ols.service.installed` results in some
redundant work, but that's not a serious problem. The problem here is
that the `launchpad.db.configured` flag is still set at the point when
the dispatch logic decides whether to invoke `launchpad-admin`'s
`configure` handler; as a result, it may do so almost immediately after
unpacking the new payload rather than carefully working its way back up
the stack of layers, configuring `launchpad-payload`, then
`launchpad-base`, then `launchpad-db`.

I think the least bad workaround for this is to observe that
`charms.reactive.bus.dispatch` documents that all `@hook` handlers are
invoked first. We can therefore add a few `@hook` handlers that clear
flags for each layer, and thereby ensure that things go in the right
order when upgrading a charm and changing its build label at the same
time.

Succeeded
[SUCCEEDED] lint:0 (build)
11 of 1 result
Merged branch ~cjwatson/launchpad-layers:upgrade-charm-clear-flags
178fe3f... by Colin Watson

Revert "Restore Python 3.6 compatibility in turnip-base"

This reverts commit 466a8348106b0a14e4c1cf18fbafe13d1f927bad. turnip is
deployed on focal now.

Succeeded
[SUCCEEDED] lint:0 (build)
11 of 1 result
Merged branch ~cjwatson/launchpad-layers:turnip-py38
42d39a9... by Colin Watson

turnip-base: Avoid comma in Nagios service description

On production, the comma caused Nagios to fail to parse the collected
configuration with errors such as:

  Error: Could not find a service matching host name 'lp-prodstack-git-juju-f2a69b-prod-launchpad-git-17' and description 'Git E2E git://git.launchpad.net/launchpad - hint: check nfs-ganesha.service if all appservers are bad' (config file '/etc/nagios3/conf.d/servicegroups/prompt-critical.cfg', starting on line 2)
  Error: Could not expand member services specified in servicegroup (config file '/etc/nagios3/conf.d/servicegroups/prompt-critical.cfg', starting on line 2)

Succeeded
[SUCCEEDED] lint:0 (build)
11 of 1 result
Merged branch ~cjwatson/launchpad-layers:turnip-base-nagios-avoid-comma
77ce25b... by Ines Almeida

Add storm_cache_size param to launchpad-db-lazr.conf

Succeeded
[SUCCEEDED] lint:0 (build)
11 of 1 result
9f9bc67... by Ines Almeida

Add storm_cache_size param to launchpad-db config.yaml