Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions samples/features/sql-big-data-cluster/app-deploy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ Application deployment allows you to deploy applications into SQL Server big dat

## Pre-requisites
* SQL Server big data cluster CTP 2.3 or later
* `mssqlctl` CLI familiarity. If you are unfamiliar with `mssqlctl` please refer to - [App Deployment in SQL Server big data cluster](https://docs.microsoft.com/en-us/sql/big-data-cluster/big-data-cluster-create-apps?view=sqlallproducts-allversions) for more information.
* `azdata` CLI familiarity. If you are unfamiliar with `azdata` please refer to - [App Deployment in SQL Server big data cluster](https://docs.microsoft.com/en-us/sql/big-data-cluster/big-data-cluster-create-apps?view=sqlallproducts-allversions) for more information.

* Tip
**mssqlctl app -h** will display the various commands to manage the app
**azdata app -h** will display the various commands to manage the app

## Templates
Templates are used by our [App Deploy add-ins](https://docs.microsoft.com/en-us/sql/big-data-cluster/app-deployment-extension?view=sqlallproducts-allversions) and can be used to quickly deploy applications.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ To run this sample, you need the following prerequisites.
**Software prerequisites:**

1. SQL Server big data cluster CTP 2.3 or later.
2. `mssqlctl`. Refer to [installing mssqlctl](https://docs.microsoft.com/en-us/sql/big-data-cluster/deploy-install-mssqlctl?view=sqlallproducts-allversions) document on setting up the `mssqlctl` and connecting to a SQL Server 2019 big data cluster.
2. `azdata`. Refer to [installing azdata](https://docs.microsoft.com/en-us/sql/big-data-cluster/deploy-install-azdata?view=sqlallproducts-allversions) document on setting up the `azdata` and connecting to a SQL Server 2019 big data cluster.

<a name=run-this-sample></a>

Expand All @@ -44,20 +44,20 @@ To run this sample, you need the following prerequisites.
2. Log in to the SQL Server big data cluster using the command below using the IP address of the `mgmtproxy-svc-external` in your cluster. If you are not familiar with `mssqltctl` you can refer to the [documentation](https://docs.microsoft.com/en-us/sql/big-data-cluster/big-data-cluster-create-apps?view=sqlallproducts-allversions) and then return to this sample.

```bash
mssqlctl login -e https://<ip-address-of-mgmtproxy-svc-external>:30777 -u <user-name> -p <password>
azdata login -e https://<ip-address-of-mgmtproxy-svc-external>:30777 -u <user-name> -p <password>
```
3. Deploy the application by running the following command, specifying the folder where your `spec.yaml` and `roll-dice.R` files are located:
```bash
mssqlctl app create --spec ./RollDice
azdata app create --spec ./RollDice
```
4. Check the deployment by running the following command:
```bash
mssqlctl app list -n roll-dice -v [version]
azdata app list -n roll-dice -v [version]
```
Once the app is listed as `Ready` you can continue to the next step.
5. Test the app by running the following command:
```bash
mssqlctl app run -n roll-dice -v [version] --input x=3
azdata app run -n roll-dice -v [version] --input x=3
```
You should get output like the example for three dice below. The results of the dice rolled are in the `result` data frame:
```json
Expand Down Expand Up @@ -88,7 +88,7 @@ To run this sample, you need the following prerequisites.
6. You can clean up the sample by running the following commands:
```bash
# delete app
mssqlctl app delete --name roll-dice --version [version]
azdata app delete --name roll-dice --version [version]
```

<a name=sample-details></a>
Expand Down
12 changes: 6 additions & 6 deletions samples/features/sql-big-data-cluster/app-deploy/SSIS/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ To run this sample, you need the following prerequisites.
**Software prerequisites:**

1. SQL Server big data cluster CTP 2.3 or later.
2. `mssqlctl`. Refer to [installing mssqlctl](https://docs.microsoft.com/en-us/sql/big-data-cluster/deploy-install-mssqlctl?view=sqlallproducts-allversions) document on setting up the `mssqlctl` and connecting to a SQL Server big data cluster.
2. `azdata`. Refer to [installing azdata](https://docs.microsoft.com/en-us/sql/big-data-cluster/deploy-install-azdata?view=sqlallproducts-allversions) document on setting up the `azdata` and connecting to a SQL Server big data cluster.
3. Optional: to see the SSIS package itself, install Visual Studio 2017 if you don't have it already. After that download and install [SSDT](https://docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt?view=sql-server-2017#ssdt-for-vs-2017-standalone-installer).
4. Optional: install [SSMS](https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms?view=sql-server-2017) if it is not already installed.

Expand All @@ -35,16 +35,16 @@ To run this sample, you need the following prerequisites.
2. Log in to the SQL Server big data cluster using the command below using the IP address of the `mgmtproxy-svc-external` in your cluster. If you are not familiar with `mssqltctl` you can refer to the [documentation](https://docs.microsoft.com/en-us/sql/big-data-cluster/big-data-cluster-create-apps?view=sqlallproducts-allversions) and then return to this sample.

```bash
mssqlctl login -e https://<ip-address-of-mgmtproxy-svc-external>:30777 -u <user-name> -p <password>
azdata login -e https://<ip-address-of-mgmtproxy-svc-external>:30777 -u <user-name> -p <password>
```
3. Replace `[SA_PASSWORD]` in the `spec.yaml` file with the password for SQL user `sa`.
4. Deploy the application by running the following command, specifying the folder where your `spec.yaml` and `back-up-db.dtsx` files are located:
```bash
mssqlctl app create --spec ./SSIS
azdata app create --spec ./SSIS
```
5. Check the deployment by running the following command:
```bash
mssqlctl app list --name back-up-db --version [version]
azdata app list --name back-up-db --version [version]
```
Once the app is listed as `Ready` the job should run within a minute.
You can check if the backup is created by running:
Expand All @@ -56,7 +56,7 @@ To run this sample, you need the following prerequisites.
6. You can clean up the sample by running the following commands:
```bash
# delete app
mssqlctl app delete --name back-up-db --version [version]
azdata app delete --name back-up-db --version [version]
# delete backup files
kubectl -n [your namespace] exec -it mssql-master-pool-0 -c mssql-server -- /bin/bash -c "rm /var/opt/mssql/data/*.DWConfigbak"
```
Expand All @@ -73,7 +73,7 @@ Here is the spec file for this application. This sample uses the `SSIS` runtime
|Setting|Description|
|-|-|
|options|Specifies any command line parameters passed to the execution of the SSIS package|
|schedule|Specifies when the job should run. This follows cron expressions. A value of '*/1 * * * *' means the job runs *every minute*. If omitted the package will not run automatically and you can run the package on demand using `mssqlctl run -n back-up-db -v [version]` or making a call to the API.|
|schedule|Specifies when the job should run. This follows cron expressions. A value of '*/1 * * * *' means the job runs *every minute*. If omitted the package will not run automatically and you can run the package on demand using `azdata run -n back-up-db -v [version]` or making a call to the API.|

```yaml
name: back-up-db
Expand Down
20 changes: 10 additions & 10 deletions samples/features/sql-big-data-cluster/app-deploy/addpy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ To run this sample, you need the following prerequisites.
**Software prerequisites:**

1. SQL Server big data cluster CTP 2.3 or later.
2. `mssqlctl`. Refer to [installing mssqlctl](https://docs.microsoft.com/en-us/sql/big-data-cluster/deploy-install-mssqlctl?view=sqlallproducts-allversions) document on setting up the `mssqlctl` and connecting to a SQL Server 2019 big data cluster.
2. `azdata`. Refer to [installing azdata](https://docs.microsoft.com/en-us/sql/big-data-cluster/deploy-install-azdata?view=sqlallproducts-allversions) document on setting up the `azdata` and connecting to a SQL Server 2019 big data cluster.

<a name=run-this-sample></a>

Expand All @@ -45,20 +45,20 @@ To run this sample, you need the following prerequisites.
2. Log in to the SQL Server big data cluster using the command below using the IP address of the `mgmtproxy-svc-external` in your cluster. If you are not familiar with `mssqltctl` you can refer to the [documentation](https://docs.microsoft.com/en-us/sql/big-data-cluster/big-data-cluster-create-apps?view=sqlallproducts-allversions) and then return to this sample.

```bash
mssqlctl login -e https://<ip-address-of-mgmtproxy-svc-external>:30777 -u <user-name> -p <password>
azdata login -e https://<ip-address-of-mgmtproxy-svc-external>:30777 -u <user-name> -p <password>
```
3. Deploy the application by running the following command, specifying the folder where your `spec.yaml` and `add.py` files are located:
```bash
mssqlctl app create --spec ./addpy
azdata app create --spec ./addpy
```
4. Check the deployment by running the following command:
```bash
mssqlctl app list -n addpy -v [version]
azdata app list -n addpy -v [version]
```
Once the app is listed as `Ready` you can continue to the next step.
5. Test the app by running the following command:
```bash
mssqlctl app run -n addpy -v [version] --input x=3,y=5
azdata app run -n addpy -v [version] --input x=3,y=5
```
You should get output like the example below. The result of adding 3+5 are returned as `result`.
```json
Expand All @@ -75,7 +75,7 @@ To run this sample, you need the following prerequisites.
```
6. <a name=restapi></a>Any app you create is also accessible using a RESTful web service that is [Swagger](swagger.io) compliant. You can get the endpoint for the web service by running:
```bash
mssqlctl app describe --name addpy --version [version]
azdata app describe --name addpy --version [version]
```
This will return an output much like the following:
```json
Expand Down Expand Up @@ -106,28 +106,28 @@ To run this sample, you need the following prerequisites.
}
```
Note the IP address and the port number in this output. Open the following URL in your browser:
`https://[IP]:[PORT]/api/docs/swagger.json`. You will have to log in with the same credentials you used for `mssqlctl login`. The contents of the `swagger.json` you can paste into [Swagger Editor](https://editor.swagger.io) to understand what methods are available:
`https://[IP]:[PORT]/api/docs/swagger.json`. You will have to log in with the same credentials you used for `azdata login`. The contents of the `swagger.json` you can paste into [Swagger Editor](https://editor.swagger.io) to understand what methods are available:
![API Swagger](api_swagger.png)

Notice the `app` GET method as well as the `token` POST method. Since the authentication for apps uses JWT tokens you will need to get a token my using your favorite tool to make a POST call to the `token` method. Here is an example of how to do just that in [Postman](https://www.getpostman.com/):
![Postman Token](postman_token.png)

The result of this request will give you an `access_token`, which you will need to call the URL to run the app.

> *Optional*: If you want, you can open the URL for the `swagger` that was returned when you ran `mssqlctl app describe --name addpy --version [version]` in your browser. You will have to log in with the same credentials you used for `mssqlctl login`. The contents of the `swagger.json` you can paste into [Swagger Editor](https://editor.swagger.io). You will see that the web service exposes the `run` method.
> *Optional*: If you want, you can open the URL for the `swagger` that was returned when you ran `azdata app describe --name addpy --version [version]` in your browser. You will have to log in with the same credentials you used for `azdata login`. The contents of the `swagger.json` you can paste into [Swagger Editor](https://editor.swagger.io). You will see that the web service exposes the `run` method.

You can use your favorite tool to call the `run` method (`https://[IP]:30778/api/app/addpy/[version]/run`), passing in the parameters in the body of your POST request as json. In this example we will use [Postman](https://www.getpostman.com/). Before making the call, you will need to set the `Authorization` to `Bearer Token` and paste in the token you retrieved earlier. This will set a header on your request. See the screenshot below.
![Postman Run Headers](postman_run_1.png)
Next, in the requests body, pass in the parameters to the app you are calling and set the `content-type` to `application/json`:
![Postman Run Body](postman_run_2.png)
When you send the request, you will get the same output as you did when you ran the app through `mssqlctl app run`:
When you send the request, you will get the same output as you did when you ran the app through `azdata app run`:
![Postman Run Result](postman_result.png)
You have now successfully called the app through the web service!

7. You can clean up the sample by running the following commands:
```bash
# delete app
mssqlctl app delete --name addpy --version [version]
azdata app delete --name addpy --version [version]
```

<a name=sample-details></a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ To run this sample, you need the following prerequisites.
**Software prerequisites:**

1. SQL Server big data cluster CTP 2.3 or later.
2. `mssqlctl`. Refer to [installing mssqlctl](https://docs.microsoft.com/en-us/sql/big-data-cluster/deploy-install-mssqlctl?view=sqlallproducts-allversions) document on setting up the `mssqlctl` and connecting to a SQL Server 2019 big data cluster.
2. `azdata`. Refer to [installing azdata](https://docs.microsoft.com/en-us/sql/big-data-cluster/deploy-install-azdata?view=sqlallproducts-allversions) document on setting up the `azdata` and connecting to a SQL Server 2019 big data cluster.

<a name=run-this-sample></a>

Expand All @@ -44,20 +44,20 @@ To run this sample, you need the following prerequisites.
2. Log in to the SQL Server big data cluster using the command below using the IP address of the `mgmtproxy-svc-external` in your cluster. If you are not familiar with `mssqltctl` you can refer to the [documentation](https://docs.microsoft.com/en-us/sql/big-data-cluster/big-data-cluster-create-apps?view=sqlallproducts-allversions) and then return to this sample.

```bash
mssqlctl login -e https://<ip-address-of-mgmtproxy-svc-external>:30777 -u <user-name> -p <password>
azdata login -e https://<ip-address-of-mgmtproxy-svc-external>:30777 -u <user-name> -p <password>
```
3. Deploy the application by running the following command, specifying the folder where your `spec.yaml` and `magic8ball.py` files are located:
```bash
mssqlctl app create --spec ./magic8ball
azdata app create --spec ./magic8ball
```
4. Check the deployment by running the following command:
```bash
mssqlctl app list -n magic8ball -v [version]
azdata app list -n magic8ball -v [version]
```
Once the app is listed as `Ready` you can continue to the next step.
5. Test the app by running the following command:
```bash
mssqlctl app run -n magic8ball -v [version] --input txt="Will it rain tomorrow?"
azdata app run -n magic8ball -v [version] --input txt="Will it rain tomorrow?"
```
You should get output like the example below. The answer to your question are returned as `result`.
```json
Expand All @@ -78,7 +78,7 @@ To run this sample, you need the following prerequisites.
6. You can clean up the sample by running the following commands:
```bash
# delete app
mssqlctl app delete --name magic8ball --version [version]
azdata app delete --name magic8ball --version [version]
```

<a name=sample-details></a>
Expand Down
12 changes: 6 additions & 6 deletions samples/features/sql-big-data-cluster/app-deploy/mleap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ To run this sample, you need the following prerequisites.
**Software prerequisites:**

1. SQL Server big data cluster CTP 2.3 or later.
2. `mssqlctl`. Refer to [installing mssqlctl](https://docs.microsoft.com/en-us/sql/big-data-cluster/deploy-install-mssqlctl?view=sqlallproducts-allversions) document on setting up the `mssqlctl` and connecting to a SQL Server 2019 big data cluster.
2. `azdata`. Refer to [installing azdata](https://docs.microsoft.com/en-us/sql/big-data-cluster/deploy-install-azdata?view=sqlallproducts-allversions) document on setting up the `azdata` and connecting to a SQL Server 2019 big data cluster.

<a name=run-this-sample></a>

Expand All @@ -41,25 +41,25 @@ To run this sample, you need the following prerequisites.
2. Log in to the SQL Server big data cluster using the command below using the IP address of the `mgmtproxy-svc-external` in your cluster. If you are not familiar with `mssqltctl` you can refer to the [documentation](https://docs.microsoft.com/en-us/sql/big-data-cluster/big-data-cluster-create-apps?view=sqlallproducts-allversions) and then return to this sample.

```bash
mssqlctl login -e https://<ip-address-of-mgmtproxy-svc-external>:30777 -u <user-name> -p <password>
azdata login -e https://<ip-address-of-mgmtproxy-svc-external>:30777 -u <user-name> -p <password>
```
3. This example uses a TensorFlow Machine Learning Model that uses public US Census data predict income. [More details and information on the example are here](https://docs.microsoft.com/en-us/sql/big-data-cluster/train-and-create-machinelearning-models-with-spark?view=sqlallproducts-allversions). The application you will be deploying as part of this sample is a Random Forest Model that was built in Spark and has been [serialized as an MLeap bundle](https://docs.microsoft.com/en-us/sql/big-data-cluster/export-model-with-spark-mleap?view=sqlallproducts-allversions).

Deploy the app using the `create` command and pass the location of the spec file. In the example below, the spec file is expected to be in the `mleap` folder:
```bash
mssqlctl app create --spec ./mleap/
azdata app create --spec ./mleap/
```
1. Check the deployment by running the following command:
```bash
mssqlctl app list -n mleap-census -v [version]
azdata app list -n mleap-census -v [version]
```
Once the app is listed as `Ready` you can continue to the next step.
2. Now that the app has been deployed you can test if the app works correctly by passing in a sample input that is available in the `mleap` folder. The deployed app is a RESTful webservice that is [Swagger](swagger.io) compliant. For this sample we will show you how you can test this using the CLI.

To test the app, run the command below. The input parameter is a `MLeapFrame`, a `json` file that describes the parameters and the values provided to the model for predicting income. Note that the input parameter has a special character '@' to indicate that a `json` file is being passed. This command needs to be run within the `mleap` folder.

```bash
mssqlctl app run --name mleap-census --version [version] --input schema=@census_frame.json
azdata app run --name mleap-census --version [version] --input schema=@census_frame.json
```

The result will be a json output that includes the predicted income along with additional data.
Expand All @@ -69,7 +69,7 @@ To run this sample, you need the following prerequisites.
6. You can clean up the sample by running the following commands:
```bash
# delete app
mssqlctl app delete --name mleap-census --version [version]
azdata app delete --name mleap-census --version [version]
```

<a name=sample-details></a>
Expand Down
Loading