Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release/6.0] Docker fixes for the enterprise linux testing pipeline #68913

Merged
merged 3 commits into from
May 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
85 changes: 45 additions & 40 deletions eng/pipelines/libraries/enterprise/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ pr:
- src/libraries/System.Net.Http/*
- src/libraries/System.Net.Security/*

pool:
name: NetCore1ESPool-Svc-Public
demands: ImageOverride -equals Build.Ubuntu.1804.Amd64.Open

variables:
- template: ../variables.yml
- name: enterpriseTestsSetup
Expand All @@ -31,45 +27,54 @@ variables:
- name: containerLibrariesRoot
value: /repo/src/libraries

steps:
- bash: |
cd $(enterpriseTestsSetup)
docker-compose build
displayName: Build test machine images
env:
DOTNET_RUNTIME_REPO_ROOT: $(Build.SourcesDirectory)
jobs:
- job: EnterpriseLinuxTests
timeoutInMinutes: 120
pool:
name: NetCore1ESPool-Svc-Public
demands: ImageOverride -equals Build.Ubuntu.1804.Amd64.Open
steps:
- bash: |
cd $(enterpriseTestsSetup)
docker-compose build
displayName: Build test machine images
env:
DOTNET_RUNTIME_REPO_ROOT: $(Build.SourcesDirectory)

- bash: |
cd $(enterpriseTestsSetup)
docker-compose up -d
displayName: Start test network and machines
env:
DOTNET_RUNTIME_REPO_ROOT: $(Build.SourcesDirectory)
- bash: |
cd $(enterpriseTestsSetup)
docker-compose up -d
displayName: Start test network and machines
env:
DOTNET_RUNTIME_REPO_ROOT: $(Build.SourcesDirectory)

- bash: |
docker exec linuxclient bash /setup/test-webserver.sh
displayName: Test linuxclient connection to web server
- bash: |
docker exec linuxclient bash /setup/test-webserver.sh
displayName: Test linuxclient connection to web server

- bash: |
docker exec linuxclient bash -c '/repo/build.sh -subset clr+libs -runtimeconfiguration release -ci /p:NoPgoOptimize=true'
displayName: Build product sources
- bash: |
docker exec linuxclient bash -c '/repo/build.sh -subset clr+libs -runtimeconfiguration release -ci /p:NoPgoOptimize=true'
docker exec linuxclient bash -c '/repo/dotnet.sh build $(containerLibrariesRoot)/System.Net.Http/tests/EnterpriseTests/System.Net.Http.Enterprise.Tests.csproj'
docker exec linuxclient bash -c '/repo/dotnet.sh build $(containerLibrariesRoot)/System.Net.Security/tests/EnterpriseTests/System.Net.Security.Enterprise.Tests.csproj'
displayName: Build product sources

- bash: |
docker exec linuxclient $(containerRunTestsCommand) $(containerLibrariesRoot)/System.Net.Http/tests/EnterpriseTests/System.Net.Http.Enterprise.Tests.csproj
docker exec linuxclient $(containerRunTestsCommand) $(containerLibrariesRoot)/System.Net.Security/tests/EnterpriseTests/System.Net.Security.Enterprise.Tests.csproj
displayName: Build and run tests
- bash: |
docker exec linuxclient bash -c 'if [ -f /erc/resolv.conf.ORI ]; then cp -f /erc/resolv.conf.ORI /etc/resolv.conf; fi'
docker exec linuxclient $(containerRunTestsCommand) $(containerLibrariesRoot)/System.Net.Http/tests/EnterpriseTests/System.Net.Http.Enterprise.Tests.csproj
docker exec linuxclient $(containerRunTestsCommand) $(containerLibrariesRoot)/System.Net.Security/tests/EnterpriseTests/System.Net.Security.Enterprise.Tests.csproj
displayName: Build and run tests

- bash: |
cd $(enterpriseTestsSetup)
docker-compose down
displayName: Stop test network and machines
env:
DOTNET_RUNTIME_REPO_ROOT: $(Build.SourcesDirectory)
- bash: |
cd $(enterpriseTestsSetup)
docker-compose down
displayName: Stop test network and machines
env:
DOTNET_RUNTIME_REPO_ROOT: $(Build.SourcesDirectory)

- task: PublishTestResults@2
inputs:
testRunner: 'xUnit'
testResultsFiles: '**/testResults.xml'
testRunTitle: 'Enterprise Tests'
mergeTestResults: true
failTaskOnFailedTests: true
- task: PublishTestResults@2
inputs:
testRunner: 'xUnit'
testResultsFiles: '**/testResults.xml'
testRunTitle: 'Enterprise Tests'
mergeTestResults: true
failTaskOnFailedTests: true
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:18.04
FROM mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-20220421022739-9c434db

ARG DEBIAN_FRONTEND=noninteractive

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ services:
hostname: linuxclient
domainname: linux.contoso.com
dns_search: linux.contoso.com
privileged: true
dns:
- 8.8.8.8
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is a backport but I just wanted to make sure that we are ok with using the Google DNS here? cc @GrabYourPitchforks

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is there specifically because of https://github.com/dotnet/core-eng/issues/15594
If we can fix the underlying problem and make DNS resolution work in our infrastructure, this could be removed.

volumes:
- shared-volume:/SHARED
- ${DOTNET_RUNTIME_REPO_ROOT}:/repo
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:18.04
FROM mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-20220421022739-9c434db

COPY ./kdc/kadm5.acl /etc/krb5kdc/
COPY ./kdc/kdc.conf /etc/krb5kdc/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-20211022152710-047508b
FROM mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-20220421022739-9c434db

# Prevents dialog prompting when installing packages
ARG DEBIAN_FRONTEND=noninteractive
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ kdestroy
echo password | kinit user1
curl --verbose --negotiate -u: http://apacheweb.linux.contoso.com
kdestroy

nslookup github.com