oscar-python 1.3.1__tar.gz → 1.3.2__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.
Files changed (33) hide show
  1. {oscar_python-1.3.1 → oscar_python-1.3.2}/PKG-INFO +20 -6
  2. {oscar_python-1.3.1 → oscar_python-1.3.2}/README.md +1 -1
  3. {oscar_python-1.3.1 → oscar_python-1.3.2}/oscar_python.egg-info/PKG-INFO +21 -7
  4. {oscar_python-1.3.1 → oscar_python-1.3.2}/oscar_python.egg-info/SOURCES.txt +0 -1
  5. {oscar_python-1.3.1 → oscar_python-1.3.2}/oscar_python.egg-info/top_level.txt +0 -2
  6. oscar_python-1.3.1/oscar_python/test_v2.py +0 -206
  7. {oscar_python-1.3.1 → oscar_python-1.3.2}/LICENSE +0 -0
  8. {oscar_python-1.3.1 → oscar_python-1.3.2}/oscar_python/__init__.py +0 -0
  9. {oscar_python-1.3.1 → oscar_python-1.3.2}/oscar_python/_oidc.py +0 -0
  10. {oscar_python-1.3.1 → oscar_python-1.3.2}/oscar_python/_providers/_minio.py +0 -0
  11. {oscar_python-1.3.1 → oscar_python-1.3.2}/oscar_python/_providers/_onedata.py +0 -0
  12. {oscar_python-1.3.1 → oscar_python-1.3.2}/oscar_python/_providers/_providers_base.py +0 -0
  13. {oscar_python-1.3.1 → oscar_python-1.3.2}/oscar_python/_providers/_s3.py +0 -0
  14. {oscar_python-1.3.1 → oscar_python-1.3.2}/oscar_python/_providers/_webdav.py +0 -0
  15. {oscar_python-1.3.1 → oscar_python-1.3.2}/oscar_python/_utils.py +0 -0
  16. {oscar_python-1.3.1 → oscar_python-1.3.2}/oscar_python/client.py +0 -0
  17. {oscar_python-1.3.1 → oscar_python-1.3.2}/oscar_python/client_anon.py +0 -0
  18. {oscar_python-1.3.1 → oscar_python-1.3.2}/oscar_python/default_client.py +0 -0
  19. {oscar_python-1.3.1 → oscar_python-1.3.2}/oscar_python/local_test.py +0 -0
  20. {oscar_python-1.3.1 → oscar_python-1.3.2}/oscar_python/storage.py +0 -0
  21. {oscar_python-1.3.1 → oscar_python-1.3.2}/oscar_python.egg-info/dependency_links.txt +0 -0
  22. {oscar_python-1.3.1 → oscar_python-1.3.2}/oscar_python.egg-info/not-zip-safe +0 -0
  23. {oscar_python-1.3.1 → oscar_python-1.3.2}/oscar_python.egg-info/requires.txt +5 -5
  24. {oscar_python-1.3.1 → oscar_python-1.3.2}/setup.cfg +0 -0
  25. {oscar_python-1.3.1 → oscar_python-1.3.2}/setup.py +0 -0
  26. {oscar_python-1.3.1 → oscar_python-1.3.2}/tests/test_client.py +0 -0
  27. {oscar_python-1.3.1 → oscar_python-1.3.2}/tests/test_default_client.py +0 -0
  28. {oscar_python-1.3.1 → oscar_python-1.3.2}/tests/test_oidc.py +0 -0
  29. {oscar_python-1.3.1 → oscar_python-1.3.2}/tests/test_onedata.py +0 -0
  30. {oscar_python-1.3.1 → oscar_python-1.3.2}/tests/test_s3.py +0 -0
  31. {oscar_python-1.3.1 → oscar_python-1.3.2}/tests/test_storage.py +0 -0
  32. {oscar_python-1.3.1 → oscar_python-1.3.2}/tests/test_utils.py +0 -0
  33. {oscar_python-1.3.1 → oscar_python-1.3.2}/tests/test_webdav.py +0 -0
@@ -1,16 +1,32 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: oscar_python
3
- Version: 1.3.1
3
+ Version: 1.3.2
4
4
  Summary: OSCAR API for python
