Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Commit 0e433f4

Browse files
Andrew's repo (#347)
Co-authored-by: Andrew Conniff <[email protected]>
1 parent 3f58a4c commit 0e433f4

File tree

103 files changed

+1130
-7278
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+1130
-7278
lines changed

.markdownlint.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"default": true,
3+
"MD013": false,
4+
"MD033": false,
5+
"MD007": { "indent": 4 }
6+
}

FAQ.md

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,12 @@ Find information for common problems or questions.
66

77
## Common Questions / Problems
88

9-
1. The deploy ingress dns script errors out with this message:
10-
11-
```bash
12-
5-Deploy ingress (bash ./deploy_ingress_dns.sh -s ./test_fetch_build -l westus2 -n teamdcaro04)
13-
Upgrading tiller (helm server) to match client version.
14-
$HELM_HOME has been configured at /home/azureuser/.helm.
15-
Error: tiller was not found. polling deadline exceeded
16-
```
17-
18-
There are a number of steps in this script to try and ensure tiller is available, but sometime it still times out. Please refer to Common Resolution #1 for the solution.
9+
1. A team deployment times out failures due to quotas or constraints on your Azure subscription.
1910

2011
## Common Resolution
2112

2213
1. Delete & Recreate environment
2314

24-
Instead of manually hacking the setup script and trying to re-run the steps, sometimes it is easier to simply delete the resource groups where the failure occurred and recreate the resources via the setup script using the same team number since it is fully automated.
15+
Instead of manually hacking the setup script and trying to re-run the steps, sometimes it is easier to simply delete the resource group where the failure occurred and recreate the resources via the setup script using the same team number since it is fully automated.
16+
17+
2. Review the guidance for resource quotas included in provisioning [README](./provision-team/README.md)

README.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,37 +5,34 @@ languages:
55
- sql
66
products:
77
- azure
8-
description: "This repo contains the code for the provisioning of the resources necessary to execute a DevOps openhack event."
8+
description: "This repo contains the code for the provisioning of the resources necessary to execute a DevOps OpenHack event."
99
---
1010

11-
# DevOps Openhack Proctor Repository
11+
# DevOps OpenHack Proctor Repository
1212

