pybiolib 1.1.2191__py3-none-any.whl → 1.1.2195__py3-none-any.whl

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.
@@ -2,6 +2,7 @@ import io
2
2
  import subprocess
3
3
  import tarfile
4
4
  import time
5
+ from urllib.parse import urlparse
5
6
 
6
7
  from docker.errors import ImageNotFound # type: ignore
7
8
  from docker.models.containers import Container # type: ignore
@@ -145,14 +146,12 @@ class RemoteHostProxy:
145
146
  raise Exception('RemoteHostProxy container not defined when attempting to write NGINX config')
146
147
 
147
148
  docker = BiolibDockerClient.get_docker_client()
148
- base_url = BiolibApiClient.get().base_url
149
+ upstream_hostname = urlparse(BiolibApiClient.get().base_url).hostname
149
150
  if self.is_app_caller_proxy:
150
- if not utils.IS_RUNNING_IN_CLOUD or not utils.BIOLIB_CLOUD_BASE_URL:
151
+ if not utils.IS_RUNNING_IN_CLOUD:
151
152
  raise BioLibError('Calling apps inside apps is not supported in local compute environment')
152
153
 
153
154
  logger_no_user_data.debug(f'Job "{self._job_uuid}" writing config for and starting App Caller Proxy...')
154
- cloud_base_url = utils.BIOLIB_CLOUD_BASE_URL
155
-
156
155
  config = CloudUtils.get_webserver_config()
157
156
  compute_node_uuid = config['compute_node_info']['public_id']
158
157
  compute_node_auth_token = config['compute_node_info']['auth_token']
