diff --git a/samples/features/sql-big-data-cluster/app-templates/README.md b/samples/features/sql-big-data-cluster/app-templates/README.md new file mode 100644 index 00000000..133b1fed --- /dev/null +++ b/samples/features/sql-big-data-cluster/app-templates/README.md @@ -0,0 +1,20 @@ +# App Templates +These are the language kernel templates for deployment and consumption of applications deployed into an on premise SQL Server Big Data Cluster. + +Each directory listed is a separate language kernel that is supported for app deployment: +- Python +- R +- SSIS +- Mleap + +Each template contains three primary files: +- spec.yaml + - This is the deployment definition given to the cluster +- run-spec.yaml + - This is the app consumption definition given to the VS Code Ext. client +- app code + - Example code for deployment of that particular type of language kernel + +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. + +Future language kernels supported for app deployment will be contributed as templates here. \ No newline at end of file diff --git a/samples/features/sql-big-data-cluster/app-templates/mleap/frame.airbnb.json b/samples/features/sql-big-data-cluster/app-templates/mleap/frame.airbnb.json new file mode 100644 index 00000000..3accc051 --- /dev/null +++ b/samples/features/sql-big-data-cluster/app-templates/mleap/frame.airbnb.json @@ -0,0 +1,45 @@ +{ + "schema": { + "fields": [{ + "name": "state", + "type": "string" + }, { + "name": "bathrooms", + "type": "double" + }, { + "name": "square_feet", + "type": "double" + }, { + "name": "bedrooms", + "type": "double" + }, { + "name": "security_deposit", + "type": "double" + }, { + "name": "cleaning_fee", + "type": "double" + }, { + "name": "extra_people", + "type": "double" + }, { + "name": "number_of_reviews", + "type": "double" + }, { + "name": "review_scores_rating", + "type": "double" + }, { + "name": "room_type", + "type": "string" + }, { + "name": "host_is_superhost", + "type": "string" + }, { + "name": "cancellation_policy", + "type": "string" + }, { + "name": "instant_bookable", + "type": "string" + }] + }, + "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"]] +} diff --git a/samples/features/sql-big-data-cluster/app-templates/mleap/run-spec.yaml b/samples/features/sql-big-data-cluster/app-templates/mleap/run-spec.yaml new file mode 100644 index 00000000..0fa7edb1 --- /dev/null +++ b/samples/features/sql-big-data-cluster/app-templates/mleap/run-spec.yaml @@ -0,0 +1,3 @@ +name: hello-mleap +version: v1 +inputs: ./frame.airbnb.json \ No newline at end of file diff --git a/samples/features/sql-big-data-cluster/app-templates/mleap/spec.yaml b/samples/features/sql-big-data-cluster/app-templates/mleap/spec.yaml new file mode 100644 index 00000000..c392d3cc --- /dev/null +++ b/samples/features/sql-big-data-cluster/app-templates/mleap/spec.yaml @@ -0,0 +1,4 @@ +name: hello-mleap +version: v1 +runtime: Mleap +bundleFileName: airbnb.model.lr.zip \ No newline at end of file diff --git a/samples/features/sql-big-data-cluster/app-templates/python/hello.py b/samples/features/sql-big-data-cluster/app-templates/python/hello.py new file mode 100644 index 00000000..9ef1b95a --- /dev/null +++ b/samples/features/sql-big-data-cluster/app-templates/python/hello.py @@ -0,0 +1,18 @@ +def handler(msg): + """ + Writes input argument back-out to the standard output returning input as + output. + + Generated by: `SQL Server Big Data Cluster` + + :param msg: The message to echo. + :type msg: str + :return: The input message `msg` as output `out`. + """ + print(msg) + out = msg + return out + + +if __name__ == '__main__': + handler('Hello') \ No newline at end of file diff --git a/samples/features/sql-big-data-cluster/app-templates/python/run-spec.yaml b/samples/features/sql-big-data-cluster/app-templates/python/run-spec.yaml new file mode 100644 index 00000000..34d8f7e4 --- /dev/null +++ b/samples/features/sql-big-data-cluster/app-templates/python/run-spec.yaml @@ -0,0 +1,4 @@ +name: hello-python +version: v1 +inputs: + msg: hello \ No newline at end of file diff --git a/samples/features/sql-big-data-cluster/app-templates/python/spec.yaml b/samples/features/sql-big-data-cluster/app-templates/python/spec.yaml new file mode 100644 index 00000000..4a27bcbf --- /dev/null +++ b/samples/features/sql-big-data-cluster/app-templates/python/spec.yaml @@ -0,0 +1,11 @@ +name: hello-python +version: v1 +runtime: Python +src: ./hello.py +entrypoint: handler +replicas: 1 +poolsize: 1 +inputs: + msg: str +output: + out: str \ No newline at end of file diff --git a/samples/features/sql-big-data-cluster/app-templates/r/hello.R b/samples/features/sql-big-data-cluster/app-templates/r/hello.R new file mode 100644 index 00000000..04175d7b --- /dev/null +++ b/samples/features/sql-big-data-cluster/app-templates/r/hello.R @@ -0,0 +1,12 @@ +#' Writes input argument back-out to the +#' standard output returning input as output. +#' +#' Generated by: `SQL Server Big Data Cluster` +#' +#' @param msg A character message to echo. +#' @return The input \code{msg} as output \code{out}. +handler <- function(msg) { + print(msg) + out = msg + out +} diff --git a/samples/features/sql-big-data-cluster/app-templates/r/run-spec.yaml b/samples/features/sql-big-data-cluster/app-templates/r/run-spec.yaml new file mode 100644 index 00000000..5f1969dc --- /dev/null +++ b/samples/features/sql-big-data-cluster/app-templates/r/run-spec.yaml @@ -0,0 +1,4 @@ +name: hello-r +version: v1 +inputs: + msg: hello \ No newline at end of file diff --git a/samples/features/sql-big-data-cluster/app-templates/r/spec.yaml b/samples/features/sql-big-data-cluster/app-templates/r/spec.yaml new file mode 100644 index 00000000..fc09f4c8 --- /dev/null +++ b/samples/features/sql-big-data-cluster/app-templates/r/spec.yaml @@ -0,0 +1,11 @@ +name: hello-r +version: v1 +runtime: R +src: ./hello.R +entrypoint: handler +replicas: 1 +poolsize: 1 +inputs: + msg: character +output: + out: character \ No newline at end of file diff --git a/samples/features/sql-big-data-cluster/app-templates/ssis/hello.dtsx b/samples/features/sql-big-data-cluster/app-templates/ssis/hello.dtsx new file mode 100644 index 00000000..103864b6 --- /dev/null +++ b/samples/features/sql-big-data-cluster/app-templates/ssis/hello.dtsx @@ -0,0 +1,68 @@ + + + 8 + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + \ No newline at end of file diff --git a/samples/features/sql-big-data-cluster/app-templates/ssis/run-spec.yaml b/samples/features/sql-big-data-cluster/app-templates/ssis/run-spec.yaml new file mode 100644 index 00000000..da7a3db4 --- /dev/null +++ b/samples/features/sql-big-data-cluster/app-templates/ssis/run-spec.yaml @@ -0,0 +1,2 @@ +name: hello-ssis +version: v1 \ No newline at end of file diff --git a/samples/features/sql-big-data-cluster/app-templates/ssis/spec.yaml b/samples/features/sql-big-data-cluster/app-templates/ssis/spec.yaml new file mode 100644 index 00000000..6fd2c686 --- /dev/null +++ b/samples/features/sql-big-data-cluster/app-templates/ssis/spec.yaml @@ -0,0 +1,6 @@ +name: hello-ssis +version: v1 +runtime: SSIS +entrypoint: ./hello.dtsx +options: /REP V +schedule: "*/2 * * * *"