Closed Ishan27g closed 2 years ago
If you can map and explain how that would work we welcome the change.
The existing function
service can me modified -
The deploy-request variable repo
can be set as an absolute/path/to/local/go/file
.
Or
A new var can be added to denote local/remote.
The local file ( via repo
) with the exported function (via entrypoint
) can then be optionally validated to ensure it has the valid param signature.
Deploying this function would not be any different line 329 so long as fn.Entrypoint
has a valid param-signature. It would just skip using the git package.
- The git package could also be modified to skip to a local dir without doing the checkout
The line 339 can then be set according to the absolute path or the git.repo
I guess the assumption you're making here is that the function service is actually running on your machine as opposed to in the cloud.
oops, is that not the case when my env
is set to local?
Sure but the case then has zero value when we actually run this in the cloud and remotely which is the point of the software, unless the code is located with the machine running the services. So it's just a case of understanding what you're optimising for.
Yea that makes sense. Cheers
I'm happy to accept a PR if you still feel like it's a value add feature that you are personally using.
I don't see any use-cases outside of local development, so now i'm not sure if its worthwhile.
But I can probably pitch in for one of the existing issues, maybe Lists Api? Can you give some information about that? I was thinking, maybe lists
could reuse notes
Sure, I think actually if someone is running micro locally it might be useful but equally a potential design pattern for the future where the source is actually mounted as a networked filesystem. There's no reason github couldn't be mounted that way :)
On lists. It's the idea of creating a list for anything really, waitlist, mailing list, todo list, etc. It could reuse notes but equally might be easy enough to copy the service as the storage will then at least be in a separate table for lists.
Just thinking out loud, what if the local-source files could be transferred to the remote / cloud machine? ( not sure if micro has file transfer or some similar functionality). The locally transferred files could then be deployed as discussed earlier .
Ive got an idea about lists, will update soon
https://github.com/micro/services/pull/397/files
This is a simple solution that just takes in the source file. It's only useful for single file operations but it works.
Functions now supports a "source" argument that takes source code and deploys it. This only works for single files but it's a starting point.
Hi, the
functions
service can deploy and run serverless functions from a Git repository. It would be useful to deploy a function from a local .go file instead of the git repository, similar to Google's functions-framework-go I can have a go at this feature if it sounds like a good addition