-
Notifications
You must be signed in to change notification settings - Fork 12
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
[PR] Adding configuration to deploy to fly.io and upgrading to Phoenix 1.7 #111
Conversation
Getting https://community.fly.io/t/instance-refused-connection/9961 Re-building doesn't seem to be working :/ |
The Dockerfile from https://github.com/dwyl/phoenix-chat-example/blob/main/Dockerfile seems to be similar to this one, so it should work, in theyro. |
@LuchoTurtle do you want to pair on getting this done? |
Sure |
Keep getting this error, even after changing |
Ok. Let's speed-run this now. 🐎 |
Sending build context to Docker daemon 59.19kB
[+] Building 76.1s (6/27)
=> [internal] load remote build context 0.0s
=> copy /context / 0.1s
=> [internal] load metadata for docker.io/hexpm/elixir:1.14.1-erlang-25.1.1-debian-bullseye-20220801-slim 1.0s
=> [internal] load metadata for docker.io/library/debian:bullseye-20220801-slim 0.9s
=> ERROR [builder 1/17] FROM docker.io/hexpm/elixir:1.14.1-erlang-25.1.1-debian-bullseye-20220801-slim@sha256:03ba790fed12ff 75.1s
=> => resolve docker.io/hexpm/elixir:1.14.1-erlang-25.1.1-debian-bullseye-20220801-slim@sha256:03ba790fed12ff8e4ec4243b66d5480 0.0s
=> => sha256:41368024d1e2ff41784e06ac4d2627fcae0f4f63669ff1084f2a3afc1ade87e7 5.25MB / 5.25MB 0.1s
=> => sha256:03ba790fed12ff8e4ec4243b66d54802ecc5ae81eec38acfcde4d21feea1193d 772B / 772B 0.0s
=> => sha256:9de014a78a1c23d957c839a85bf17a3ccafaa45ddbaf33ed09d04339394faae0 1.16kB / 1.16kB 0.0s
=> => sha256:9cbc096d345689a64313e042e3f8908efac1e2e374431dccc58ba20d9be39952 2.33kB / 2.33kB 0.0s
=> => sha256:58d3810f0cbf21328583a4f00b8f525f533e4366e5959211360916399b60bc0d 14.37MB / 14.37MB 0.2s
=> => sha256:c082ec3e945013d5e2e48a39e62140703ae0d82b4bf59cc2a263b5e169ba56b9 44.56MB / 44.56MB 0.4s
=> ERROR [stage-1 1/6] FROM docker.io/library/debian:bullseye-20220801-slim@sha256:a811e62769a642241b168ac34f615fb02da863307a 75.1s
=> => resolve docker.io/library/debian:bullseye-20220801-slim@sha256:a811e62769a642241b168ac34f615fb02da863307a14c4432cea8e5a0 0.0s
=> => sha256:a811e62769a642241b168ac34f615fb02da863307a14c4432cea8e5a0f9782b8 1.85kB / 1.85kB 0.0s
=> => sha256:139a42fa3bde3e5bad6ae912aaaf2103565558a7a73afe6ce6ceed6e46a6e519 529B / 529B 0.0s
=> => sha256:6a8065e4ba130e5f581c9fb79da4f58bc6513fa65fae1aba12418be4c5a7ed76 1.46kB / 1.46kB 0.0s
------
> [builder 1/17] FROM docker.io/hexpm/elixir:1.14.1-erlang-25.1.1-debian-bullseye-20220801-slim@sha256:03ba790fed12ff8e4ec4243b66d54802ecc5ae81eec38acfcde4d21feea1193d:
------
------
> [stage-1 1/6] FROM docker.io/library/debian:bullseye-20220801-slim@sha256:a811e62769a642241b168ac34f615fb02da863307a14c4432cea8e5a0f9782b8:
------
Error failed to fetch an image or build from source: error building: failed commit on ref "layer-sha256:1efc276f4ff952c055dea726cfc96ec6a4fdb8b62d9eed816bd2b788f2860ad7": "layer-sha256:1efc276f4ff952c055dea726cfc96ec6a4fdb8b62d9eed816bd2b788f2860ad7" failed size validation: 0 != 31366757: failed precondition
|
Eventually we get the following: ⏳ Failure #1
Instance
ID PROCESS VERSION REGION DESIRED STATUS HEALTH CHECKS RESTARTS CREATED
3f7a031b app 0 mad run running 1 total, 1 critical 0 4m48s ago
Recent Events
TIMESTAMP TYPE MESSAGE
2023-03-01T10:14:44Z Received Task received by client
2023-03-01T10:14:44Z Task Setup Building Task Directory
2023-03-01T10:14:48Z Started Task started by client
2023-03-01T10:14:47Z [info]Configuring firecracker
2023-03-01T10:14:47Z [info]Starting virtual machine
2023-03-01T10:14:48Z [info]Starting init (commit: 08b4c2b)...
2023-03-01T10:14:48Z [info]Preparing to run: `/app/bin/server` as nobody
2023-03-01T10:14:48Z [info]2023/03/01 10:14:48 listening on [fdaa:1:811c:a7b:e0:3f7a:31b:2]:22 (DNS: [fdaa::3]:53)
2023-03-01T10:19:32Z [error]instance refused connection
2023-03-01T10:19:36Z [warn]Could not proxy HTTP request. Retrying in 1000 ms (attempt 10)
2023-03-01T10:19:42Z [error]instance refused connection
--> v0 failed - Failed due to unhealthy allocations - no stable job version to auto revert to and deploying as v1
--> Troubleshooting guide at https://fly.io/docs/getting-started/troubleshooting/
Error abort
|
@SimonLab suggested running |
Now exporting the flyctl secrets set AUTH_API_KEY=88SwQFHmoyKLLddGN7NBrD2gq4qy7yCmKob8xLwLpYu/88SwQDEuH2wzHbS6aLAtHyPeLJZSvSCazgLHXkjse66PAsazE/authdemo.fly.dev Output: Release v1 created
==> Monitoring deployment
Logs: https://fly.io/apps/liveview-chat-example/monitoring
1 desired, 1 placed, 0 healthy, 0 unhealthy Let's see if that does anything for the deploy ... ⌛ |
Still failing: Failure #1
Instance
ID PROCESS VERSION REGION DESIRED STATUS HEALTH CHECKS RESTARTS CREATED
1f47ad52 app 1 mad run running 1 total, 1 critical 0 5m6s ago
Recent Events
TIMESTAMP TYPE MESSAGE
2023-03-01T10:23:36Z Received Task received by client
2023-03-01T10:23:54Z Task Setup Building Task Directory
2023-03-01T10:23:58Z Started Task started by client
2023-03-01T10:23:57Z [info]Unpacking image
2023-03-01T10:23:57Z [info]Preparing kernel init
2023-03-01T10:23:58Z [info]Configuring firecracker
2023-03-01T10:23:58Z [info]Starting virtual machine
2023-03-01T10:23:58Z [info]Starting init (commit: 08b4c2b)...
2023-03-01T10:23:58Z [info]Preparing to run: `/app/bin/server` as nobody
2023-03-01T10:23:58Z [info]2023/03/01 10:23:58 listening on [fdaa:1:811c:a7b:e0:1f47:ad52:2]:22 (DNS: [fdaa::3]:53)
--> v1 failed - Failed due to unhealthy allocations - no stable job version to auto revert to and deploying as v2
--> Troubleshooting guide at https://fly.io/docs/getting-started/troubleshooting/
Error abort |
Yeah, that appears to resolve the issue for a |
If you are running checks. please comment. 🙏 |
Everything under |
Ok. I think we can |
I've deleted the fly app that was deployed to the |
==> Creating release
--> release v2 created
--> You can detach the terminal anytime without stopping the deployment
==> Release command detected: /app/bin/migrate
--> This release will not be available until the release command succeeds.
Starting instance
Configuring virtual machine
Pulling container image
Unpacking image
Preparing kernel init
Configuring firecracker
Starting virtual machine
Starting init (commit: 08b4c2b)...
Preparing to run: `/app/bin/migrate` as nobody
2023/03/01 11:17:27 listening on [fdaa:1:811c:a7b:bada:87c6:54b6:2]:22 (DNS: [fdaa::3]:53)
11:17:30.023 [info] == Running 20211122121548 LiveviewChat.Repo.Migrations.CreateMessages.change/0 forward
11:17:30.028 [info] create table messages
11:17:30.048 [info] == Migrated 20211122121548 in 0.0s
Starting clean up.
Starting instance
Configuring virtual machine
Pulling container image
Unpacking image
Preparing kernel init
Configuring firecracker
Starting virtual machine
Starting init (commit: 08b4c2b)...
Preparing to run: `/app/bin/migrate` as nobody
2023/03/01 11:17:27 listening on [fdaa:1:811c:a7b:bada:87c6:54b6:2]:22 (DNS: [fdaa::3]:53)
11:17:30.023 [info] == Running 20211122121548 LiveviewChat.Repo.Migrations.CreateMessages.change/0 forward
11:17:30.028 [info] create table messages
11:17:30.048 [info] == Migrated 20211122121548 in 0.0s
Starting clean up.
Starting instance
Configuring virtual machine
Pulling container image
Unpacking image
Preparing kernel init
Configuring firecracker
Starting virtual machine
Starting init (commit: 08b4c2b)...
Preparing to run: `/app/bin/migrate` as nobody
2023/03/01 11:17:27 listening on [fdaa:1:811c:a7b:bada:87c6:54b6:2]:22 (DNS: [fdaa::3]:53)
11:17:30.023 [info] == Running 20211122121548 LiveviewChat.Repo.Migrations.CreateMessages.change/0 forward
11:17:30.028 [info] create table messages
11:17:30.048 [info] == Migrated 20211122121548 in 0.0s
Starting clean up.
==> Monitoring deployment
Logs: https://fly.io/apps/liveview-chat-example/monitoring
1 desired, 1 placed, 0 healthy, 0 unhealthy [health checks: 1 total, 1 critical] Still "critical" ... 🤷 |
OK. honestly this has sucked enough of our time now. (Almost |
4fd65cf
to
98e57ad
Compare
- Check dependencies with `mix hex.outdated` - Update the available dependencies with `mix deps.update --all` - Clean the lock file to remove unsued dependencies with `mix deps.clean --unlock --unused`
I've updated the dependencies and tried to deploy the application, however the error is still the same. |
Dockerfile
Outdated
ENV ECTO_IPV6 true | ||
ENV ERL_AFLAGS "-proto_dist inet6_tcp" | ||
|
||
# Appended by flyctl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete these lines, you only need it once.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for checking the Dockerfile, I've pushed the latest versions of the Dockerfile and fly.toml
Dockerfile
Outdated
ENV ECTO_IPV6 true | ||
ENV ERL_AFLAGS "-proto_dist inet6_tcp" | ||
|
||
# Appended by flyctl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete this extra lines
Attempt to recreate the fly.toml and Dockerfile after updating flyctl
Co-authored-by: Jason S. <stiebs.81@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The application is now deployed on Fly (we still need to add manually the auth environment variable)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. 👌
Thanks @LuchoTurtle, @jeregrine & @SimonLab 🙌
related to #86
This PR should address the needed config to deploy to fly.io.
It's still not working (check #86 as to why this is and why it's still in draft mode) but it deals with a few hurdles already.