simplex 1.2.8__tar.gz → 1.2.10__tar.gz
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.
Potentially problematic release.
This version of simplex might be problematic. Click here for more details.
- {simplex-1.2.8 → simplex-1.2.10}/PKG-INFO +1 -1
- {simplex-1.2.8 → simplex-1.2.10}/setup.py +1 -1
- {simplex-1.2.8 → simplex-1.2.10}/simplex/deploy/push.py +32 -7
- {simplex-1.2.8 → simplex-1.2.10}/simplex/simplex.py +0 -1
- {simplex-1.2.8 → simplex-1.2.10}/simplex.egg-info/PKG-INFO +1 -1
- {simplex-1.2.8 → simplex-1.2.10}/LICENSE +0 -0
- {simplex-1.2.8 → simplex-1.2.10}/README.md +0 -0
- {simplex-1.2.8 → simplex-1.2.10}/pyproject.toml +0 -0
- {simplex-1.2.8 → simplex-1.2.10}/setup.cfg +0 -0
- {simplex-1.2.8 → simplex-1.2.10}/simplex/__init__.py +0 -0
- {simplex-1.2.8 → simplex-1.2.10}/simplex/cli.py +0 -0
- {simplex-1.2.8 → simplex-1.2.10}/simplex/deploy/__init__.py +0 -0
- {simplex-1.2.8 → simplex-1.2.10}/simplex.egg-info/SOURCES.txt +0 -0
- {simplex-1.2.8 → simplex-1.2.10}/simplex.egg-info/dependency_links.txt +0 -0
- {simplex-1.2.8 → simplex-1.2.10}/simplex.egg-info/entry_points.txt +0 -0
- {simplex-1.2.8 → simplex-1.2.10}/simplex.egg-info/requires.txt +0 -0
- {simplex-1.2.8 → simplex-1.2.10}/simplex.egg-info/top_level.txt +0 -0
|
@@ -7,7 +7,8 @@ from dotenv import load_dotenv
|
|
|
7
7
|
import requests
|
|
8
8
|
from typing import Optional
|
|
9
9
|
from datetime import datetime, timedelta
|
|
10
|
-
|
|
10
|
+
|
|
11
|
+
|
|
11
12
|
|
|
12
13
|
S3_URL = "https://u3mvtbirxf.us-east-1.awsapprunner.com"
|
|
13
14
|
JOB_URL = "https://simplex--job-scheduler-app-handler.modal.run"
|
|
@@ -41,6 +42,7 @@ def create_archive(directory: str, config: dict) -> str:
|
|
|
41
42
|
|
|
42
43
|
def push_directory(directory: str):
|
|
43
44
|
"""Main function to handle parsing yaml and creating zip archive"""
|
|
45
|
+
|
|
44
46
|
config = read_config(directory)
|
|
45
47
|
archive_path = create_archive(directory, config)
|
|
46
48
|
|
|
@@ -61,7 +63,7 @@ def push_directory(directory: str):
|
|
|
61
63
|
os.unlink(archive_path)
|
|
62
64
|
|
|
63
65
|
try:
|
|
64
|
-
create_job_scheduled(project_name, cron_schedule, s3_uri)
|
|
66
|
+
create_job_scheduled(directory, project_name, cron_schedule, s3_uri)
|
|
65
67
|
except Exception as e:
|
|
66
68
|
print(f"Error creating job: {e}")
|
|
67
69
|
raise
|
|
@@ -70,7 +72,13 @@ def push_directory(directory: str):
|
|
|
70
72
|
|
|
71
73
|
|
|
72
74
|
|
|
73
|
-
def upload_files_to_s3(archive_path: str, project_name: str):
|
|
75
|
+
def upload_files_to_s3(directory: str, archive_path: str, project_name: str):
|
|
76
|
+
"""Upload files to S3"""
|
|
77
|
+
# Load .env file from the target directory
|
|
78
|
+
env_path = Path(directory) / '.env'
|
|
79
|
+
if env_path.exists():
|
|
80
|
+
load_dotenv(env_path)
|
|
81
|
+
|
|
74
82
|
# Read API key from environment
|
|
75
83
|
api_key = os.getenv('SIMPLEX_API_KEY')
|
|
76
84
|
if not api_key:
|
|
@@ -107,8 +115,14 @@ def upload_files_to_s3(archive_path: str, project_name: str):
|
|
|
107
115
|
print(f"Error uploading project: {e}")
|
|
108
116
|
raise
|
|
109
117
|
|
|
110
|
-
def create_job_scheduled(project_name: str, cron_schedule: str, s3_uri: str):
|
|
118
|
+
def create_job_scheduled(directory: str, project_name: str, cron_schedule: str, s3_uri: str):
|
|
111
119
|
"""Create a new job via the API"""
|
|
120
|
+
|
|
121
|
+
# Load .env file from the target directory
|
|
122
|
+
env_path = Path(directory) / '.env'
|
|
123
|
+
if env_path.exists():
|
|
124
|
+
load_dotenv(env_path)
|
|
125
|
+
|
|
112
126
|
# Read API key from environment
|
|
113
127
|
api_key = os.getenv('SIMPLEX_API_KEY')
|
|
114
128
|
if not api_key:
|
|
@@ -145,8 +159,14 @@ def create_job_scheduled(project_name: str, cron_schedule: str, s3_uri: str):
|
|
|
145
159
|
raise
|
|
146
160
|
|
|
147
161
|
|
|
148
|
-
def create_job_immediately(project_name: str, s3_uri: str):
|
|
162
|
+
def create_job_immediately(directory: str, project_name: str, s3_uri: str):
|
|
149
163
|
"""Create a new job via the API"""
|
|
164
|
+
|
|
165
|
+
# Load .env file from the target directory
|
|
166
|
+
env_path = Path(directory) / '.env'
|
|
167
|
+
if env_path.exists():
|
|
168
|
+
load_dotenv(env_path)
|
|
169
|
+
|
|
150
170
|
# Read API key from environment
|
|
151
171
|
api_key = os.getenv('SIMPLEX_API_KEY')
|
|
152
172
|
if not api_key:
|
|
@@ -185,6 +205,11 @@ def create_job_immediately(project_name: str, s3_uri: str):
|
|
|
185
205
|
|
|
186
206
|
def run_directory(directory: str):
|
|
187
207
|
"""Run a directory immediately"""
|
|
208
|
+
# Load .env file from the target directory
|
|
209
|
+
env_path = Path(directory) / '.env'
|
|
210
|
+
if env_path.exists():
|
|
211
|
+
load_dotenv(env_path)
|
|
212
|
+
|
|
188
213
|
config = read_config(directory)
|
|
189
214
|
archive_path = create_archive(directory, config)
|
|
190
215
|
|
|
@@ -193,7 +218,7 @@ def run_directory(directory: str):
|
|
|
193
218
|
raise ValueError("Project name not specified in simplex.yaml")
|
|
194
219
|
|
|
195
220
|
try:
|
|
196
|
-
s3_uri = upload_files_to_s3(archive_path, project_name)
|
|
221
|
+
s3_uri = upload_files_to_s3(directory, archive_path, project_name)
|
|
197
222
|
except Exception as e:
|
|
198
223
|
print(f"Error uploading project: {e}")
|
|
199
224
|
raise
|
|
@@ -202,7 +227,7 @@ def run_directory(directory: str):
|
|
|
202
227
|
os.unlink(archive_path)
|
|
203
228
|
|
|
204
229
|
try:
|
|
205
|
-
create_job_immediately(project_name, s3_uri)
|
|
230
|
+
create_job_immediately(directory, project_name, s3_uri)
|
|
206
231
|
except Exception as e:
|
|
207
232
|
print(f"Error creating job: {e}")
|
|
208
233
|
raise
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|