From df678e566f976c46b86af16d4e93e7279e3f3d71 Mon Sep 17 00:00:00 2001 From: David Tesar Date: Tue, 25 Jun 2019 18:34:42 -0700 Subject: [PATCH 1/4] Pipeline to use container --- azure-pipelines.yml | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c3815408..7578824f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,9 +1,7 @@ pool: vmImage: 'Ubuntu 16.04' -#Your build pipeline references a secret variable named ‘sp_username’. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab, and then select the option to make it secret. See https://go.microsoft.com/fwlink/?linkid=865972 -#Your build pipeline references a secret variable named ‘sp_password’. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab, and then select the option to make it secret. See https://go.microsoft.com/fwlink/?linkid=865972 -#Your build pipeline references a secret variable named ‘sp_tenantid’. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab, and then select the option to make it secret. See https://go.microsoft.com/fwlink/?linkid=865972 -#Your build pipeline references a secret variable named ‘subscription_id’. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab, and then select the option to make it secret. See https://go.microsoft.com/fwlink/?linkid=865972 + +container: dtzar/conda3mlops variables: - group: AzureKeyVaultSecrets @@ -14,18 +12,6 @@ trigger: - develop steps: -- task: UsePythonVersion@0 - inputs: - versionSpec: '3.6' - architecture: 'x64' - -- task: Bash@3 - displayName: 'Install Requirements' - inputs: - targetType: filePath - filePath: 'environment_setup/install_requirements.sh' - workingDirectory: 'environment_setup' - - script: | az login --service-principal -u $(spidentity) -p $(spsecret) --tenant $(sptenant) From 9cbcf8252c3900e7fb6186ea5dd03af021271134 Mon Sep 17 00:00:00 2001 From: David Tesar Date: Tue, 25 Jun 2019 19:01:28 -0700 Subject: [PATCH 2/4] Add Dockerfile --- environment_setup/Dockerfile | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 environment_setup/Dockerfile diff --git a/environment_setup/Dockerfile b/environment_setup/Dockerfile new file mode 100644 index 00000000..d199b243 --- /dev/null +++ b/environment_setup/Dockerfile @@ -0,0 +1,7 @@ +FROM conda/miniconda3 + +COPY . /setup + +RUN ["apt", "update"] +RUN apt install gcc -y && pip install -r /setup/requirements.txt +RUN pip install azure-cli==2.0.65 && pip install --upgrade azureml-sdk[cli] \ No newline at end of file From c93bea3ea4388638839c2503f76b8445bed433e2 Mon Sep 17 00:00:00 2001 From: David Tesar Date: Tue, 25 Jun 2019 19:04:42 -0700 Subject: [PATCH 3/4] add latest tag --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7578824f..787fa327 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,7 +1,7 @@ pool: vmImage: 'Ubuntu 16.04' -container: dtzar/conda3mlops +container: dtzar/conda3mlops:latest variables: - group: AzureKeyVaultSecrets From d14c4b1150ea2c226c0ef2438151039377cf8e6c Mon Sep 17 00:00:00 2001 From: David Tesar Date: Tue, 25 Jun 2019 19:08:39 -0700 Subject: [PATCH 4/4] Add docker image build pipeline --- environment_setup/docker-image-pipeline.yml | 32 +++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 environment_setup/docker-image-pipeline.yml diff --git a/environment_setup/docker-image-pipeline.yml b/environment_setup/docker-image-pipeline.yml new file mode 100644 index 00000000..2ee943f1 --- /dev/null +++ b/environment_setup/docker-image-pipeline.yml @@ -0,0 +1,32 @@ +resources: +- repo: self + +queue: + name: Hosted Ubuntu 1604 + +trigger: + branches: + include: + - master + + paths: + include: + - environment_setup/* + +steps: + +- task: Docker@2 + displayName: Login to Docker Hub + inputs: + command: login + containerRegistry: msftDockerHub + +- task: Docker@2 + displayName: 'Build and push an image' + inputs: + command: buildAndPush + repository: dtzar/conda3mlops + buildContext: '$(Build.SourcesDirectory)/environment_setup' + tags: | + $(Build.BuildNumber) + latest \ No newline at end of file