kernelci / kernelci/kernelci-core
Add `Runtime._connect()` method
- Dominant language
- Python
- Stars
- 120
- Forks
- 107
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 21
Description
Just like we have `Storage._connect()` to open a connection to the storage service, it would be useful to have a `Runtime._connect()` method too so the setup doesn't have to be repeated in every `.submit()` call. For example, with Kubernetes we have this at the moment:
```python
def submit(self, job_path):
kubernetes.config.load_kube_config(context=self.config.context)
client = kubernetes.client.ApiClient()
return kubernetes.utils.create_from_yaml(client, job_path)
```
The `client` could be kept in the object so it would only be created the first time a job is submitted. Maybe this doesn't need to be handled in the base class like for Storage, that's an implementation decision. Having a consistent way to do this between Storage and Runtime would be nice though.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by comparing the existing Storage._connect() pattern with the Runtime.submit() entry point and the Kubernetes example in the issue. Done means Runtime provides a consistent connection path and repeated submissions reuse the client instead of repeating setup; the implementation location and tests still need investigation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kubernetes, python
- Domain
- infrastructure
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100