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

Are There Additional Self-Hosting Instructions? #65

Open
mergesort opened this issue Feb 9, 2024 · 17 comments
Open

Are There Additional Self-Hosting Instructions? #65

mergesort opened this issue Feb 9, 2024 · 17 comments

Comments

@mergesort
Copy link

Hey @videah, I decided to spin up an instance of Skybridge on Fly using your instructions in the readme. I updated the fly.toml and docker-compose.yml below, and while it does deploy to Fly I'm not able to get Skybridge to do anything. (Visiting the instance's URL just tries to load up a webpage that never loads.)

fly.toml

app = 'obscured-for-privacy'
primary_region = 'ewr'

[build]

[http_service]
  internal_port = 8080
  force_https = true
  auto_stop_machines = true
  auto_start_machines = true
  min_machines_running = 0
  processes = ['app']

[[vm]]
  cpu_kind = 'shared'
  cpus = 1
  memory_mb = 1024

Dockerfile

version: "3.8"
services:
  skybridge:
    container_name: "skybridge"
    image: videah/skybridge:latest
    restart: always
    volumes:
      - skybridge:/app/database
    environment:
      # Base URL of where SkyBridge will be hosted without the protocol.
      - SKYBRIDGE_BASEURL=obscured-for-privacy.fly.dev
      # Random secret, generate with `openssl rand -base64 32`.
      - SKYBRIDGE_SECRET
      # Password used to make a SkyBridge instance private.
      - SKYBRIDGE_AUTH_PASSWORD
      # Should a bridge password be required to authenticate?
      - SKYBRIDGE_REQUIRE_AUTH_PASSWORD=true
      # Should a nice index page be shown on the root URL?
      - SKYBRIDGE_SHOW_INDEX=false
      # Allow backfilling/scrolling on timelines? (can cause issues on instances under heavy load)
      - SKYBRIDGE_ALLOW_BACKFILL=true

volumes:
  skybridge:

Are there perhaps other dependencies or config changes I'd need to make to get a fresh instance running?

And of course, thank you so much for all the hard work!

@ObjectInSpace
Copy link

I'm in the same boat, it deployed okay but the image won't start. Here are my logs from fly.dev:

Configuring firecracker
2024-05-27T18:55:23.052 app[e825d3ef723028] ord [info] 2024-05-27T18:55:23.052593707 [01HYXPG3ZPRA3WA8RFB7SY8BVV:main] Running Firecracker v1.7.0
2024-05-27T18:55:23.222 app[e825d3ef723028] ord [info] [ 0.046637] PCI: Fatal: No config space access function found
2024-05-27T18:55:23.494 app[e825d3ef723028] ord [info] INFO Starting init (commit: d772ddd9)...
2024-05-27T18:55:23.517 app[e825d3ef723028] ord [info] INFO Mounting /dev/vdc at /app/database w/ uid: 0, gid: 0 and chmod 0755
2024-05-27T18:55:23.522 app[e825d3ef723028] ord [info] INFO Resized /app/database to 1056964608 bytes
2024-05-27T18:55:23.522 app[e825d3ef723028] ord [info] INFO Preparing to run: /app/entrypoint.sh as root
2024-05-27T18:55:23.531 app[e825d3ef723028] ord [info] ERROR Error: failed to spawn command: /app/entrypoint.sh: No such file or directory (os error 2)
2024-05-27T18:55:23.531 app[e825d3ef723028] ord [info] does /app/entrypoint.sh exist and is it executable?

Probably doing something wrong somewhere.

@Pikuboy
Copy link

Pikuboy commented Sep 4, 2024

Did one of you managed to make it work ? I have the same issues.

@Pikuboy
Copy link

Pikuboy commented Sep 5, 2024

I managed to make it work. Here's my fly.toml

app = 'skybridge'  #you need to rename it
primary_region = 'lhr'

[build]
image = "videah/skybridge:latest"

[http_service]
  internal_port = 8080
  force_https = true
  auto_stop_machines = true
  auto_start_machines = true
  min_machines_running = 0

