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 776cdf8..0000000 Binary files a/app/__pycache__/api.cpython-37.pyc and /dev/null differ diff --git a/app/__pycache__/ceph.cpython-37.pyc b/app/__pycache__/ceph.cpython-37.pyc deleted file mode 100644 index e2ac3e5..0000000 Binary files a/app/__pycache__/ceph.cpython-37.pyc and /dev/null differ diff --git a/app/__pycache__/file.cpython-37.pyc b/app/__pycache__/file.cpython-37.pyc deleted file mode 100644 index 0c37018..0000000 Binary files a/app/__pycache__/file.cpython-37.pyc and /dev/null differ diff --git a/app/__pycache__/helper.cpython-37.pyc b/app/__pycache__/helper.cpython-37.pyc deleted file mode 100644 index 1be7644..0000000 Binary files a/app/__pycache__/helper.cpython-37.pyc and /dev/null differ diff --git a/app/__pycache__/host.cpython-37.pyc b/app/__pycache__/host.cpython-37.pyc deleted file mode 100644 index 5ec91e0..0000000 Binary files a/app/__pycache__/host.cpython-37.pyc and /dev/null differ diff --git a/app/__pycache__/image.cpython-37.pyc b/app/__pycache__/image.cpython-37.pyc deleted file mode 100644 index 3b12569..0000000 Binary files a/app/__pycache__/image.cpython-37.pyc and /dev/null differ diff --git a/app/__pycache__/scheduler.cpython-37.pyc b/app/__pycache__/scheduler.cpython-37.pyc deleted file mode 100644 index b6a9606..0000000 Binary files a/app/__pycache__/scheduler.cpython-37.pyc and /dev/null differ 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