13-
This repo contains the code for the provisioning of the resources necessary to execute a DevOps openhack event. The relevant code individual teams use (i.e. the APIs) to complete their challenges can be found in the [DevOps Openhack Team repository](https://github.com/Azure-Samples/openhack-devops-team/).
13+
This repo contains the code for the provisioning of the resources necessary to execute a DevOps OpenHack event. The relevant code individual teams use (i.e. the APIs) to complete their challenges can be found in the [DevOps OpenHack Team repository](https://github.com/Azure-Samples/openhack-devops-team/).
1414

1515
## Components
1616

1717
The components are organized by folders which contain the following:
1818

19-
* **leaderboard** - visualizes the uptime for the teams' APIs and contains an Azure Functions API which connects to CosmosDB, Sentinel (pods to query the APIs and report status), and a web front end.
20-
* **provision-proctor** - code to support the provisioning of a complete proctor environment (1 needed per event).
2119
* **provision-team** - code to support the provisioning of a complete team environment.
22-
* **provision-vm** - automates the provisioning of an Ubuntu 16.04 VM used as the foundation for provisioning the team and proctor environments.
2320
* **simulator** - simulates traffic to the SQL database the APIs use for every team's environment.
21+
* **tripviewer** - the team website that your customers are using to review their driving scores and trips which are being simulated against the APIs.
2422

2523
Go to the root of these folders to see a readme with deeper information on each component.
2624

2725
## Getting Started
2826

2927
### Prerequisites
3028

31-
The first step is to create a virtual machine which has the necessary software installed required to provision the teams and proctor environments. In order to create the VM, only the following needs to be installed
32-
33-
* Azure PowerShell
29+
* Bash Shell
30+
* Azure CLI
3431
* An Azure Subscription
3532

3633
### High-Level Installation Flow
3734

38-
[Deploy a team environment](./provision-vm) using the Azure Resource Manager template.
35+
Deploy a team environment using the `deploy.sh` script and the guidance included in the [provision-team](./provision-team) directory.
3936

4037
## Resources
4138

provision-team/Dockerfile

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# SQL Server Command Line Tools
2+
FROM ubuntu:16.04
3+
LABEL maintainer="Opsgility"
4+
5+
# apt-get and system utilities
6+
RUN apt-get update && apt-get install -y \
7+
curl apt-transport-https debconf-utils \
8+
&& rm -rf /var/lib/apt/lists/*
9+
10+
# adding custom MS repository
11+
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
12+
RUN curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list > /etc/apt/sources.list.d/mssql-release.list
13+
14+
# install SQL Server drivers and tools
15+
RUN apt-get update && ACCEPT_EULA=Y apt-get install -y msodbcsql mssql-tools
16+
RUN echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
17+
RUN /bin/bash -c "source ~/.bashrc"
18+
19+
RUN apt-get -y install locales
20+
RUN locale-gen en_US.UTF-8
21+
RUN update-locale LANG=en_US.UTF-8
22+
23+
# install dig (dnstools)
24+
RUN apt-get update && apt-get -y install dnsutils
25+
26+
# install git
27+
RUN apt-get update && apt-get -y install git
28+
29+
# install azure cli
30+
RUN curl -sL https://aka.ms/InstallAzureCLIDeb | bash
31+
32+
COPY deploy.sh /deploy/
33+
COPY azuredeploy.json /deploy/
34+
COPY jenkins/* /deploy/jenkins/

provision-team/README.md

Lines changed: 52 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,70 @@
1-
# Team Infrastructure script
1+
# DevOps OpenHack Deployment
22

3-
## Description
3+
To initiate a deployment, download both the ARM template (`azuredeploy.json`), the bash script (`deploy.sh`), and the `jenkins/` folder to the same directory in a bash shell.
44

5-
This script is used to install the Openhack team environment for the DevOps OpenHack. This script will deploy all the necessary resources and configure the environment for a team to participate in the OpenHack.
5+
You can download these manually or using `git clone`. For example:
66

7-
## Pre-requisites
7+
```sh
8+
git clone https://github.com/Azure-Samples/openhack-devops-proctor.git
9+
```
810

9-
The required pre-requisites for installing a team environment are installed as part of proctor VM Setup. The [setup script](https://raw.githubusercontent.com/Azure-Samples/openhack-devops-proctor/master/provision-vm/proctorVMSetup.sh) lists all pre-reqs along with required versions.
11+
> **Note:** [Azure Cloud Shell](https://docs.microsoft.com/azure/cloud-shell/overview) will be the easiest to use as it has all of the required tooling (az/sqlcmd/bcp/dig/etc.) installed already.
1012
11-
## Usage
13+
## Execute Deployment
1214

13-
`nohup ./setup.sh -i <subscriptionId> -l <resourceGroupLocation> -n <teamName> -e <teamNumber> ><teamName><teamNumber>.out &`
15+
***You must be logged in to Azure already using `az login`. The deployment script as shown in the example will not perform a login for you.***
1416

15-
**NOTE: You must login against the target subscription, if you have not already done so using the azure cli, prior to executing the setup script for a team.**
17+
To execute a deployment, you can run deploy.sh with a single parameter (`-l` for location). *e.g.* To deploy into `eastus`:
1618

17-
### Parameters
19+
```sh
20+
bash deploy.sh -l eastus
21+
```
1822

19-
- SubscriptionId - id of the subscription to deploy the team infrastructure to
20-
- resourceGroupLocation - Azure region to deploy to. **_Must be a region that supports ACR, AKS, and KeyVault._**
21-
- teamName - name of the team. This value is used for the base name of all of the resources provisioned in Azure. **_Must be all lowercase alphanumeric characters_**
22-
- teamNumber (optional) - specific number for a team to provision. If this is not specified, a random (3 character + 1 number) will be auto-generated.
23+
> **Note:** Some Azure services are not available in all locations. A list of known locations will need to be built out over time.
2324
24-
An example command to provision with a random team number:
25+
### Optional container-based deployment
2526

26-
`nohup ./setup.sh -i <subscriptionId> -l eastus -n devopsoh >devopoh-random.out &`
27+
An optional container deployment is available if you wish to create your environment by supplying a username and password to the deployment script.
2728

28-
An example command to provision with a specific team number:
29+
> **Note:** This method does not support MFA-enabled logins. Please clone the repository and use the deployment script manually after executing `az login`.
2930
30-
`nohup ./setup.sh -i <subscriptionId> -l eastus -n devopsoh -e 1 >devopsoh1.out &`
31+
1. To execute a container deployment, build a container using the [Dockerfile](Dockerfile) located in the [provision-team](/provision-team/) directory.
3132

32-
**Important** - The specific team number format should be used when provisioning an event with sequential numbers starting at 1 in order for the sentinels in the proctor environment to work properly. For example:
33+
```sh
34+
docker build -f Dockerfile . -t devopsohdeploy:latest
35+
```
3336

34-
```bash
35-
nohup ./setup.sh -i <subscriptionId> -l eastus -n devopsohseawa -e 1 >devopsohseawa1.out &
36-
nohup ./setup.sh -i <subscriptionId> -l eastus -n devopsohseawa -e 2 >devopsohseawa2.out &
37-
nohup ./setup.sh -i <subscriptionId> -l eastus -n devopsohseawa -e 3 >devopsohseawa3.out &
38-
```
37+
2. Run the container, replacing the tokens `<AZURE_USERNAME>`, `<AZURE_PASSWORD>`, and `<LOCATION>` with a username and password that have the required permissions and a location which can accommodate the required resources.
3938

40-
The `nohup` command prevents the long running script (`setup.sh`) from being aborted when you exit the shell or logout.
41-
The `&` indicates to run the script in the background to not block your current session.
39+
```sh
40+
docker run -i -t devopsohdeploy:latest /bin/bash -c "export PATH="$PATH:/opt/mssql-tools/bin" && cd /deploy && bash deploy.sh -l <LOCATION> -u '<AZURE_USERNAME>' -p '<AZURE_PASSWORD>'"
41+
```
4242

43-
The standard out of the script is written to the file indicated after the sign `>`.
44-
Use the `tail` command to from the same path where you ran the setup script to monitor in real time what is written to the file:
43+
## Requirements
4544

46-
```bash
47-
tail -f devopsoh1.out
48-
```
45+
### Software requirements
46+
47+
The current deployment stack requires the following tooling and versions:
48+
49+
- Azure CLI v2.3.0 (or higher) ([Installation instructions](https://docs.microsoft.com/cli/azure/install-azure-cli))
50+
- sqlcmd v17.5.0001.2 Linux (or higher) ([Installaton instructions](https://docs.microsoft.com/sql/linux/sql-server-linux-setup-tools))
51+
- bcp
52+
- dig v9.10.3 (or higher)
53+
- git
54+
55+
### Azure permissions
56+
57+
- You must be a Contributor or an Owner on the subscription where you would like to deploy.
58+
59+
> **Note**: If you are using a custom role, you must have `write` permissions to create all the resources required for this OpenHack.
60+
61+
### Azure resource requirements
62+
63+
| Azure resource | Pricing tier/SKU | Purpose |
64+
| ------------------------ | ---------------------- | --------------------------------------- |
65+
| Azure SQL Database | Standard S3: 100 DTUs | mydrivingDB |
66+
| Azure Container Registry | Basic | Private container registry |
67+
| Azure Container Instance | 1 CPU core/1.5 GiB RAM | Jenkins container |
68+
| Azure Key Vault | Standard | Key vault for database secrets |
69+
| App Service Plan | Standard S2 | App Service Plan for all Azure Web Apps |
70+
| Azure Container Instance | 1 CPU core/1.5 GiB RAM | Simulator |

0 commit comments

Comments
 (0)