[env]
  SKYBRIDGE_BASEURL = 'skybride.fly.dev' #you need to rename it using your app name .fly.dev
  SKYBRIDGE_SHOW_INDEX = 'true'
  FLY_SWAP = 'true'
  SKYBRIDGE_SECRET=' ' #you need to fill it, I taped random numbers and it worked
  SKYBRIDGE_REQUIRE_AUTH_PASSWORD = true
  SKYBRIDGE_AUTH_PASSWORD = '' #if above is true, it will be asked when you'll try to log in to you bsky account in the app
  SKYBRIDGE_ALLOW_BACKFILL = true

[[mounts]]
  source = 'skybridge_data'
  destination = '/app/database'

[[http_service.checks]]
  grace_period = "30s"
  interval = "30s"
  method = "GET"
  timeout = "5s"
  path = "/api/v2/instance"

[http_service.concurrency]
  type = "requests"
  hard_limit = 999999
  soft_limit = 9999

[[vm]]
  memory = '256mb'
  cpu_kind = 'shared'
  cpus = 1

@ObjectInSpace
Copy link

ObjectInSpace commented Oct 19, 2024

This configuration got me up and running. Thanks a lot!

One thing that really helped was using fly's github integration to launch and deploy the app. Fork the skybridge repo to your account, commit a change to fly.toml with your own configuration, then link your github to fly and launch from the web UI. No need to git clone or worry about dart_frog_cli version missmatches or anything like that, fly will just do everything so you don't need to copy anything to your local machine. Worked great, once I filled everything out correctly.

