You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by di...@apache.org on 2023/01/28 08:24:09 UTC

[airavata-mft] branch master updated: Detecting platforms from the cli before installation

This is an automated email from the ASF dual-hosted git repository.

dimuthuupe pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata-mft.git


The following commit(s) were added to refs/heads/master by this push:
     new b52b619  Detecting platforms from the cli before installation
b52b619 is described below

commit b52b6191fdafb9317e37c25a20adb8b9b154f6fb
Author: Dimuthu Wannipurage <di...@gmail.com>
AuthorDate: Sat Jan 28 03:23:59 2023 -0500

    Detecting platforms from the cli before installation
---
 python-cli/mft_cli/airavata_mft_cli/bootstrap.py | 20 +++++++++++++++++---
 python-cli/mft_cli/pyproject.toml                | 10 +++++-----
 2 files changed, 22 insertions(+), 8 deletions(-)

diff --git a/python-cli/mft_cli/airavata_mft_cli/bootstrap.py b/python-cli/mft_cli/airavata_mft_cli/bootstrap.py
index 6bf48fd..e6e9b9e 100644
--- a/python-cli/mft_cli/airavata_mft_cli/bootstrap.py
+++ b/python-cli/mft_cli/airavata_mft_cli/bootstrap.py
@@ -23,6 +23,7 @@ import zipfile
 from subprocess import call
 from subprocess import Popen
 from pathlib import Path
+from sys import platform
 
 def download_and_unarchive(url, download_path, extract_dir = os.path.join(os.path.expanduser('~'), ".mft/")):
 
@@ -62,13 +63,26 @@ def stop_service(bin_path, daemon_script_name):
 def start_mft():
   print("Setting up MFT Services")
 
+  if platform == "linux" or platform == "linux2":
+    consul_url = "https://releases.hashicorp.com/consul/1.7.1/consul_1.7.1_linux_amd64.zip"
+  elif platform == "darwin":
+    consul_url = "https://releases.hashicorp.com/consul/1.7.1/consul_1.7.1_darwin_amd64.zip"
+  elif platform == "win32":
+    print("Windows support is not avialable yet")
+    raise typer.Exit()
+  else:
+    print("Un supported platform: " + platform)
+    raise typer.Exit()
+
+  mft_dir = os.path.join(os.path.expanduser('~'), ".mft")
+  if not os.path.exists(mft_dir):
+    os.makedirs(mft_dir)
+
   path = os.path.join(os.path.expanduser('~'), ".mft/consul")
   if not os.path.exists(path):
-    consul_macos_url = "https://releases.hashicorp.com/consul/1.7.1/consul_1.7.1_darwin_amd64.zip"
-    consul_linux_url = "https://releases.hashicorp.com/consul/1.7.1/consul_1.7.1_linux_amd64.zip"
     print("Downloading Consul...")
     zip_path = os.path.join(os.path.expanduser('~'), ".mft/consul.zip")
-    download_and_unarchive(consul_macos_url, zip_path, os.path.join(os.path.expanduser('~'), ".mft/"))
+    download_and_unarchive(consul_url, zip_path, os.path.join(os.path.expanduser('~'), ".mft/"))
 
   current_dir =  os.getcwd()
   try:
diff --git a/python-cli/mft_cli/pyproject.toml b/python-cli/mft_cli/pyproject.toml
index 149b192..02a6660 100644
--- a/python-cli/mft_cli/pyproject.toml
+++ b/python-cli/mft_cli/pyproject.toml
@@ -18,9 +18,9 @@
 
 [tool.poetry]
 name = "airavata-mft-cli"
-version = "0.1.3"
-description = "Command Line Client for Airavata MFT data transfer framework"
-authors = ["Apache Airavata <dev@apache.airavata.org"]
+version = "0.1.6"
+description = "Command Line Client for Airavata MFT data transfer software"
+authors = ["Apache Airavata <de...@apache.airavata.org>"]
 readme = "README.md"
 
 [tool.poetry.scripts]
@@ -30,8 +30,8 @@ mft = "airavata_mft_cli.main:app"
 python = "^3.10"
 typer = {extras = ["all"], version = "^0.7.0"}
 pick = {version= "2.2.0"}
-grpcio= {version="1.46.3"}
-grpcio-tools = {version="1.46.3"}
+grpcio= {version="^1.46.3"}
+grpcio-tools = {version="^1.46.3"}
 airavata_mft_sdk= {version="0.0.1-alpha21"}