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

Chore: Deploy Demo App to Fly.io #15

Closed
1 task done
nelsonic opened this issue Feb 9, 2023 · 11 comments
Closed
1 task done

Chore: Deploy Demo App to Fly.io #15

nelsonic opened this issue Feb 9, 2023 · 11 comments
Assignees
Labels
awaiting-review An issue or pull request that needs to be reviewed chore a tedious but necessary task often paying technical debt discuss Share your constructive thoughts on how to make progress with this issue enhancement New feature or enhancement of existing functionality good first issue Good for newcomers help wanted If you can help make progress with this issue, please comment! priority-3 Third priority. Considered "Nice to Have". Not urgent. T25m Time Estimate 25 Minutes technical A technical issue that requires understanding of the code, infrastructure or dependencies

Comments

@nelsonic
Copy link
Member

nelsonic commented Feb 9, 2023

Heroku has kindly deleted our old demo app - that was consuming 0.0001 hours per month and basically cost them nothing ...
https://elixir-auth-google-demo.herokuapp.com/
image

So ...

Todo

  • Deploy this app to Fly.io

The reason I'm opening this now is to help debug: dwyl/elixir-auth-google#83 💭
Which in turn will help ensure that our auth is working correctly. 👌

Related to: dwyl/learn-heroku#52

@nelsonic nelsonic added enhancement New feature or enhancement of existing functionality help wanted If you can help make progress with this issue, please comment! good first issue Good for newcomers chore a tedious but necessary task often paying technical debt priority-3 Third priority. Considered "Nice to Have". Not urgent. technical A technical issue that requires understanding of the code, infrastructure or dependencies T25m Time Estimate 25 Minutes discuss Share your constructive thoughts on how to make progress with this issue labels Feb 9, 2023
@nelsonic nelsonic self-assigned this Feb 9, 2023
@nelsonic nelsonic moved this to 🏗 In progress in dwyl app kanban Feb 9, 2023
@nelsonic
Copy link
Member Author

nelsonic commented Feb 9, 2023

Failed:

Preparing system for Elixir builds
Installing application dependencies
Running Docker release generator
Error failed running /opt/homebrew/bin/mix phx.gen.release --docker: exit status 1

@nelsonic
Copy link
Member Author

nelsonic commented Feb 9, 2023

Working on localhost:

image

Going to try and deploy to Fly.io again. ⏳

@nelsonic
Copy link
Member Author

nelsonic commented Feb 9, 2023

Error while trying to deploy to Fly.io:

--> Pushing image done
image: registry.fly.io/elxir-google-auth-demo:deployment-01GRVCAZJD0573G1F8NGQ0Z7WH
image size: 122 MB
==> Creating release
--> release v2 created

--> You can detach the terminal anytime without stopping the deployment
==> Monitoring deployment
Logs: https://fly.io/apps/elxir-google-auth-demo/monitoring

 1 desired, 1 placed, 0 healthy, 1 unhealthy [restarts: 2] [health checks: 1 total]
Failed Instances

Failure #1

Instance
ID      	PROCESS	VERSION	REGION	DESIRED	STATUS 	HEALTH CHECKS	RESTARTS	CREATED 
eedf95a6	app    	0      	lhr   	run    	pending	1 total      	2       	25s ago	

Recent Events
TIMESTAMP           	TYPE      	MESSAGE                         
2023-02-09T15:22:46Z	Received  	Task received by client        	
2023-02-09T15:22:46Z	Task Setup	Building Task Directory        	
2023-02-09T15:22:55Z	Started   	Task started by client         	
2023-02-09T15:22:59Z	Terminated	Exit Code: 1                   	
2023-02-09T15:22:59Z	Restarting	Task restarting in 1.186411976s	
2023-02-09T15:23:05Z	Started   	Task started by client         	
2023-02-09T15:23:09Z	Terminated	Exit Code: 1                   	
2023-02-09T15:23:09Z	Restarting	Task restarting in 1.005551008s	

