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

fly deployment #42

Open
2 tasks done
gedw99 opened this issue Mar 30, 2023 · 11 comments
Open
2 tasks done

fly deployment #42

gedw99 opened this issue Mar 30, 2023 · 11 comments
Assignees
Labels
🧙 proposal Let's bring more ideas together

Comments

@gedw99
Copy link

gedw99 commented Mar 30, 2023

Type out the question

It might be nice to have a fly deployment for the server ?

https://fly.io/docs/languages-and-frameworks/dockerfile/

https://fly.io/docs/languages-and-frameworks/golang/

Fly can only handle docker files and not docker compose. SO you can just have 2 dockers.
we need postgresql and so will use cockroach as its alot easier...

Consent

  • I agree to follow the Code of Conduct
  • I understand a satisfying answer is not guaranteed
@gedw99 gedw99 added the ❓question Further information is requested label Mar 30, 2023
@gedw99
Copy link
Author

gedw99 commented Mar 30, 2023

boy thats too easy !

flyctl launch
Creating app in /Users/apple/workspace/go/src/github.com/pgrok/pgrok
Scanning source code
Detected a Dockerfile app
? Choose an app name (leave blank to generate one): pgrokd
automatically selected personal organization: xxx
? Choose a region for deployment: Stockholm, Sweden (arn)
Created app pgrokd in organization personal
Admin URL: https://fly.io/apps/pgrokd
Hostname: pgrokd.fly.dev
Wrote config file fly.toml
? Would you like to set up a Postgresql database now? Yes
? Select configuration: Development - Single node, 1x shared CPU, 256MB RAM, 1GB disk
Creating postgres cluster in organization personal
Creating app...
Setting secrets on app pgrokd-db...
Provisioning 1 of 1 machines with image flyio/postgres:14.6@sha256:9cfb3fafcc1b9bc2df7c901d2ae4a81e83ba224bfe79b11e4dc11bb1838db46e



@gedw99
Copy link
Author

gedw99 commented Mar 30, 2023

I can make a PR is you want once i get it working..

just let me know..

@unknwon
Copy link
Member

unknwon commented Mar 30, 2023

I can make a PR is you want once i get it working..

😍 no reason to say no!

@unknwon unknwon added the status: needs feedback Needs more feedback to proceed label Mar 30, 2023
@gedw99
Copy link
Author

gedw99 commented Mar 31, 2023

cool. will let you know..

@unknwon unknwon added status: needs followup Need some extra work and removed status: needs feedback Needs more feedback to proceed labels Mar 31, 2023
@gedw99
Copy link
Author

gedw99 commented Jun 29, 2023

@unknwon

if we use cockroachdb and embed it in the server then there is no need for docker or docker files.
We just use overmind to run them both.

this works on fly.io and well as anyones latop.

wanny try this ?

@unknwon
Copy link
Member

unknwon commented Aug 13, 2023

Hey @gedw99!

if we use cockroachdb and embed it in the server then there is no need for docker or docker files.
We just use overmind to run them both.

What does it mean to "embed" when you say "embed it in the server". Does it mean just grab/install the binary version of the cockroachdb?

@unknwon unknwon added status: needs feedback Needs more feedback to proceed and removed status: needs followup Need some extra work labels Aug 13, 2023
@gedw99
Copy link
Author

gedw99 commented Aug 13, 2023

In the docker you put cockroachdb as well as Pgrok.

you also put overmind inside.

then you use overmind to start it up. So fly runs overmind which runs the other binaries!

this is how others run multiple processes on fly.io

@gedw99
Copy link
Author

gedw99 commented Aug 13, 2023

You can also run caddy I side fly.io this way as well as whatever app your hosting / proxying

https://github.com/jveres/fly-keydb-serf/blob/main/Dockerfile

https://github.com/tmm1/flyapp-mastodon/blob/main/Dockerfile

@gedw99
Copy link
Author

gedw99 commented Aug 13, 2023

What I like about this is that it’s portable. It’s just a docker with overmind and the binaries

you can run this on a desktop without docker

@unknwon
Copy link
Member

unknwon commented Aug 13, 2023

Gotcha, that sounds good to me! So we just need another Dockerfile to build images for fly.io (or in general, a bundle image).

@gedw99
Copy link
Author

gedw99 commented Aug 13, 2023

Yes that’s right.

You can also get a bit fancy and slip stream the binaries in at runtime using a control plane like NATS jetstream.

You Store all versions of binaries inside Nats object store.

the docker boots and all it has is a nats.Go that a ts as an agent. It sits there on top of overmind and subscribes to the binaries.

When you have 10 I stances running on fly ( or anywhere else that can run a docker ) , they all update the binary a few milliseconds later.

you can fork the process and update the binary with zero down time.

This is something I have been working with for a while but have not finished it.

Nats is your registry and the binaries can live in your GitHub releases.

—-

Fly can btw use a do jet image that is hosted on GitHub packsge system too. You might find that useful

@unknwon unknwon added 🧙 proposal Let's bring more ideas together and removed ❓question Further information is requested status: needs feedback Needs more feedback to proceed labels Aug 14, 2023
@unknwon unknwon self-assigned this Aug 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧙 proposal Let's bring more ideas together
Projects
None yet
Development

No branches or pull requests

2 participants