5
5
  Home-page: https://github.com/grycap/oscar_python
6
6
  Author: GRyCAP - Universitat Politecnica de Valencia
7
7
  Author-email: calarcon@i3m.upv.es
8
8
  License: Apache 2.0
9
- Platform: UNKNOWN
10
9
  Classifier: Programming Language :: Python :: 3
11
10
  Classifier: License :: OSI Approved :: Apache Software License
12
11
  Description-Content-Type: text/markdown
13
12
  License-File: LICENSE
13
+ Requires-Dist: webdavclient3==3.14.6
14
+ Requires-Dist: requests
15
+ Requires-Dist: boto3
16
+ Requires-Dist: setuptools>=40.8.0
17
+ Requires-Dist: pyyaml
18
+ Requires-Dist: aiohttp
19
+ Requires-Dist: liboidcagent
20
+ Dynamic: author
21
+ Dynamic: author-email
22
+ Dynamic: classifier
23
+ Dynamic: description
24
+ Dynamic: description-content-type
25
+ Dynamic: home-page
26
+ Dynamic: license
27
+ Dynamic: license-file
28
+ Dynamic: requires-dist
29
+ Dynamic: summary
14
30
 
15
31
  ## Python OSCAR client
16
32
 
@@ -252,7 +268,7 @@ This method returns a JSON with the info except for OneData, which returns an HT
252
268
 
253
269
  ``` python
254
270
  # get a list of the files of one of the service storage provider
255
- files = storage_service.list_files_from_path("storage_provider") # returns json
271
+ files = storage_service.list_files_from_path("storage_provider", "remote_path") # returns json
256
272
  ```
257
273
 
258
274
  **upload_file**
