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

Dev server running in docker #67

Merged
merged 15 commits into from
Apr 8, 2022
Merged

Dev server running in docker #67

merged 15 commits into from
Apr 8, 2022

Conversation

stuartc
Copy link
Member

@stuartc stuartc commented Apr 5, 2022

Closes #52

See here for the README changes with Docker instructions.

@stuartc stuartc self-assigned this Apr 5, 2022
@codecov
Copy link

codecov bot commented Apr 5, 2022

Codecov Report

Merging #67 (f3f9ff5) into main (0905aa0) will increase coverage by 0.77%.
The diff coverage is 80.00%.

@@            Coverage Diff             @@
##             main      #67      +/-   ##
==========================================
+ Coverage   75.91%   76.68%   +0.77%     
==========================================
  Files          50       50              
  Lines         411      386      -25     
==========================================
- Hits          312      296      -16     
+ Misses         99       90       -9     
Impacted Files Coverage Δ
lib/lightning/users/user.ex 100.00% <ø> (ø)
lib/lightning_web/live/user_live/form_component.ex 83.33% <ø> (-1.29%) ⬇️
lib/lightning_web/live/user_live/index.ex 88.88% <ø> (ø)
lib/lightning_web/live/user_live/show.ex 0.00% <ø> (ø)
lib/lightning/runner.ex 90.32% <66.66%> (-2.79%) ⬇️
lib/lightning/adaptor_registry.ex 77.08% <100.00%> (ø)
lib/lightning/repo.ex 100.00% <100.00%> (ø)
lib/lightning_web/router.ex

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0905aa0...f3f9ff5. Read the comment docs.

@stuartc stuartc mentioned this pull request Apr 6, 2022
5 tasks
@stuartc
Copy link
Member Author

stuartc commented Apr 6, 2022

I think we need to exclude both router.ex and release.ex from coveralls, I've seen other projects do the same.

Copy link
Member

@taylordowns2000 taylordowns2000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, but I'm not able to get up and running via the Readme. I get this on my first and second attempt:

~/lightning docker-dev ❯ docker compose up                              4m 37s erl 24.2.1 elixir 1.13.2-otp-24 07:55:58
[+] Running 2/0
 ⠿ Container lightning-postgres-1  Running                                                                         0.0s
 ⠿ Container lightning-web-1       Created                                                                         0.1s
Attaching to lightning-postgres-1, lightning-web-1
lightning-web-1       | Interactive Elixir (1.13.3) - press Ctrl+C to exit (type h() ENTER for help)
lightning-web-1 exited with code 0
^CGracefully stopping... (press Ctrl+C again to force)
[+] Running 4/4
 ⠿ Container lightning_web_run_41743a2aa9ab  Stopped                                                               0.0s
 ⠿ Container lightning-web-1                 Stopped                                                               0.0s
 ⠿ Container lightning_web_run_fb96305976f4  Stopped                                                               0.0s
 ⠿ Container lightning-postgres-1            Stopped                                                               0.1s
canceled
~/lightning docker-dev ❯ docker compose up                           ✘ INT 15s erl 24.2.1 elixir 1.13.2-otp-24 07:56:59
[+] Running 2/0
 ⠿ Container lightning-postgres-1  Created                                                                         0.0s
 ⠿ Container lightning-web-1       Created                                                                         0.0s
Attaching to lightning-postgres-1, lightning-web-1
lightning-postgres-1  | 
lightning-postgres-1  | PostgreSQL Database directory appears to contain a database; Skipping initialization
lightning-postgres-1  | 
lightning-postgres-1  | 2022-04-06 06:57:01.118 UTC [1] LOG:  starting PostgreSQL 14.2 on aarch64-unknown-linux-musl, compiled by gcc (Alpine 10.3.1_git20211027) 10.3.1 20211027, 64-bit
lightning-postgres-1  | 2022-04-06 06:57:01.118 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
lightning-postgres-1  | 2022-04-06 06:57:01.118 UTC [1] LOG:  listening on IPv6 address "::", port 5432
lightning-postgres-1  | 2022-04-06 06:57:01.120 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
lightning-postgres-1  | 2022-04-06 06:57:01.125 UTC [22] LOG:  database system was shut down at 2022-04-06 06:56:59 UTC
lightning-postgres-1  | 2022-04-06 06:57:01.129 UTC [1] LOG:  database system is ready to accept connections
lightning-web-1       | Interactive Elixir (1.13.3) - press Ctrl+C to exit (type h() ENTER for help)
lightning-web-1 exited with code 0

Any thoughts on this?

- Added PORT and LIGHTNING_LISTEN_ADDRESS env vars to `runtime.exs`
This causes the container to start without deps and priv/openfn causing
it to fail unless the local copy has already been set up.

Also on startup try and install the runtime deps (priv/openfn) when the
folder can't be found.
- Exclude router.ex and release.ex from code coverage
stuartc and others added 4 commits April 7, 2022 12:13
Added a tip onto README for removing extra local files
Without `runtime.exs` the port binding to `0.0.0.0` doesn't work,
causing the docker container instance of the server to be unreachable
from outside.

Credentials are optional right now for a Job, don't expect one when
running a Job.

Defaulted a Run's log to `[]`, for some reason I was getting errors when
rendering a log should afaik have a log list.
@taylordowns2000 taylordowns2000 merged commit 6fae68c into main Apr 8, 2022
@taylordowns2000 taylordowns2000 deleted the docker-dev branch April 8, 2022 09:14
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

Successfully merging this pull request may close these issues.

Dockerize without elixir releases
2 participants