Make your repo private if you do this though, so no one can snoop on your configuration file. (not that anyone would, but, you know, can't be too careful.)

@bdleblanc81
Copy link

bdleblanc81 commented Nov 14, 2024

@Pikuboy OK, total noob here so I am likely making some sort of stupid mistake, but I copied your fly.toml wholesale (only changed the app name and baseurl to be my fly server) and my dockerfile looks identical to the OP's, but it continually times out when I try to deploy.

There is this warning:

WARNING The app is not listening on the expected address and will not be reachable by fly-proxy.
You can fix this by configuring your app to listen on the following addresses:
 0.0.0.0:8080

And then after about ten minutes the deployment times out with this error:

Unrecoverable error: timeout reached waiting for health checks to pass for machine 1781977ae00418: failed to get VM 1781977ae00418: Get "https://api.machines.dev/v1/apps/[redacted]/machines/1781977ae00418": net/http: request canceled
 Clearing lease for 1781977ae00418
 Cleared lease for 1781977ae00418
Error: failed to update machine 1781977ae00418: Unrecoverable error: timeout reached waiting for health checks to pass for machine 1781977ae00418: failed to get VM 1781977ae00418: Get "https://api.machines.dev/v1/apps/[redacted]/machines/1781977ae00418": net/http: request canceled
unsuccessful command 'flyctl deploy -a [redacted] --image videah/skybridge:latest --depot-scope=app --config fly.toml

Any ideas?

@Pikuboy
Copy link

Pikuboy commented Nov 14, 2024

You need

@Pikuboy OK, total noob here so I am likely making some sort of stupid mistake, but I copied your fly.toml wholesale (only changed the app name and baseurl to be my fly server) and my dockerfile looks identical to the OP's, but it continually times out when I try to deploy.

There is this warning:

WARNING The app is not listening on the expected address and will not be reachable by fly-proxy.
You can fix this by configuring your app to listen on the following addresses:
 0.0.0.0:8080

And then after about ten minutes the deployment times out with this error:

Unrecoverable error: timeout reached waiting for health checks to pass for machine 1781977ae00418: failed to get VM 1781977ae00418: Get "https://api.machines.dev/v1/apps/[redacted]/machines/1781977ae00418": net/http: request canceled
 Clearing lease for 1781977ae00418
 Cleared lease for 1781977ae00418
Error: failed to update machine 1781977ae00418: Unrecoverable error: timeout reached waiting for health checks to pass for machine 1781977ae00418: failed to get VM 1781977ae00418: Get "https://api.machines.dev/v1/apps/[redacted]/machines/1781977ae00418": net/http: request canceled
unsuccessful command 'flyctl deploy -a [redacted] --image videah/skybridge:latest --depot-scope=app --config fly.toml

Any ideas?

You need to fill the Skybridge Secret line too in the fly.toml file with something line this

SKYBRIDGE_SECRET='451865'

this is just an example, use different numbers, I don’t know what it does but it fixed the same issue I had when I tried to deploy to fly.io.

@bdleblanc81
Copy link

@Pikuboy sorry, should have said that I did fill that line in with random numbers. That didn't do anything, unfortunately.

I assume that the app variable on the first line needs to match the app name in the URL, right? That's how I have my fly.toml file set up, anyway.

@Pikuboy
Copy link

Pikuboy commented Nov 14, 2024

I assume the same concerning the app name.

Don’t know if it might cause your issue but did you also fill the SKYBRIDGE_AUTH_PASSWORD line? In my template SKYBRIDGE_REQUIRE_AUTH_PASSWORD is set to true.

@bdleblanc81
Copy link

That worked! I set SKYBRIDGE_AUTH_PASSWORD to be identical to SKYBRIDGE_SECRET and it fired right up. Not sure if they need to match, but I figured it was more likely to work if they did. Thank you!!!

@CameronBanga
Copy link

Thanks for support here, was able to get up and running!

Question quick, does anyone know how much this ~should cost per month on Fly.io?

@Pikuboy
Copy link

Pikuboy commented Nov 19, 2024

Thanks for support here, was able to get up and running!

Question quick, does anyone know how much this ~should cost per month on Fly.io?

I’m not an expert on fly.io and I still don’t quite understand exactly how the pricing work but I have it running since mid-September (it has been like 2 months) and it didn’t cost me a penny. But I received for free 5$ when I sign up and as of today I have 3,53$ left of it. So maybe less than a dollar per month at some point.

@CameronBanga
Copy link

Thanks for support here, was able to get up and running!
Question quick, does anyone know how much this ~should cost per month on Fly.io?

I’m not an expert on fly.io and I still don’t quite understand exactly how the pricing work but I have it running since mid-September (it has been like 2 months) and it didn’t cost me a penny. But I received for free 5$ when I sign up and as of today I have 3,53$ left of it. So maybe less than a dollar per month at some point.

Oh cool! I am giving some friends access to server, so may need to ramp up. I investigated a bit and it seems like it would be ~$3/month based on config, but better to hear from someone on real world usage lol.

@bdleblanc81
Copy link

bdleblanc81 commented Nov 19, 2024 via email

@ObjectInSpace
Copy link

Is anyone else experiencing rate limitting through this method? I still tend to only get about twenty posts loaded in my feed at a time and it doesn't seem to be able to pull more posts. Might make a separate issue for it.

@CameronBanga
Copy link

Is anyone else experiencing rate limitting through this method? I still tend to only get about twenty posts loaded in my feed at a time and it doesn't seem to be able to pull more posts. Might make a separate issue for it.

I have never looked at the bluesky API docs, but did notice in the logs that occasionally the calls being made do have limits, saw this in mine:

/api/v1/timelines/home?limit=40&min_id=1970604808951824384

Likewise, HTTP Response times seem very long, and there was some wonkiness still when I set up the instance and connected to Ivory. My thought was to give a shot ramping up to a beefier machine on Fly.io, but it's been ~good enough so far personally. But if I still see issues, may bump to a 512MB instance.

@lnlyssg
Copy link

lnlyssg commented Dec 2, 2024

Chances are there’s some lower limit under which they won’t even bother invoicing for. It’s probably diminishing returns for them to try to collect any balance less than five bucks. I’ll report back when I get to the end of the billing cycle but I don’t anticipate this breaking the bank by any measure.

I just got this email:

Good news from Fly.io! We don’t collect bills smaller than $5.00 on your default (personal) organization.This month, your bill of $0.24 falls below that threshold, so we’re discounting it by 100%.

@CameronBanga
Copy link

Chances are there’s some lower limit under which they won’t even bother invoicing for. It’s probably diminishing returns for them to try to collect any balance less than five bucks. I’ll report back when I get to the end of the billing cycle but I don’t anticipate this breaking the bank by any measure.

I just got this email:

Good news from Fly.io! We don’t collect bills smaller than $5.00 on your default (personal) organization.This month, your bill of $0.24 falls below that threshold, so we’re discounting it by 100%.

Can confirm I also got the same message. Mine for 12 days was a whopping $0.33.

@lnlyssg lnlyssg mentioned this issue Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants