Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qg-dockerfiles
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QA
qg-dockerfiles
Commits
3fd34f79
Commit
3fd34f79
authored
Mar 20, 2018
by
kalvin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init_container
parent
b0cf1c71
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
0 deletions
+40
-0
Dockerfile
baseimg/init_container/Dockerfile
+8
-0
checker.py
baseimg/init_container/checker.py
+32
-0
No files found.
baseimg/init_container/Dockerfile
0 → 100644
View file @
3fd34f79
FROM
192.168.4.36/baseimg/python:latest
USER
root
WORKDIR
/home/quant_group
COPY
checker.py .
RUN
chmod
+x ./docker-entrypoint.sh
CMD
["python", "-c", "checker.py"]
\ No newline at end of file
baseimg/init_container/checker.py
0 → 100644
View file @
3fd34f79
import
requests
import
time
import
json
def
check
():
url
=
"http://192.168.29.116:9001/api/etcd/get_env_job_status"
querystring
=
{
"namespace"
:
"0zhangbo"
}
headers
=
{}
response
=
requests
.
request
(
"GET"
,
url
,
headers
=
headers
,
params
=
querystring
)
return
json
.
loads
(
response
.
text
)
count
=
0
all_job_is_done
=
False
while
True
:
res
=
check
()
for
instance
in
res
[
"details"
][
"instances"
]:
db_sync
=
instance
[
"db_sync"
]
rabbitmq_sync
=
instance
[
"rabbitmq_sync"
]
if
db_sync
==
"done"
and
rabbitmq_sync
==
"done"
:
print
"All of the sync job is done!"
all_job_is_done
=
True
else
:
print
"db_sync is:"
+
db_sync
print
"rabbitmq_sync is:"
+
rabbitmq_sync
time
.
sleep
(
2
)
if
count
==
120
or
all_job_is_done
:
break
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment