Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Warning

INTERNAL DRAFT

Changes since Beta 1

  • Using the same ODS/API code as recently released for version 3.3 (thus the ODS/API at "production quality")
  • Supports Data Standard 3.2
  • Admin App now included.
  • Improvements to the deployment scripts. From end-user perspective, the primary change is to download previously-packaged versions of the web applications instead of re-compiling and re-packaging them.
  • No longer testing on PostgreSQL 10, now that all three cloud providers support PostgreSQL 11.

Project Scope

As a reminder, project Roadrunner is simplified, binary-release of the Ed-Fi ODS/API, targeting both PostgreSQL and SQL Server database engines. This installation provides the following applications:

  1. ODS/API with all resources from EFDS32, operating in "Shared Instance" mode.
    1. Does not include: extension support; API Composites; sandboxes; change queries; profiles.
  2. AdminApp
  3. /wiki/spaces/ODSAPI33/pages/26443888 (also known as: Client Side Bulk Load)Swagger UI
  4. Swagger UI
  5. Deployment scripts for deploying the databases and configuring the four applications above.

Operational Requirements

The Roadrunner deployment scripts allow the user to deploy the three Ed-Fi databases (Admin, ODS, Security) to either PostgreSQL or SQL Serveron a PostgreSQL database server. In addition, they download the ODS/API version 3.3 binary release of the API, Swagger UI, and Client Side Bulk Loader, and the current pre-release of Admin App v1.7. After download, the deployment scripts will reconfigure the web.config files by setting up the correct connection strings for the environment, and they will copy the files out to another directory of the user's choosing. These could be network paths for pushing the files out to another web server.

Note

Configuration of IIS is currently up to the end-user. These scripts only modify the web.config files for the downloaded applications.

Deployment Server

For the server running the deployment scripts:

  • Scripts are built on assumption of PowerShell version 5 or above.
  • Requires .NET Core 2.2 SDKFor PostgreSQL there are two deployment modes, with different requirements:
  • (RECOMMENDED) From source scripts: automatically installs correct version of a custom database deployment tool.
  • From backup files ("templates"): requires psql  executable to be in your command path

    Note

    Install via template is primarily intended for cloud environments, where re-packaging might be necessary and the custom deployment tool may be a sub-optimal solution.

    You can install the PostgreSQL client tools locally, which includes psql.exe, from Enterprise DB. While installing you can choose to install only the command line tools without the server, if desired

    Requires the command line tools from PostgreSQL 10 or 11, with psql.exe  in your command path.

    Expand
    titleInstalling PostgreSQL tools...
    1. Download the 11.5 release from Enterprise DB (Windows x64 edition).
    2. Run the installer.
    3. When the installer gets to the point of selecting components, you can deselect the Server and Stack Builder options. pgAdmin4 is optional; it is a versatile GUI tool for managing your server, with the drawback that it cannot open or save SQL files.
      Image Added
    4. When the installation is complete, edit your path by adding C:\Program Files\PostgreSQL\11\bin (assuming you installed the x64 edition).


  • Internet access - this is not an offline deployment process.

Web Server

  • Windows 10 Professional or Windows Server 2016+.
  • Server role: Web Server. On our integration server we have the following IIS features installed:

    Expand
    titleIIS Features ...
    • Common HTTP Features
      • Default Document
      • Directory Browsing
      • HTTP Errors
      • Static Content
      • HTTP Redirection
    • Health and Diagnostics
      • HTTP Logging
      • Logging Tools
      • Request Monitor
      • Tracing
    • Performance
      • Static Content Compression
    • Security
      • Request Filtering
      • Basic Authentication
      • Windows Authentication
    • Application Development
      • .NET Extensibility 3.7
      • Application Initialization
      • ASP.NET 4.7
      • ISAPI Extensions
      • ISAPI Filters
      • WebSocket Protocol


  • URL Rewrite module
  • .NET Framework 4.8 runtime
  • Firewall access from web server to database server, if running on separate servers.
  • Does not require MSMQ or .NET Framework 3.5, unlike the full ODS/API release.

Database Server

  • Installing SQL Server: both versions 2016 and 2017 have been tested. No testing on 2019 yet.
  • Installing on PostgreSQL: final testing performed only on version 11; Beta release was also tested on version 10. No testing on 12 yet.
  • Credentials with permission to create and drop databases.
Tip
titleInstalling on Cloud Managed Services

This release has been tested with Azure and AWS managed services for PostgreSQL. The Roadrunner Beta 1 release was tested on Google Cloud SQL.

When installing on AWS, you'll need to configure a postgres  role and add your administrative user to it, since AWS does not create that role by default.

Code Block
create role postgres NOINHERIT;
grant postgres to edfi;

This role is utilized by the Roadrunner deployment scripts and must exist.

Install Process

1. Download NuGet Package

Roadrunner binaries and automation scripts are available via a NuGet package. You should download this on your webserver. Two options: NuGet command line or direct download.

This command will automatically unzip the contents into the working directory, under  EdFi.Ods.RoadRunner.1.0.0-rc1 .

