Skip to content

Commit b87afa6

Browse files
authored
Merge pull request #513 from Microsoft/app-templates
Added app templates
2 parents 8134b8a + 861e852 commit b87afa6

13 files changed

Lines changed: 208 additions & 0 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# App Templates
2+
These are the language kernel templates for deployment and consumption of applications deployed into an on premise SQL Server Big Data Cluster.
3+
4+
Each directory listed is a separate language kernel that is supported for app deployment:
5+
- Python
6+
- R
7+
- SSIS
8+
- Mleap
9+
10+
Each template contains three primary files:
11+
- spec.yaml
12+
- This is the deployment definition given to the cluster
13+
- run-spec.yaml
14+
- This is the app consumption definition given to the VS Code Ext. client
15+
- app code
16+
- Example code for deployment of that particular type of language kernel
17+
18+
These templates are automatically pulled by the mssqlctl CLI and the App Deploy VS Code Extension. Customers may also download these templates themselves outside of the clients, if desired.
19+
20+
Future language kernels supported for app deployment will be contributed as templates here.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"schema": {
3+
"fields": [{
4+
"name": "state",
5+
"type": "string"
6+
}, {
7+
"name": "bathrooms",
8+
"type": "double"
9+
}, {
10+
"name": "square_feet",
11+
"type": "double"
12+
}, {
13+
"name": "bedrooms",
14+
"type": "double"
15+
}, {
16+
"name": "security_deposit",
17+
"type": "double"
18+
}, {
19+
"name": "cleaning_fee",
20+
"type": "double"
21+
}, {
22+
"name": "extra_people",
23+
"type": "double"
24+
}, {
25+
"name": "number_of_reviews",
26+
"type": "double"
27+
}, {
28+
"name": "review_scores_rating",
29+
"type": "double"
30+
}, {
31+
"name": "room_type",
32+
"type": "string"
33+
}, {
34+
"name": "host_is_superhost",
35+
"type": "string"
36+
}, {
37+
"name": "cancellation_policy",
38+
"type": "string"
39+
}, {
40+
"name": "instant_bookable",
41+
"type": "string"
42+
}]
43+
},
44+
"rows": [["NY", 2.0, 1250.0, 3.0, 50.0, 30.0, 2.0, 56.0, 90.0, "Entire home/apt", "1.0", "strict", "1.0"]]
45+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
name: hello-mleap
2+
version: v1
3+
inputs: ./frame.airbnb.json
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
name: hello-mleap
2+
version: v1
3+
runtime: Mleap
4+
bundleFileName: airbnb.model.lr.zip
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
def handler(msg):
2+
"""
3+
Writes input argument back-out to the standard output returning input as
4+
output.
5+
6+
Generated by: `SQL Server Big Data Cluster`
7+
8+
:param msg: The message to echo.
9+
:type msg: str
10+
:return: The input message `msg` as output `out`.
11+
"""
12+
print(msg)
13+
out = msg
14+
return out
15+
16+
17+
if __name__ == '__main__':
18+
handler('Hello')
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
name: hello-python
2+
version: v1
3+
inputs:
4+
msg: hello
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: hello-python
2+
version: v1
3+
runtime: Python
4+
src: ./hello.py
5+
entrypoint: handler
6+
replicas: 1
7+
poolsize: 1
8+
inputs:
9+
msg: str
10+
output:
11+
out: str
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#' Writes input argument back-out to the
2+
#' standard output returning input as output.
3+
#'
4+
#' Generated by: `SQL Server Big Data Cluster`
5+
#'
6+
#' @param msg A character message to echo.
7+
#' @return The input \code{msg} as output \code{out}.
8+
handler <- function(msg) {
9+
print(msg)
10+
out = msg
11+
out
12+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
name: hello-r
2+
version: v1
3+
inputs:
4+
msg: hello
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: hello-r
2+
version: v1
3+
runtime: R
4+
src: ./hello.R
5+
entrypoint: handler
6+
replicas: 1
7+
poolsize: 1
8+
inputs:
9+
msg: character
10+
output:
11+
out: character

0 commit comments

Comments
 (0)