Skip to content

Commit

Permalink
Merge pull request microsoft#15 from microsoft/bobworking
Browse files Browse the repository at this point in the history
Build 2020 demos
  • Loading branch information
rgward authored May 5, 2020
2 parents f61d6f0 + 0ed755b commit fc58f4f
Show file tree
Hide file tree
Showing 69 changed files with 342,263 additions and 0 deletions.
1,557 changes: 1,557 additions & 0 deletions demos/build2020/iqp/iqp_tablevariabledeferred.ipynb

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions demos/build2020/iqp/restorewwi.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
restore database WideWorldImporters from disk = 'c:\sql_sample_databases\WideWorldImporters-Full.bak' with
move 'WWI_Primary' to 'c:\sql_sample_databases\WideWorldImporters.mdf',
move 'WWI_UserData' to 'c:\sql_sample_databases\WideWorldImporters_UserData.ndf',
move 'WWI_Log' to 'c:\sql_sample_databases\WideWorldImporters.ldf',
move 'WWI_InMemory_Data_1' to 'c:\sql_sample_databases\WideWorldImporters_InMemory_Data_1',
stats=5
go
1 change: 1 addition & 0 deletions demos/build2020/sqlcontainers/wwi/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# wwi
6 changes: 6 additions & 0 deletions demos/build2020/sqlcontainers/wwi/apptest/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM mcr.microsoft.com/mssql-tools

COPY . /

RUN chmod +x /db-init.sh
CMD /bin/bash ./entrypoint.sh
8 changes: 8 additions & 0 deletions demos/build2020/sqlcontainers/wwi/apptest/apptest.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
USE [WideWorldImporters]
GO
SELECT @@VERSION
GO
PRINT 'How many objects are in the database'
GO
SELECT COUNT(*) AS numobjects FROM sys.objects
GO
4 changes: 4 additions & 0 deletions demos/build2020/sqlcontainers/wwi/apptest/db-init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
echo "Perform application testing...."

# run a T-SQL script to perform sanity checks
/opt/mssql-tools/bin/sqlcmd -S mssql -U sa -P Sql2019isfast -d master -i apptest.sql
6 changes: 6 additions & 0 deletions demos/build2020/sqlcontainers/wwi/apptest/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#start SQL Server, start the script to create/setup the DB
#You need a non-terminating process to keep the container alive.
#In a series of commands separated by single ampersands the commands to the left of the right-most ampersand are run in the background.
#So - if you are executing a series of commands simultaneously using single ampersands, the command at the right-most position needs to be non-terminating
/db-init.sh

40 changes: 40 additions & 0 deletions demos/build2020/sqlcontainers/wwi/azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml

trigger:
- master

pool:
vmImage: 'ubuntu-latest'

steps:

- task: DockerCompose@0
displayName: 'Build any containers'
inputs:
dockerComposeFiles: docker-compose.yml
action: Run a Docker Compose command
dockerComposeCommand: build

- task: DockerCompose@0
displayName: 'Start up SQL Server'
inputs:
dockerComposeFiles: docker-compose.yml
action: Run a Docker Compose command
dockerComposeCommand: up -d mssql

- task: DockerCompose@0
displayName: 'Create Database'
inputs:
dockerComposeFiles: docker-compose.yml
action: Run a Docker Compose command
dockerComposeCommand: up createdb

- task: DockerCompose@0
displayName: 'Application Test'
inputs:
dockerComposeFiles: docker-compose.yml
action: Run a Docker Compose command
dockerComposeCommand: up apptest
6 changes: 6 additions & 0 deletions demos/build2020/sqlcontainers/wwi/createdb/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM mcr.microsoft.com/mssql-tools

COPY . /

RUN chmod +x /db-init.sh
CMD /bin/bash ./entrypoint.sh
7 changes: 7 additions & 0 deletions demos/build2020/sqlcontainers/wwi/createdb/db-init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# wait for the SQL Server to come up. We only need about 15 seconds. Azure Pipeline delay task appears to be
sleep 15s

echo "Create the WideWorldImporters Database...."
# run the setup script to create the DB and the schema in the DB

/opt/mssql-tools/bin/sqlcmd -S mssql -U sa -P Sql2019isfast -d master -i wwi.sql
6 changes: 6 additions & 0 deletions demos/build2020/sqlcontainers/wwi/createdb/db-init.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CREATE DATABASE WideWorldImporters
GO
USE [WideWorldImporters]
GO
SELECT * FROM sys.objects
GO
6 changes: 6 additions & 0 deletions demos/build2020/sqlcontainers/wwi/createdb/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#start SQL Server, start the script to create/setup the DB
#You need a non-terminating process to keep the container alive.
#In a series of commands separated by single ampersands the commands to the left of the right-most ampersand are run in the background.
#So - if you are executing a series of commands simultaneously using single ampersands, the command at the right-most position needs to be non-terminating
/db-init.sh

Binary file not shown.
20 changes: 20 additions & 0 deletions demos/build2020/sqlcontainers/wwi/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: "3"
services:
mssql:
image: mcr.microsoft.com/mssql/server:2019-CU3-ubuntu-18.04
environment:
SA_PASSWORD: "Sql2019isfast"
ACCEPT_EULA: "Y"
MSSQL_AGENT_ENABLED: "true"
container_name: mssql
hostname: mssql

createdb:
build: ./createdb
container_name: createdb
hostname: createdb

apptest:
build: ./apptest
container_name: apptest
hostname: apptest
12 changes: 12 additions & 0 deletions demos/build2020/sqllinux/createtable.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
CREATE TABLE orauser.rental_data(
year int,
month int,
day int,
rentalcount int,
weekday int,
holiday int,
snow int,
fholiday varchar2(255),
fsnow varchar2(255),
fweekday varchar2(255)
);
8 changes: 8 additions & 0 deletions demos/build2020/sqllinux/createuser.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CREATE USER orauser IDENTIFIED BY orapwd DEFAULT TABLESPACE users TEMPORARY TABLESPACE temp QUOTA UNLIMITED ON users;
GRANT CREATE SESSION TO orauser;
GRANT CREATE TABLE TO orauser;
GRANT CREATE VIEW TO orauser;
GRANT CREATE ANY TRIGGER TO orauser;
GRANT CREATE ANY PROCEDURE TO orauser;
GRANT CREATE SEQUENCE TO orauser;
GRANT CREATE SYNONYM TO orauser;
Loading

0 comments on commit fc58f4f

Please sign in to comment.