2023-02-09T15:23:07Z   [info]    (elixir 1.14.3) lib/code.ex:425: Code.validated_eval_string/3
2023-02-09T15:23:07Z   [info]5,110,103,46,10,70,111,114,32,101,120,97,109,112,108,101,58,32,101,99,116,111,58,47,47,85,83,69,82,58,80,65,83,83,64,72,79,83,84,47,68,65,84,65,66,65,83,69,10>>},[{elixir_eval,'__FILE__',1,[{file,"/app/releases/1.6.5/runtime.exs"},{line,26}]},{elixir,'-eval_external_handler/1-fun-2-',4,[{file,"src/elixir.erl"},{line,309},{error_info,#{module=>'Elixir.Exception'}}]},{erl_eval,do_apply,7,[{file,"erl_eval.erl"},{line,748}]},{erl_eval,expr,6,[{file,"erl_eval.erl"},{line,492}]},{erl_eval,exprs,6,[{file,"erl_eval.erl"},{line,136}]},{elixir,eval_forms,4,[{file,"src/elixir.erl"},{line,294}]},{'Eli
2023-02-09T15:23:07Z   [info]5,110,103,46,10,70,111,114,32,101,120,97,109,112,108,101,58,32,101,99,116,111,58,47,47,85,83,69,82,58,80,65,83,83,64,72,79,83,84,47,68,65,84,65,66,65,83,69,10>>},[{elixir_eval,'__FILE__',1,[{file,"/app/releases/1.6.5/runtime.exs"},{line,26}]},{elixir,'-eval_external_handler/1-fun-2-',4,[{file,"src/elixir.erl"},{line,309},{error_info,#{module=>'Elixir.Exception'}}]},{erl_eval,do_apply,7,[{file,"erl_eval.erl"},{line,748}]},{erl_eval,expr,6,[{file,"erl_eval.erl"},{line,492}]},{erl_eval,exprs,6,[{file,"erl_eval.erl"},{line,136}]},{elixir,eval_forms,4,[{file,"src/elixir.erl"},{line,294}]},{'Eli
ir.Module.ParallelChecker',verify,1,[{file,"lib/module/parallel_checker.ex"},{line,110}]},{'Elixir.Code',validated_eval_string,3,[{file,"lib/code.ex"},{line,425}]}]}}
2023-02-09T15:23:07Z   [info]Crash dump is being written to: erl_crash.dump...done
2023-02-09T15:23:08Z   [info]Starting clean up.
2023-02-09T15:23:13Z   [info]Starting instance
2023-02-09T15:23:13Z   [info]Configuring virtual machine
2023-02-09T15:23:13Z   [info]Pulling container image
2023-02-09T15:23:13Z   [info]Unpacking image
2023-02-09T15:23:13Z   [info]Preparing kernel init
2023-02-09T15:23:14Z   [info]Configuring firecracker
2023-02-09T15:23:14Z   [info]Starting virtual machine
2023-02-09T15:23:14Z   [info]Starting init (commit: c19b424)...
2023-02-09T15:23:14Z   [info]Preparing to run: `/app/bin/server` as nobody
2023-02-09T15:23:14Z   [info]2023/02/09 15:23:14 listening on [fdaa:1:3fd8:a7b:bbfa:eedf:95a6:2]:22 (DNS: [fdaa::3]:53)
2023-02-09T15:23:17Z   [info]ERROR! Config provider Config.Reader failed with:
2023-02-09T15:23:17Z   [info]** (RuntimeError) environment variable DATABASE_URL is missing.
2023-02-09T15:23:17Z   [info]For example: ecto://USER:PASS@HOST/DATABASE
2023-02-09T15:23:17Z   [info]    /app/releases/1.6.5/runtime.exs:26: (file)
2023-02-09T15:23:17Z   [info]    (elixir 1.14.3) src/elixir.erl:309: anonymous fn/4 in :elixir.eval_external_handler/1
2023-02-09T15:23:17Z   [info]    (stdlib 4.2) erl_eval.erl:748: :erl_eval.do_apply/7
2023-02-09T15:23:17Z   [info]    (stdlib 4.2) erl_eval.erl:492: :erl_eval.expr/6
2023-02-09T15:23:17Z   [info]    (stdlib 4.2) erl_eval.erl:136: :erl_eval.exprs/6
2023-02-09T15:23:17Z   [info]    (elixir 1.14.3) src/elixir.erl:294: :elixir.eval_forms/4
2023-02-09T15:23:17Z   [info]    (elixir 1.14.3) lib/module/parallel_checker.ex:110: Module.ParallelChecker.verify/1
2023-02-09T15:23:17Z   [info]    (elixir 1.14.3) lib/code.ex:425: Code.validated_eval_string/3
2023-02-09T15:23:17Z   [info]init terminating in do_boboot",{#{'__exception__'=>true,'__struct__'=>'Elixir.RuntimeError',message=><<101,110,118,105,114,111,110,109,101,110,116,32,118,97,114,105,97,98,108,101,32,68,65,84,65,66,65,83,69,95,85,82,76,32,105,115,32,109,105,115,115,105,110,103,46,10,70,111,114,32,101,120,97,109,112,108,101,58,32,101,99,116,111,58,47,47,85,83,69,82,58,80,65,83,83,64,72,79,83,84,47,68,65,84,65,66,65,83,69,10>>},[{elixir_eval,'__FILE__',1,[{file,"/app/releases/1.6.5/runtime.exs"},{line,26}]},{elixir,'-eval_external_handler/1-fun-2-',4,[{file,"src/elixir.erl"},{line,309},{error_info,#{module=>'Elixir.Exception'}}]},{erl_eval,do_apply,7,[{file,"erl_eval.erl"},{line,748}]},{erl_eval,expr,6,[{file,"erl_eval.erl"},{line,492}]},{erl_eval,exprs,6,[{file,"erl_eval.erl"},{line,136}]},{elixir,eval_forms,4,[{file,"src/elixir.erl"},{line,294}]},{'Elixir.Module.ParallelChecker',verify,1,[{file,"lib/module/parallel_checker.ex"},{line,110}]},{'Elixir.Code',validated_eval_string,3,[{file,"lib/code.ex"},{line,425}]}]}}
2023-02-09T15:23:17Z   [info]init terminating in do_boot ({,[{elixir_eval,__FILE__,1,[{_},{_}]},{elixir,-eval_external_handler/1-fun-2-,4,[{_},{_},{_}]},{erl_eval,do_apply,7,[{_},{_}]},{erl_eval,expr,6,[{_},{_}]},{erl_eval,exprs,6,[{_},{_}]},{elixir,eval_forms,4,[{_},{_}]},{Elixir.Module.ParallelChecker,verify,1,[{_},{_}]},{Elixir.Code,validated_eval_string,3,[{_},{_}]}]})
2023-02-09T15:23:17Z   [info]Crash dump is being written to: erl_crash.dump...done
2023-02-09T15:23:17Z   [info]Starting clean up.
--> 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

Also, on localhost getting the following error: 🤷‍♂️

spawn: Could not cd to /elixir-auth-google-demo/assets

@nelsonic
Copy link
Member Author

nelsonic commented Feb 9, 2023

fly secrets set SECRET_KEY_BASE=wLJ3lRg5sbJSD3G4IOoqDBnG0+iSyXWyu+bChlHMsJwoC3i4c0sXUwKretc.

@nelsonic
Copy link
Member Author

nelsonic commented Feb 9, 2023

Getting the following error when trying to write a test:

%{error: "invalid_grant", error_description: "Malformed auth code."}

@nelsonic
Copy link
Member Author

nelsonic commented Feb 9, 2023

https://elixir-google-auth-demo.fly.dev/
image

502 ... 🤷‍♂️
image

nelsonic added a commit that referenced this issue Feb 9, 2023
nelsonic added a commit that referenced this issue Feb 9, 2023
nelsonic added a commit that referenced this issue Feb 9, 2023
@nelsonic
Copy link
Member Author

nelsonic commented Feb 9, 2023

Working:

image

@nelsonic
Copy link
Member Author

nelsonic commented Feb 9, 2023

Deployed and documented. PR: #16

@nelsonic nelsonic assigned SimonLab and unassigned nelsonic Feb 9, 2023
@nelsonic nelsonic added the awaiting-review An issue or pull request that needs to be reviewed label Feb 9, 2023
@nelsonic nelsonic moved this from 🏗 In progress to ⏳Awaiting Review in dwyl app kanban Feb 9, 2023
SimonLab added a commit that referenced this issue Feb 13, 2023
@SimonLab
Copy link
Member

SimonLab commented Feb 13, 2023

The github action to deploy the application is not properly formatted:
image

list of failing actions: https://github.com/dwyl/elixir-auth-google-demo/actions

The deploy action needs to be indented to be under the jobs section

SimonLab added a commit that referenced this issue Feb 13, 2023
@nelsonic
Copy link
Member Author

Should be fixed now. 👍

@nelsonic
Copy link
Member Author

Fixed by #19

@github-project-automation github-project-automation bot moved this from ⏳Awaiting Review to ✅ Done in dwyl app kanban Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-review An issue or pull request that needs to be reviewed chore a tedious but necessary task often paying technical debt discuss Share your constructive thoughts on how to make progress with this issue enhancement New feature or enhancement of existing functionality good first issue Good for newcomers help wanted If you can help make progress with this issue, please comment! priority-3 Third priority. Considered "Nice to Have". Not urgent. T25m Time Estimate 25 Minutes technical A technical issue that requires understanding of the code, infrastructure or dependencies
Projects
Status: Done
Development

No branches or pull requests

2 participants