Code Block
nuget.exe install EdFi.ODS.Roadrunner -Version 1.0.0-rc1 -Source https://www.myget.org/F/ed-fi/api/v3/index.json

Alternately, download from https://www.myget.org/F/ed-fi/api/v2/package/EdFi.ODS.Roadrunner/1.0.0-rc1. This is just a fancy zip file - so if you want to inspect it, just open it with your favorite zip file client.

Inside that NuGet package, you'll find Initialize-Environment.ps1 . This orchestration script handles all of the deployment processes described above - installation to either database engine, download of the applications, and setting up connection strings. 

2. Run Initialize-Environment.ps1

Prepare

In order to run the script, you'll need to have the following information at hand:

  1. Database server name
    1. In either case, is the database engine running on a non-default port? (1433 for SQL Server, 5432 for PostgreSQL)

  2. Database user credentials

    Note

    These credentials will be inserted into the web application connection strings. If using integrated security with SQL Server, then be sure to setup the IIS Appl Pool Identity user or the IIS service user, as appropriate, with db_datareader  and db_datawriter access in all three databases.


    1. If SQL Server, either the deployment account must have admin rights in the database (integrated security), or you need to provide SQL credentials that have admin rights. You can set the password via environment variable $env:SQLSERVERPASSWORD or pass it as a parameter.

    2. If PostgreSQL, then you need to provide database credentials. While the username is passed in as a parameter, the password must be passed through environment variable $env:PGPASSWORD  or, if the client tools are installed, through the pgpass config file.

  3. If installing on PostgreSQL
    1. Do you want the standard install or the template-based install? If using templates, you can choose from "empty", "minimal" (includes descriptors), and "populated" (includes a small set of sample data).
    2. If your instance requires SSL/TLS encryption, then set environment variable $env:PGSSLMODE="require" .

  4. Additional database options
    1. If the destination databases already exist, do you want to drop them? ((warning) for PostgreSQL, requires that you have the client utilities installed on the deployment server).
    2. Do you want to change the database names away from the defaults of EdFi_Admin , EdFi_ODS, and EdFi_Security?

  5. Destination folder paths for the four applications:
    1. Web API
    2. Swagger UI
    3. Admin App
    4. API Bulk Loader

This script has a long list of parameters. It can be useful to create a PowerShell object (dictionary) with the values, instead of trying to string all of the values together in a single command. Doing so makes it easier to review your parameters before running the script.

Code Block
languagepowershell
# Prepare an object dictionary with your parameters
$parameters = @{
   # Add parameters here, e.g.
   engine = "postgresql"
}

# Can also set parameters one-by one
$parameters.databaseServer = "myserver"

# Can review all parameters
$parameters

# Everything look good? Then pass the parameters to the deployment script:
.\Initialize-Environment.ps1 @parameters

Command Syntax

Code Block
Initialize-Environment [[-swaggerIisFolder] <String>] [[-webApiBaseUrl] <String>] [[-webApiIisFolder] <String>] [[-apiBulkFolder] <String>] [-engine] <String> [-databaseServer] <String> [[-databasePort] <String>] [[-databaseUser] <String>] [[-databasePassword] <String>] [-useIntegratedSecurity] [[-adminDatabaseName] <String>] [[-odsDatabaseName] <String>] [[-securityDatabaseName] <String>] [-useTemplates] [[-odsTemplate] <String>] [-noDuration] [-dropDatabases] [<CommonParameters>]

Parameter List

NameDescriptionRequired?Default Value
-webApiBaseUrlBase URL that Swagger should use when connecting to the Web API. Defaults
to "http://localhost:54746".
falsehttp://localhost:54746
-webApiIisFolderDestination folder for Web API web application. Files will be overwritten.
Default value of $null prevents Web API web application from being
configured and deployed.
false
-adminAppIisFolderDestination folder for the AdminApp web application. Files will be overwritten. Default value of $null prevents AdminApp web application from being configured and deployed.false
-swaggerIisFolder

Destination folder for Swagger web application. Files will be overwritten.
Default value of $null prevents Swagger web application from being
configured and deployed.

(warning) Not recommended for production installations.

false
-apiBulkFolderDestination folder for installing the API bulk loader program.false
-engineThe database engine that will be used: SqlServer or PostgreSQL.true
-databaseServerThe network name or IP address of the database server.true
-databasePortDatabase port number. For PostgreSQL, defaults to 5432. For SQL Server,
defaults to 1433.
false
-databaseUserUsername for connection to the database instance, both during installation
and during runtime. User must have permission to drop and create databases.
false
-databasePassword

Optionally provide a database password for non integrated-security.
Alternately, can provide via environment variable $env:SqlServerPassword.
Note that this is option is only supported for SQL Server.

(warning) For PostgreSQL the password must be passed through environment variable or pgpass config file.

