-
Notifications
You must be signed in to change notification settings - Fork 18
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
Tickets/dm 17656 #508
base: u/jgates/loader
Are you sure you want to change the base?
Tickets/dm 17656 #508
Changes from all commits
24fdf1c
8657cc9
e3723a2
757bdf6
64d7678
1747b79
c650198
17875a5
b5c56c2
f13a1c6
6fe9cf8
263e92f
6d5e162
9b170d2
7d8db62
7d012c9
9307c28
bf2bce5
e147bcd
7cec788
ab197f9
2613224
e22c5d0
b000de0
fc9d1c7
02fba9e
51739ae
b0be4f6
e2891ea
868aace
25acfd4
cba467b
08c935c
8967fbe
da3cf79
840b269
6c5f8cb
4ab5a48
e8aacb9
f7d221e
78732ce
62ea94c
77de954
9425a12
b40ec85
8401c78
1dcfe00
af3d654
fd8af34
379d435
6b5fb97
020a427
2810e62
2473845
378ec47
f2db0e3
4bc3338
479f6fb
8526688
5bd2f76
c01cf16
7f938ff
1ebebe5
ff13cbd
d00a31e
b8348f0
126835d
131a5e4
844c391
38c07c9
04e2a09
70730c3
d839ad4
ab69c00
a0c3a70
49d1c0e
aefa5a6
b062471
c95a543
0a40045
e7c2513
9a95c3e
15c7689
2358c35
364d629
ac60356
36da2ce
4752dc7
865b44c
2ed287e
0b100c5
a35dda8
16a53d2
dd92d7f
8e1e1de
2138a67
d6f9a49
4defa29
b1b0d2d
ccd0bcc
a01379b
914341a
58f783e
ee9ebde
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# | ||
# Configuration file for log4cxx | ||
# can be used for unit test | ||
# by launching next command before unit tests: | ||
# export LSST_LOG_CONFIG=$HOME/.lsst/log4cxx.unittest.properties | ||
# | ||
|
||
log4j.rootLogger=INFO, CONSOLE | ||
#log4j.rootLogger=DEBUG, CONSOLE | ||
#log4j.rootLogger=WARN, CONSOLE | ||
|
||
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender | ||
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout | ||
#log4j.appender.CONSOLE.layout.ConversionPattern=[%d{yyyy-MM-ddTHH:mm:ss.SSSZ}] [%t] %-5p %c{2} (%F:%L) - %m%n | ||
log4j.appender.CONSOLE.layout.ConversionPattern=[%d{ddTHH:mm:ss.SSSZ}] [%t] %-5p %c{2} (%F:%L) - %m%n | ||
|
||
# Tune log at the module level | ||
#log4j.logger.lsst.qserv.util=DEBUG |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# | ||
# Configuration file for log4cxx | ||
# can be used for unit test | ||
# by launching next command before unit tests: | ||
# export LSST_LOG_CONFIG=$HOME/.lsst/log4cxx.unittest.properties | ||
# | ||
|
||
#log4j.rootLogger=INFO, CONSOLE | ||
log4j.rootLogger=DEBUG, CONSOLE | ||
#log4j.rootLogger=WARN, CONSOLE | ||
|
||
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender | ||
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout | ||
#log4j.appender.CONSOLE.layout.ConversionPattern=[%d{yyyy-MM-ddTHH:mm:ss.SSSZ}] [%t] %-5p %c{2} (%F:%L) - %m%n | ||
log4j.appender.CONSOLE.layout.ConversionPattern=[%d{ddTHH:mm:ss.SSSZ}] [%t] %-5p %c{2} (%F:%L) - %m%n | ||
|
||
# Tune log at the module level | ||
#log4j.logger.lsst.qserv.util=DEBUG |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Invoking the following command from the qserv directory should build and push the containers and is | ||
useful for breaking the build into smaller commands when there are problems. | ||
|
||
It helps to do a "rm -rf bin share build" before running as docker copies everything in | ||
the qserv directory and includes it in the base container. This saves a couple of GB | ||
in both the initial copy and pushing the containers. | ||
|
||
|
||
docker build -f admin/tools/docker/index/container/dev/Dockerfile -t qserv/indexbase:dev . && \ | ||
cd admin/tools/docker/index/container/dev/worker/ && docker build -t qserv/indexworker:dev . && \ | ||
cd ../master/ && docker build -t qserv/indexmaster:dev . && \ | ||
cd ../clientNum/ && docker build -t qserv/indexclientnum:dev . && \ | ||
cd ../../../../../../../../qserv | ||
docker push qserv/indexmaster:dev && docker push qserv/indexworker:dev && docker push qserv/indexclientnum:dev | ||
|
||
|
||
Useful kubernetes commands: | ||
kubectl apply -f admin/tools/docker/index/index-k8-m.yaml | ||
kubectl delete -f admin/tools/docker/index/index-k8-m.yaml | ||
kubectl get pods | ||
kubectl logs -f imaster-sts-0 | grep -i keycount | ||
kubectl logs -f iclientnum2-sts-0 | egrep "DONE|INSERT|LOOK" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#! /bin/bash | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would also recommend adding:
to this and all other shell scripts. This will terminate the on errors and prevent unreliable results. See more on tis at: |
||
|
||
set -e | ||
|
||
# qserv/admin/tools/docker/loader/container/buildContainers.bash | ||
# cd back to base qserv directory as the Dockerfile COPY needs the entire project | ||
# in the docker context. | ||
cd ../../../../../../qserv | ||
docker build -f admin/tools/docker/index/container/dev/Dockerfile -t qserv/indexbase:dev . | ||
|
||
# go to individual directories to minimize the size of docker's context copy | ||
# worker | ||
cd admin/tools/docker/index/container/dev/worker/ && docker build -t qserv/indexworker:dev . | ||
#docker build -f admin/tools/docker/index/container/dev/worker/Dockerfile -t qserv/indexworker:dev . | ||
|
||
# master | ||
cd ../master/ && docker build -t qserv/indexmaster:dev . | ||
#docker build -f admin/tools/docker/index/container/dev/master/Dockerfile -t qserv/indexmaster:dev . | ||
|
||
# clientNum | ||
cd ../clientNum/ && docker build -t qserv/indexclientnum:dev . | ||
#docker build -f admin/tools/docker/index/container/dev/clientNum/Dockerfile -t qserv/indexclientnum:dev . | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# docker build -f admin/tools/docker/index/container/dev/Dockerfile -t qserv/indexbase:dev . | ||
# | ||
# Using the development toolchain | ||
|
||
FROM qserv/qserv:dev | ||
|
||
USER 0 | ||
|
||
#RUN mv /usr/bin/sh /usr/bin/sh.old && ln -s /usr/bin/bash /usr/bin/sh | ||
RUN yum update --assumeyes && yum install --assumeyes bind-utils gdb screen | ||
|
||
USER 1000 | ||
|
||
RUN mkdir /home/qserv/dev/ && \ | ||
chown -R qserv:qserv /home/qserv | ||
|
||
COPY --chown=qserv:qserv . /home/qserv/dev/qserv | ||
|
||
RUN bash -lc "rm -rf /home/qserv/dev/qserv/build /home/qserv/dev/qserv/share /home/qserv/dev/qserv/bin && \ | ||
cd /qserv/stack/ && source ./loadLSST.bash && \ | ||
cd /home/qserv/dev/qserv && setup -r . -t qserv-dev && \ | ||
printenv && \ | ||
scons -j10 install && \ | ||
mkdir -p /home/qserv/run && \ | ||
qserv-configure.py --all -R /home/qserv/run" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's a point in building a separate binary container for each tool (
I think you may just add the name of a script/binary as an extra argument in the Kubernetes YAML file:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It made the yaml scripts easier to write and get working (which was not easy) and an actual instance of the system would not have the client apps, as they are only for testing. It would make sense to eventually trim down the containers so they only contain what they really need. |
||
# | ||
# cd ~/work/qserv/admin/tools/docker/index/container/dev/clientNum | ||
# docker build -t qserv/indexclientnum:dev . | ||
FROM qserv/indexbase:dev | ||
|
||
USER 0 | ||
|
||
RUN yum update --assumeyes && yum install --assumeyes bind-utils | ||
|
||
USER 1000 | ||
|
||
ENTRYPOINT ["/home/qserv/dev/qserv/admin/tools/docker/index/container/dev/clientNum/appClientNum.bash"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#! /bin/bash -l | ||
# admin/tools/docker/loader/container/dev/clientNum/appClientNum.bash | ||
|
||
_term() { | ||
echo "Caught SIGTERM signal!" | ||
kill -TERM "$child" 2>/dev/null | ||
} | ||
|
||
trap _term SIGTERM | ||
trap _term SIGKILL | ||
|
||
source /qserv/stack/loadLSST.bash | ||
cd /home/qserv/dev/qserv | ||
setup -r . -t qserv-dev | ||
|
||
export LSST_LOG_CONFIG=/home/qserv/dev/qserv/admin/templates/configuration/etc/log4cxx.index.properties | ||
|
||
echo appClientNum $1 $2 $3 | ||
|
||
/home/qserv/dev/qserv/build/loader/appClientNum $1 $2 /home/qserv/dev/qserv/core/modules/loader/config/$3 | ||
|
||
child=$! | ||
wait "$child" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why this is needed here? I don't see anything above which would be launching a detached process. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe Kubernetes or microk8s wasn't able to kill these containers until all this was added. They'd get stuck terminating the pods. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#! /bin/bash -l | ||
# admin/tools/docker/loader/container/dev/clientNum/appClientNumScreen.bash | ||
|
||
echo appClientScreen $1 $2 $3 | ||
|
||
screen -dm /home/qserv/dev/qserv/admin/tools/docker/index/container/dev/clientNum/appClientNum $1 $2 $3 | ||
|
||
|
||
tail -f /dev/null |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Run the following build command from the qserv base directory (could be ~/work/qserv or ~/development/qserv) | ||
# The COPY command can only access files below $PWD in the file tree. | ||
# cd ~/work/qserv/admin/tools/docker/index/container/dev/master | ||
# docker build -t qserv/indexmaster:dev . | ||
FROM qserv/indexbase:dev | ||
|
||
USER 0 | ||
|
||
RUN yum update --assumeyes && yum install --assumeyes bind-utils | ||
|
||
USER 1000 | ||
|
||
ENTRYPOINT ["/home/qserv/dev/qserv/admin/tools/docker/index/container/dev/master/appMaster.bash"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#! /bin/bash -l | ||
# admin/tools/docker/loader/container/dev/master/appMaster.bash | ||
|
||
_term() { | ||
echo "Caught SIGTERM signal!" | ||
kill -TERM "$child" 2>/dev/null | ||
} | ||
|
||
trap _term SIGTERM | ||
trap _term SIGKILL | ||
|
||
source /qserv/stack/loadLSST.bash | ||
cd /home/qserv/dev/qserv | ||
setup -r . -t qserv-dev | ||
|
||
export LSST_LOG_CONFIG=/home/qserv/dev/qserv/admin/templates/configuration/etc/log4cxx.index_master.properties | ||
|
||
/home/qserv/dev/qserv/build/loader/appMaster /home/qserv/dev/qserv/core/modules/loader/config/master.cnf | ||
|
||
child=$! | ||
echo "child ${child}" | ||
wait "$child" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why this is needed here? I don't see anything above which would be launching a detached process. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# | ||
# | ||
# cd ~/work/qserv/admin/tools/docker/index/container/dev/worker | ||
# docker build -t qserv/indexworker:dev . | ||
FROM qserv/indexbase:dev | ||
|
||
USER 0 | ||
|
||
RUN yum update --assumeyes && yum install --assumeyes bind-utils | ||
|
||
USER 1000 | ||
|
||
ENTRYPOINT ["/home/qserv/dev/qserv/admin/tools/docker/index/container/dev/worker/appWorker.bash"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#! /bin/bash | ||
# admin/tools/docker/loader/container/dev/worker/appWorker.bash | ||
|
||
_term() { | ||
echo "Caught SIGTERM signal!" | ||
kill -TERM "$child" 2>/dev/null | ||
} | ||
|
||
trap _term SIGTERM | ||
trap _term SIGKILL | ||
|
||
source /qserv/stack/loadLSST.bash | ||
cd /home/qserv/dev/qserv | ||
setup -r . -t qserv-dev | ||
|
||
export LSST_LOG_CONFIG=/home/qserv/dev/qserv/admin/templates/configuration/etc/log4cxx.index.properties | ||
|
||
/home/qserv/dev/qserv/build/loader/appWorker /home/qserv/dev/qserv/core/modules/loader/config/worker-k8s-a.cnf | ||
|
||
child=$! | ||
echo "child ${child}" | ||
wait "$child" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#! /bin/bash | ||
# admin/tools/docker/loader/container/dev/worker/appWorkerScreen.bash | ||
|
||
|
||
screen -dm /home/qserv/dev/qserv/admin/tools/docker/index/container/dev/worker/appWorker.bash | ||
|
||
tail -f /dev/null |
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.
Based on my understanding on what the script does it's supposed to be launched from (
cd <path>
) some specific directory (which is the same one where the script runs. This opens numerous possibilities for making mistakes. I would recommend passing a target folder as a parameter to the script, so that it could be run like:You may get and evaluate a value of the parameter with: