-
Notifications
You must be signed in to change notification settings - Fork 462
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
Extract all data acquisition from ResourceService #1288
Commits on Dec 8, 2023
-
Extract all data acquisition from ResourceService
This creates a new class `KubernetesDataSource` that encapsulates all code related to obtaining data from kubernetes in the `ResourceService`. This cleans the service code up a lot and makes the responsibilities clearer. The use of `Channel<ResourceChange>` has been removed. Instead, code invocations are made directly, skipping queuing. We still have two other channels that ensure front/back are decoupled. The kubernetes channel will ultimately also be removed, leaving just a channel for the subscriber. Added some API docs.
Configuration menu - View commit details
-
Copy full SHA for 9696462 - Browse repository at this point
Copy the full SHA 9696462View commit details -
Configuration menu - View commit details
-
Copy full SHA for ff69825 - Browse repository at this point
Copy the full SHA ff69825View commit details -
Remove Channel<T> for kubernetes objects
This is the second removal of a `Channel<T>` from this component. Now, updates are passed by direct code invocations, skipping queuing. We still have a downstream channel for the subscriber to decouple front/back.
Configuration menu - View commit details
-
Copy full SHA for 5425254 - Browse repository at this point
Copy the full SHA 5425254View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4fc397c - Browse repository at this point
Copy the full SHA 4fc397cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2aae053 - Browse repository at this point
Copy the full SHA 2aae053View commit details -
Simplify inclusion of docker environment
A few changes here: - Use more consistent names throughout. They're not "extra" or "additional" arguments. In fact they are a complete replacement. In their absence, the "spec" environment is used. - Move creation of docker inspection task to view model method, making the various "handle * update" methods more uniform, for future refactoring. - Remove special handling in `ProcessKubernetesChange` for one scenario. Simplifies the signature, and the code a fair bit.
Configuration menu - View commit details
-
Copy full SHA for b9c8a83 - Browse repository at this point
Copy the full SHA b9c8a83View commit details -
Configuration menu - View commit details
-
Copy full SHA for db66a05 - Browse repository at this point
Copy the full SHA db66a05View commit details -
Merge ObjectChangeType Add and Modified
We only need to know if the value is "upserted" (updated or inserted), or "deleted". Recent changes to threading/queuing in the code here changed some timing. The arrival of one kind of resouce can trigger the publication of another, and these would always be "modified", however they could arrive before that resource's stream published that instance. The rest of the code handles these happening out-of-order. We just need to treat add and modified the same way, so they've been merged.
Configuration menu - View commit details
-
Copy full SHA for a8f68f7 - Browse repository at this point
Copy the full SHA a8f68f7View commit details -
Use semaphore to serialize kubernetes data processing
There are multiple kubernetes resource types, each with its own monitoring stream. Across these resources, updates arrive concurrently. The update flows for each type of resource can interact with state stored for other resources. Therefore we use a semaphore to ensure that only one resource update can flow through the system at a time. Another option would have been to make the collections concurrent, or use explicit locking. Concurrent collections are heavy. Explicit locking is tricky to get right. This mutual exclusion via top-level semaphore seems like a safe and elegant approach for now.
Configuration menu - View commit details
-
Copy full SHA for b6663ef - Browse repository at this point
Copy the full SHA b6663efView commit details -
When this method is passed the same collection twice, the `FromSpec` value will always be true, because every item in the list is in the list. Instead we pass `null` and consider all items as from the spec.
Configuration menu - View commit details
-
Copy full SHA for 8bf4672 - Browse repository at this point
Copy the full SHA 8bf4672View commit details -
Configuration menu - View commit details
-
Copy full SHA for b255e1d - Browse repository at this point
Copy the full SHA b255e1dView commit details -
Each instance of `WatchKubernetesResource<T>` produces a single type, that would flow through `ProcessKubernetesChange` to look up the relevant handler. Instead, pass the handler in to `WatchKubernetesResource<T>` so it can be invoked directly.
Configuration menu - View commit details
-
Copy full SHA for bcc255f - Browse repository at this point
Copy the full SHA bcc255fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6d50eb0 - Browse repository at this point
Copy the full SHA 6d50eb0View commit details
Commits on Dec 10, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 6416388 - Browse repository at this point
Copy the full SHA 6416388View commit details
Commits on Dec 11, 2023
-
Rename class to avoid name conflict
This object is a snapshot of a service's state, not a service itself. We have another class which is a service. Append "Snapshot" to differentiate. Future work will extend this concept of snapshots more broadly.
Configuration menu - View commit details
-
Copy full SHA for 5872436 - Browse repository at this point
Copy the full SHA 5872436View commit details -
Configuration menu - View commit details
-
Copy full SHA for 24f7d9d - Browse repository at this point
Copy the full SHA 24f7d9dView commit details -
Configuration menu - View commit details
-
Copy full SHA for abefbdb - Browse repository at this point
Copy the full SHA abefbdbView commit details -
Make ResourceViewModel.Environment immutable
Note that it's just the collection that becomes immutable here. The elements are still currently mutable. That will change when we split front/back ends, and have a snapshot on the backend with a view model on the front end.
Configuration menu - View commit details
-
Copy full SHA for f0afba7 - Browse repository at this point
Copy the full SHA f0afba7View commit details -
Configuration menu - View commit details
-
Copy full SHA for a451352 - Browse repository at this point
Copy the full SHA a451352View commit details -
Configuration menu - View commit details
-
Copy full SHA for 07778d7 - Browse repository at this point
Copy the full SHA 07778d7View commit details -
Configuration menu - View commit details
-
Copy full SHA for cc0e748 - Browse repository at this point
Copy the full SHA cc0e748View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9e15ead - Browse repository at this point
Copy the full SHA 9e15eadView commit details -
Configuration menu - View commit details
-
Copy full SHA for fc57efe - Browse repository at this point
Copy the full SHA fc57efeView commit details -
Configuration menu - View commit details
-
Copy full SHA for a34c768 - Browse repository at this point
Copy the full SHA a34c768View commit details -
Configuration menu - View commit details
-
Copy full SHA for e515c5e - Browse repository at this point
Copy the full SHA e515c5eView commit details -
Source container variables from status
This data is now available from DCP, so we don't have to launch processes to query docker for this data any more, which simplifies things quite nicely.
Configuration menu - View commit details
-
Copy full SHA for 0f0b74b - Browse repository at this point
Copy the full SHA 0f0b74bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 03083cd - Browse repository at this point
Copy the full SHA 03083cdView commit details -
Configuration menu - View commit details
-
Copy full SHA for dd2d0a2 - Browse repository at this point
Copy the full SHA dd2d0a2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 177948d - Browse repository at this point
Copy the full SHA 177948dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 66eabe9 - Browse repository at this point
Copy the full SHA 66eabe9View commit details -
Configuration menu - View commit details
-
Copy full SHA for e81a95c - Browse repository at this point
Copy the full SHA e81a95cView commit details -
Merge project/executable snapshot construction
Now that project snapshots derive from executable snapshots, we can unify a bunch of construction logic.
Configuration menu - View commit details
-
Copy full SHA for 665df71 - Browse repository at this point
Copy the full SHA 665df71View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4f31609 - Browse repository at this point
Copy the full SHA 4f31609View commit details -
Configuration menu - View commit details
-
Copy full SHA for 029ca5b - Browse repository at this point
Copy the full SHA 029ca5bView commit details -
Start using "snapshot" naming in DCP data source
We still have some types named ViewModel, but they'll be renamed later in the split.
Configuration menu - View commit details
-
Copy full SHA for fad004b - Browse repository at this point
Copy the full SHA fad004bView commit details -
Rename ObjectChangeType to ResourceChangeType
It's not clear what object the name refers to, so make it more specific. It's internal, so we can always rename it again later. This name pairs nicely with `ObjectChange` too.
Configuration menu - View commit details
-
Copy full SHA for da62fc6 - Browse repository at this point
Copy the full SHA da62fc6View commit details -
Further consolidate data processing
The methods that handle executable and container updates are largely the same. Extract that commonality to a new method.
Configuration menu - View commit details
-
Copy full SHA for 7c657cb - Browse repository at this point
Copy the full SHA 7c657cbView commit details