hexfusion / avalanchego

Go implementation of an Avalanche node.
https://avax.network
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

[task]: extend vm factory to provide support for container implementation #2

Closed hexfusion closed 1 year ago

hexfusion commented 1 year ago

During bootstrap the vm factory uses the VM runtime engine to start a vm subprocess[1]. Currently this is very specific to the subprocess implementation. We loop the files in the directory[1] and attempt to match VMID. In order for the node to pick up the configuration for the container we will want to drop the pod yaml in the plugins dir using the following format. <VMID>_pod.yaml

tGas3T58KzdjcJ2iKSyiYsWiqYctRXaPTqBCA11BqEkNg8kPc_pod.yaml

Then if we match _pod.yaml use the container implementation otherwise subprocess.

[1] https://github.com/ava-labs/avalanchego/blob/eb6e7973a900dc647d29a2da8e7a233ac0a5fe77/vms/registry/vm_getter.go#L102 [2] https://github.com/ava-labs/avalanchego/blob/master/vms/rpcchainvm/factory.go#L36 [3] https://github.com/ava-labs/avalanchego/blob/master/vms/registry/vm_getter.go#L64

aaronbuchwald commented 1 year ago

Just added a messy switch in that looks for the _pod suffix and will call the alternative podman factory if present.

Building the podman VM factory will depend on the podman client.

Here's the PR https://github.com/hexfusion/avalanchego/pull/11