@@ -186,10 +185,11 @@ http {{
186
185
 
187
186
  server {{
188
187
  listen 80;
189
- resolver 127.0.0.11 valid=30s;
188
+ resolver 127.0.0.11 ipv6=off valid=30s;
189
+ set $upstream_hostname {upstream_hostname};
190
190
 
191
191
  location ~* "^/api/jobs/cloud/(?<job_id>[a-z0-9-]{{36}})/status/$" {{
192
- proxy_pass {base_url}/api/jobs/cloud/$job_id/status/;
192
+ proxy_pass https://$upstream_hostname/api/jobs/cloud/$job_id/status/;
193
193
  proxy_set_header authorization $bearer_token_on_get;
194
194
  proxy_set_header cookie "";
195
195
  proxy_ssl_server_name on;
@@ -197,35 +197,35 @@ http {{
197
197
 
198
198
  location ~* "^/api/jobs/cloud/$" {{
199
199
  # Note: Using $1 here as URI part from regex must be used for proxy_pass
200
- proxy_pass {base_url}/api/jobs/cloud/$1;
200
+ proxy_pass https://$upstream_hostname/api/jobs/cloud/$1;
201
201
  proxy_set_header authorization $bearer_token_on_post;
202
202
  proxy_set_header cookie "";
203
203
  proxy_ssl_server_name on;
204
204
  }}
205
205
 
206
206
  location ~* "^/api/jobs/(?<job_id>[a-z0-9-]{{36}})/storage/input/start_upload/$" {{
207
- proxy_pass {base_url}/api/jobs/$job_id/storage/input/start_upload/;
207
+ proxy_pass https://$upstream_hostname/api/jobs/$job_id/storage/input/start_upload/;
208
208
  proxy_set_header authorization "";
209
209
  proxy_set_header cookie "";
210
210
  proxy_ssl_server_name on;
211
211
  }}
212
212
 
213
213
  location ~* "^/api/jobs/(?<job_id>[a-z0-9-]{{36}})/storage/input/presigned_upload_url/$" {{
214
- proxy_pass {base_url}/api/jobs/$job_id/storage/input/presigned_upload_url/$is_args$args;
214
+ proxy_pass https://$upstream_hostname/api/jobs/$job_id/storage/input/presigned_upload_url/$is_args$args;
215
215
  proxy_set_header authorization "";
216
216
  proxy_set_header cookie "";
217
217
  proxy_ssl_server_name on;
218
218
  }}
219
219
 
220
220
  location ~* "^/api/jobs/(?<job_id>[a-z0-9-]{{36}})/storage/input/complete_upload/$" {{
221
- proxy_pass {base_url}/api/jobs/$job_id/storage/input/complete_upload/;
221
+ proxy_pass https://$upstream_hostname/api/jobs/$job_id/storage/input/complete_upload/;
222
222
  proxy_set_header authorization "";
223
223
  proxy_set_header cookie "";
224
224
  proxy_ssl_server_name on;
225
225
  }}
226
226
 
227
227
  location ~* "^/api/jobs/(?<job_id>[a-z0-9-]{{36}})/main_result/$" {{
228
- proxy_pass {base_url}/api/jobs/$job_id/main_result/;
228
+ proxy_pass https://$upstream_hostname/api/jobs/$job_id/main_result/;
229
229
  proxy_set_header authorization "";
230
230
  proxy_set_header cookie "";
231
231
  proxy_pass_request_headers on;
@@ -233,7 +233,7 @@ http {{
233
233
  }}
234
234
 
235
235
  location ~* "^/api/jobs/(?<job_id>[a-z0-9-]{{36}})/$" {{
236
- proxy_pass {base_url}/api/jobs/$job_id/;
236
+ proxy_pass https://$upstream_hostname/api/jobs/$job_id/;
237
237
  proxy_set_header authorization $bearer_token_on_patch_and_get;
238
238
  proxy_set_header caller-job-uuid "{self._job_uuid}";
239
239
  proxy_set_header cookie "";
@@ -242,7 +242,7 @@ http {{
242
242
 
243
243
  location ~* "^/api/jobs/create_job_with_data/$" {{
244
244
  # Note: Using $1 here as URI part from regex must be used for proxy_pass
245
- proxy_pass {base_url}/api/jobs/create_job_with_data/$1;
245
+ proxy_pass https://$upstream_hostname/api/jobs/create_job_with_data/$1;
246
246
  proxy_set_header authorization $bearer_token_on_post;
247
247
  proxy_set_header caller-job-uuid "{self._job_uuid}";
248
248
  proxy_set_header cookie "";
@@ -251,7 +251,7 @@ http {{
251
251
 
252
252
  location ~* "^/api/jobs/$" {{
253
253
  # Note: Using $1 here as URI part from regex must be used for proxy_pass
254
- proxy_pass {base_url}/api/jobs/$1;
254
+ proxy_pass https://$upstream_hostname/api/jobs/$1;
255
255
  proxy_set_header authorization $bearer_token_on_post;
256
256
  proxy_set_header caller-job-uuid "{self._job_uuid}";
257
257
  proxy_set_header cookie "";
@@ -260,7 +260,7 @@ http {{
260
260
 
261
261
  location ~ "^/api/jobs/{self._job_uuid}/notes/$" {{
262
262
  # Note: Using $1 here as URI part from regex must be used for proxy_pass
263
- proxy_pass {base_url}/api/jobs/{self._job_uuid}/notes/$1;
263
+ proxy_pass https://$upstream_hostname/api/jobs/{self._job_uuid}/notes/$1;
264
264
  proxy_set_header authorization "";
265
265
  proxy_set_header job-auth-token "";
266
266
  proxy_set_header compute-node-auth-token "{compute_node_auth_token}";
@@ -270,7 +270,7 @@ http {{
270
270
  }}
271
271
 
272
272
  location /api/lfs/ {{
273
- proxy_pass {base_url}/api/lfs/;
273
+ proxy_pass https://$upstream_hostname/api/lfs/$is_args$args;
274
274
  proxy_set_header authorization "";
275
275
  proxy_set_header compute-node-auth-token "{compute_node_auth_token}";
276
276
  proxy_set_header job-uuid "{self._job_uuid}";
@@ -279,7 +279,7 @@ http {{
279
279
  }}
280
280
 
281
281
  location /api/app/ {{
282
- proxy_pass {base_url}/api/app/;
282
+ proxy_pass https://$upstream_hostname/api/app/$is_args$args;
283
283
  proxy_set_header authorization "";
284
284
  proxy_set_header compute-node-auth-token "{compute_node_auth_token}";
285
285
  proxy_set_header job-uuid "{self._job_uuid}";
@@ -288,28 +288,28 @@ http {{
288
288
  }}
289
289
 
290
290
  location /api/ {{
291
- proxy_pass {base_url}/api/;
291
+ proxy_pass https://$upstream_hostname/api/$is_args$args;
292
292
  proxy_set_header authorization "";
293
293
  proxy_set_header cookie "";
294
294
  proxy_ssl_server_name on;
295
295
  }}
296
296
 
297
297
  location /proxy/storage/job-storage/ {{
298
- proxy_pass {cloud_base_url}/proxy/storage/job-storage/;
298
+ proxy_pass https://$upstream_hostname/proxy/storage/job-storage/$is_args$args;
299
299
  proxy_set_header authorization "";
300
300
  proxy_set_header cookie "";
301
301
  proxy_ssl_server_name on;
302
302
  }}
303
303
 
304
304
  location /proxy/storage/lfs/versions/ {{
305
- proxy_pass {cloud_base_url}/proxy/storage/lfs/versions/;
305
+ proxy_pass https://$upstream_hostname/proxy/storage/lfs/versions/$is_args$args;
306
306
  proxy_set_header authorization "";
307
307
  proxy_set_header cookie "";
308
308
  proxy_ssl_server_name on;
309
309
  }}
310
310
 
311
311
  location /proxy/cloud/ {{
312
- proxy_pass {cloud_base_url}/proxy/cloud/;
312
+ proxy_pass https://$upstream_hostname/proxy/cloud/$is_args$args;
313
313
  proxy_set_header authorization "";
314
314
  proxy_set_header cookie "";
315
315
  proxy_ssl_server_name on;
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pybiolib
3
- Version: 1.1.2191
3
+ Version: 1.1.2195
4
4
  Summary: BioLib Python Client
5
5
  Home-page: https://github.com/biolib
6
6
  License: MIT
@@ -86,7 +86,7 @@ biolib/compute_node/job_worker/large_file_system.py,sha256=XXqRlVtYhs-Ji9zQGIk5K
86
86
  biolib/compute_node/job_worker/mappings.py,sha256=Z48Kg4nbcOvsT2-9o3RRikBkqflgO4XeaWxTGz-CNvI,2499
87
87
  biolib/compute_node/job_worker/utilization_reporter_thread.py,sha256=7tm5Yk9coqJ9VbEdnO86tSXI0iM0omwIyKENxdxiVXk,8575
88
88
  biolib/compute_node/job_worker/utils.py,sha256=wgxcIA8yAhUPdCwyvuuJ0JmreyWmmUoBO33vWtG60xg,1282
89
- biolib/compute_node/remote_host_proxy.py,sha256=GsCZhts8rYvq7DJuX1y2pfFF5Jhj5-nsnNWJuipbn3w,14422
89
+ biolib/compute_node/remote_host_proxy.py,sha256=KiWUXt2Xd25M8CXs1n_H42Yh5-f5tm1Yqm2i7aTNGDU,14768
90
90
  biolib/compute_node/socker_listener_thread.py,sha256=T5_UikA3MB9bD5W_dckYLPTgixh72vKUlgbBvj9dbM0,1601
91
91
  biolib/compute_node/socket_sender_thread.py,sha256=YgamPHeUm2GjMFGx8qk-99WlZhEs-kAb3q_2O6qByig,971
92
92
  biolib/compute_node/utils.py,sha256=M7i_WTyxbFM3Lri9RWZ_8FeQNYrQIWpKGLfp2I55oeY,4677
@@ -116,8 +116,8 @@ biolib/utils/cache_state.py,sha256=u256F37QSRIVwqKlbnCyzAX4EMI-kl6Dwu6qwj-Qmag,3
116
116
  biolib/utils/multipart_uploader.py,sha256=XvGP1I8tQuKhAH-QugPRoEsCi9qvbRk-DVBs5PNwwJo,8452
117
117
  biolib/utils/seq_util.py,sha256=ZQFcaE37B2dtucN2zDjOmdya_X0ITc1zBFZJNQY13XA,5183
118
118
  biolib/utils/zip/remote_zip.py,sha256=0wErYlxir5921agfFeV1xVjf29l9VNgGQvNlWOlj2Yc,23232
119
- pybiolib-1.1.2191.dist-info/LICENSE,sha256=F2h7gf8i0agDIeWoBPXDMYScvQOz02pAWkKhTGOHaaw,1067
120
- pybiolib-1.1.2191.dist-info/METADATA,sha256=rKlCDAj0A1ygrKqBGIyZKZy_fy723ESDGg79nYwGoOg,1508
121
- pybiolib-1.1.2191.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
122
- pybiolib-1.1.2191.dist-info/entry_points.txt,sha256=p6DyaP_2kctxegTX23WBznnrDi4mz6gx04O5uKtRDXg,42
123
- pybiolib-1.1.2191.dist-info/RECORD,,
119
+ pybiolib-1.1.2195.dist-info/LICENSE,sha256=F2h7gf8i0agDIeWoBPXDMYScvQOz02pAWkKhTGOHaaw,1067
120
+ pybiolib-1.1.2195.dist-info/METADATA,sha256=aa5g5s1TFjL-R2522tV8GbygRKwLgMlIYEdsl8ukJtY,1508
121
+ pybiolib-1.1.2195.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
122
+ pybiolib-1.1.2195.dist-info/entry_points.txt,sha256=p6DyaP_2kctxegTX23WBznnrDi4mz6gx04O5uKtRDXg,42
123
+ pybiolib-1.1.2195.dist-info/RECORD,,