From a64b411ad46451355f608103340e68a454828d14 Mon Sep 17 00:00:00 2001 From: Ahmed Bilal Khalid Date: Fri, 30 Aug 2019 22:21:56 +0500 Subject: [PATCH] a --- .gitignore | 1 + _not_working_etcd.sh | 39 ----------------------- app/__pycache__/api.cpython-37.pyc | Bin 1783 -> 0 bytes app/__pycache__/ceph.cpython-37.pyc | Bin 988 -> 0 bytes app/__pycache__/file.cpython-37.pyc | Bin 1402 -> 0 bytes app/__pycache__/helper.cpython-37.pyc | Bin 4774 -> 0 bytes app/__pycache__/host.cpython-37.pyc | Bin 1569 -> 0 bytes app/__pycache__/image.cpython-37.pyc | Bin 1338 -> 0 bytes app/__pycache__/scheduler.cpython-37.pyc | Bin 1529 -> 0 bytes app/abk.py | 33 ------------------- app/ceph.py | 28 ---------------- ceph_batch_cmd | 2 -- init.sh | 3 +- requirements.txt | 0 14 files changed, 3 insertions(+), 103 deletions(-) create mode 100644 .gitignore delete mode 100644 _not_working_etcd.sh delete mode 100644 app/__pycache__/api.cpython-37.pyc delete mode 100644 app/__pycache__/ceph.cpython-37.pyc delete mode 100644 app/__pycache__/file.cpython-37.pyc delete mode 100644 app/__pycache__/helper.cpython-37.pyc delete mode 100644 app/__pycache__/host.cpython-37.pyc delete mode 100644 app/__pycache__/image.cpython-37.pyc delete mode 100644 app/__pycache__/scheduler.cpython-37.pyc delete mode 100644 app/abk.py delete mode 100644 app/ceph.py delete mode 100644 ceph_batch_cmd delete mode 100644 requirements.txt diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..600d2d3 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.vscode \ No newline at end of file diff --git a/_not_working_etcd.sh b/_not_working_etcd.sh deleted file mode 100644 index af0360e..0000000 --- a/_not_working_etcd.sh +++ /dev/null @@ -1,39 +0,0 @@ -#/bin/sh - -if [ $# -lt 2 ]; then - echo "Insufficient Args" - echo "Please pass IPv6 address like [2a0a:e5c0:0:2:0:b3ff:fe39:7994] and password of root" - exit 1 -fi - -# Enable Alpine (3.10 + Edge) Repos -cat > /etc/apk/repositories << EOF -http://dl-cdn.alpinelinux.org/alpine/v3.10/main -http://dl-cdn.alpinelinux.org/alpine/v3.10/community -http://dl-cdn.alpinelinux.org/alpine/edge/main -http://dl-cdn.alpinelinux.org/alpine/edge/community -http://dl-cdn.alpinelinux.org/alpine/edge/testing -EOF - - -# Update Package List and Upgrade System -apk update -apk upgrade - -apk add etcd etcd-ctl - -sed -i -e "s/localhost/$1/g" /etc/etcd/conf.yml - -# Should be made better -sed -i -e "s/initial-cluster:/initial-cluster: http:\/\/$1:2380/g" /etc/etcd/conf.yml - -echo 'alias etcdctl="ETCDCTL_API=3 etcdctl"' >> ~/.bashrc -source ~/.bashrc - -service etcd start -rc-update add etcd - - -etcdctl --endpoints http://$1:2379 user add root:$2 -etcdctl --endpoints http://$1:2379 user grant-role root root -etcdctl --endpoints http://$1:2379 auth enable diff --git a/app/__pycache__/api.cpython-37.pyc b/app/__pycache__/api.cpython-37.pyc deleted file mode 100644 index 776cdf83aa2606b284b78391849fbdcf6b873b5a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1783 zcma)7OK;;g5Ek{YWZ90L*S1)oKv3+(2U{pw^ib4A(~a96@B61@+dax9= z#tO=5d-X3U7Ko4iGyMTN^wLxRLQfr1cI*vWpcFX#X80No=cB&sbZiAmvLC$CEJgWK zD67%|@GaEr4-iZ-EUTn$<^(qqFl;)dIZP1lSq*NU5NGqznjZn-U_ z5aqtTP_TyeUzB&q?U2s>7B&`$DAO)(U=v$&RpRCbwl{EV1GfR2xHH$}jIE8H?gsAR zZM=hb=NjI_hS>G-=k_qVRQmgW!5Nj)zF8T5lqRHV%Vy%IahxXAPOTB{trm z{-&@dXlwDe;{<6;oS39D=ZIvtJf)7GV&dfBXpRRN;W>4{PpILLzO6K9x5ct52t{Qr zkd+~a6^+4wdOW!5qsn6B=R9Nt7p=j-%Xu(KyqG*F8G)YmvWF2bii_@GAi>0oqI5=Z zU#+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37.pyc b/app/__pycache__/host.cpython-37.pyc deleted file mode 100644 index 5ec91e0797637de003492ab520dc9d329ba9ff6b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1569 zcma)6%WmXE6m^x~Zuesb291VI7PGNLw+A7yKm-Ak88#?0nhZj+gj$ZP6uaXWRpo?O z4jb6!3(!d2Oa6f`sVyshffcvxbf<}gL|Jv}+^XyA>-(s$$74@}!5^hRh?7GC5bjcV)BMk6{g ze${?Kkx%{gn3x+xwbg`J#3s%S?zy|iJ>Vna-{}3xc<*Gg$EO1)Gh!;+`%g3_=tK)1 z`~`oY9S4>)le{Xa^!sI*R7Fvh^5Gy+k&xvji|d*)>3@@nS3qKsfyVT8R@3t0Ze#p1 z%jr%`l=w_GM{svE*nl+85eXb zpVOp<=|=}YhYQdSGqPkn4lwhTc_XEH{qGk!Z@u}v4_3qSc6!U} znDfhukp#-9A1>esW*-YxLPA@kPTL>^rF3lxyw(Zstlyw0-su~3Z4;wIAekKov^pKo z?hHVuGXdRqqid(LSB5ZGme5xA+UYFfZE)w1(T$F@{tT~l*!9Wy-p*v$5$?*{y*u6D z9iNfuMkfz$@U5NE$_G0SmE7m>z2nxsP0dBo2B{D=|19iNwrI+;oMuV7NYZf2=XGuRYQ zN4izLWRy3#V5$M{+L);#XR68{!Q@W?G{?gRHqgX)Y8&XWZXg3;WNPkhpC6QKD qt6Qu0YtPsI22u`7=kuZ>O-{d1cNKpO;Gq7&2j0wdkPpwK$A18(+OVbo diff --git a/app/__pycache__/image.cpython-37.pyc b/app/__pycache__/image.cpython-37.pyc deleted file mode 100644 index 3b12569700d405e05c860d38293c2b94245d15c7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1338 zcmZ`&&5PVN6qn?0&&XKFgDn5@eHd4gbp3TZgCNHO0xq`i^Q^9EC&t}W0VhfrIjk^eIku~EzE~Bd2a6x13 zs~*}*4^|hzUjQW9;uh^NhRR->l57o1TJsO6)q7)yuPth}7EMILTl=6H-VluBfR5Jlg?=7nU1Y##jYlTng0x=gbu3v^K)9(Xq;;s~;?45-o+cepvxM}k;@ z(P&u(f^(^G)Qs;3pL_TBGp3W~v&re{r0j?~5p^*s-^zp+lRQcbpwD!q2(O?45+H+s zE=EGLNEs2O!qLduh*YxveRIvzLfBgEq(vp8EK??j9#HlQyxGvH+aGif{8H|LU24>! z1GkhXSjiVflr!b=av@k%XHsY$ht58#+r|)@ePRIO9<1t95Xkn4NlbiXd}5kdFB22& z8pp;EPsh5Y)A+UWt9n@q9!M&S{;oN4nuF{iKUwl8Jw8xp>&k{{ZSNVUz#> diff --git a/app/__pycache__/scheduler.cpython-37.pyc b/app/__pycache__/scheduler.cpython-37.pyc deleted file mode 100644 index b6a96067081da5026bd4e3828f5c4f2f07ddd8a9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1529 zcma)6&5qAvmBN1nkT%NH81gC>(Ek4A`FBq(P5VPB zo2FJihQWUWK{SGLEn3egLcNY7+|PQX!;EvIFe9_DBCD_?yKo|>a3ijc6YG1g9kf!xPwP)Ovc1io_BjRA?Q@|Cx1fx z+M#brGs&xx%3(jvld34HQr=%{R3v16$>O@EOb(xB;s`)2GT1RW&T3k|yfuuTWI5fc ziE_Vb2*6_)+yFr|I36ATsxb$&Tk+TXVOkY5ENFEZ?o<9kRCSnCgoX_S(~y8u(bOTt z67nRaq{%6p)vu(x)u!qQ3_`<9)k&KDC#@9(bu7{|A4!MN@0*NK(hh>)WihWAeV+Z$ zj)EYqxY(%EAW-}0t;Gw1J{Jwk+sO^CW6m!tMiSsi-&~Lb82zvQ4nSy2)M+b(fG1a$ zz)PLr&iWZD{#sw5E1MV{0?q6&NUPI9+MNN?=}eIB>%o=N*$YFM3rlDVd+Br*@m9EV z$lzK>TEB)DI#`EfbjLDYTZFstw%<-xc#EfGveL=DYkcEpuo!}$`%3Ri^u}R3-DG}~ z@77O+sQHIsUzk}_UgR`O(pi#*8ywWld7dRgRh<)>{vYS;Oz1K{MpGDd+lV6k3Ts*{pRRoe@`M0Tms{KEDcpoX(v@FXertc z{&!I8|G6Q#kJ%WCBz0BPcmLBzoEDUvXL+25iURL#@5AVhddIocIZLEYxbRVbkUx^R z;&9(mk}+n&(M*w5>M-_$nV{>aj761|(&A|&vRpbzRlgF9Ql`iz?X2V?&U4@G zH%IQ4%F$ql$kF)UG?vbW#Ig^5zM-&m8Lg{%85dN#RXt~vH@RRF731wKRs3d(;BUd; z4?$>-hYf6?vGLG0&;#8-2ExeM&QtUz_NVHJ$&we+ diff --git a/app/abk.py b/app/abk.py deleted file mode 100644 index ceb8973..0000000 --- a/app/abk.py +++ /dev/null @@ -1,33 +0,0 @@ -import subprocess -import os - -from pipfile import Pipfile - - -def globally_installed_py_packages(): - output = subprocess.check_output("pip list --format freeze".split(), env={}) - output = output.decode("utf-8") - output = output.strip() - global_packages = output.split("\n") - return global_packages - - -global_packages = globally_installed_py_packages() - -name = "cow" -p = Pipfile.load(filename=name) -content = "" -with open(name, "r") as f: - content = f.read() - -for pip_package in p.data["default"]: - version = p.data["default"][pip_package] - if version == "*": - for package in global_packages: - package = package.lower() - if package.startswith(pip_package.lower()): - substr = f'{pip_package} = "*"' - content = content.replace(substr, package) - -with open(name, "w") as f: - f.write(content) \ No newline at end of file diff --git a/app/ceph.py b/app/ceph.py deleted file mode 100644 index 02df750..0000000 --- a/app/ceph.py +++ /dev/null @@ -1,28 +0,0 @@ -import click -import os -import subprocess - - -@click.group() -def ceph(): - pass - - -@ceph.command("setup") -@click.option("--ceph_url", required=True) -@click.option("--ssh_username", required=True) -def setup(ceph_url, ssh_username): - try: - os.makedirs("/etc/ceph", exist_ok=True) - command = f"sftp -b ./ceph_batch_cmd {ssh_username}@{ceph_url}:/etc/ceph" - subprocess.check_output(command.split()) - except Exception: - p = subprocess.check_output(f"ssh-keyscan {ceph_url}".split()) - keys = p.decode("utf-8").strip().split("\n") - keys = "\n".join(keys) - with open(os.path.expanduser("~/.ssh/known_hosts"), "a") as known_hosts: - known_hosts.write(keys) - - os.makedirs("/etc/ceph", exist_ok=True) - command = f"sftp -b ./ceph_batch_cmd {ssh_username}@{ceph_url}:/etc/ceph" - subprocess.check_output(command.split()) diff --git a/ceph_batch_cmd b/ceph_batch_cmd deleted file mode 100644 index 6019f51..0000000 --- a/ceph_batch_cmd +++ /dev/null @@ -1,2 +0,0 @@ -lcd /etc/ceph -get * \ No newline at end of file diff --git a/init.sh b/init.sh index be5f388..65227a2 100644 --- a/init.sh +++ b/init.sh @@ -18,7 +18,8 @@ apk add python3 ceph py2-pip py3-pip # Some python package dependencies apk add libffi-dev openssl-dev make alpine-sdk gcc g++ python3-dev -apk add py3-grpcio +apk add py3-grpcio py3-protobuf + pip3 install --upgrade pip pip2 install --upgrade pip diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index e69de29..0000000