now change crabserver(cache/taskworker) and wcore version as needed/usual
vim crabserver.spec
build and upload (before uploading RPMs, make sure that you are subscribed to cms-comp-devs e group which will give you required permissions to upload it)
cd /build/belforte
pkgtools/cmsBuild -c cmsdist --repository comp -a slc7_amd64_gcc630 --builders 8 -j 5 --work-dir w build comp
pkgtools/cmsBuild -c cmsdist --repository comp -a slc7_amd64_gcc630 --builders 8 -j 5 --work-dir w --upload-user=$USER upload comp
note the HG version and crabserver etc. version in the rpms
2. Use build.sh script that will build, push, delete image
run script
CMSK8STAG=v3.210301 ./build.sh "crabserver"
However, be aware that if you use this script, image will be build and uploaded to cmssw DH account. If you want to upload to your private repo, you have to do it manually.
check with e.g.
docker images
docker inspect sbelforte/crabserver:v3.210301
docker inspect <IMAGE ID> # where <IMAGE ID> is from docker images output
docker run --rm -h `hostname -f` -v /tmp:/tmp -i -t sbelforte/crabserver:v3.210301 /bin/bash
the latter command logs you in the container and where can examine the /data/srv tree
Cluster number 2 is dedicated for and should be used by CRAB team. Depending on which cluster you want to access, you will use different KUBECONFIG value.
Access to the cluster
kubernetes tools are deployed at CERN on CC8 machines
ssh lxplus8
setup OpenStack Project, OS_TOKEN and cluster's OpensStack confing as per Valentin's instructions. I.e. via
service/crabserver created
configmap/crabserver created
deployment.apps/crabserver created
Restart crabserver pod
Or, better stated, how to restart all pods which run a given service, i.e. a Deployment (see yaml files) which may
indicate several pods running the same service for load share/balance
If no change to yaml file is needed, use this trick from https://medium.com/faun/how-to-restart-kubernetes-pod-7c702ca984c1 :
kubectl -n crab scale deployment crabserver --replicas=0
# followed later by
kubectl -n crab scale deployment crabserver --replicas=1 # or whatever
e.g.
belforte@lxplus735/services> kubectl -n crab get pod
NAME READY STATUS RESTARTS AGE
crabcache-686d5b9ffc-q47lq 1/1 Running 0 2d10h
crabserver-85688cfbdb-pd4kl 1/1 Running 0 2d10h
cron-proxy-1587773100-gmcpc 0/1 Completed 0 2d21h
cron-proxy-1587859500-h96m7 0/1 Completed 0 45h
cron-proxy-1587945900-drmg5 0/1 Completed 0 21h
belforte@lxplus735/services>
belforte@lxplus735/services> kubectl -n crab scale deployment crabserver --replicas=0
deployment.apps/crabserver scaled
belforte@lxplus735/services> kubectl -n crab get pod
NAME READY STATUS RESTARTS AGE
crabcache-686d5b9ffc-q47lq 1/1 Running 0 2d10h
crabserver-85688cfbdb-pd4kl 1/1 Terminating 0 2d10h
cron-proxy-1587773100-gmcpc 0/1 Completed 0 2d21h
cron-proxy-1587859500-h96m7 0/1 Completed 0 45h
cron-proxy-1587945900-drmg5 0/1 Completed 0 21h
belforte@lxplus735/services>
# after a minute or so
belforte@lxplus735/services>
belforte@lxplus735/services> kubectl -n crab get pod
NAME READY STATUS RESTARTS AGE
crabcache-686d5b9ffc-q47lq 1/1 Running 0 2d10h
cron-proxy-1587773100-gmcpc 0/1 Completed 0 2d21h
cron-proxy-1587859500-h96m7 0/1 Completed 0 45h
cron-proxy-1587945900-drmg5 0/1 Completed 0 21h
belforte@lxplus735/services>
belforte@lxplus735/services> kubectl -n crab scale deployment crabserver --replicas=1
deployment.apps/crabserver scaled
belforte@lxplus735/services> kubectl -n crab get pod
NAME READY STATUS RESTARTS AGE
crabcache-686d5b9ffc-q47lq 1/1 Running 0 2d10h
crabserver-85688cfbdb-hmjjm 1/1 Running 0 6s
cron-proxy-1587773100-gmcpc 0/1 Completed 0 2d21h
cron-proxy-1587859500-h96m7 0/1 Completed 0 45h
cron-proxy-1587945900-drmg5 0/1 Completed 0 21h
belforte@lxplus735/services>