File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ if [ "${1}" == "./bin/rails" ] && [ "${2}" == "server" ]; then
1010 orchestrator:await_healthy[redis,5] \
1111 orchestrator:connect_self
1212
13+ bundle exec orchestrator:debug
14+
1315 # create connection environment variables
1416 eval $( bundle exec rake orchestrator:create_connection_environment[postgresql,redis])
1517 fi
Original file line number Diff line number Diff line change @@ -36,6 +36,10 @@ def healthy?
3636 internal_container . info [ 'State' ] [ 'Status' ] == 'running'
3737 end
3838
39+ def last_ip_number
40+ raise NotImplementedError
41+ end
42+
3943 def self . []( container )
4044 Containers . const_get ( container . capitalize ) . new
4145 end
Original file line number Diff line number Diff line change @@ -39,6 +39,10 @@ def healthy?
3939 super && internal_container . exec ( %w[ pg_isready ] ) . last . zero?
4040 end
4141
42+ def last_ip_number
43+ 4
44+ end
45+
4246 def orchestrator_connection_details
4347 return { } unless healthy?
4448
Original file line number Diff line number Diff line change @@ -28,6 +28,10 @@ def ports
2828 }
2929 end
3030
31+ def last_ip_number
32+ 5
33+ end
34+
3135 def orchestrator_connection_details
3236 return { } unless healthy?
3337
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ def ensure_container_down!(container)
3333 destroy_container! ( container ) unless State [ container . name ] . internal_container . nil?
3434 end
3535
36- private
36+ # private
3737
3838 def ensure_network!
3939 return unless network . nil?
@@ -45,7 +45,10 @@ def ensure_network!
4545 end
4646
4747 def network
48- Docker ::Network . all ( filters : JSON . dump ( { 'label' => [ "#{ ORCHESTRATOR_LABEL_PREFIX } =network" ] } ) ) . first
48+ network_id = Docker ::Network . all ( filters : JSON . dump (
49+ { 'label' => [ "#{ ORCHESTRATOR_LABEL_PREFIX } =network" ] }
50+ ) ) . first . id
51+ Docker ::Network . get ( network_id )
4952 end
5053
5154 def ensure_volumes! ( container )
Original file line number Diff line number Diff line change @@ -86,6 +86,15 @@ namespace :orchestrator do
8686 puts env_variables . map { |key , value | "export #{ key } =#{ value } " } . join ( "\n " )
8787 end
8888
89+ task debug : :build_state do
90+ puts '=====> volumes'
91+ p Sagittarius ::Orchestrator ::State . volumes
92+ puts '=====> containers'
93+ p Sagittarius ::Orchestrator ::State . containers
94+ puts '=====> network'
95+ p Sagittarius ::Orchestrator ::Operator . network
96+ end
97+
8998 if Rails . env . local?
9099 namespace :dev do
91100 task start : :build_state do
You can’t perform that action at this time.
0 commit comments