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

DM-46588: Configure connection limits and instrument configs for fan-out #17

Merged
merged 18 commits into from
Oct 21, 2024

Conversation

kfindeisen
Copy link
Member

@kfindeisen kfindeisen commented Oct 14, 2024

This PR makes the fan-out service's supported instruments and detectors configurable, and makes the maximum number of outgoing connections tunable. It also performs some refactoring to minimize code duplication and special-case variables.

The previous code would leave a request marked as "in process" even if
the service, for example, timed out waiting for a response. This
introduced a permanent offset into the metric that could only be
cleared by rebooting the fan-out service. The new code is
exception-safe and should not have this problem.
Grouping the Gauges together, and indexing them by instrument name,
lets us remove a large amount of boilerplate code in both initializing
the Gauges and passing them around.
This commit begins the process of removing specific instrument
references from the source code. However, some references still remain.
The configuration is now handled in Phalanx, and can be changed without
rebuilding the container.
The old format was called a "detector" config despite having room for
more fields. Calling it an instrument config makes it more natural to
add other instrument-specific information to the file.
@kfindeisen kfindeisen force-pushed the tickets/DM-46588 branch 2 times, most recently from 38984e7 to 8d93f83 Compare October 15, 2024 18:31
The original config was organized instrument->detectors->detector,
which required the entire config to be overridden if only one
per-instrument property was environment-dependent. The new config is
organized detectors->instrument->detector, which allows non-detector
configs to be changed without touching or duplicating the detectors.
@kfindeisen kfindeisen force-pushed the tickets/DM-46588 branch 3 times, most recently from b210ced to c83bbd1 Compare October 16, 2024 23:38
This consolidates the instrument-specific configs in one place.
Grouping the detectors and URLs together, and indexing them by
instrument name, lets us remove most instrument-specific branches. The
exceptions are the HSC Cosmos mini-datasets, which still need special
treatment.
These datasets require specific detector combinations, but these
combinations are uniquely identifiable by visit ID.
Coordinates are pairs of floats, not ints, and not all values
are strings.
Collecting the target Knative URL and the fanned-out messages into a
single object makes it easy to factor out the shared code.
The HSC Cosmos datasets still need special casing, but the relevant
function and switch branch can be simply deleted once HSC support is
phased out.
The old add_detectors was an instance method implemented like a static
method. This commit changes it to a proper instance method, since that
is the existing usage pattern.
This change makes the loop much easier to read and edit. However, the
functions need to take an inordinate number of "global" variables, so
they could use some further factoring.
The original behavior was to crash and restart the entire fan-out
service if it got a message it didn't know how to handle. If the
message loop instead catches the corresponding exception, then there is
no need to specifically exempt the LSST cameras.

With this commit, it's now safe to configure the SUPPORTED_INSTRUMENTS
env variable.
This makes it possible to change logging levels from the configuration.

This commit also replaces the double `logging.basicConfig` calls of the
original code; `basicConfig` only has an effect the first time
it's called.
@kfindeisen kfindeisen changed the title DM-46588: Prototype multiple parallel Prompt Processing services on ComCamSim-dev DM-46588: Configure connection limits for fan-out Oct 17, 2024
@kfindeisen kfindeisen changed the title DM-46588: Configure connection limits for fan-out DM-46588: Configure connection limits and instrument configs for fan-out Oct 17, 2024
The code previously used the default of 100, which is much less than
the number of concurrent images we will need to handle with LSSTCam.
@kfindeisen kfindeisen marked this pull request as ready for review October 17, 2024 01:20
@kfindeisen kfindeisen merged commit e2f82a4 into main Oct 21, 2024
2 checks passed
@kfindeisen kfindeisen deleted the tickets/DM-46588 branch October 21, 2024 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants