hundreds-father-404
01/27/2021, 8:21 PMRemotingOptions well before the graph session is initialized. Iiuc, that remoting setup is supposed to happen before we can do anything like use the plugin API, as we can't set up things like the Store and CommandRunner without it
Does this indeed sound impossible to add?average-vr-56795
01/27/2021, 8:33 PMaverage-vr-56795
01/27/2021, 8:33 PMCommandRunner from Core to Sessionaverage-vr-56795
01/27/2021, 8:34 PMCore, and would need some way to dynamically inject the Session when evaluating themaverage-vr-56795
01/27/2021, 8:35 PMContexthundreds-father-404
01/27/2021, 8:35 PMis to move CommandRunner from Core to SessionThat makes sense. But that new plugin could not use the actual Rules API, right? Fundamentally, this plugin's purpose is to assist in setting up the remote store + remote command runner. Therefore, it cannot use things like
Process because the command runner has not yet been set up
We could maybe get into a world where remote setup happens after we already set up the local runners, and after this plugin has executed. We re-init it all. But that sounds pretty complexaverage-vr-56795
01/27/2021, 8:36 PMaverage-vr-56795
01/27/2021, 8:37 PMhundreds-father-404
01/27/2021, 8:37 PMDownloadFile uses the Storeaverage-vr-56795
01/27/2021, 8:38 PMStore, for surehundreds-father-404
01/27/2021, 8:39 PMWe could maybe get into a world where remote setup happens after we already set up the local runners, and after this plugin has executed. We re-init it all.that does sound pretty complex
fast-nail-55400
01/27/2021, 8:39 PMfast-nail-55400
01/27/2021, 8:39 PMfast-nail-55400
01/27/2021, 8:39 PMhundreds-father-404
01/27/2021, 8:40 PMfast-nail-55400
01/27/2021, 8:40 PMfast-nail-55400
01/27/2021, 8:41 PMthat is, circumvent the Rules API and use normal Python, right?yes
hundreds-father-404
01/27/2021, 8:41 PMrequests library because this is pre-graph/pre-memoizationaverage-vr-56795
01/27/2021, 8:42 PMfast-nail-55400
01/27/2021, 8:43 PMaverage-vr-56795
01/27/2021, 8:43 PMfast-nail-55400
01/27/2021, 8:44 PMwitty-crayon-22786
01/27/2021, 8:54 PMhundreds-father-404
01/28/2021, 6:40 PM--remote-auth-plugin, which takes the format path.to.module:func and invokes it as normal Python
That works great, but Toolchain needs to be able to access arbitrary subsystems for its plugin. Not only the bootstrap options. So I think we need a well-formed Options object
That means passing Options instead of OptionsBootstrapper to a couple places like EngineInitializer.setup_graph()..It looks like that's feasible - we parse options before we setup the graph. But does anyone know of an issue with now needing to wire Options everywhere instead of OptionsBootstrapper?average-vr-56795
01/28/2021, 6:42 PMaverage-vr-56795
01/28/2021, 6:43 PMhundreds-father-404
01/28/2021, 6:47 PM(Because these won't be part of cache keys anywhere)Right now, the plugin returns this dataclass
@dataclass(frozen=True)
class AuthPluginResult:
"""The return type for a function specified via `--remote-auth-plugin`."""
store_headers: Dict[str, str]
execution_headers: Dict[str, str]
auth_host_name: Optional[str] = None
expiration: Optional[datetime] = None
Only the first two are actually used. I'm not sure the second will actually make sense, but Asher had suggested them
--
this return type is used to set the store_headers and execution_headers that we send over FFI to setup the RemotingOptions. If those change, would our caching not pick that up? Or you mean something else?average-vr-56795
01/28/2021, 6:47 PMaverage-vr-56795
01/28/2021, 6:48 PMaverage-vr-56795
01/28/2021, 6:48 PMhundreds-father-404
01/28/2021, 6:48 PMhundreds-father-404
01/28/2021, 6:49 PMYou should rebuild things the they failed because your oauth token expired, but now you're using a new onewe don't cache or memoize failures