Skip to content
Open
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
33 changes: 33 additions & 0 deletions multi-cloud-ai-workflow-az/build/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FROM ubuntu:19.10

RUN apt-get update
RUN apt-get install curl -y
RUN curl -o msft.deb https://packages.microsoft.com/config/ubuntu/19.04/packages-microsoft-prod.deb
RUN dpkg -i msft.deb

RUN apt-get update

RUN apt-get install nano git unzip default-jre python2.7 python-pip apt-transport-https dotnet-sdk-2.1 dotnet-sdk-3.1 -y

RUN curl -sL https://aka.ms/InstallAzureCLIDeb | bash

# get install script and pass it to execute:
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash -
# and install node
RUN apt-get update
RUN apt-get install nodejs -y
# confirm that it was successful
RUN node -v
# npm installs automatically
RUN npm -v

RUN curl -o tf.zip https://releases.hashicorp.com/terraform/0.12.12/terraform_0.12.12_linux_amd64.zip
RUN unzip tf.zip
RUN mv terraform /usr/local/bin
RUN rm tf.zip
RUN dotnet tool install -g dotnet-script


WORKDIR /var/opt
COPY ./task-inputs.json .
COPY ./init.sh .
14 changes: 14 additions & 0 deletions multi-cloud-ai-workflow-az/build/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Build and Deploy MCMA for Azure with Docker
## Steps
* Use the Dockerfile in this folder to build a docker image. Use the following `docker` command.
* `docker build -t mcma-deploy-az --rm . `
* Edit the [__env.txt__](env.txt) with all the required values.
* Run the docker container with this `docker` command
* `docker run --env-file env.txt --name mcma-build -it mcma-deploy-az /bin/bash`
* Once inside the container, run the [__init.sh__](init.sh) script:
* `root@d5ac7e9bca23:/var/opt# ./init.sh`

This script will
* clone this repository into the Docker container.
* populate the `task-inputs.json` file wit the environment variables that were passed in.
* run __./tasks.sh deploy__ and deploy your MCMA resources to Azure.
13 changes: 13 additions & 0 deletions multi-cloud-ai-workflow-az/build/env.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
ENVIRONMENTNAME=uniqueNameForGroupingYourResources
ENVIRONMENTTYPE=typeOfEnvironmentBeingDeployed
AZURESUBSCRIPTIONID=Guid
AZURETENANTID=Guid
AZURELOCATION=East US
AZURECLIENTID=Guid
AZURECLIENTSECRET=clientSecret
AWSACCESSKEY=AwsAccessKey
AWSSECRETKEY=AwsSecretKey
AWSREGION=us-east-1
AZUREVIDEOINDEXERACCOUNTID=VideoIndexerAccountId
AZUREVIDEOINDEXERSUBSCRIPTIONKEY=AzureVideoIndexerAccountId
ONMICROSOFTPREFIX=yourOnMicrosoftDomainPrefix
24 changes: 24 additions & 0 deletions multi-cloud-ai-workflow-az/build/init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
export PATH="$PATH:/root/.dotnet/tools"
export NG_CLI_ANALYTICS=ci
git clone https://github.com/ebu/mcma-projects-dotnet.git
mv ./task-inputs.json /var/opt/mcma-projects-dotnet/multi-cloud-ai-workflow-az/task-inputs.json
chmod 777 /var/opt/mcma-projects-dotnet/multi-cloud-ai-workflow-az/tasks.sh
rm /var/opt/mcma-projects-dotnet/multi-cloud-ai-workflow-az/website/package-lock.json
cd /var/opt/mcma-projects-dotnet/multi-cloud-ai-workflow-az
sed -i "s|evanverneyfinklive|$ONMICROSOFTPREFIX|g" /var/opt/mcma-projects-dotnet/multi-cloud-ai-workflow-az/deployment/website/main.tf

sed -i "s|VALUE01|$ENVIRONMENTNAME|g" /var/opt/mcma-projects-dotnet/multi-cloud-ai-workflow-az/task-inputs.json
sed -i "s|VALUE02|$ENVIRONMENTTYPE|g" /var/opt/mcma-projects-dotnet/multi-cloud-ai-workflow-az/task-inputs.json
sed -i "s|VALUE03|$AZURESUBSCRIPTIONID|g" /var/opt/mcma-projects-dotnet/multi-cloud-ai-workflow-az/task-inputs.json
sed -i "s|VALUE04|$AZURETENANTID|g" /var/opt/mcma-projects-dotnet/multi-cloud-ai-workflow-az/task-inputs.json
sed -i "s|VALUE05|$AZURELOCATION|g" /var/opt/mcma-projects-dotnet/multi-cloud-ai-workflow-az/task-inputs.json
sed -i "s|VALUE06|$AZURECLIENTID|g" /var/opt/mcma-projects-dotnet/multi-cloud-ai-workflow-az/task-inputs.json
sed -i "s|VALUE07|$AZURECLIENTSECRET|g" /var/opt/mcma-projects-dotnet/multi-cloud-ai-workflow-az/task-inputs.json
sed -i "s|VALUE08|$AWSACCESSKEY|g" /var/opt/mcma-projects-dotnet/multi-cloud-ai-workflow-az/task-inputs.json
sed -i "s|VALUE09|$AWSSECRETKEY|g" /var/opt/mcma-projects-dotnet/multi-cloud-ai-workflow-az/task-inputs.json
sed -i "s|VALUE10|$AWSREGION|g" /var/opt/mcma-projects-dotnet/multi-cloud-ai-workflow-az/task-inputs.json
sed -i "s|VALUE11|$AZUREVIDEOINDEXERACCOUNTID|g" /var/opt/mcma-projects-dotnet/multi-cloud-ai-workflow-az/task-inputs.json
sed -i "s|VALUE12|$AZUREVIDEOINDEXERSUBSCRIPTIONKEY|g" /var/opt/mcma-projects-dotnet/multi-cloud-ai-workflow-az/task-inputs.json

# Deploy
./tasks.sh deploy