adalib.apps¶
The Apps sub-package exposes the core integrations of the deployed apps in AdaLab.
Functions¶
delete_app ¶
Delete a deployed app from AdaLab.
Use the example Jupyter Notebook to test this function or build upon it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
app_id |
str
|
the app's ID |
required |
Source code in adalib/apps/apps.py
deploy_app ¶
deploy_app(name, description, metadata_id, url_path_prefix, stripped_prefix=True, port=80, replicas=1, environment_variables={}, max_cpu=1.0, min_cpu=0.0, max_ram=500, min_ram=20, command='', acl_type='public', acl_userlist=[], acl_group_names=[], idp_enabled=False, idp_scope='')
Deploy an app to AdaLab from an existing metadata object.
Use the example Jupyter Notebook to test this function or build upon it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name |
str
|
the app's name |
required |
description |
str
|
the app's description |
required |
metadata_id |
int
|
the ID of the metadata object |
required |
url_path_prefix |
str
|
URL endpoint to deploy the app to |
required |
stripped_prefix |
bool
|
whether to strip the apps/{app_url} prefix from the URL, defaults to True |
True
|
port |
int
|
the port where the app is served from, defaults to 80 |
80
|
replicas |
int
|
number of replicas to deploy, defaults to 1 |
1
|
environment_variables |
dict
|
environment variables to pass to the app, defaults to {} |
{}
|
max_cpu |
float
|
maximum CPU usage allowed (vCPU), defaults to 1.0 |
1.0
|
min_cpu |
float
|
minimum CPU usage allowed (vCPU), defaults to 0.0 |
0.0
|
max_ram |
int
|
maximum RAM usage allowed (Mb), defaults to 500 |
500
|
min_ram |
int
|
minimum RAM usage allowed (Mb), defaults to 20 |
20
|
command |
str
|
command to start up the app, defaults to "" |
''
|
acl_type |
str
|
type of access control list, defaults to "public" |
'public'
|
acl_userlist |
list[str]
|
list of users allowed to access the app when acl_type="userlist", defaults to [] |
[]
|
acl_group_names |
list[str]
|
list of groups allowed to access the app when acl_type="group", defaults to [] |
[]
|
idp_enabled |
bool
|
whether to enable IdP token in app headers, defaults to False |
False
|
idp_scope |
str
|
IdP token scope, defaults to "" |
''
|
Returns:
| Type | Description |
|---|---|
str
|
the app's ID |
Source code in adalib/apps/apps.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | |
edit_app ¶
edit_app(app_id, name=None, description=None, metadata_id=None, url_path_prefix=None, stripped_prefix=None, port=None, replicas=None, environment_variables=None, max_cpu=None, min_cpu=None, max_ram=None, min_ram=None, command=None, acl_type=None, acl_userlist=None, acl_group_names=None, idp_enabled=None, idp_scope=None)
Edit a deployed app's configuration.
Use the example Jupyter Notebook to test this function or build upon it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
app_id |
str
|
the app's ID |
required |
name |
str
|
the app's name, defaults to None (old one) |
None
|
description |
str
|
the app's description, defaults to None (old one) |
None
|
metadata_id |
int
|
the ID of the metadata object, defaults to None (old one) |
None
|
url_path_prefix |
str
|
URL endpoint to deploy the app to, defaults to None (old one) |
None
|
stripped_prefix |
bool
|
whether to strip the apps/{app_url} prefix from the URL, defaults to None (old one) |
None
|
port |
int
|
the port where the app is served from, defaults to None (old one) |
None
|
replicas |
int
|
number of replicas to deploy, defaults to None (old one) |
None
|
environment_variables |
dict
|
environment variables to pass to the app, defaults to None (old one) |
None
|
max_cpu |
float
|
maximum CPU usage allowed (vCPU), defaults to None (old one) |
None
|
min_cpu |
float
|
minimum CPU usage allowed (vCPU), defaults to None (old one) |
None
|
max_ram |
int
|
maximum RAM usage allowed (Mb), defaults to None (old one) |
None
|
min_ram |
int
|
minimum RAM usage allowed (Mb), defaults to None (old one) |
None
|
command |
str
|
command to start up the app, defaults to None (old one) |
None
|
acl_type |
str
|
type of access control list, defaults to None (old one) |
None
|
acl_userlist |
list[str]
|
list of users allowed to access the app when acl_type="userlist", defaults to None (old one) |
None
|
acl_group_names |
list[str]
|
list of groups allowed to access the app when acl_type="group", defaults to None (old one) |
None
|
idp_enabled |
bool
|
whether to enable IdP token in app headers, defaults to None (old one) |
None
|
idp_scope |
str
|
IdP token scope, defaults to None (old one) |
None
|
Returns:
| Type | Description |
|---|---|
None
|
nothing |
Source code in adalib/apps/apps.py
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 | |
get_all_apps ¶
Get information for all the apps deployed in AdaLab.
Use the example Jupyter Notebook to test this function or build upon it.
Returns:
| Type | Description |
|---|---|
list
|
list with all the information of each app |
Source code in adalib/apps/apps.py
get_app ¶
Get the information of a specific deployed app in AdaLab.
Use the example Jupyter Notebook to test this function or build upon it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
app_id |
str
|
the app's ID |
required |
Returns:
| Type | Description |
|---|---|
dict
|
app's information |
Source code in adalib/apps/apps.py
get_app_id ¶
Get the ID of a deployed app in AdaLab. Either app_url, or app_name and author_id, must be specified.
Use the example Jupyter Notebook to test this function or build upon it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
app_name |
str
|
name of the app, defaults to "" |
''
|
author_id |
str
|
author of the app, defaults to "" |
''
|
app_url |
str
|
endpoint of the app's URL, defaults to "" |
''
|
Returns:
| Type | Description |
|---|---|
str
|
the app's ID |
Source code in adalib/apps/apps.py
get_app_logs ¶
Get the execution or deployment logs of a deployed app in AdaLab.
Use the example Jupyter Notebook to test this function or build upon it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
app_id |
str
|
the app's ID |
required |
system |
bool
|
whether to get the system logs or the deployment logs, defaults to False |
False
|
Returns:
| Type | Description |
|---|---|
str
|
deployment logs |
Source code in adalib/apps/apps.py
get_apps_by_author ¶
Get information for all the apps deployed in AdaLab by a specific author.
Use the example Jupyter Notebook to test this function or build upon it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
author_id |
str
|
the ID of the app's author |
required |
Returns:
| Type | Description |
|---|---|
list
|
list with all the information of each app |
Source code in adalib/apps/apps.py
get_apps_status ¶
Get the status of all the apps deployed in AdaLab.
Use the example Jupyter Notebook to test this function or build upon it.
Returns:
| Type | Description |
|---|---|
dict
|
dictionary with the status of each app |
Source code in adalib/apps/apps.py
restart_app ¶
Restart a deployed app in AdaLab.
Use the example Jupyter Notebook to test this function or build upon it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
app_id |
str
|
the app's ID |
required |
Returns:
| Type | Description |
|---|---|
None
|
nothing |
Source code in adalib/apps/apps.py
start_app ¶
Start a deployed app in AdaLab.
Use the example Jupyter Notebook to test this function or build upon it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
app_id |
str
|
the app's ID |
required |
Returns:
| Type | Description |
|---|---|
None
|
nothing |
Source code in adalib/apps/apps.py
stop_app ¶
Stop a deployed app in AdaLab.
Use the example Jupyter Notebook to test this function or build upon it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
app_id |
str
|
the app's ID |
required |
Returns:
| Type | Description |
|---|---|
None
|
nothing |