@@ -266,5 +282,3 @@ response = storage_service.upload_file("storage_provider", "local_path", "remote
266
282
  # download a file from a remote path to a local path
267
283
  response = storage_service.download_file("storage_provider", "local_path", "remote_path")
268
284
  ```
269
-
270
-
@@ -238,7 +238,7 @@ This method returns a JSON with the info except for OneData, which returns an HT
238
238
 
239
239
  ``` python
240
240
  # get a list of the files of one of the service storage provider
241
- files = storage_service.list_files_from_path("storage_provider") # returns json
241
+ files = storage_service.list_files_from_path("storage_provider", "remote_path") # returns json
242
242
  ```
243
243
 
244
244
  **upload_file**
@@ -1,16 +1,32 @@
1
- Metadata-Version: 2.1
2
- Name: oscar-python
3
- Version: 1.3.1
1
+ Metadata-Version: 2.4
2
+ Name: oscar_python
3
+ Version: 1.3.2
4
4
  Summary: OSCAR API for python
5
5
  Home-page: https://github.com/grycap/oscar_python
6
6
  Author: GRyCAP - Universitat Politecnica de Valencia
7
7
  Author-email: calarcon@i3m.upv.es
8
8
  License: Apache 2.0
9
- Platform: UNKNOWN
10
9
  Classifier: Programming Language :: Python :: 3
11
10
  Classifier: License :: OSI Approved :: Apache Software License
12
11
  Description-Content-Type: text/markdown
13
12
  License-File: LICENSE
13
+ Requires-Dist: webdavclient3==3.14.6
14
+ Requires-Dist: requests
15
+ Requires-Dist: boto3
16
+ Requires-Dist: setuptools>=40.8.0
17
+ Requires-Dist: pyyaml
18
+ Requires-Dist: aiohttp
19
+ Requires-Dist: liboidcagent
20
+ Dynamic: author
21
+ Dynamic: author-email
22
+ Dynamic: classifier
23
+ Dynamic: description
24
+ Dynamic: description-content-type
25
+ Dynamic: home-page
26
+ Dynamic: license
27
+ Dynamic: license-file
28
+ Dynamic: requires-dist
29
+ Dynamic: summary
14
30
 
15
31
  ## Python OSCAR client
16
32
 
@@ -252,7 +268,7 @@ This method returns a JSON with the info except for OneData, which returns an HT
252
268
 
253
269
  ``` python
254
270
  # get a list of the files of one of the service storage provider
255
- files = storage_service.list_files_from_path("storage_provider") # returns json
271
+ files = storage_service.list_files_from_path("storage_provider", "remote_path") # returns json
256
272
  ```
257
273
 
258
274
  **upload_file**
@@ -266,5 +282,3 @@ response = storage_service.upload_file("storage_provider", "local_path", "remote
266
282
  # download a file from a remote path to a local path
267
283
  response = storage_service.download_file("storage_provider", "local_path", "remote_path")
268
284
  ```
269
-
270
-
@@ -9,7 +9,6 @@ oscar_python/client_anon.py
9
9
  oscar_python/default_client.py
10
10
  oscar_python/local_test.py
11
11
  oscar_python/storage.py
12
- oscar_python/test_v2.py
13
12
  oscar_python.egg-info/PKG-INFO
14
13
  oscar_python.egg-info/SOURCES.txt
15
14
  oscar_python.egg-info/dependency_links.txt
@@ -1,5 +1,3 @@
1
- build
2
- dist
3
1
  jupyter_example
4
2
  oscar_python
5
3
  tests
@@ -1,206 +0,0 @@
1
- import json
2
- import base64
3
- from client import Client
4
- #from client import Client
5
- from storage import Storage
6
- from client_anon import AnonymousClient
7
-
8
-
9
- def get_svc_test(client):
10
- response = client.get_service("cowsay")
11
- print(response)
12
-
13
- def cowsay_test_anon(client):
14
- text = {"message": "blyat"}
15
- tk = '38919156059e55805f66b81f74e8f6b59e0ba9e1f987900ed0a6eb0eb0aed82e'
16
- response = client.run_service("cowsay", token=tk, input=json.dumps(text))
17
- print(response.text)
18
-
19
- def cowsay_test_text(client):
20
- text = "blyat"
21
- response = client.run_service("cowsay", input=text)
22
- print(response.text)
23
-
24
- def plants_test_anon(client):
25
- tk = "201d9c9c252a47d70e61dacbf02353074921ddd4a39aaef16440949b604c2e26"
26
- image_in = "/home/calarcon/Pictures/plant2.jpg"
27
- response = client.run_service("ai4eosc-service", token= tk, input=image_in, timeout=400)
28
- print(response)
29
-
30
- def text_to_speech_test(client):
31
- file_in = "/home/caterina/Documentos/text-to-speech-coqui/text.txt"
32
- file_out = "/home/caterina/Documentos/text-to-speech-coqui/test-python-run-out.mp3"
33
- response = client.run_service("text-to-speech-coqui", input="si vose volve a desir uwu", output="test-tes-test.mp3", timeout=100)
34
- #print(response.text)
35
-
36
- def plants_sync_test(client):
37
- image_in = "/home/caterina/Documentos/egi_conference_2023/plants_example/images/cerezos.jpg"
38
- response = client.run_service("plant-classification", input=image_in, timeout=400)
39
-
40
-
41
- def grayify_test(client):
42
- response = client.run_service("grayify", input="/home/caterina/Documentos/imagemagick_example/images")
43
-
44
- def create_service_test(client):
45
- path = "/home/caterina/Documentos/imagemagick_example/imagemagick.yaml"
46
- return client.create_service(path)
47
-
48
- def json_definition_example():
49
- return {
50
- "name": "grayify",
51
- "memory": "1Gi",
52
- "cpu": "1.0",
53
- "total_memory": "1Gi",
54
- "total_cpu": "1.0",
55
- "log_level": "CRITICAL",
56
- "image": "ghcr.io/grycap/imagemagick",
57
- "alpine": True,
58
- "script": "#!/bin/bash \necho \'SCRIPT: Invoked Image Grayifier. File available in $INPUT_FILE_PATH\' \nFILE_NAME=`basename \'$INPUT_FILE_PATH\'` \nOUTPUT_FILE=\'$TMP_OUTPUT_DIR/$FILE_NAME\' \necho \'SCRIPT: Converting input image file $INPUT_FILE_PATH to grayscale to output file $OUTPUT_FILE\' \nconvert \'$INPUT_FILE_PATH\' -type Grayscale \'$OUTPUT_FILE\'",
59
- "image_pull_secrets": [
60
- ],
61
- "input": [
62
- {
63
- "storage_provider": "minio.default",
64
- "path": "grayify/input",
65
- "suffix": [
66
- ""
67
- ],
68
- "prefix": [
69
- ""
70
- ]
71
- }
72
- ],
73
- "output": [
74
- {
75
- "storage_provider": "minio.default",
76
- "path": "grayify/output",
77
- "suffix": [
78
- ""
79
- ],
80
- "prefix": [
81
- ""
82
- ]
83
- },
84
- {
85
- "storage_provider": "webdav.dcache",
86
- "path": "/Users/calarcon/grayify",
87
- "suffix": [
88
- ""
89
- ],
90
- "prefix": [
91
- ""
92
- ]
93
- }
94
- ],
95
- "storage_providers": {
96
- "minio": {
97
- "default": {
98
- "endpoint": "http://console.minio.wizardly-lamport0.im.grycap.net",
99
- "region": "us-west-1",
100
- "secret_key": "a1b2c3d4",
101
- "access_key": "minio",
102
- "verify": True
103
- }
104
- },
105
- "webdav": {
106
- "dcache": {
107
- "hostname": "prometheus.desy.de",
108
- "login": "calarcon",
109
- "password": "v5vsYhd2"
110
- }
111
- }
112
- }
113
- }
114
-
115
- def ai4eosc_test(client):
116
- service = {
117
- "log_level": "CRITICAL",
118
- "memory": "1Gi",
119
- "cluster_id": "oscar-cluster",
120
- "name": "test2",
121
- "cpu": "1.0",
122
- "vo": "vo.ai4eosc.eu",
123
- "image": "deephdc/deep-oc-plants-classification-tf",
124
- "alpine": False,
125
- "script": "#!/bin/bash",
126
- "allowed_users" : []
127
- }
128
- res = client.create_service(service)
129
- print(res.text)
130
-
131
- def get_service_base_definition():
132
- """
133
- Base parameters of an OSCAR service
134
-
135
- """
136
- return {
137
-
138
- "log_level": "CRITICAL",
139
- "alpine": False,
140
- "script": "#!/bin/bash \nFILE_NAME=`basename $INPUT_FILE_PATH` \
141
- \nOUTPUT_FILE=\"$TMP_OUTPUT_DIR/$FILE_NAME\"\
142
- \necho \"SCRIPT: Invoked deepaas-predict command. File available in $INPUT_FILE_PATH.\" \
143
- \deepaas-predict -i $INPUT_FILE_PATH -o $OUTPUT_FILE"
144
- }
145
-
146
- def main():
147
-
148
- #client.remove_service(svc_name)
149
- #local_client = Client("oscar-test","http://localhost", "oscar", "MTY5Yjc0", False)
150
-
151
- # Options for basic auth login
152
- options_basic_auth = {'cluster_id':'oscar-egi-cluster',
153
- 'endpoint':'https://funny-kalam8.im.grycap.net',
154
- 'user':'oscar',
155
- 'password':'oscar123',
156
- 'ssl':'True'}
157
-
158
- options_egi = {'cluster_id':'oscar-cluster',
159
- 'endpoint':'https://oscar.test.fedcloud.eu/',
160
- 'shortname':'calarcon',
161
- 'ssl':'True'}
162
-
163
- SERVICE_NAME = "grayify"
164
- token = "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJQVVlPaXJBM1ktZF9kR3BkajRpSkRIdzR6SGE4SVktYmhaZGFFajByamJVIn0.eyJleHAiOjE3MTY4MDMwMDksImlhdCI6MTcxNjc5OTQwOSwiYXV0aF90aW1lIjoxNzE2Nzk1NDgzLCJqdGkiOiI0OTBmNDdlNy00NTc2LTRjODYtYWUyMy00ZjIxNDUzZDEzMjMiLCJpc3MiOiJodHRwczovL2FhaS5lZ2kuZXUvYXV0aC9yZWFsbXMvZWdpIiwic3ViIjoiNjJiYjExYjQwMzk4ZjczNzc4YjY2ZjM0NGQyODIyNDJkZWJiOGVlM2ViYjEwNjcxN2ExMjNjYTIxMzE2MjkyNkBlZ2kuZXUiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJpbS1kYXNoYm9hcmQiLCJzZXNzaW9uX3N0YXRlIjoiMjhiMjU5OGUtYmQ2YS00Y2UzLWI4MDUtNDgyNWRmNGQ2ZjM0Iiwic2NvcGUiOiJvcGVuaWQgb2ZmbGluZV9hY2Nlc3MgZWR1cGVyc29uX2VudGl0bGVtZW50IHByb2ZpbGUgZW1haWwiLCJzaWQiOiIyOGIyNTk4ZS1iZDZhLTRjZTMtYjgwNS00ODI1ZGY0ZDZmMzQiLCJhdXRoZW50aWNhdGluZ19hdXRob3JpdHkiOiJodHRwczovL3d3dy5yZWRpcmlzLmVzL3Npci91cHZpZHAifQ.aZib2Rypqy-XGjPn4ycmEA4u1nlNUb45zz4ry8yZevAdna3lNzEIvxsfwYpjgAvmiDEzrJMYRNAm2652EgvCPUK4bnn9qJuzPhEfSpRbam_jDxmG9MiX6XlKSIO-UqlJQLuDxAAAGuxhdvfqffaT9rZ10042w6-0qTvSiXtNOvFkusc4iVHp8eBcr469txMFvEcWoV8uPXtTL6bl8rbEQMEo2KT1p9twzVpL1WQNIa0XrVa4pfIS3V_IDCKjcDl8PmV3N7KKKkIiQEFg13FS6TSLEs2peszi8eqSAXX2Lq27eSxl0pPH3ZTcrA7vI5dyTKSi7qoK7lsKtHZJOvOCvw"
165
- options_egi_oidc = {'cluster_id':'oscar-egi-oidc',
166
- 'endpoint':'https://inference.cloud.ai4eosc.eu',
167
- 'oidc_token': token,
168
- 'ssl':'True'}
169
-
170
- #client = Client("oscar-cluster","https://sleepy-brown8.im.grycap.net", "oscar", "oscar123", True)
171
- anon_client = AnonymousClient({
172
- 'cluster_id':'oscar-cluster',
173
- 'endpoint':'https://funny-kalam8.im.grycap.net',
174
- 'ssl':'true'
175
- })
176
-
177
- #get_svc_test(anon_client)
178
-
179
- try:
180
- client = Client(options = options_egi)
181
- print("Client created!!")
182
- except:
183
- print("Error creating OSCAR client!!!!11")
184
-
185
- # res = client.run_service(SERVICE_NAME, input="/home/calarcon/Pictures/cat.jpg", output=".")
186
- # print(res)
187
- storage = client.create_storage_client()
188
- print(storage.storage_providers)
189
- print("------------------------")
190
- storage = client.create_storage_client("grayify")
191
- print(storage.storage_providers)
192
- #cowsay_test_text(client)
193
- #get_svc_test(client)
194
- #grayify_storage = client.create_storage_client(svc_name)
195
- #stablediff_storage = client.create_storage_client("stable-diffusion")
196
-
197
- # Download files test
198
- #res = stablediff_storage.download_file("minio.default", "/home/caterina/Documentos/oscar_python_package", "stable-diffusion/out/text1.zip")
199
- #res = grayify_storage.download_file("minio.default", "/home/caterina/Documentos/oscar_python_package", "gray/output/image1.jpg")
200
-
201
- # Upload files test
202
- #res = stablediff_storage.upload_file("minio.default", "/home/caterina/Documentos/txt_to_img/text1.txt", "stable-diffusion/in")
203
- #res = grayify_storage.upload_file("minio.default", "/home/caterina/Documentos/imagemagick_example/images/image2.jpeg", "gray/input")
204
-
205
- if __name__ == "__main__":
206
- main()
File without changes
@@ -1,7 +1,7 @@
1
- aiohttp
2
- boto3
3
- liboidcagent
4
- pyyaml
1
+ webdavclient3==3.14.6
5
2
  requests
3
+ boto3
6
4
  setuptools>=40.8.0
7
- webdavclient3==3.14.6
5
+ pyyaml
6
+ aiohttp
7
+ liboidcagent
File without changes
File without changes