From 4f6532f288575039b7671250101a974c16d34cbf Mon Sep 17 00:00:00 2001 From: Maxime Lenormand Date: Tue, 11 Feb 2025 10:21:08 +0100 Subject: [PATCH 1/3] Updating /mnt/cache/ to /mount/ --- public/Package_Management/Package_Management.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/public/Package_Management/Package_Management.py b/public/Package_Management/Package_Management.py index 81306f1..7a91e32 100644 --- a/public/Package_Management/Package_Management.py +++ b/public/Package_Management/Package_Management.py @@ -31,7 +31,7 @@ def list_folders(path="/mnt/cache/envs/"): return pd.DataFrame({'error': ["Path does not exist"]}) @fused.udf -def pip_freeze(env='demo_env', mnt_path="/mnt/cache/envs/"): +def pip_freeze(env='testxenv', mnt_path="/mnt/cache/envs/"): import pandas as pd utils = fused.load('https://github.com/fusedio/udfs/tree/d0f4a86/public/common/').utils r = utils.run_cmd( @@ -41,14 +41,14 @@ def pip_freeze(env='demo_env', mnt_path="/mnt/cache/envs/"): return df @fused.udf -def udf(name='numpy', env='demo_env', mnt_path="/mnt/cache/envs/", packages_path="/lib/python3.11/site-packages"): +def udf(name='numpy', env='testxenv', mnt_path="/mnt/cache/envs/", packages_path="/lib/python3.11/site-packages"): import pandas as pd import loguru utils = fused.load('https://github.com/fusedio/udfs/tree/d0f4a86/public/common/').utils # install_module = utils.install_module def install_module( name, - env="demo_env", + env="testxenv", mnt_path="/mnt/cache/envs/", packages_path="/lib/python3.11/site-packages", ): @@ -73,8 +73,8 @@ def install_module( if is_loggedin: # User Inputs name = st.text_input("Module Name", value="numpy") - env = st.text_input("Environment", value="demo_env") - mnt_path = st.text_input("Mount Path", value="/mnt/cache/envs/") + env = st.text_input("Environment", value="testxenv") + mnt_path = st.text_input("Mount Path", value="/mount/envs/") # with st.expander(f"See all Environment options in {mnt_path}", expanded=False): place_holder0 = st.empty() x = place_holder0.button(f"Environments Details",on_click=click_button, args=['button2']) @@ -120,7 +120,7 @@ def install_module( st.code(f""" import sys; - sys.path.append(f"/mnt/cache/envs/{env}/lib/python3.11/site-packages") + sys.path.append(f"/mount/envs/{env}/lib/python3.11/site-packages/") """) st.session_state.button1=True From dd08485f3eb8bcc586ac8466afcdbf6ba11d8c66 Mon Sep 17 00:00:00 2001 From: Maxime Lenormand Date: Tue, 11 Feb 2025 10:22:28 +0100 Subject: [PATCH 2/3] Keeping demo_env --- public/Package_Management/Package_Management.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/Package_Management/Package_Management.py b/public/Package_Management/Package_Management.py index 7a91e32..e69182a 100644 --- a/public/Package_Management/Package_Management.py +++ b/public/Package_Management/Package_Management.py @@ -31,7 +31,7 @@ def list_folders(path="/mnt/cache/envs/"): return pd.DataFrame({'error': ["Path does not exist"]}) @fused.udf -def pip_freeze(env='testxenv', mnt_path="/mnt/cache/envs/"): +def pip_freeze(env='demo_env', mnt_path="/mnt/cache/envs/"): import pandas as pd utils = fused.load('https://github.com/fusedio/udfs/tree/d0f4a86/public/common/').utils r = utils.run_cmd( @@ -41,14 +41,14 @@ def pip_freeze(env='testxenv', mnt_path="/mnt/cache/envs/"): return df @fused.udf -def udf(name='numpy', env='testxenv', mnt_path="/mnt/cache/envs/", packages_path="/lib/python3.11/site-packages"): +def udf(name='numpy', env='demo_env', mnt_path="/mnt/cache/envs/", packages_path="/lib/python3.11/site-packages"): import pandas as pd import loguru utils = fused.load('https://github.com/fusedio/udfs/tree/d0f4a86/public/common/').utils # install_module = utils.install_module def install_module( name, - env="testxenv", + env="demo_env", mnt_path="/mnt/cache/envs/", packages_path="/lib/python3.11/site-packages", ): @@ -73,7 +73,7 @@ def install_module( if is_loggedin: # User Inputs name = st.text_input("Module Name", value="numpy") - env = st.text_input("Environment", value="testxenv") + env = st.text_input("Environment", value="demo_env") mnt_path = st.text_input("Mount Path", value="/mount/envs/") # with st.expander(f"See all Environment options in {mnt_path}", expanded=False): place_holder0 = st.empty() From 518e508b1a1d0e152158aa912e2ab681a63148de Mon Sep 17 00:00:00 2001 From: Maxime Lenormand Date: Tue, 11 Feb 2025 10:23:55 +0100 Subject: [PATCH 3/3] Updating everywhere in app --- public/Package_Management/Package_Management.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/Package_Management/Package_Management.py b/public/Package_Management/Package_Management.py index e69182a..4942df5 100644 --- a/public/Package_Management/Package_Management.py +++ b/public/Package_Management/Package_Management.py @@ -21,7 +21,7 @@ def click_button(button_arg): st.session_state[button_arg] = False @fused.udf -def list_folders(path="/mnt/cache/envs/"): +def list_folders(path="/mount/envs/"): import os import pandas as pd if os.path.exists(path): @@ -31,7 +31,7 @@ def list_folders(path="/mnt/cache/envs/"): return pd.DataFrame({'error': ["Path does not exist"]}) @fused.udf -def pip_freeze(env='demo_env', mnt_path="/mnt/cache/envs/"): +def pip_freeze(env='demo_env', mnt_path="/mount/envs/"): import pandas as pd utils = fused.load('https://github.com/fusedio/udfs/tree/d0f4a86/public/common/').utils r = utils.run_cmd( @@ -41,7 +41,7 @@ def pip_freeze(env='demo_env', mnt_path="/mnt/cache/envs/"): return df @fused.udf -def udf(name='numpy', env='demo_env', mnt_path="/mnt/cache/envs/", packages_path="/lib/python3.11/site-packages"): +def udf(name='numpy', env='demo_env', mnt_path="/mount/envs/", packages_path="/lib/python3.11/site-packages"): import pandas as pd import loguru utils = fused.load('https://github.com/fusedio/udfs/tree/d0f4a86/public/common/').utils @@ -49,7 +49,7 @@ def udf(name='numpy', env='demo_env', mnt_path="/mnt/cache/envs/", packages_path def install_module( name, env="demo_env", - mnt_path="/mnt/cache/envs/", + mnt_path="/mount/envs/", packages_path="/lib/python3.11/site-packages", ): import os