gitarsenal-cli 1.7.3 → 1.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/python/test_modalSandboxScript.py +20 -29
- package/test_modalSandboxScript.py +20 -29
package/package.json
CHANGED
@@ -1033,6 +1033,7 @@ Directory contents:
|
|
1033
1033
|
|
1034
1034
|
stored_credentials = get_stored_credentials()
|
1035
1035
|
auth_context = generate_auth_context(stored_credentials)
|
1036
|
+
print(auth_context)
|
1036
1037
|
|
1037
1038
|
# Create a prompt for the LLM
|
1038
1039
|
print("\n" + "="*60)
|
@@ -1081,17 +1082,25 @@ IMPORTANT GUIDELINES:
|
|
1081
1082
|
|
1082
1083
|
4. For authentication issues:
|
1083
1084
|
- Analyze the error to determine what type of authentication is needed
|
1084
|
-
-
|
1085
|
+
- ALWAYS use the actual credential values from the AVAILABLE CREDENTIALS section above (NOT placeholders)
|
1086
|
+
- Look for the specific API key or token needed in the auth_context and use its exact value
|
1085
1087
|
- Common patterns:
|
1086
|
-
* wandb errors: use wandb login with WANDB_API_KEY
|
1087
|
-
* huggingface errors: use huggingface-cli login with HF_TOKEN or HUGGINGFACE_TOKEN
|
1088
|
-
* github errors: configure git credentials with GITHUB_TOKEN
|
1089
|
-
* kaggle errors: create ~/.kaggle/kaggle.json with KAGGLE_USERNAME and KAGGLE_KEY
|
1090
|
-
* API errors: export the appropriate API key as environment variable
|
1088
|
+
* wandb errors: use wandb login with the actual WANDB_API_KEY value from auth_context
|
1089
|
+
* huggingface errors: use huggingface-cli login with the actual HF_TOKEN or HUGGINGFACE_TOKEN value from auth_context
|
1090
|
+
* github errors: configure git credentials with the actual GITHUB_TOKEN value from auth_context
|
1091
|
+
* kaggle errors: create ~/.kaggle/kaggle.json with the actual KAGGLE_USERNAME and KAGGLE_KEY values from auth_context
|
1092
|
+
* API errors: export the appropriate API key as environment variable using the actual value from auth_context
|
1091
1093
|
|
1092
1094
|
5. Environment variable exports:
|
1093
1095
|
- Use export commands for API keys that need to be in environment
|
1094
|
-
-
|
1096
|
+
- ALWAYS use the actual credential values from auth_context, never use placeholders like "YOUR_API_KEY"
|
1097
|
+
- Example: export OPENAI_API_KEY="sk-..." (using the actual key from auth_context)
|
1098
|
+
|
1099
|
+
6. CRITICAL: When using any API key, token, or credential:
|
1100
|
+
- Find the exact value in the AVAILABLE CREDENTIALS section
|
1101
|
+
- Use that exact value in your command
|
1102
|
+
- Do not use generic placeholders or dummy values
|
1103
|
+
- The auth_context contains real, usable credentials
|
1095
1104
|
|
1096
1105
|
Do not provide any explanations, just the exact command to run.
|
1097
1106
|
"""
|
@@ -1618,7 +1627,7 @@ def create_modal_ssh_container(gpu_type, repo_url=None, repo_name=None, setup_co
|
|
1618
1627
|
"python3", "python3-pip", "build-essential", "tmux", "screen", "nano",
|
1619
1628
|
"gpg", "ca-certificates", "software-properties-common"
|
1620
1629
|
)
|
1621
|
-
.
|
1630
|
+
.pip_install("uv", "modal", "requests", "openai") # Remove problematic CUDA packages
|
1622
1631
|
.run_commands(
|
1623
1632
|
# Create SSH directory
|
1624
1633
|
"mkdir -p /var/run/sshd",
|
@@ -1680,37 +1689,19 @@ def create_modal_ssh_container(gpu_type, repo_url=None, repo_name=None, setup_co
|
|
1680
1689
|
# Set OpenAI API key if provided
|
1681
1690
|
if openai_api_key:
|
1682
1691
|
os.environ['OPENAI_API_KEY'] = openai_api_key
|
1683
|
-
print(f"✅ Set OpenAI API key in container environment (length: {len(openai_api_key)})")
|
1692
|
+
# print(f"✅ Set OpenAI API key in container environment (length: {len(openai_api_key)})")
|
1684
1693
|
else:
|
1685
1694
|
print("⚠️ No OpenAI API key provided to container")
|
1686
1695
|
|
1687
1696
|
# Start SSH service
|
1688
1697
|
subprocess.run(["service", "ssh", "start"], check=True)
|
1689
1698
|
|
1690
|
-
# Clone repository if provided
|
1691
|
-
repo_dir = "/root"
|
1692
|
-
if repo_url:
|
1693
|
-
repo_name_from_url = repo_name or repo_url.split('/')[-1].replace('.git', '')
|
1694
|
-
print(f"📥 Cloning repository: {repo_url}")
|
1695
|
-
|
1696
|
-
try:
|
1697
|
-
subprocess.run(["git", "clone", repo_url], check=True, cwd="/root")
|
1698
|
-
print(f"✅ Repository cloned successfully: {repo_name_from_url}")
|
1699
|
-
|
1700
|
-
# Change to repository directory
|
1701
|
-
repo_dir = f"/root/{repo_name_from_url}"
|
1702
|
-
if os.path.exists(repo_dir):
|
1703
|
-
print(f"📂 Will run setup commands in repository directory: {repo_dir}")
|
1704
|
-
|
1705
|
-
except subprocess.CalledProcessError as e:
|
1706
|
-
print(f"❌ Failed to clone repository: {e}")
|
1707
|
-
|
1708
1699
|
# Run setup commands if provided using PersistentShell
|
1709
1700
|
if setup_commands:
|
1710
1701
|
print(f"⚙️ Running {len(setup_commands)} setup commands with persistent shell...")
|
1711
1702
|
|
1712
|
-
# Create persistent shell instance
|
1713
|
-
shell = PersistentShell(working_dir=
|
1703
|
+
# Create persistent shell instance starting in /root
|
1704
|
+
shell = PersistentShell(working_dir="/root", timeout=120)
|
1714
1705
|
|
1715
1706
|
try:
|
1716
1707
|
# Start the persistent shell
|
@@ -1033,6 +1033,7 @@ Directory contents:
|
|
1033
1033
|
|
1034
1034
|
stored_credentials = get_stored_credentials()
|
1035
1035
|
auth_context = generate_auth_context(stored_credentials)
|
1036
|
+
print(auth_context)
|
1036
1037
|
|
1037
1038
|
# Create a prompt for the LLM
|
1038
1039
|
print("\n" + "="*60)
|
@@ -1081,17 +1082,25 @@ IMPORTANT GUIDELINES:
|
|
1081
1082
|
|
1082
1083
|
4. For authentication issues:
|
1083
1084
|
- Analyze the error to determine what type of authentication is needed
|
1084
|
-
-
|
1085
|
+
- ALWAYS use the actual credential values from the AVAILABLE CREDENTIALS section above (NOT placeholders)
|
1086
|
+
- Look for the specific API key or token needed in the auth_context and use its exact value
|
1085
1087
|
- Common patterns:
|
1086
|
-
* wandb errors: use wandb login with WANDB_API_KEY
|
1087
|
-
* huggingface errors: use huggingface-cli login with HF_TOKEN or HUGGINGFACE_TOKEN
|
1088
|
-
* github errors: configure git credentials with GITHUB_TOKEN
|
1089
|
-
* kaggle errors: create ~/.kaggle/kaggle.json with KAGGLE_USERNAME and KAGGLE_KEY
|
1090
|
-
* API errors: export the appropriate API key as environment variable
|
1088
|
+
* wandb errors: use wandb login with the actual WANDB_API_KEY value from auth_context
|
1089
|
+
* huggingface errors: use huggingface-cli login with the actual HF_TOKEN or HUGGINGFACE_TOKEN value from auth_context
|
1090
|
+
* github errors: configure git credentials with the actual GITHUB_TOKEN value from auth_context
|
1091
|
+
* kaggle errors: create ~/.kaggle/kaggle.json with the actual KAGGLE_USERNAME and KAGGLE_KEY values from auth_context
|
1092
|
+
* API errors: export the appropriate API key as environment variable using the actual value from auth_context
|
1091
1093
|
|
1092
1094
|
5. Environment variable exports:
|
1093
1095
|
- Use export commands for API keys that need to be in environment
|
1094
|
-
-
|
1096
|
+
- ALWAYS use the actual credential values from auth_context, never use placeholders like "YOUR_API_KEY"
|
1097
|
+
- Example: export OPENAI_API_KEY="sk-..." (using the actual key from auth_context)
|
1098
|
+
|
1099
|
+
6. CRITICAL: When using any API key, token, or credential:
|
1100
|
+
- Find the exact value in the AVAILABLE CREDENTIALS section
|
1101
|
+
- Use that exact value in your command
|
1102
|
+
- Do not use generic placeholders or dummy values
|
1103
|
+
- The auth_context contains real, usable credentials
|
1095
1104
|
|
1096
1105
|
Do not provide any explanations, just the exact command to run.
|
1097
1106
|
"""
|
@@ -1618,7 +1627,7 @@ def create_modal_ssh_container(gpu_type, repo_url=None, repo_name=None, setup_co
|
|
1618
1627
|
"python3", "python3-pip", "build-essential", "tmux", "screen", "nano",
|
1619
1628
|
"gpg", "ca-certificates", "software-properties-common"
|
1620
1629
|
)
|
1621
|
-
.
|
1630
|
+
.pip_install("uv", "modal", "requests", "openai") # Remove problematic CUDA packages
|
1622
1631
|
.run_commands(
|
1623
1632
|
# Create SSH directory
|
1624
1633
|
"mkdir -p /var/run/sshd",
|
@@ -1680,37 +1689,19 @@ def create_modal_ssh_container(gpu_type, repo_url=None, repo_name=None, setup_co
|
|
1680
1689
|
# Set OpenAI API key if provided
|
1681
1690
|
if openai_api_key:
|
1682
1691
|
os.environ['OPENAI_API_KEY'] = openai_api_key
|
1683
|
-
print(f"✅ Set OpenAI API key in container environment (length: {len(openai_api_key)})")
|
1692
|
+
# print(f"✅ Set OpenAI API key in container environment (length: {len(openai_api_key)})")
|
1684
1693
|
else:
|
1685
1694
|
print("⚠️ No OpenAI API key provided to container")
|
1686
1695
|
|
1687
1696
|
# Start SSH service
|
1688
1697
|
subprocess.run(["service", "ssh", "start"], check=True)
|
1689
1698
|
|
1690
|
-
# Clone repository if provided
|
1691
|
-
repo_dir = "/root"
|
1692
|
-
if repo_url:
|
1693
|
-
repo_name_from_url = repo_name or repo_url.split('/')[-1].replace('.git', '')
|
1694
|
-
print(f"📥 Cloning repository: {repo_url}")
|
1695
|
-
|
1696
|
-
try:
|
1697
|
-
subprocess.run(["git", "clone", repo_url], check=True, cwd="/root")
|
1698
|
-
print(f"✅ Repository cloned successfully: {repo_name_from_url}")
|
1699
|
-
|
1700
|
-
# Change to repository directory
|
1701
|
-
repo_dir = f"/root/{repo_name_from_url}"
|
1702
|
-
if os.path.exists(repo_dir):
|
1703
|
-
print(f"📂 Will run setup commands in repository directory: {repo_dir}")
|
1704
|
-
|
1705
|
-
except subprocess.CalledProcessError as e:
|
1706
|
-
print(f"❌ Failed to clone repository: {e}")
|
1707
|
-
|
1708
1699
|
# Run setup commands if provided using PersistentShell
|
1709
1700
|
if setup_commands:
|
1710
1701
|
print(f"⚙️ Running {len(setup_commands)} setup commands with persistent shell...")
|
1711
1702
|
|
1712
|
-
# Create persistent shell instance
|
1713
|
-
shell = PersistentShell(working_dir=
|
1703
|
+
# Create persistent shell instance starting in /root
|
1704
|
+
shell = PersistentShell(working_dir="/root", timeout=120)
|
1714
1705
|
|
1715
1706
|
try:
|
1716
1707
|
# Start the persistent shell
|