false$env:SqlServerPassword
-useIntegratedSecuritySwitch to enable use of Windows Integrated Security instead of a database
username and password. When true, any values provided for user name and
password are ignored.
falseFalse
-adminDatabaseNameName of the Admin database. Defaults to EdFi_Admin.falseEdFi_Admin
-odsDatabaseNameName of the ODS database. Defaults to EdFi_ODS.falseEdFi_ODS
-securityDatabaseNameName of the Security database. Defaults to EdFi_Security.falseEdFi_Security
-useTemplatesSwitch to install from template databases instead of the original SQL
scripts used by the EdFi.Db.Deploy executable. Currently only available
for PostgreSQL.
falseFalse
-odsTemplateTemplate to use when $useTemplates is true. Allowed values: empty,
minimal, populated. Defaults to empty.
falseempty
-noDurationWhen true, does not report task duration.falseFalse
-dropDatabasesWhen true, drops databases if they already exist. Defaults to false.
If databases exists and $dropDatabases is false, then deploy from
templates will fail, but deploy from Db Deploy will succeed.
falseFalse

Examples

Install databases on PostgreSQL and all three WebApps (Web API, Admin App, Swagger UI), and selecting the ODS populated template. (This is a good option for kicking the tires).

Code Block
$parameters = @{ 
	engine = "postgresql"
	databaseServer = "myserver"
	databaseUser = "postgres" 
    useTemplates = $true 
	odsTemplate = "populated"
    webApiIisFolder = "c:\inetpub\ed-fi\webapi"
    swaggerIisFolder = "c:\inetpub\ed-fi\swagger"
    adminAppIisFolder = "c:\inetpub\ed-fi\adminapp"
}
 .\Initialize-Environment.ps1 @parameters

Only install databases on PostgreSQL, using all available default values.

Code Block
$parameters = @{ 
	engine = "postgresql"
	databaseServer = "myserver"
	databaseUser = "postgres" 
}
 .\Initialize-Environment.ps1 @parameters

Only install databases on PostgreSQL, using templates (populated ODS).

Code Block
$parameters = @{ 
	engine = "postgresql" 
	databaseServer = "myserver" 
	databaseUser = "postgres" 
	useTemplates = $true 
	odsTemplate = "populated" 
}
.\Initialize-Environment.ps1 @parameters

Only install databases on PostgreSQL, dropping existing database first.

Code Block
$parameters = @{ 
	engine = "postgresql" 
	databaseServer = "myserver" 
	databaseUser = "postgres" 
	dropDatabases = $true 
}
.\Initialize-Environment.ps1 @parameters

Install databases on SQL Server, with alternate port 1450, and deploy the Web API.

Code Block
$parameters = @{ 
	engine = "sqlserver"
	databaseServer = "myserver"
	databasePort = 1450
	useIntegratedSecurity = $true
	dropDatabases = $true
	webApiIisFolder = "c:\inetpub\ed-fi\webapi"
} 
.\Initialize-Environment.ps1 @parameters

Install on SQL Server, override the default database, and deploy both the Web API and Swagger UI.

Code Block
$parameters = @{ 
	engine = "sqlserver"
	databaseServer = "myserver"
	databasePort = 1450
	useIntegratedSecurity = $true
	dropDatabases = $true
	webApiIisFolder = "c:\inetpub\ed-fi\webapi"
	swaggerIisFolder = "c:\inetpub\ed-fi\swagger"
	admindatabase = "edfi_admin_rr"
	odsdatabase = "edfi_ods_rr"
	securitydatabase = "edfi_security_rr"
}
.\Initialize-Environment.ps1 @parameters

3. Setup IIS Applications

As mentioned earlier,  configuration of IIS is up to the end user in the release candidate.  Some IIS configuration tips follow:

  • If the deployment server is not also the web server, and if your "IIS Folder" paths were local rather than remote, then copy/move the three web application folders to your IIS web server(s). In IIS Manager, setup an Application for each, with custom app pools.
  • If using integrated security in your connection strings, then we recommend setting App Pool Identity as the user and granting that user access rights to read and write in the three remote databases.
  • Grant write access to the IIS_IUSRS account to the folder containing AdminApp assets, so that the secrets.json file can be updated during the Admin App's first-run configuration.

Running the Applications

Now that everything is setup, you can start using the applications.

  • As a first step, you may want to confirm that the Web API is running. If you installed on server "myserver" with IIS Application named "webapi", then try loading https://myserver/webapi in a browser to confirm that the version endpoint does not generate any errors. If that works, next try https://myserver/webapi/metadata. Any problems? Check the ODS/API error log, which by default is in c:\ProgramData\Ed-Fi-ODS-API.
  • Before accessing Swagger UI or loading data via the API Bulk Loader, you'll need to use the Admin App to generate client credentials (key and secret).
    • If you installed Admin App on server "myserver" with IIS Application named "AdminApp", then try loading https://myserver/AdminApp.
    • Click through the Admin App initial setup, and then before you do anything else, stop and restart the WebAPI web site via IIS Manager to force a security cache refresh.

Providing Feedback

Found a bug? Please file a Bug Report in the ODS project in Tracker. Ideally, use "roadrunner" in the labels field and put the name "Roadrunner" in the summary.

Feedback on the deployment scripts? Either file a ticket in Tracker, post a comment below, respond in #dev-roadrunner in Slack, or send email to Vinaya Mayya and Stephen Fuqua.


Table of Contents