Calling Golang from Python?

Hi folks,

We’d like to use Go for our federated solution.
Since Go is a compiled language/runtime, we’d need to either:

  1. pre-compile our Go code and include the compiled binary in our submission, or

  2. vendor our Go dependencies, request installation of conda-forge Go package and then do an offline compilation of our Go code at runtime.

Regardless of the method, could you confirm that we’re allowed to execute the compiled binary as a subprocess at runtime, and to communicate with it over its stdin/stdout?

Then, I think for simplicity we’d prefer option (1). Could you comment if this is allowed?

Alternatively, if this is not allowed, with option (2) how can we make sure we only compile the code once at runtime, and can then reuse it in various steps? I was thinking we could compile it on the first Client / Strategy class constructor invocation, and cache it in the client_dir or server_dir, but I’m not sure if the submission harness allows storing executable files in these folders.

Thank you

Hi @denis.broadinstitute,

Option (1) of pre-compiling your Go code and including the binaries as part of your submission is acceptable. Please also include the Go source code and documentation for how to compile the binaries as part of your submission.

1 Like