Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go.mod support #340

Open
rcarmo opened this issue Apr 6, 2024 · 9 comments
Open

go.mod support #340

rcarmo opened this issue Apr 6, 2024 · 9 comments

Comments

@rcarmo
Copy link
Member

rcarmo commented Apr 6, 2024

Needs to be done now that it's stabilised.

@rcarmo rcarmo self-assigned this Apr 6, 2024
@psugand
Copy link

psugand commented Jun 10, 2024

Any plans for implementing this?

@rcarmo
Copy link
Member Author

rcarmo commented Jun 10, 2024

Yes, but no schedule. We tend to implement (or accept PRs) when people are actively using this and can do troubleshooting, and right now I have more Rust projects than Go ones (and haven't yet tackled that), so... contributions are welcome. It really shouldn't be very hard, but I have very little bandwidth currently.

@psugand
Copy link

psugand commented Jun 10, 2024

I don't mind giving it a go if you need a pair of extra hands. I will explore the code and let you know if I have any questions.

If you got any pointers or quick overview which would expedite things please share.

@rcarmo
Copy link
Member Author

rcarmo commented Jun 10, 2024

Sure, you can look at #344 for an example. The Go detection and deployment functions are just beside the ones I linked to in that, and the key thing is trying to make sure that GOPATH and equivalents are set to a place that is easy to clean up when the app is destroyed.

@psugand
Copy link

psugand commented Jun 10, 2024

Thanks.

How would you propose the actual execution of applications to work?

I can see you have a Procfile defined, however, when deploying a Go app would you want the application to be compiled as a binary and then execute the binary ? or simply let the user specify the run path by pointing to their main.go, i.e. go run cmd/main.go

@rcarmo
Copy link
Member Author

rcarmo commented Jun 10, 2024

We don't need to be very prescriptive... For compiled languages, we typically use the release worker to run the build (if that fails, the app isn't (re)started). And then you can just invoke the resulting binary.

For simple stuff, go run is fine. One thing you can do is look at the sample repos (go back to the org tree, we try to have at least one sample per runtime) and build a tiny sample repo - I'd also welcome having that, since I hope to some day use those sample repos for end-to-end CI testing...

@rcarmo
Copy link
Member Author

rcarmo commented Jun 10, 2024

@chr15m
Copy link
Contributor

chr15m commented Jun 10, 2024

That brings up an alternative way to deploy go apps that is already compatible with Piku. What you do is create a gh-pages type of branch called e.g. 'live' and you commit the compiled binary in there and use that to deploy to Piku. Alternatively you can commit the compiled binary into a sub-directory. Some people find the idea of committing binary artifacts a bit weird but I think there are actually advantages to this. If you go down this route check out the 'release' worker which you can use to do set up things etc.

@rcarmo
Copy link
Member Author

rcarmo commented Jun 10, 2024

I don't judge :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: To do
Development

No branches or pull requests

3 participants